2021-04-22 22:29:33 +09:00
|
|
|
<template>
|
|
|
|
<FormBase>
|
|
|
|
<FormSuspense :p="init">
|
2021-04-23 14:43:40 +09:00
|
|
|
<FormInfo v-if="noMaintainerInformation" warn>{{ $ts.noMaintainerInformationWarning }} <MkA to="/instance/settings" class="_link">{{ $ts.configure }}</MkA></FormInfo>
|
|
|
|
<FormInfo v-if="noBotProtection" warn>{{ $ts.noBotProtectionWarning }} <MkA to="/instance/bot-protection" class="_link">{{ $ts.configure }}</MkA></FormInfo>
|
|
|
|
|
2021-04-22 22:29:33 +09:00
|
|
|
<FormSuspense :p="fetchStats" v-slot="{ result: stats }">
|
|
|
|
<FormGroup>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>Users</template>
|
|
|
|
<template #value>{{ number(stats.originalUsersCount) }}</template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>Notes</template>
|
|
|
|
<template #value>{{ number(stats.originalNotesCount) }}</template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
</FormGroup>
|
|
|
|
</FormSuspense>
|
|
|
|
|
2021-09-30 00:50:45 +09:00
|
|
|
<div class="_debobigegoItem">
|
|
|
|
<div class="_debobigegoPanel">
|
2021-04-22 22:29:33 +09:00
|
|
|
<MkInstanceStats :chart-limit="300" :detailed="true"/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<XMetrics/>
|
|
|
|
|
|
|
|
<FormSuspense :p="fetchServerInfo" v-slot="{ result: serverInfo }">
|
|
|
|
<FormGroup>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>Node.js</template>
|
|
|
|
<template #value>{{ serverInfo.node }}</template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>PostgreSQL</template>
|
|
|
|
<template #value>{{ serverInfo.psql }}</template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>Redis</template>
|
|
|
|
<template #value>{{ serverInfo.redis }}</template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
</FormGroup>
|
|
|
|
</FormSuspense>
|
|
|
|
</FormSuspense>
|
|
|
|
</FormBase>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { computed, defineComponent, markRaw } from 'vue';
|
2021-09-30 00:50:45 +09:00
|
|
|
import FormKeyValueView from '@client/components/debobigego/key-value-view.vue';
|
|
|
|
import FormInput from '@client/components/debobigego/input.vue';
|
|
|
|
import FormButton from '@client/components/debobigego/button.vue';
|
|
|
|
import FormBase from '@client/components/debobigego/base.vue';
|
|
|
|
import FormGroup from '@client/components/debobigego/group.vue';
|
|
|
|
import FormTextarea from '@client/components/debobigego/textarea.vue';
|
|
|
|
import FormInfo from '@client/components/debobigego/info.vue';
|
|
|
|
import FormSuspense from '@client/components/debobigego/suspense.vue';
|
2021-04-22 22:29:33 +09:00
|
|
|
import MkInstanceStats from '@client/components/instance-stats.vue';
|
|
|
|
import MkButton from '@client/components/ui/button.vue';
|
2021-09-30 00:50:45 +09:00
|
|
|
import MkSelect from '@client/components/form/select.vue';
|
|
|
|
import MkInput from '@client/components/form/input.vue';
|
2021-04-22 22:29:33 +09:00
|
|
|
import MkContainer from '@client/components/ui/container.vue';
|
|
|
|
import MkFolder from '@client/components/ui/folder.vue';
|
|
|
|
import { version, url } from '@client/config';
|
2021-08-05 16:34:18 +09:00
|
|
|
import bytes from '@client/filters/bytes';
|
|
|
|
import number from '@client/filters/number';
|
2021-04-22 22:29:33 +09:00
|
|
|
import MkInstanceInfo from './instance.vue';
|
|
|
|
import XMetrics from './metrics.vue';
|
|
|
|
import * as os from '@client/os';
|
|
|
|
import * as symbols from '@client/symbols';
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
components: {
|
|
|
|
FormBase,
|
|
|
|
FormSuspense,
|
|
|
|
FormGroup,
|
2021-04-23 14:43:40 +09:00
|
|
|
FormInfo,
|
2021-04-22 22:29:33 +09:00
|
|
|
FormKeyValueView,
|
|
|
|
MkInstanceStats,
|
|
|
|
XMetrics,
|
|
|
|
},
|
|
|
|
|
|
|
|
emits: ['info'],
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
[symbols.PAGE_INFO]: {
|
|
|
|
title: this.$ts.overview,
|
2021-10-02 23:11:21 +09:00
|
|
|
icon: 'fas fa-tachometer-alt',
|
|
|
|
bg: 'var(--bg)',
|
2021-04-22 22:29:33 +09:00
|
|
|
},
|
|
|
|
page: 'index',
|
|
|
|
version,
|
|
|
|
url,
|
|
|
|
stats: null,
|
2021-05-31 12:02:02 +09:00
|
|
|
meta: null,
|
2021-04-22 22:29:33 +09:00
|
|
|
fetchStats: () => os.api('stats', {}),
|
|
|
|
fetchServerInfo: () => os.api('admin/server-info', {}),
|
|
|
|
fetchJobs: () => os.api('admin/queue/deliver-delayed', {}),
|
|
|
|
fetchModLogs: () => os.api('admin/show-moderation-logs', {}),
|
2021-04-23 14:43:40 +09:00
|
|
|
noMaintainerInformation: false,
|
|
|
|
noBotProtection: false,
|
2021-04-22 22:29:33 +09:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
async mounted() {
|
|
|
|
this.$emit('info', this[symbols.PAGE_INFO]);
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
async init() {
|
|
|
|
this.meta = await os.api('meta', { detail: true });
|
2021-04-23 14:43:40 +09:00
|
|
|
|
|
|
|
const isEmpty = (x: any) => x == null || x == '';
|
|
|
|
|
|
|
|
this.noMaintainerInformation = isEmpty(this.meta.maintainerName) || isEmpty(this.meta.maintainerEmail);
|
|
|
|
this.noBotProtection = !this.meta.enableHcaptcha && !this.meta.enableRecaptcha;
|
2021-04-22 22:29:33 +09:00
|
|
|
},
|
|
|
|
|
|
|
|
async showInstanceInfo(q) {
|
|
|
|
let instance = q;
|
|
|
|
if (typeof q === 'string') {
|
|
|
|
instance = await os.api('federation/show-instance', {
|
|
|
|
host: q
|
|
|
|
});
|
|
|
|
}
|
|
|
|
os.popup(MkInstanceInfo, {
|
|
|
|
instance: instance
|
|
|
|
}, {}, 'closed');
|
|
|
|
},
|
|
|
|
|
|
|
|
bytes,
|
|
|
|
|
|
|
|
number,
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|