2018-02-15 10:33:34 +01:00
|
|
|
<template>
|
2020-11-25 13:31:34 +01:00
|
|
|
<MkContainer>
|
2022-12-19 11:01:30 +01:00
|
|
|
<template #header><i class="ti ti-chart-line" style="margin-right: 0.5em;"></i>{{ $ts.activity }}</template>
|
2022-03-11 10:55:47 +01:00
|
|
|
<template #func>
|
|
|
|
<button class="_button" @click="showMenu">
|
2022-12-19 11:01:30 +01:00
|
|
|
<i class="ti ti-dots"></i>
|
2022-03-11 10:55:47 +01:00
|
|
|
</button>
|
|
|
|
</template>
|
2020-11-25 13:31:34 +01:00
|
|
|
|
|
|
|
<div style="padding: 8px;">
|
2022-03-11 10:55:47 +01:00
|
|
|
<MkChart :src="chartSrc" :args="{ user, withoutAll: true }" span="day" :limit="limit" :bar="true" :stacked="true" :detailed="false" :aspect-ratio="5"/>
|
2020-11-25 13:31:34 +01:00
|
|
|
</div>
|
|
|
|
</MkContainer>
|
2018-02-15 10:33:34 +01:00
|
|
|
</template>
|
|
|
|
|
2022-01-12 18:46:14 +01:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { } from 'vue';
|
|
|
|
import * as misskey from 'misskey-js';
|
2022-09-06 11:21:49 +02:00
|
|
|
import MkContainer from '@/components/MkContainer.vue';
|
2022-08-30 17:24:33 +02:00
|
|
|
import MkChart from '@/components/MkChart.vue';
|
2022-03-11 10:55:47 +01:00
|
|
|
import * as os from '@/os';
|
|
|
|
import { i18n } from '@/i18n';
|
2018-11-03 08:44:05 +01:00
|
|
|
|
2022-01-12 18:46:14 +01:00
|
|
|
const props = withDefaults(defineProps<{
|
|
|
|
user: misskey.entities.User;
|
|
|
|
limit?: number;
|
|
|
|
}>(), {
|
2022-02-11 07:14:08 +01:00
|
|
|
limit: 50,
|
2018-02-15 10:33:34 +01:00
|
|
|
});
|
2022-03-11 10:55:47 +01:00
|
|
|
|
|
|
|
let chartSrc = $ref('per-user-notes');
|
|
|
|
|
|
|
|
function showMenu(ev: MouseEvent) {
|
|
|
|
os.popupMenu([{
|
|
|
|
text: i18n.ts.notes,
|
|
|
|
active: true,
|
|
|
|
action: () => {
|
|
|
|
chartSrc = 'per-user-notes';
|
2022-06-29 04:13:32 +02:00
|
|
|
},
|
2022-12-12 11:27:47 +01:00
|
|
|
}, /*, {
|
2022-03-11 10:55:47 +01:00
|
|
|
text: i18n.ts.following,
|
|
|
|
action: () => {
|
|
|
|
chartSrc = 'per-user-following';
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
text: i18n.ts.followers,
|
|
|
|
action: () => {
|
|
|
|
chartSrc = 'per-user-followers';
|
|
|
|
}
|
|
|
|
}*/], ev.currentTarget ?? ev.target);
|
|
|
|
}
|
2018-02-15 10:33:34 +01:00
|
|
|
</script>
|