2020-01-30 04:37:25 +09:00
|
|
|
<template>
|
2021-10-24 04:03:07 +09:00
|
|
|
<div class="taeiyria">
|
|
|
|
<div class="query">
|
|
|
|
<MkInput v-model="host" :debounce="true" class="">
|
|
|
|
<template #prefix><i class="fas fa-search"></i></template>
|
|
|
|
<template #label>{{ $ts.host }}</template>
|
|
|
|
</MkInput>
|
|
|
|
<div class="_inputSplit">
|
|
|
|
<MkSelect v-model="state">
|
|
|
|
<template #label>{{ $ts.state }}</template>
|
|
|
|
<option value="all">{{ $ts.all }}</option>
|
|
|
|
<option value="federating">{{ $ts.federating }}</option>
|
|
|
|
<option value="subscribing">{{ $ts.subscribing }}</option>
|
|
|
|
<option value="publishing">{{ $ts.publishing }}</option>
|
|
|
|
<option value="suspended">{{ $ts.suspended }}</option>
|
|
|
|
<option value="blocked">{{ $ts.blocked }}</option>
|
|
|
|
<option value="notResponding">{{ $ts.notResponding }}</option>
|
|
|
|
</MkSelect>
|
|
|
|
<MkSelect v-model="sort">
|
|
|
|
<template #label>{{ $ts.sort }}</template>
|
|
|
|
<option value="+pubSub">{{ $ts.pubSub }} ({{ $ts.descendingOrder }})</option>
|
|
|
|
<option value="-pubSub">{{ $ts.pubSub }} ({{ $ts.ascendingOrder }})</option>
|
|
|
|
<option value="+notes">{{ $ts.notes }} ({{ $ts.descendingOrder }})</option>
|
|
|
|
<option value="-notes">{{ $ts.notes }} ({{ $ts.ascendingOrder }})</option>
|
|
|
|
<option value="+users">{{ $ts.users }} ({{ $ts.descendingOrder }})</option>
|
|
|
|
<option value="-users">{{ $ts.users }} ({{ $ts.ascendingOrder }})</option>
|
|
|
|
<option value="+following">{{ $ts.following }} ({{ $ts.descendingOrder }})</option>
|
|
|
|
<option value="-following">{{ $ts.following }} ({{ $ts.ascendingOrder }})</option>
|
|
|
|
<option value="+followers">{{ $ts.followers }} ({{ $ts.descendingOrder }})</option>
|
|
|
|
<option value="-followers">{{ $ts.followers }} ({{ $ts.ascendingOrder }})</option>
|
|
|
|
<option value="+caughtAt">{{ $ts.registeredAt }} ({{ $ts.descendingOrder }})</option>
|
|
|
|
<option value="-caughtAt">{{ $ts.registeredAt }} ({{ $ts.ascendingOrder }})</option>
|
|
|
|
<option value="+lastCommunicatedAt">{{ $ts.lastCommunication }} ({{ $ts.descendingOrder }})</option>
|
|
|
|
<option value="-lastCommunicatedAt">{{ $ts.lastCommunication }} ({{ $ts.ascendingOrder }})</option>
|
|
|
|
<option value="+driveUsage">{{ $ts.driveUsage }} ({{ $ts.descendingOrder }})</option>
|
|
|
|
<option value="-driveUsage">{{ $ts.driveUsage }} ({{ $ts.ascendingOrder }})</option>
|
|
|
|
<option value="+driveFiles">{{ $ts.driveFilesCount }} ({{ $ts.descendingOrder }})</option>
|
|
|
|
<option value="-driveFiles">{{ $ts.driveFilesCount }} ({{ $ts.ascendingOrder }})</option>
|
|
|
|
</MkSelect>
|
2020-01-30 04:37:25 +09:00
|
|
|
</div>
|
2021-10-24 04:03:07 +09:00
|
|
|
</div>
|
2021-04-22 22:29:33 +09:00
|
|
|
|
2021-10-24 04:03:07 +09:00
|
|
|
<MkPagination :pagination="pagination" #default="{items}" ref="instances" :key="host + state">
|
|
|
|
<div class="dqokceoi">
|
|
|
|
<MkA class="instance" v-for="instance in items" :key="instance.id" :to="`/instance-info/${instance.host}`">
|
|
|
|
<div class="host"><img :src="instance.faviconUrl">{{ instance.host }}</div>
|
|
|
|
<div class="table">
|
|
|
|
<div class="cell">
|
|
|
|
<div class="key">{{ $ts.registeredAt }}</div>
|
|
|
|
<div class="value"><MkTime :time="instance.caughtAt"/></div>
|
2021-08-07 10:24:50 +09:00
|
|
|
</div>
|
2021-10-24 04:03:07 +09:00
|
|
|
<div class="cell">
|
|
|
|
<div class="key">{{ $ts.software }}</div>
|
|
|
|
<div class="value">{{ instance.softwareName || `(${$ts.unknown})` }}</div>
|
2021-08-07 10:24:50 +09:00
|
|
|
</div>
|
2021-10-24 04:03:07 +09:00
|
|
|
<div class="cell">
|
|
|
|
<div class="key">{{ $ts.version }}</div>
|
|
|
|
<div class="value">{{ instance.softwareVersion || `(${$ts.unknown})` }}</div>
|
|
|
|
</div>
|
|
|
|
<div class="cell">
|
|
|
|
<div class="key">{{ $ts.users }}</div>
|
|
|
|
<div class="value">{{ instance.usersCount }}</div>
|
|
|
|
</div>
|
|
|
|
<div class="cell">
|
|
|
|
<div class="key">{{ $ts.notes }}</div>
|
|
|
|
<div class="value">{{ instance.notesCount }}</div>
|
|
|
|
</div>
|
|
|
|
<div class="cell">
|
|
|
|
<div class="key">{{ $ts.sent }}</div>
|
|
|
|
<div class="value"><MkTime v-if="instance.latestRequestSentAt" :time="instance.latestRequestSentAt"/><span v-else>N/A</span></div>
|
|
|
|
</div>
|
|
|
|
<div class="cell">
|
|
|
|
<div class="key">{{ $ts.received }}</div>
|
|
|
|
<div class="value"><MkTime v-if="instance.latestRequestReceivedAt" :time="instance.latestRequestReceivedAt"/><span v-else>N/A</span></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="footer">
|
|
|
|
<span class="status" :class="getStatus(instance)">{{ getStatus(instance) }}</span>
|
|
|
|
<span class="pubSub">
|
|
|
|
<span class="sub" v-if="instance.followersCount > 0"><i class="fas fa-caret-down icon"></i>Sub</span>
|
|
|
|
<span class="sub" v-else><i class="fas fa-caret-down icon"></i>-</span>
|
|
|
|
<span class="pub" v-if="instance.followingCount > 0"><i class="fas fa-caret-up icon"></i>Pub</span>
|
|
|
|
<span class="pub" v-else><i class="fas fa-caret-up icon"></i>-</span>
|
|
|
|
</span>
|
|
|
|
<span class="right">
|
|
|
|
<span class="latestStatus">{{ instance.latestStatus || '-' }}</span>
|
|
|
|
<span class="lastCommunicatedAt"><MkTime :time="instance.lastCommunicatedAt"/></span>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</MkA>
|
|
|
|
</div>
|
|
|
|
</MkPagination>
|
2020-01-30 04:37:25 +09:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2020-10-17 20:12:00 +09:00
|
|
|
import { defineComponent } from 'vue';
|
2021-11-12 02:02:25 +09:00
|
|
|
import MkButton from '@/components/ui/button.vue';
|
|
|
|
import MkInput from '@/components/form/input.vue';
|
|
|
|
import MkSelect from '@/components/form/select.vue';
|
|
|
|
import MkPagination from '@/components/ui/pagination.vue';
|
|
|
|
import * as os from '@/os';
|
|
|
|
import * as symbols from '@/symbols';
|
2020-01-30 04:37:25 +09:00
|
|
|
|
2020-10-17 20:12:00 +09:00
|
|
|
export default defineComponent({
|
2020-01-30 04:37:25 +09:00
|
|
|
components: {
|
|
|
|
MkButton,
|
|
|
|
MkInput,
|
|
|
|
MkSelect,
|
|
|
|
MkPagination,
|
|
|
|
},
|
|
|
|
|
2021-04-22 22:29:33 +09:00
|
|
|
emits: ['info'],
|
|
|
|
|
2020-01-30 04:37:25 +09:00
|
|
|
data() {
|
|
|
|
return {
|
2021-04-10 12:54:12 +09:00
|
|
|
[symbols.PAGE_INFO]: {
|
2020-12-26 10:47:36 +09:00
|
|
|
title: this.$ts.federation,
|
2021-10-02 23:11:21 +09:00
|
|
|
icon: 'fas fa-globe',
|
|
|
|
bg: 'var(--bg)',
|
2020-10-17 20:12:00 +09:00
|
|
|
},
|
2020-01-30 04:37:25 +09:00
|
|
|
host: '',
|
|
|
|
state: 'federating',
|
|
|
|
sort: '+pubSub',
|
|
|
|
pagination: {
|
|
|
|
endpoint: 'federation/instances',
|
|
|
|
limit: 10,
|
|
|
|
offsetMode: true,
|
|
|
|
params: () => ({
|
|
|
|
sort: this.sort,
|
|
|
|
host: this.host != '' ? this.host : null,
|
|
|
|
...(
|
|
|
|
this.state === 'federating' ? { federating: true } :
|
|
|
|
this.state === 'subscribing' ? { subscribing: true } :
|
|
|
|
this.state === 'publishing' ? { publishing: true } :
|
|
|
|
this.state === 'suspended' ? { suspended: true } :
|
|
|
|
this.state === 'blocked' ? { blocked: true } :
|
|
|
|
this.state === 'notResponding' ? { notResponding: true } :
|
|
|
|
{})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
watch: {
|
|
|
|
host() {
|
|
|
|
this.$refs.instances.reload();
|
|
|
|
},
|
|
|
|
state() {
|
|
|
|
this.$refs.instances.reload();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2021-04-22 22:29:33 +09:00
|
|
|
mounted() {
|
|
|
|
this.$emit('info', this[symbols.PAGE_INFO]);
|
|
|
|
},
|
|
|
|
|
2020-01-30 04:37:25 +09:00
|
|
|
methods: {
|
|
|
|
getStatus(instance) {
|
2021-08-07 10:24:50 +09:00
|
|
|
if (instance.isSuspended) return 'suspended';
|
|
|
|
if (instance.isNotResponding) return 'error';
|
|
|
|
return 'alive';
|
2020-01-30 04:37:25 +09:00
|
|
|
},
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2021-08-07 10:24:50 +09:00
|
|
|
.taeiyria {
|
2021-04-22 22:29:33 +09:00
|
|
|
> .query {
|
2021-08-07 10:24:50 +09:00
|
|
|
background: var(--bg);
|
|
|
|
padding: 16px;
|
2021-04-22 22:29:33 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-08-07 10:24:50 +09:00
|
|
|
.dqokceoi {
|
|
|
|
display: grid;
|
|
|
|
grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
|
|
|
|
grid-gap: 12px;
|
2020-10-17 20:12:00 +09:00
|
|
|
padding: 16px;
|
2020-01-30 04:37:25 +09:00
|
|
|
|
2021-08-07 10:24:50 +09:00
|
|
|
> .instance {
|
|
|
|
padding: 16px;
|
|
|
|
border: solid 1px var(--divider);
|
|
|
|
border-radius: 6px;
|
2020-01-30 04:37:25 +09:00
|
|
|
|
2021-08-07 10:24:50 +09:00
|
|
|
&:hover {
|
|
|
|
border: solid 1px var(--accent);
|
|
|
|
text-decoration: none;
|
|
|
|
}
|
2020-01-30 04:37:25 +09:00
|
|
|
|
2021-08-07 10:24:50 +09:00
|
|
|
> .host {
|
|
|
|
font-weight: bold;
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
|
|
|
> img {
|
|
|
|
width: 18px;
|
|
|
|
height: 18px;
|
|
|
|
margin-right: 6px;
|
|
|
|
vertical-align: middle;
|
2020-10-17 20:12:00 +09:00
|
|
|
}
|
2021-08-07 10:24:50 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
> .table {
|
|
|
|
display: grid;
|
|
|
|
grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
|
|
|
|
grid-gap: 6px;
|
|
|
|
margin: 6px 0;
|
|
|
|
font-size: 70%;
|
2020-01-30 04:37:25 +09:00
|
|
|
|
2021-08-07 10:24:50 +09:00
|
|
|
> .cell {
|
|
|
|
> .key, > .value {
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .key {
|
|
|
|
opacity: 0.7;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .value {
|
|
|
|
}
|
2020-10-17 20:12:00 +09:00
|
|
|
}
|
2021-08-07 10:24:50 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
> .footer {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
2021-08-09 21:45:46 +09:00
|
|
|
font-size: 0.9em;
|
2021-08-07 10:24:50 +09:00
|
|
|
|
|
|
|
> .status {
|
|
|
|
&.suspended {
|
|
|
|
opacity: 0.5;
|
|
|
|
}
|
2020-10-17 20:12:00 +09:00
|
|
|
|
2021-08-07 10:24:50 +09:00
|
|
|
&.error {
|
|
|
|
color: var(--error);
|
|
|
|
}
|
|
|
|
|
|
|
|
&.alive {
|
|
|
|
color: var(--success);
|
|
|
|
}
|
2020-10-17 20:12:00 +09:00
|
|
|
}
|
2020-01-30 04:37:25 +09:00
|
|
|
|
2021-08-07 10:24:50 +09:00
|
|
|
> .pubSub {
|
|
|
|
margin-left: 8px;
|
2020-10-17 20:12:00 +09:00
|
|
|
}
|
2020-01-30 04:37:25 +09:00
|
|
|
|
2021-08-07 10:24:50 +09:00
|
|
|
> .right {
|
|
|
|
margin-left: auto;
|
2020-01-30 04:37:25 +09:00
|
|
|
|
2021-08-07 10:24:50 +09:00
|
|
|
> .latestStatus {
|
|
|
|
border: solid 1px var(--divider);
|
|
|
|
border-radius: 4px;
|
|
|
|
margin: 0 8px;
|
|
|
|
padding: 0 4px;
|
|
|
|
}
|
2020-01-30 04:37:25 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|