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