2021-04-16 10:34:06 +02:00
|
|
|
<template>
|
|
|
|
<FormBase>
|
|
|
|
<FormGroup v-if="instance">
|
|
|
|
<template #label>{{ instance.host }}</template>
|
2021-04-16 14:47:12 +02:00
|
|
|
<FormGroup>
|
2021-09-29 17:50:45 +02:00
|
|
|
<div class="_debobigegoItem">
|
|
|
|
<div class="_debobigegoPanel fnfelxur">
|
2021-04-16 14:47:12 +02:00
|
|
|
<img :src="instance.iconUrl || instance.faviconUrl" alt="" class="icon"/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>Name</template>
|
|
|
|
<template #value><span class="_monospace">{{ instance.name || `(${$ts.unknown})` }}</span></template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
</FormGroup>
|
2021-04-16 10:34:06 +02:00
|
|
|
|
2021-11-19 11:36:12 +01:00
|
|
|
<FormButton v-if="$i.isAdmin || $i.isModerator" primary @click="info">{{ $ts.settings }}</FormButton>
|
2021-08-09 05:28:23 +02:00
|
|
|
|
2021-04-17 07:06:32 +02:00
|
|
|
<FormTextarea readonly :value="instance.description">
|
|
|
|
<span>{{ $ts.description }}</span>
|
|
|
|
</FormTextarea>
|
|
|
|
|
2021-04-16 10:34:06 +02:00
|
|
|
<FormGroup>
|
|
|
|
<FormKeyValueView>
|
2021-04-16 14:47:12 +02:00
|
|
|
<template #key>{{ $ts.software }}</template>
|
2021-04-16 10:34:06 +02:00
|
|
|
<template #value><span class="_monospace">{{ instance.softwareName || `(${$ts.unknown})` }}</span></template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
<FormKeyValueView>
|
2021-04-16 14:47:12 +02:00
|
|
|
<template #key>{{ $ts.version }}</template>
|
2021-04-16 10:34:06 +02:00
|
|
|
<template #value><span class="_monospace">{{ instance.softwareVersion || `(${$ts.unknown})` }}</span></template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
</FormGroup>
|
|
|
|
<FormGroup>
|
|
|
|
<FormKeyValueView>
|
2021-04-16 14:47:12 +02:00
|
|
|
<template #key>{{ $ts.administrator }}</template>
|
2021-04-16 10:34:06 +02:00
|
|
|
<template #value><span class="_monospace">{{ instance.maintainerName || `(${$ts.unknown})` }}</span></template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
<FormKeyValueView>
|
2021-04-16 14:47:12 +02:00
|
|
|
<template #key>{{ $ts.contact }}</template>
|
2021-04-16 10:34:06 +02:00
|
|
|
<template #value><span class="_monospace">{{ instance.maintainerEmail || `(${$ts.unknown})` }}</span></template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
</FormGroup>
|
|
|
|
<FormGroup>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>{{ $ts.latestRequestSentAt }}</template>
|
|
|
|
<template #value><MkTime v-if="instance.latestRequestSentAt" :time="instance.latestRequestSentAt"/><span v-else>N/A</span></template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>{{ $ts.latestStatus }}</template>
|
|
|
|
<template #value>{{ instance.latestStatus ? instance.latestStatus : 'N/A' }}</template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>{{ $ts.latestRequestReceivedAt }}</template>
|
|
|
|
<template #value><MkTime v-if="instance.latestRequestReceivedAt" :time="instance.latestRequestReceivedAt"/><span v-else>N/A</span></template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
</FormGroup>
|
|
|
|
<FormGroup>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>Open Registrations</template>
|
|
|
|
<template #value>{{ instance.openRegistrations ? $ts.yes : $ts.no }}</template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
</FormGroup>
|
2021-09-29 17:50:45 +02:00
|
|
|
<div class="_debobigegoItem">
|
|
|
|
<div class="_debobigegoLabel">{{ $ts.statistics }}</div>
|
|
|
|
<div class="_debobigegoPanel cmhjzshl">
|
2021-04-16 14:47:12 +02:00
|
|
|
<div class="selects">
|
2021-08-06 15:29:19 +02:00
|
|
|
<MkSelect v-model="chartSrc" style="margin: 0; flex: 1;">
|
2021-10-21 22:36:48 +02:00
|
|
|
<option value="instance-requests">{{ $ts._instanceCharts.requests }}</option>
|
|
|
|
<option value="instance-users">{{ $ts._instanceCharts.users }}</option>
|
|
|
|
<option value="instance-users-total">{{ $ts._instanceCharts.usersTotal }}</option>
|
|
|
|
<option value="instance-notes">{{ $ts._instanceCharts.notes }}</option>
|
|
|
|
<option value="instance-notes-total">{{ $ts._instanceCharts.notesTotal }}</option>
|
|
|
|
<option value="instance-ff">{{ $ts._instanceCharts.ff }}</option>
|
|
|
|
<option value="instance-ff-total">{{ $ts._instanceCharts.ffTotal }}</option>
|
|
|
|
<option value="instance-drive-usage">{{ $ts._instanceCharts.cacheSize }}</option>
|
|
|
|
<option value="instance-drive-usage-total">{{ $ts._instanceCharts.cacheSizeTotal }}</option>
|
|
|
|
<option value="instance-drive-files">{{ $ts._instanceCharts.files }}</option>
|
|
|
|
<option value="instance-drive-files-total">{{ $ts._instanceCharts.filesTotal }}</option>
|
2021-04-16 14:47:12 +02:00
|
|
|
</MkSelect>
|
2021-08-06 15:29:19 +02:00
|
|
|
<MkSelect v-model="chartSpan" style="margin: 0;">
|
2021-04-16 14:47:12 +02:00
|
|
|
<option value="hour">{{ $ts.perHour }}</option>
|
|
|
|
<option value="day">{{ $ts.perDay }}</option>
|
|
|
|
</MkSelect>
|
|
|
|
</div>
|
|
|
|
<div class="chart">
|
2021-10-21 22:36:48 +02:00
|
|
|
<MkChart :src="chartSrc" :span="chartSpan" :limit="90" :detailed="true"></MkChart>
|
2021-04-16 14:47:12 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-04-16 10:34:06 +02:00
|
|
|
<FormGroup>
|
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>{{ $ts.registeredAt }}</template>
|
|
|
|
<template #value><MkTime mode="detail" :time="instance.caughtAt"/></template>
|
|
|
|
</FormKeyValueView>
|
2021-04-17 04:29:44 +02:00
|
|
|
<FormKeyValueView>
|
|
|
|
<template #key>{{ $ts.updatedAt }}</template>
|
|
|
|
<template #value><MkTime mode="detail" :time="instance.infoUpdatedAt"/></template>
|
|
|
|
</FormKeyValueView>
|
2021-04-16 10:34:06 +02:00
|
|
|
</FormGroup>
|
|
|
|
<FormObjectView tall :value="instance">
|
|
|
|
<span>Raw</span>
|
|
|
|
</FormObjectView>
|
2021-04-17 04:29:44 +02:00
|
|
|
<FormGroup>
|
2021-04-19 13:06:23 +02:00
|
|
|
<template #label>Well-known resources</template>
|
2021-04-17 04:29:44 +02:00
|
|
|
<FormLink :to="`https://${host}/.well-known/host-meta`" external>host-meta</FormLink>
|
|
|
|
<FormLink :to="`https://${host}/.well-known/host-meta.json`" external>host-meta.json</FormLink>
|
|
|
|
<FormLink :to="`https://${host}/.well-known/nodeinfo`" external>nodeinfo</FormLink>
|
2021-04-19 13:06:23 +02:00
|
|
|
<FormLink :to="`https://${host}/robots.txt`" external>robots.txt</FormLink>
|
|
|
|
<FormLink :to="`https://${host}/manifest.json`" external>manifest.json</FormLink>
|
2021-04-17 04:29:44 +02:00
|
|
|
</FormGroup>
|
2021-11-19 11:36:12 +01:00
|
|
|
<FormSuspense v-slot="{ result: dns }" :p="dnsPromiseFactory">
|
2021-04-17 07:06:32 +02:00
|
|
|
<FormGroup>
|
|
|
|
<template #label>DNS</template>
|
|
|
|
<FormKeyValueView v-for="record in dns.a" :key="record">
|
|
|
|
<template #key>A</template>
|
|
|
|
<template #value><span class="_monospace">{{ record }}</span></template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
<FormKeyValueView v-for="record in dns.aaaa" :key="record">
|
|
|
|
<template #key>AAAA</template>
|
|
|
|
<template #value><span class="_monospace">{{ record }}</span></template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
<FormKeyValueView v-for="record in dns.cname" :key="record">
|
|
|
|
<template #key>CNAME</template>
|
|
|
|
<template #value><span class="_monospace">{{ record }}</span></template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
<FormKeyValueView v-for="record in dns.txt">
|
|
|
|
<template #key>TXT</template>
|
|
|
|
<template #value><span class="_monospace">{{ record[0] }}</span></template>
|
|
|
|
</FormKeyValueView>
|
|
|
|
</FormGroup>
|
|
|
|
</FormSuspense>
|
2021-04-16 10:34:06 +02:00
|
|
|
</FormGroup>
|
|
|
|
</FormBase>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { defineAsyncComponent, defineComponent } from 'vue';
|
2021-11-11 18:02:25 +01:00
|
|
|
import MkChart from '@/components/chart.vue';
|
|
|
|
import FormObjectView from '@/components/debobigego/object-view.vue';
|
|
|
|
import FormTextarea from '@/components/debobigego/textarea.vue';
|
|
|
|
import FormLink from '@/components/debobigego/link.vue';
|
|
|
|
import FormBase from '@/components/debobigego/base.vue';
|
|
|
|
import FormGroup from '@/components/debobigego/group.vue';
|
|
|
|
import FormButton from '@/components/debobigego/button.vue';
|
|
|
|
import FormKeyValueView from '@/components/debobigego/key-value-view.vue';
|
|
|
|
import FormSuspense from '@/components/debobigego/suspense.vue';
|
|
|
|
import MkSelect from '@/components/form/select.vue';
|
|
|
|
import * as os from '@/os';
|
|
|
|
import number from '@/filters/number';
|
|
|
|
import bytes from '@/filters/bytes';
|
|
|
|
import * as symbols from '@/symbols';
|
|
|
|
import MkInstanceInfo from '@/pages/admin/instance.vue';
|
2021-04-16 10:34:06 +02:00
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
components: {
|
|
|
|
FormBase,
|
|
|
|
FormTextarea,
|
|
|
|
FormObjectView,
|
|
|
|
FormButton,
|
|
|
|
FormLink,
|
|
|
|
FormGroup,
|
|
|
|
FormKeyValueView,
|
|
|
|
FormSuspense,
|
2021-04-16 14:47:12 +02:00
|
|
|
MkSelect,
|
2021-10-21 22:36:48 +02:00
|
|
|
MkChart,
|
2021-04-16 10:34:06 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
props: {
|
|
|
|
host: {
|
|
|
|
type: String,
|
|
|
|
required: true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
[symbols.PAGE_INFO]: {
|
|
|
|
title: this.$ts.instanceInfo,
|
2021-04-20 16:22:59 +02:00
|
|
|
icon: 'fas fa-info-circle',
|
2021-04-16 14:47:12 +02:00
|
|
|
actions: [{
|
|
|
|
text: `https://${this.host}`,
|
2021-04-20 16:22:59 +02:00
|
|
|
icon: 'fas fa-external-link-alt',
|
2021-04-16 14:47:12 +02:00
|
|
|
handler: () => {
|
|
|
|
window.open(`https://${this.host}`, '_blank');
|
|
|
|
}
|
|
|
|
}],
|
2021-04-16 10:34:06 +02:00
|
|
|
},
|
|
|
|
instance: null,
|
2021-04-17 07:06:32 +02:00
|
|
|
dnsPromiseFactory: () => os.api('federation/dns', {
|
|
|
|
host: this.host
|
|
|
|
}),
|
2021-10-21 22:36:48 +02:00
|
|
|
chartSrc: 'instance-requests',
|
2021-04-16 14:47:12 +02:00
|
|
|
chartSpan: 'hour',
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2021-04-16 10:34:06 +02:00
|
|
|
mounted() {
|
|
|
|
this.fetch();
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
number,
|
|
|
|
bytes,
|
|
|
|
|
|
|
|
async fetch() {
|
|
|
|
this.instance = await os.api('federation/show-instance', {
|
|
|
|
host: this.host
|
|
|
|
});
|
2021-04-16 14:47:12 +02:00
|
|
|
},
|
2021-08-09 05:28:23 +02:00
|
|
|
|
|
|
|
info() {
|
|
|
|
os.popup(MkInstanceInfo, {
|
|
|
|
instance: this.instance
|
|
|
|
}, {}, 'closed');
|
|
|
|
}
|
2021-04-16 10:34:06 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
2021-04-16 14:47:12 +02:00
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.fnfelxur {
|
|
|
|
padding: 16px;
|
|
|
|
|
2021-04-25 05:31:11 +02:00
|
|
|
> .icon {
|
2021-04-16 14:47:12 +02:00
|
|
|
display: block;
|
|
|
|
margin: auto;
|
|
|
|
height: 64px;
|
|
|
|
border-radius: 8px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.cmhjzshl {
|
|
|
|
> .selects {
|
|
|
|
display: flex;
|
|
|
|
padding: 16px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|