use tab instead of page header

This commit is contained in:
Namekuji 2023-04-30 11:39:01 -04:00
parent cec5813ab2
commit f0b4e10735
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" noJobs: "There are no jobs"
federating: "Federating" federating: "Federating"
blocked: "Blocked" blocked: "Blocked"
silenced: "Silenced"
suspended: "Suspended" suspended: "Suspended"
all: "All" all: "All"
subscribing: "Subscribing" subscribing: "Subscribing"
@ -833,7 +834,7 @@ active: "Active"
offline: "Offline" offline: "Offline"
notRecommended: "Not recommended" notRecommended: "Not recommended"
botProtection: "Bot Protection" botProtection: "Bot Protection"
instanceBlocking: "Blocked/Silenced Instances" instanceBlocking: "Federation Block/Silence"
selectAccount: "Select account" selectAccount: "Select account"
switchAccount: "Switch account" switchAccount: "Switch account"
enabled: "Enabled" enabled: "Enabled"

View file

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

View file

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

View file

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

View file

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