remove unused API and websocket calls from admin dashboard
This commit is contained in:
parent
c3ae0c7e8c
commit
428c9258a1
1 changed files with 1 additions and 101 deletions
|
|
@ -65,8 +65,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { markRaw, onMounted, onBeforeUnmount, nextTick, shallowRef, ref, computed, useTemplateRef } from 'vue';
|
import { computed } from 'vue';
|
||||||
import * as Misskey from 'misskey-js';
|
|
||||||
import XFederation from './overview.federation.vue';
|
import XFederation from './overview.federation.vue';
|
||||||
import XInstances from './overview.instances.vue';
|
import XInstances from './overview.instances.vue';
|
||||||
import XQueue from './overview.queue.vue';
|
import XQueue from './overview.queue.vue';
|
||||||
|
|
@ -77,109 +76,10 @@ import XStats from './overview.stats.vue';
|
||||||
import XRetention from './overview.retention.vue';
|
import XRetention from './overview.retention.vue';
|
||||||
import XModerators from './overview.moderators.vue';
|
import XModerators from './overview.moderators.vue';
|
||||||
import XHeatmap from './overview.heatmap.vue';
|
import XHeatmap from './overview.heatmap.vue';
|
||||||
import type { InstanceForPie } from './overview.pie.vue';
|
|
||||||
import * as os from '@/os.js';
|
|
||||||
import { misskeyApi, misskeyApiGet } from '@/utility/misskey-api.js';
|
|
||||||
import { useStream } from '@/stream.js';
|
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { definePage } from '@/page.js';
|
import { definePage } from '@/page.js';
|
||||||
import MkFoldableSection from '@/components/MkFoldableSection.vue';
|
import MkFoldableSection from '@/components/MkFoldableSection.vue';
|
||||||
|
|
||||||
const rootEl = useTemplateRef('rootEl');
|
|
||||||
const serverInfo = ref<Misskey.entities.ServerInfoResponse | null>(null);
|
|
||||||
const topSubInstancesForPie = ref<InstanceForPie[] | null>(null);
|
|
||||||
const topPubInstancesForPie = ref<InstanceForPie[] | null>(null);
|
|
||||||
const federationPubActive = ref<number | null>(null);
|
|
||||||
const federationPubActiveDiff = ref<number | null>(null);
|
|
||||||
const federationSubActive = ref<number | null>(null);
|
|
||||||
const federationSubActiveDiff = ref<number | null>(null);
|
|
||||||
const newUsers = ref<Misskey.entities.UserDetailed[] | null>(null);
|
|
||||||
const activeInstances = shallowRef<Misskey.entities.FederationInstance | null>(null);
|
|
||||||
const queueStatsConnection = markRaw(useStream().useChannel('queueStats'));
|
|
||||||
const now = new Date();
|
|
||||||
const filesPagination = {
|
|
||||||
endpoint: 'admin/drive/files' as const,
|
|
||||||
limit: 9,
|
|
||||||
noPaging: true,
|
|
||||||
};
|
|
||||||
|
|
||||||
function onInstanceClick(i) {
|
|
||||||
os.pageWindow(`/instance-info/${i.host}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(async () => {
|
|
||||||
/*
|
|
||||||
const magicGrid = new MagicGrid({
|
|
||||||
container: rootEl,
|
|
||||||
static: true,
|
|
||||||
animate: true,
|
|
||||||
});
|
|
||||||
|
|
||||||
magicGrid.listen();
|
|
||||||
*/
|
|
||||||
|
|
||||||
misskeyApiGet('charts/federation', { limit: 2, span: 'day' }).then(chart => {
|
|
||||||
federationPubActive.value = chart.pubActive[0];
|
|
||||||
federationPubActiveDiff.value = chart.pubActive[0] - chart.pubActive[1];
|
|
||||||
federationSubActive.value = chart.subActive[0];
|
|
||||||
federationSubActiveDiff.value = chart.subActive[0] - chart.subActive[1];
|
|
||||||
});
|
|
||||||
|
|
||||||
misskeyApiGet('federation/stats', { limit: 10 }).then(res => {
|
|
||||||
topSubInstancesForPie.value = [
|
|
||||||
...res.topSubInstances.map(x => ({
|
|
||||||
name: x.host,
|
|
||||||
color: x.themeColor,
|
|
||||||
value: x.followersCount,
|
|
||||||
onClick: () => {
|
|
||||||
os.pageWindow(`/instance-info/${x.host}`);
|
|
||||||
},
|
|
||||||
})),
|
|
||||||
{ name: '(other)', color: '#80808080', value: res.otherFollowersCount },
|
|
||||||
];
|
|
||||||
topPubInstancesForPie.value = [
|
|
||||||
...res.topPubInstances.map(x => ({
|
|
||||||
name: x.host,
|
|
||||||
color: x.themeColor,
|
|
||||||
value: x.followingCount,
|
|
||||||
onClick: () => {
|
|
||||||
os.pageWindow(`/instance-info/${x.host}`);
|
|
||||||
},
|
|
||||||
})),
|
|
||||||
{ name: '(other)', color: '#80808080', value: res.otherFollowingCount },
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
misskeyApi('admin/server-info').then(serverInfoResponse => {
|
|
||||||
serverInfo.value = serverInfoResponse;
|
|
||||||
});
|
|
||||||
|
|
||||||
misskeyApi('admin/show-users', {
|
|
||||||
limit: 5,
|
|
||||||
sort: '+createdAt',
|
|
||||||
}).then(res => {
|
|
||||||
newUsers.value = res;
|
|
||||||
});
|
|
||||||
|
|
||||||
misskeyApi('federation/instances', {
|
|
||||||
sort: '+latestRequestReceivedAt',
|
|
||||||
limit: 25,
|
|
||||||
}).then(res => {
|
|
||||||
activeInstances.value = res;
|
|
||||||
});
|
|
||||||
|
|
||||||
nextTick(() => {
|
|
||||||
queueStatsConnection.send('requestLog', {
|
|
||||||
id: Math.random().toString().substring(2, 10),
|
|
||||||
length: 100,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
onBeforeUnmount(() => {
|
|
||||||
queueStatsConnection.dispose();
|
|
||||||
});
|
|
||||||
|
|
||||||
const headerActions = computed(() => []);
|
const headerActions = computed(() => []);
|
||||||
|
|
||||||
const headerTabs = computed(() => []);
|
const headerTabs = computed(() => []);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue