2022-06-20 12:49:51 +02:00
|
|
|
<template>
|
2023-04-08 02:01:42 +02:00
|
|
|
<MkStickyContainer>
|
|
|
|
<template #header
|
|
|
|
><MkPageHeader
|
|
|
|
v-model:tab="tab"
|
|
|
|
:actions="headerActions"
|
|
|
|
:tabs="headerTabs"
|
|
|
|
/></template>
|
|
|
|
<MkSpacer
|
|
|
|
v-if="instance"
|
|
|
|
:content-max="600"
|
|
|
|
:margin-min="16"
|
|
|
|
:margin-max="32"
|
2022-09-10 00:42:17 +02:00
|
|
|
>
|
2023-05-26 04:47:10 +02:00
|
|
|
<swiper
|
2023-05-26 23:02:17 +02:00
|
|
|
:round-lengths="true"
|
2023-05-26 04:47:10 +02:00
|
|
|
:touch-angle="25"
|
|
|
|
:threshold="10"
|
|
|
|
:centeredSlides="true"
|
2023-04-08 02:01:42 +02:00
|
|
|
:modules="[Virtual]"
|
|
|
|
:space-between="20"
|
|
|
|
:virtual="true"
|
2023-06-26 21:47:05 +02:00
|
|
|
:allow-touch-move="
|
|
|
|
defaultStore.state.swipeOnMobile &&
|
|
|
|
(deviceKind !== 'desktop' ||
|
|
|
|
defaultStore.state.swipeOnDesktop)
|
|
|
|
"
|
2023-04-08 02:01:42 +02:00
|
|
|
@swiper="setSwiperRef"
|
|
|
|
@slide-change="onSlideChange"
|
|
|
|
>
|
|
|
|
<swiper-slide>
|
|
|
|
<div class="_formRoot">
|
|
|
|
<div class="fnfelxur">
|
|
|
|
<img :src="faviconUrl" alt="" class="icon" />
|
|
|
|
<span class="name">{{
|
|
|
|
instance.name || `(${i18n.ts.unknown})`
|
|
|
|
}}</span>
|
|
|
|
</div>
|
|
|
|
<MkKeyValue :copy="host" oneline style="margin: 1em 0">
|
|
|
|
<template #key>Host</template>
|
|
|
|
<template #value
|
|
|
|
><span class="_monospace"
|
|
|
|
><MkLink :url="`https://${host}`">{{
|
|
|
|
host
|
|
|
|
}}</MkLink></span
|
|
|
|
></template
|
|
|
|
>
|
2022-09-10 00:42:17 +02:00
|
|
|
</MkKeyValue>
|
2023-04-08 02:01:42 +02:00
|
|
|
<MkKeyValue oneline style="margin: 1em 0">
|
|
|
|
<template #key>{{ i18n.ts.software }}</template>
|
|
|
|
<template #value
|
|
|
|
><span class="_monospace"
|
|
|
|
>{{
|
|
|
|
instance.softwareName ||
|
|
|
|
`(${i18n.ts.unknown})`
|
|
|
|
}}
|
|
|
|
/
|
|
|
|
{{
|
|
|
|
instance.softwareVersion ||
|
|
|
|
`(${i18n.ts.unknown})`
|
|
|
|
}}</span
|
|
|
|
></template
|
|
|
|
>
|
2022-09-10 00:42:17 +02:00
|
|
|
</MkKeyValue>
|
2023-04-08 02:01:42 +02:00
|
|
|
<MkKeyValue oneline style="margin: 1em 0">
|
|
|
|
<template #key>{{
|
|
|
|
i18n.ts.administrator
|
|
|
|
}}</template>
|
|
|
|
<template #value
|
|
|
|
>{{
|
|
|
|
instance.maintainerName ||
|
|
|
|
`(${i18n.ts.unknown})`
|
|
|
|
}}
|
|
|
|
({{
|
|
|
|
instance.maintainerEmail ||
|
|
|
|
`(${i18n.ts.unknown})`
|
|
|
|
}})</template
|
|
|
|
>
|
2022-09-10 00:42:17 +02:00
|
|
|
</MkKeyValue>
|
2023-04-08 02:01:42 +02:00
|
|
|
<MkKeyValue>
|
|
|
|
<template #key>{{ i18n.ts.description }}</template>
|
|
|
|
<template #value>{{
|
|
|
|
instance.description
|
|
|
|
}}</template>
|
2022-09-10 00:42:17 +02:00
|
|
|
</MkKeyValue>
|
2022-09-15 22:40:34 +02:00
|
|
|
|
2023-05-08 01:11:20 +02:00
|
|
|
<FormSection v-if="iAmAdmin">
|
2023-04-08 02:01:42 +02:00
|
|
|
<template #label>Moderation</template>
|
|
|
|
<FormSuspense :p="init">
|
|
|
|
<FormSwitch
|
|
|
|
v-model="suspended"
|
|
|
|
class="_formBlock"
|
|
|
|
@update:modelValue="toggleSuspend"
|
|
|
|
>{{
|
|
|
|
i18n.ts.stopActivityDelivery
|
|
|
|
}}</FormSwitch
|
|
|
|
>
|
|
|
|
<FormSwitch
|
|
|
|
v-model="isBlocked"
|
|
|
|
class="_formBlock"
|
|
|
|
@update:modelValue="toggleBlock"
|
|
|
|
>{{ i18n.ts.blockThisInstance }}</FormSwitch
|
|
|
|
>
|
2023-04-30 15:01:42 +02:00
|
|
|
<FormSwitch
|
|
|
|
v-model="isSilenced"
|
|
|
|
class="_formBlock"
|
|
|
|
@update:modelValue="toggleSilence"
|
|
|
|
>{{
|
|
|
|
i18n.ts.silenceThisInstance
|
|
|
|
}}</FormSwitch
|
|
|
|
>
|
2023-04-08 02:01:42 +02:00
|
|
|
</FormSuspense>
|
|
|
|
<MkButton @click="refreshMetadata"
|
|
|
|
><i
|
|
|
|
class="ph-arrows-clockwise ph-bold ph-lg"
|
|
|
|
></i>
|
|
|
|
Refresh metadata</MkButton
|
|
|
|
>
|
|
|
|
</FormSection>
|
2022-09-15 22:40:34 +02:00
|
|
|
|
2023-04-08 02:01:42 +02:00
|
|
|
<FormSection>
|
|
|
|
<MkKeyValue oneline style="margin: 1em 0">
|
|
|
|
<template #key>{{
|
|
|
|
i18n.ts.registeredAt
|
|
|
|
}}</template>
|
|
|
|
<template #value
|
|
|
|
><MkTime
|
|
|
|
mode="detail"
|
|
|
|
:time="instance.caughtAt"
|
|
|
|
/></template>
|
|
|
|
</MkKeyValue>
|
|
|
|
<MkKeyValue oneline style="margin: 1em 0">
|
|
|
|
<template #key>{{
|
|
|
|
i18n.ts.updatedAt
|
|
|
|
}}</template>
|
|
|
|
<template #value
|
|
|
|
><MkTime
|
|
|
|
mode="detail"
|
|
|
|
:time="instance.infoUpdatedAt"
|
|
|
|
/></template>
|
|
|
|
</MkKeyValue>
|
|
|
|
<MkKeyValue oneline style="margin: 1em 0">
|
|
|
|
<template #key>{{
|
|
|
|
i18n.ts.latestRequestSentAt
|
|
|
|
}}</template>
|
|
|
|
<template #value
|
|
|
|
><MkTime
|
|
|
|
v-if="instance.latestRequestSentAt"
|
|
|
|
:time="instance.latestRequestSentAt"
|
|
|
|
/><span v-else>N/A</span></template
|
|
|
|
>
|
|
|
|
</MkKeyValue>
|
|
|
|
<MkKeyValue oneline style="margin: 1em 0">
|
|
|
|
<template #key>{{
|
|
|
|
i18n.ts.latestStatus
|
|
|
|
}}</template>
|
|
|
|
<template #value>{{
|
|
|
|
instance.latestStatus
|
|
|
|
? instance.latestStatus
|
|
|
|
: "N/A"
|
|
|
|
}}</template>
|
|
|
|
</MkKeyValue>
|
|
|
|
<MkKeyValue oneline style="margin: 1em 0">
|
|
|
|
<template #key>{{
|
|
|
|
i18n.ts.latestRequestReceivedAt
|
|
|
|
}}</template>
|
|
|
|
<template #value
|
|
|
|
><MkTime
|
|
|
|
v-if="instance.latestRequestReceivedAt"
|
|
|
|
:time="instance.latestRequestReceivedAt"
|
|
|
|
/><span v-else>N/A</span></template
|
|
|
|
>
|
|
|
|
</MkKeyValue>
|
|
|
|
</FormSection>
|
|
|
|
|
|
|
|
<FormSection>
|
|
|
|
<MkKeyValue oneline style="margin: 1em 0">
|
|
|
|
<template #key>Following (Pub)</template>
|
|
|
|
<template #value>{{
|
|
|
|
number(instance.followingCount)
|
|
|
|
}}</template>
|
|
|
|
</MkKeyValue>
|
|
|
|
<MkKeyValue oneline style="margin: 1em 0">
|
|
|
|
<template #key>Followers (Sub)</template>
|
|
|
|
<template #value>{{
|
|
|
|
number(instance.followersCount)
|
|
|
|
}}</template>
|
|
|
|
</MkKeyValue>
|
|
|
|
</FormSection>
|
|
|
|
|
|
|
|
<FormSection>
|
|
|
|
<template #label>Well-known resources</template>
|
|
|
|
<FormLink
|
|
|
|
:to="`https://${host}/.well-known/host-meta`"
|
|
|
|
external
|
|
|
|
style="margin-bottom: 8px"
|
|
|
|
>host-meta</FormLink
|
|
|
|
>
|
|
|
|
<FormLink
|
|
|
|
:to="`https://${host}/.well-known/host-meta.json`"
|
|
|
|
external
|
|
|
|
style="margin-bottom: 8px"
|
|
|
|
>host-meta.json</FormLink
|
|
|
|
>
|
|
|
|
<FormLink
|
|
|
|
:to="`https://${host}/.well-known/nodeinfo`"
|
|
|
|
external
|
|
|
|
style="margin-bottom: 8px"
|
|
|
|
>nodeinfo</FormLink
|
|
|
|
>
|
|
|
|
<FormLink
|
|
|
|
:to="`https://${host}/robots.txt`"
|
|
|
|
external
|
|
|
|
style="margin-bottom: 8px"
|
|
|
|
>robots.txt</FormLink
|
|
|
|
>
|
|
|
|
<FormLink
|
|
|
|
:to="`https://${host}/manifest.json`"
|
|
|
|
external
|
|
|
|
style="margin-bottom: 8px"
|
|
|
|
>manifest.json</FormLink
|
|
|
|
>
|
|
|
|
</FormSection>
|
|
|
|
</div>
|
|
|
|
</swiper-slide>
|
|
|
|
<swiper-slide>
|
|
|
|
<div class="_formRoot">
|
|
|
|
<div class="cmhjzshl">
|
|
|
|
<div class="selects">
|
|
|
|
<MkSelect
|
|
|
|
v-model="chartSrc"
|
|
|
|
style="margin: 0 10px 0 0; flex: 1"
|
|
|
|
>
|
|
|
|
<option value="instance-requests">
|
|
|
|
{{ i18n.ts._instanceCharts.requests }}
|
|
|
|
</option>
|
|
|
|
<option value="instance-users">
|
|
|
|
{{ i18n.ts._instanceCharts.users }}
|
|
|
|
</option>
|
|
|
|
<option value="instance-users-total">
|
|
|
|
{{ i18n.ts._instanceCharts.usersTotal }}
|
|
|
|
</option>
|
|
|
|
<option value="instance-notes">
|
|
|
|
{{ i18n.ts._instanceCharts.notes }}
|
|
|
|
</option>
|
|
|
|
<option value="instance-notes-total">
|
|
|
|
{{ i18n.ts._instanceCharts.notesTotal }}
|
|
|
|
</option>
|
|
|
|
<option value="instance-ff">
|
|
|
|
{{ i18n.ts._instanceCharts.ff }}
|
|
|
|
</option>
|
|
|
|
<option value="instance-ff-total">
|
|
|
|
{{ i18n.ts._instanceCharts.ffTotal }}
|
|
|
|
</option>
|
|
|
|
<option value="instance-drive-usage">
|
|
|
|
{{ i18n.ts._instanceCharts.cacheSize }}
|
|
|
|
</option>
|
|
|
|
<option value="instance-drive-usage-total">
|
|
|
|
{{
|
|
|
|
i18n.ts._instanceCharts
|
|
|
|
.cacheSizeTotal
|
|
|
|
}}
|
|
|
|
</option>
|
|
|
|
<option value="instance-drive-files">
|
|
|
|
{{ i18n.ts._instanceCharts.files }}
|
|
|
|
</option>
|
|
|
|
<option value="instance-drive-files-total">
|
|
|
|
{{ i18n.ts._instanceCharts.filesTotal }}
|
|
|
|
</option>
|
|
|
|
</MkSelect>
|
|
|
|
</div>
|
|
|
|
<div class="charts">
|
|
|
|
<div class="label">
|
|
|
|
{{ i18n.t("recentNHours", { n: 90 }) }}
|
|
|
|
</div>
|
|
|
|
<MkChart
|
|
|
|
class="chart"
|
|
|
|
:src="chartSrc"
|
|
|
|
span="hour"
|
|
|
|
:limit="90"
|
|
|
|
:args="{ host: host }"
|
|
|
|
:detailed="true"
|
|
|
|
></MkChart>
|
|
|
|
<div class="label">
|
|
|
|
{{ i18n.t("recentNDays", { n: 90 }) }}
|
|
|
|
</div>
|
|
|
|
<MkChart
|
|
|
|
class="chart"
|
|
|
|
:src="chartSrc"
|
|
|
|
span="day"
|
|
|
|
:limit="90"
|
|
|
|
:args="{ host: host }"
|
|
|
|
:detailed="true"
|
|
|
|
></MkChart>
|
|
|
|
</div>
|
2022-09-10 00:42:17 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2023-04-08 02:01:42 +02:00
|
|
|
</swiper-slide>
|
|
|
|
<swiper-slide>
|
|
|
|
<div class="_formRoot">
|
|
|
|
<MkPagination
|
|
|
|
v-slot="{ items }"
|
|
|
|
:pagination="usersPagination"
|
|
|
|
style="
|
|
|
|
display: grid;
|
|
|
|
grid-template-columns: repeat(
|
|
|
|
auto-fill,
|
|
|
|
minmax(270px, 1fr)
|
|
|
|
);
|
|
|
|
grid-gap: 12px;
|
|
|
|
"
|
|
|
|
>
|
|
|
|
<MkA
|
|
|
|
v-for="user in items"
|
|
|
|
:key="user.id"
|
|
|
|
v-tooltip.mfm="
|
|
|
|
`Last posted: ${new Date(
|
2023-07-06 03:28:27 +02:00
|
|
|
user.updatedAt,
|
2023-04-08 02:01:42 +02:00
|
|
|
).toLocaleString()}`
|
|
|
|
"
|
|
|
|
class="user"
|
|
|
|
:to="`/user-info/${user.id}`"
|
|
|
|
>
|
|
|
|
<MkUserCardMini :user="user" />
|
|
|
|
</MkA>
|
|
|
|
</MkPagination>
|
|
|
|
</div>
|
|
|
|
</swiper-slide>
|
|
|
|
<swiper-slide>
|
|
|
|
<div class="_formRoot">
|
|
|
|
<MkObjectView tall :value="instance"> </MkObjectView>
|
|
|
|
</div>
|
|
|
|
</swiper-slide>
|
|
|
|
</swiper>
|
|
|
|
</MkSpacer>
|
|
|
|
</MkStickyContainer>
|
2021-04-16 10:34:06 +02:00
|
|
|
</template>
|
|
|
|
|
2022-01-18 13:30:17 +01:00
|
|
|
<script lang="ts" setup>
|
2023-04-08 02:01:42 +02:00
|
|
|
import { watch } from "vue";
|
|
|
|
import { Virtual } from "swiper";
|
|
|
|
import { Swiper, SwiperSlide } from "swiper/vue";
|
2023-04-30 23:06:43 +02:00
|
|
|
import type * as calckey from "calckey-js";
|
2023-04-08 02:01:42 +02:00
|
|
|
import MkChart from "@/components/MkChart.vue";
|
|
|
|
import MkObjectView from "@/components/MkObjectView.vue";
|
|
|
|
import FormLink from "@/components/form/link.vue";
|
|
|
|
import MkLink from "@/components/MkLink.vue";
|
|
|
|
import MkButton from "@/components/MkButton.vue";
|
|
|
|
import FormSection from "@/components/form/section.vue";
|
|
|
|
import MkKeyValue from "@/components/MkKeyValue.vue";
|
|
|
|
import MkSelect from "@/components/form/select.vue";
|
|
|
|
import FormSwitch from "@/components/form/switch.vue";
|
|
|
|
import * as os from "@/os";
|
|
|
|
import number from "@/filters/number";
|
2023-05-08 01:11:20 +02:00
|
|
|
import { iAmAdmin } from "@/account";
|
2023-04-08 02:01:42 +02:00
|
|
|
import { definePageMetadata } from "@/scripts/page-metadata";
|
|
|
|
import { deviceKind } from "@/scripts/device-kind";
|
|
|
|
import { defaultStore } from "@/store";
|
|
|
|
import { i18n } from "@/i18n";
|
|
|
|
import MkUserCardMini from "@/components/MkUserCardMini.vue";
|
|
|
|
import MkPagination from "@/components/MkPagination.vue";
|
|
|
|
import "swiper/scss";
|
|
|
|
import "swiper/scss/virtual";
|
|
|
|
import { getProxiedImageUrlNullable } from "@/scripts/media-proxy";
|
2022-01-18 13:30:17 +01:00
|
|
|
|
2023-04-30 23:06:43 +02:00
|
|
|
type AugmentedInstanceMetadata = calckey.entities.DetailedInstanceMetadata & {
|
2023-04-04 05:46:23 +02:00
|
|
|
blockedHosts: string[];
|
2023-04-30 15:01:42 +02:00
|
|
|
silencedHosts: string[];
|
2023-04-04 05:46:23 +02:00
|
|
|
};
|
2023-04-30 23:06:43 +02:00
|
|
|
type AugmentedInstance = calckey.entities.Instance & {
|
2023-04-04 05:46:23 +02:00
|
|
|
isBlocked: boolean;
|
2023-04-30 15:01:42 +02:00
|
|
|
isSilenced: boolean;
|
2023-04-04 05:46:23 +02:00
|
|
|
};
|
|
|
|
|
2022-01-18 13:30:17 +01:00
|
|
|
const props = defineProps<{
|
|
|
|
host: string;
|
|
|
|
}>();
|
|
|
|
|
2023-04-08 02:01:42 +02:00
|
|
|
let tabs = ["overview"];
|
2023-05-08 01:11:20 +02:00
|
|
|
if (iAmAdmin) tabs.push("chart", "users", "raw");
|
2022-10-26 04:19:42 +02:00
|
|
|
let tab = $ref(tabs[0]);
|
2023-04-08 02:01:42 +02:00
|
|
|
watch($$(tab), () => syncSlide(tabs.indexOf(tab)));
|
2022-10-26 04:19:42 +02:00
|
|
|
|
2023-04-08 02:01:42 +02:00
|
|
|
let chartSrc = $ref("instance-requests");
|
2023-04-04 05:46:23 +02:00
|
|
|
let meta = $ref<AugmentedInstanceMetadata | null>(null);
|
|
|
|
let instance = $ref<AugmentedInstance | null>(null);
|
2022-01-18 13:30:17 +01:00
|
|
|
let suspended = $ref(false);
|
|
|
|
let isBlocked = $ref(false);
|
2023-04-30 15:01:42 +02:00
|
|
|
let isSilenced = $ref(false);
|
2023-02-10 23:46:56 +01:00
|
|
|
let faviconUrl = $ref(null);
|
2022-01-18 13:30:17 +01:00
|
|
|
|
2022-06-29 07:14:27 +02:00
|
|
|
const usersPagination = {
|
2023-05-08 01:11:20 +02:00
|
|
|
endpoint: iAmAdmin ? "admin/show-users" : ("users" as const),
|
2022-06-29 07:14:27 +02:00
|
|
|
limit: 10,
|
|
|
|
params: {
|
2023-04-08 02:01:42 +02:00
|
|
|
sort: "+updatedAt",
|
|
|
|
state: "all",
|
2022-06-29 07:14:27 +02:00
|
|
|
hostname: props.host,
|
|
|
|
},
|
|
|
|
offsetMode: true,
|
|
|
|
};
|
|
|
|
|
2022-01-18 13:30:17 +01:00
|
|
|
async function fetch() {
|
2023-05-08 22:01:06 +02:00
|
|
|
if (iAmAdmin)
|
|
|
|
meta = (await os.api("admin/meta")) as AugmentedInstanceMetadata;
|
2023-04-08 02:01:42 +02:00
|
|
|
instance = (await os.api("federation/show-instance", {
|
2022-06-28 15:56:18 +02:00
|
|
|
host: props.host,
|
2023-04-04 05:46:23 +02:00
|
|
|
})) as AugmentedInstance;
|
2022-06-28 15:56:18 +02:00
|
|
|
suspended = instance.isSuspended;
|
|
|
|
isBlocked = instance.isBlocked;
|
2023-04-30 15:01:42 +02:00
|
|
|
isSilenced = instance.isSilenced;
|
2023-04-04 05:46:23 +02:00
|
|
|
faviconUrl =
|
2023-04-08 02:01:42 +02:00
|
|
|
getProxiedImageUrlNullable(instance.faviconUrl, "preview") ??
|
|
|
|
getProxiedImageUrlNullable(instance.iconUrl, "preview");
|
2022-01-18 13:30:17 +01:00
|
|
|
}
|
2021-04-16 10:34:06 +02:00
|
|
|
|
2023-04-04 05:46:23 +02:00
|
|
|
async function toggleBlock() {
|
2022-01-18 13:30:17 +01:00
|
|
|
if (meta == null) return;
|
2023-04-04 05:46:23 +02:00
|
|
|
if (!instance) {
|
|
|
|
throw new Error(`Instance info not loaded`);
|
|
|
|
}
|
|
|
|
let blockedHosts: string[];
|
|
|
|
if (isBlocked) {
|
|
|
|
blockedHosts = meta.blockedHosts.concat([instance.host]);
|
|
|
|
} else {
|
|
|
|
blockedHosts = meta.blockedHosts.filter((x) => x !== instance!.host);
|
|
|
|
}
|
2023-04-08 02:01:42 +02:00
|
|
|
await os.api("admin/update-meta", {
|
2023-04-04 05:46:23 +02:00
|
|
|
blockedHosts,
|
2022-01-18 13:30:17 +01:00
|
|
|
});
|
|
|
|
}
|
2022-01-04 07:36:14 +01:00
|
|
|
|
2023-04-30 15:01:42 +02:00
|
|
|
async function toggleSilence() {
|
|
|
|
if (meta == null) return;
|
|
|
|
if (!instance) {
|
|
|
|
throw new Error(`Instance info not loaded`);
|
|
|
|
}
|
|
|
|
let silencedHosts: string[];
|
|
|
|
if (isSilenced) {
|
|
|
|
silencedHosts = meta.silencedHosts.concat([instance.host]);
|
|
|
|
} else {
|
|
|
|
silencedHosts = meta.silencedHosts.filter((x) => x !== instance!.host);
|
|
|
|
}
|
|
|
|
await os.api("admin/update-meta", {
|
|
|
|
silencedHosts,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-01-18 13:30:17 +01:00
|
|
|
async function toggleSuspend(v) {
|
2023-04-08 02:01:42 +02:00
|
|
|
await os.api("admin/federation/update-instance", {
|
2022-01-18 13:30:17 +01:00
|
|
|
host: instance.host,
|
|
|
|
isSuspended: suspended,
|
|
|
|
});
|
|
|
|
}
|
2022-01-04 07:36:14 +01:00
|
|
|
|
2022-01-31 12:38:26 +01:00
|
|
|
function refreshMetadata() {
|
2023-04-08 02:01:42 +02:00
|
|
|
os.api("admin/federation/refresh-remote-instance-metadata", {
|
2022-01-31 12:38:26 +01:00
|
|
|
host: instance.host,
|
|
|
|
});
|
|
|
|
os.alert({
|
2023-04-08 02:01:42 +02:00
|
|
|
text: "Refresh requested",
|
2022-01-31 12:38:26 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-01-18 13:30:17 +01:00
|
|
|
fetch();
|
|
|
|
|
2023-04-08 02:01:42 +02:00
|
|
|
const headerActions = $computed(() => [
|
|
|
|
{
|
|
|
|
text: `https://${props.host}`,
|
|
|
|
icon: "ph-arrow-square-out ph-bold ph-lg",
|
|
|
|
handler: () => {
|
|
|
|
window.open(`https://${props.host}`, "_blank");
|
|
|
|
},
|
2022-06-20 12:49:51 +02:00
|
|
|
},
|
2023-04-08 02:01:42 +02:00
|
|
|
]);
|
2022-06-20 10:38:49 +02:00
|
|
|
|
2023-04-08 02:01:42 +02:00
|
|
|
let theTabs = [
|
|
|
|
{
|
|
|
|
key: "overview",
|
|
|
|
title: i18n.ts.overview,
|
|
|
|
icon: "ph-info ph-bold ph-lg",
|
|
|
|
},
|
|
|
|
];
|
2022-07-26 02:14:37 +02:00
|
|
|
|
2023-05-08 01:11:20 +02:00
|
|
|
if (iAmAdmin) {
|
2022-07-26 02:27:57 +02:00
|
|
|
theTabs.push(
|
|
|
|
{
|
2023-04-08 02:01:42 +02:00
|
|
|
key: "chart",
|
2022-07-26 02:27:57 +02:00
|
|
|
title: i18n.ts.charts,
|
2023-04-08 02:01:42 +02:00
|
|
|
icon: "ph-chart-bar ph-bold ph-lg",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
key: "users",
|
2022-07-26 02:27:57 +02:00
|
|
|
title: i18n.ts.users,
|
2023-04-08 02:01:42 +02:00
|
|
|
icon: "ph-users ph-bold ph-lg",
|
2022-07-26 02:27:57 +02:00
|
|
|
},
|
2023-04-08 02:01:42 +02:00
|
|
|
{
|
|
|
|
key: "raw",
|
|
|
|
title: "Raw",
|
|
|
|
icon: "ph-code ph-bold ph-lg",
|
2023-07-06 03:28:27 +02:00
|
|
|
},
|
2022-07-26 02:27:57 +02:00
|
|
|
);
|
2022-07-26 02:14:37 +02:00
|
|
|
}
|
2022-06-20 10:38:49 +02:00
|
|
|
|
2022-07-26 02:27:57 +02:00
|
|
|
let headerTabs = $computed(() => theTabs);
|
|
|
|
|
2022-06-20 10:38:49 +02:00
|
|
|
definePageMetadata({
|
|
|
|
title: props.host,
|
2023-04-08 02:01:42 +02:00
|
|
|
icon: "ph-hard-drives ph-bold ph-lg",
|
2021-04-16 10:34:06 +02:00
|
|
|
});
|
2022-09-10 00:42:17 +02:00
|
|
|
|
|
|
|
let swiperRef = null;
|
|
|
|
|
|
|
|
function setSwiperRef(swiper) {
|
|
|
|
swiperRef = swiper;
|
|
|
|
syncSlide(tabs.indexOf(tab));
|
|
|
|
}
|
|
|
|
|
|
|
|
function onSlideChange() {
|
|
|
|
tab = tabs[swiperRef.activeIndex];
|
|
|
|
}
|
|
|
|
|
|
|
|
function syncSlide(index) {
|
|
|
|
swiperRef.slideTo(index);
|
|
|
|
}
|
2021-04-16 10:34:06 +02:00
|
|
|
</script>
|
2021-04-16 14:47:12 +02:00
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.fnfelxur {
|
2022-06-26 09:57:12 +02:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
|
2021-04-25 05:31:11 +02:00
|
|
|
> .icon {
|
2021-04-16 14:47:12 +02:00
|
|
|
display: block;
|
2022-06-26 09:57:12 +02:00
|
|
|
margin: 0 16px 0 0;
|
2021-04-16 14:47:12 +02:00
|
|
|
height: 64px;
|
|
|
|
border-radius: 8px;
|
|
|
|
}
|
2022-06-26 09:57:12 +02:00
|
|
|
|
|
|
|
> .name {
|
|
|
|
word-break: break-all;
|
|
|
|
}
|
2021-04-16 14:47:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
.cmhjzshl {
|
|
|
|
> .selects {
|
|
|
|
display: flex;
|
2022-01-04 07:36:14 +01:00
|
|
|
margin: 0 0 16px 0;
|
2021-04-16 14:47:12 +02:00
|
|
|
}
|
2022-06-21 10:55:38 +02:00
|
|
|
|
|
|
|
> .charts {
|
|
|
|
> .label {
|
|
|
|
margin-bottom: 12px;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
}
|
2021-04-16 14:47:12 +02:00
|
|
|
}
|
|
|
|
</style>
|