egirlskey/packages/client/src/pages/user/index.activity.vue

53 lines
1.2 KiB
Vue
Raw Normal View History

2018-02-15 09:33:34 +00:00
<template>
<MkContainer>
<template #header><i class="fas fa-chart-bar" style="margin-right: 0.5em;"></i>{{ $ts.activity }}</template>
2022-03-11 09:55:47 +00:00
<template #func>
<button class="_button" @click="showMenu">
<i class="fas fa-ellipsis-h"></i>
</button>
</template>
<div style="padding: 8px;">
2022-03-11 09:55:47 +00:00
<MkChart :src="chartSrc" :args="{ user, withoutAll: true }" span="day" :limit="limit" :bar="true" :stacked="true" :detailed="false" :aspect-ratio="5"/>
</div>
</MkContainer>
2018-02-15 09:33:34 +00:00
</template>
<script lang="ts" setup>
import { } from 'vue';
import * as misskey from 'misskey-js';
2021-11-11 17:02:25 +00:00
import MkContainer from '@/components/ui/container.vue';
import MkChart from '@/components/chart.vue';
2022-03-11 09:55:47 +00:00
import * as os from '@/os';
import { i18n } from '@/i18n';
2018-11-03 07:44:05 +00:00
const props = withDefaults(defineProps<{
user: misskey.entities.User;
limit?: number;
}>(), {
2022-02-11 06:14:08 +00:00
limit: 50,
2018-02-15 09:33:34 +00:00
});
2022-03-11 09:55:47 +00:00
let chartSrc = $ref('per-user-notes');
function showMenu(ev: MouseEvent) {
os.popupMenu([{
text: i18n.ts.notes,
active: true,
action: () => {
chartSrc = 'per-user-notes';
}
}/*, {
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 09:33:34 +00:00
</script>