2020-01-29 20:37:25 +01:00
|
|
|
<template>
|
2021-11-28 12:07:37 +01:00
|
|
|
<MkSpacer :content-max="1000">
|
|
|
|
<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" style="margin-top: var(--margin);">
|
|
|
|
<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>
|
|
|
|
</div>
|
2020-01-29 20:37:25 +01:00
|
|
|
</div>
|
2021-04-22 15:29:33 +02:00
|
|
|
|
2021-11-28 12:07:37 +01:00
|
|
|
<MkPagination #default="{items}" ref="instances" :key="host + state" :pagination="pagination">
|
|
|
|
<div class="dqokceoi">
|
|
|
|
<MkA v-for="instance in items" :key="instance.id" class="instance" :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>
|
|
|
|
</div>
|
|
|
|
<div class="cell">
|
|
|
|
<div class="key">{{ $ts.software }}</div>
|
|
|
|
<div class="value">{{ instance.softwareName || `(${$ts.unknown})` }}</div>
|
|
|
|
</div>
|
|
|
|
<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>
|
2021-10-23 21:03:07 +02:00
|
|
|
</div>
|
2021-11-28 12:07:37 +01:00
|
|
|
<div class="footer">
|
|
|
|
<span class="status" :class="getStatus(instance)">{{ getStatus(instance) }}</span>
|
|
|
|
<span class="pubSub">
|
|
|
|
<span v-if="instance.followersCount > 0" class="sub"><i class="fas fa-caret-down icon"></i>Sub</span>
|
|
|
|
<span v-else class="sub"><i class="fas fa-caret-down icon"></i>-</span>
|
|
|
|
<span v-if="instance.followingCount > 0" class="pub"><i class="fas fa-caret-up icon"></i>Pub</span>
|
|
|
|
<span v-else class="pub"><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>
|
2021-10-23 21:03:07 +02:00
|
|
|
</div>
|
2021-11-28 12:07:37 +01:00
|
|
|
</MkA>
|
|
|
|
</div>
|
|
|
|
</MkPagination>
|
|
|
|
</div>
|
|
|
|
</MkSpacer>
|
2020-01-29 20:37:25 +01:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2020-10-17 13:12:00 +02:00
|
|
|
import { defineComponent } from 'vue';
|
2021-11-11 18:02:25 +01: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-29 20:37:25 +01:00
|
|
|
|
2020-10-17 13:12:00 +02:00
|
|
|
export default defineComponent({
|
2020-01-29 20:37:25 +01:00
|
|
|
components: {
|
|
|
|
MkButton,
|
|
|
|
MkInput,
|
|
|
|
MkSelect,
|
|
|
|
MkPagination,
|
|
|
|
},
|
|
|
|
|
2021-04-22 15:29:33 +02:00
|
|
|
emits: ['info'],
|
|
|
|
|
2020-01-29 20:37:25 +01:00
|
|
|
data() {
|
|
|
|
return {
|
2021-04-10 05:54:12 +02:00
|
|
|
[symbols.PAGE_INFO]: {
|
2020-12-26 02:47:36 +01:00
|
|
|
title: this.$ts.federation,
|
2021-10-02 16:11:21 +02:00
|
|
|
icon: 'fas fa-globe',
|
|
|
|
bg: 'var(--bg)',
|
2020-10-17 13:12:00 +02:00
|
|
|
},
|
2020-01-29 20:37:25 +01: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 15:29:33 +02:00
|
|
|
mounted() {
|
|
|
|
this.$emit('info', this[symbols.PAGE_INFO]);
|
|
|
|
},
|
|
|
|
|
2020-01-29 20:37:25 +01:00
|
|
|
methods: {
|
|
|
|
getStatus(instance) {
|
2021-08-07 03:24:50 +02:00
|
|
|
if (instance.isSuspended) return 'suspended';
|
|
|
|
if (instance.isNotResponding) return 'error';
|
|
|
|
return 'alive';
|
2020-01-29 20:37:25 +01:00
|
|
|
},
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2021-08-07 03:24:50 +02:00
|
|
|
.taeiyria {
|
2021-04-22 15:29:33 +02:00
|
|
|
> .query {
|
2021-08-07 03:24:50 +02:00
|
|
|
background: var(--bg);
|
2021-11-28 12:07:37 +01:00
|
|
|
margin-bottom: 16px;
|
2021-04-22 15:29:33 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-08-07 03:24:50 +02:00
|
|
|
.dqokceoi {
|
|
|
|
display: grid;
|
|
|
|
grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
|
|
|
|
grid-gap: 12px;
|
2020-01-29 20:37:25 +01:00
|
|
|
|
2021-08-07 03:24:50 +02:00
|
|
|
> .instance {
|
|
|
|
padding: 16px;
|
|
|
|
border: solid 1px var(--divider);
|
|
|
|
border-radius: 6px;
|
2020-01-29 20:37:25 +01:00
|
|
|
|
2021-08-07 03:24:50 +02:00
|
|
|
&:hover {
|
|
|
|
border: solid 1px var(--accent);
|
|
|
|
text-decoration: none;
|
|
|
|
}
|
2020-01-29 20:37:25 +01:00
|
|
|
|
2021-08-07 03:24:50 +02: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 13:12:00 +02:00
|
|
|
}
|
2021-08-07 03:24:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
> .table {
|
|
|
|
display: grid;
|
|
|
|
grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
|
|
|
|
grid-gap: 6px;
|
|
|
|
margin: 6px 0;
|
|
|
|
font-size: 70%;
|
2020-01-29 20:37:25 +01:00
|
|
|
|
2021-08-07 03:24:50 +02:00
|
|
|
> .cell {
|
|
|
|
> .key, > .value {
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .key {
|
|
|
|
opacity: 0.7;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .value {
|
|
|
|
}
|
2020-10-17 13:12:00 +02:00
|
|
|
}
|
2021-08-07 03:24:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
> .footer {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
2021-08-09 14:45:46 +02:00
|
|
|
font-size: 0.9em;
|
2021-08-07 03:24:50 +02:00
|
|
|
|
|
|
|
> .status {
|
|
|
|
&.suspended {
|
|
|
|
opacity: 0.5;
|
|
|
|
}
|
2020-10-17 13:12:00 +02:00
|
|
|
|
2021-08-07 03:24:50 +02:00
|
|
|
&.error {
|
|
|
|
color: var(--error);
|
|
|
|
}
|
|
|
|
|
|
|
|
&.alive {
|
|
|
|
color: var(--success);
|
|
|
|
}
|
2020-10-17 13:12:00 +02:00
|
|
|
}
|
2020-01-29 20:37:25 +01:00
|
|
|
|
2021-08-07 03:24:50 +02:00
|
|
|
> .pubSub {
|
|
|
|
margin-left: 8px;
|
2020-10-17 13:12:00 +02:00
|
|
|
}
|
2020-01-29 20:37:25 +01:00
|
|
|
|
2021-08-07 03:24:50 +02:00
|
|
|
> .right {
|
|
|
|
margin-left: auto;
|
2020-01-29 20:37:25 +01:00
|
|
|
|
2021-08-07 03:24:50 +02:00
|
|
|
> .latestStatus {
|
|
|
|
border: solid 1px var(--divider);
|
|
|
|
border-radius: 4px;
|
|
|
|
margin: 0 8px;
|
|
|
|
padding: 0 4px;
|
|
|
|
}
|
2020-01-29 20:37:25 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|