use tab instead of page header

This commit is contained in:
Namekuji 2023-04-30 11:39:01 -04:00
parent a1645ddc5b
commit c89bed41b0
No known key found for this signature in database
GPG key ID: B541BD6E646CABC7
5 changed files with 14 additions and 18 deletions

View file

@ -244,6 +244,7 @@ noCustomEmojis: "There are no emoji"
noJobs: "There are no jobs"
federating: "Federating"
blocked: "Blocked"
silenced: "Silenced"
suspended: "Suspended"
all: "All"
subscribing: "Subscribing"
@ -833,7 +834,7 @@ active: "Active"
offline: "Offline"
notRecommended: "Not recommended"
botProtection: "Bot Protection"
instanceBlocking: "Blocked/Silenced Instances"
instanceBlocking: "Federation Block/Silence"
selectAccount: "Select account"
switchAccount: "Switch account"
enabled: "Enabled"

View file

@ -223,6 +223,7 @@ noCustomEmojis: "絵文字はありません"
noJobs: "ジョブはありません"
federating: "連合中"
blocked: "ブロック中"
silenced: "サイレンス中"
suspended: "配信停止"
all: "全て"
subscribing: "購読中"
@ -771,7 +772,7 @@ active: "アクティブ"
offline: "オフライン"
notRecommended: "非推奨"
botProtection: "Botプロテクション"
instanceBlocking: "インスタンスブロック・サイレンス"
instanceBlocking: "連合ブロック・サイレンス"
selectAccount: "アカウントを選択"
switchAccount: "アカウントを切り替え"
enabled: "有効"

View file

@ -18,6 +18,7 @@
<option value="publishing">{{ i18n.ts.publishing }}</option>
<option value="suspended">{{ i18n.ts.suspended }}</option>
<option value="blocked">{{ i18n.ts.blocked }}</option>
<option value="silenced">{{ i18n.ts.silenced }}</option>
<option value="notResponding">
{{ i18n.ts.notResponding }}
</option>
@ -105,13 +106,11 @@
<script lang="ts" setup>
import { computed } from "vue";
import MkButton from "@/components/MkButton.vue";
import MkInput from "@/components/form/input.vue";
import MkSelect from "@/components/form/select.vue";
import MkPagination from "@/components/MkPagination.vue";
import MkInstanceCardMini from "@/components/MkInstanceCardMini.vue";
import FormSplit from "@/components/form/split.vue";
import * as os from "@/os";
import { i18n } from "@/i18n";
let host = $ref("");
@ -133,6 +132,8 @@ const pagination = {
: state === "suspended"
? { suspended: true }
: state === "blocked"
? { silenced: true }
: state === "silenced"
? { blocked: true }
: state === "notResponding"
? { notResponding: true }
@ -143,6 +144,7 @@ const pagination = {
function getStatus(instance) {
if (instance.isSuspended) return "Suspended";
if (instance.isBlocked) return "Blocked";
if (instance.isSilenced) return "Silenced";
if (instance.isNotResponding) return "Error";
return "Alive";
}

View file

@ -3,7 +3,6 @@
<MkStickyContainer>
<template #header
><MkPageHeader
v-model:tab="tab"
:actions="headerActions"
:tabs="headerTabs"
:display-back-button="true"

View file

@ -2,12 +2,15 @@
<MkStickyContainer>
<template #header
><MkPageHeader
v-model:tab="tab"
:actions="headerActions"
:tabs="headerTabs"
:display-back-button="true"
/></template>
<MkSpacer :content-max="700" :margin-min="16" :margin-max="32">
<MkTab v-model="tab" class="_formBlock">
<option value="block">{{ i18n.ts.blockedInstances }}</option>
<option value="silence">{{ i18n.ts.silencedInstances }}</option>
</MkTab>
<FormSuspense :p="init">
<FormTextarea
v-if="tab === 'block'"
@ -44,6 +47,7 @@ import {} from "vue";
import FormButton from "@/components/MkButton.vue";
import FormTextarea from "@/components/form/textarea.vue";
import FormSuspense from "@/components/form/suspense.vue";
import MkTab from "@/components/MkTab.vue";
import * as os from "@/os";
import { fetchInstance } from "@/instance";
import { i18n } from "@/i18n";
@ -72,18 +76,7 @@ function save() {
const headerActions = $computed(() => []);
const headerTabs = $computed(() => [
{
key: "block",
title: i18n.ts.block,
icon: "ph-prohibit ph-bold ph-lg",
},
{
key: "silence",
title: i18n.ts.silence,
icon: "ph-eye-slash ph-bold ph-lg",
},
]);
const headerTabs = $computed(() => []);
definePageMetadata({
title: i18n.ts.instanceBlocking,