Sharkey/packages/frontend/src/pages/user/index.activity.vue

65 lines
1.5 KiB
Vue
Raw Normal View History

<!--
SPDX-FileCopyrightText: syuilo and other misskey contributors
SPDX-License-Identifier: AGPL-3.0-only
-->
2018-02-15 11:33:34 +02:00
<template>
<MkContainer>
2023-01-15 01:30:29 +02:00
<template #icon><i class="ti ti-chart-line"></i></template>
2023-04-01 08:01:57 +03:00
<template #header>{{ i18n.ts.activity }}</template>
2023-01-15 01:30:29 +02:00
<template #func="{ buttonStyleClass }">
<button class="_button" :class="buttonStyleClass" @click="showMenu">
<i class="ti ti-dots"></i>
2022-03-11 11:55:47 +02:00
</button>
</template>
<div style="padding: 8px;">
2023-05-29 11:24:46 +03:00
<MkChart :src="chartSrc" :args="{ user, withoutAll: true }" span="day" :limit="limit" :bar="true" :stacked="true" :detailed="false" :aspectRatio="5"/>
</div>
</MkContainer>
2018-02-15 11:33:34 +02:00
</template>
<script lang="ts" setup>
import { } from 'vue';
import * as Misskey from 'misskey-js';
import MkContainer from '@/components/MkContainer.vue';
import MkChart from '@/components/MkChart.vue';
2022-03-11 11:55:47 +02:00
import * as os from '@/os';
import { i18n } from '@/i18n';
2018-11-03 09:44:05 +02:00
const props = withDefaults(defineProps<{
user: Misskey.entities.User;
limit?: number;
}>(), {
2022-02-11 08:14:08 +02:00
limit: 50,
2018-02-15 11:33:34 +02:00
});
2022-03-11 11:55:47 +02:00
let chartSrc = $ref('per-user-notes');
function showMenu(ev: MouseEvent) {
os.popupMenu([{
text: i18n.ts.notes,
2023-01-02 03:18:47 +02:00
active: chartSrc === 'per-user-notes',
2022-03-11 11:55:47 +02:00
action: () => {
chartSrc = 'per-user-notes';
},
2023-01-02 03:18:47 +02:00
}, {
text: i18n.ts.numberOfProfileView,
active: chartSrc === 'per-user-pv',
action: () => {
chartSrc = 'per-user-pv';
},
}, /*, {
2022-03-11 11:55:47 +02: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 11:33:34 +02:00
</script>