parent
6f9ba940b9
commit
93869a5f34
11 changed files with 85 additions and 16 deletions
|
@ -17,6 +17,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<option value="federating">{{ i18n.ts.federating }}</option>
|
||||
<option value="subscribing">{{ i18n.ts.subscribing }}</option>
|
||||
<option value="publishing">{{ i18n.ts.publishing }}</option>
|
||||
<option value="nsfw">NSFW</option>
|
||||
<option value="suspended">{{ i18n.ts.suspended }}</option>
|
||||
<option value="silenced">{{ i18n.ts.silence }}</option>
|
||||
<option value="blocked">{{ i18n.ts.blocked }}</option>
|
||||
|
@ -78,6 +79,7 @@ const pagination = {
|
|||
state === 'blocked' ? { blocked: true } :
|
||||
state === 'silenced' ? { silenced: true } :
|
||||
state === 'notResponding' ? { notResponding: true } :
|
||||
state === 'nsfw' ? { nsfw: true } :
|
||||
{}),
|
||||
})),
|
||||
} as Paging;
|
||||
|
@ -87,6 +89,7 @@ function getStatus(instance) {
|
|||
if (instance.isBlocked) return 'Blocked';
|
||||
if (instance.isSilenced) return 'Silenced';
|
||||
if (instance.isNotResponding) return 'Error';
|
||||
if (instance.isNSFW) return 'NSFW';
|
||||
return 'Alive';
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -21,6 +21,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<option value="federating">{{ i18n.ts.federating }}</option>
|
||||
<option value="subscribing">{{ i18n.ts.subscribing }}</option>
|
||||
<option value="publishing">{{ i18n.ts.publishing }}</option>
|
||||
<option value="nsfw">NSFW</option>
|
||||
<option value="suspended">{{ i18n.ts.suspended }}</option>
|
||||
<option value="blocked">{{ i18n.ts.blocked }}</option>
|
||||
<option value="silenced">{{ i18n.ts.silence }}</option>
|
||||
|
@ -86,6 +87,7 @@ const pagination = {
|
|||
state === 'blocked' ? { blocked: true } :
|
||||
state === 'silenced' ? { silenced: true } :
|
||||
state === 'notResponding' ? { notResponding: true } :
|
||||
state === 'nsfw' ? { nsfw: true } :
|
||||
{}),
|
||||
})),
|
||||
};
|
||||
|
@ -95,6 +97,7 @@ function getStatus(instance) {
|
|||
if (instance.isBlocked) return 'Blocked';
|
||||
if (instance.isSilenced) return 'Silenced';
|
||||
if (instance.isNotResponding) return 'Error';
|
||||
if (instance.isNSFW) return 'NSFW';
|
||||
return 'Alive';
|
||||
}
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<MkSwitch v-model="suspended" :disabled="!instance" @update:modelValue="toggleSuspend">{{ i18n.ts.stopActivityDelivery }}</MkSwitch>
|
||||
<MkSwitch v-model="isBlocked" :disabled="!meta || !instance" @update:modelValue="toggleBlock">{{ i18n.ts.blockThisInstance }}</MkSwitch>
|
||||
<MkSwitch v-model="isSilenced" :disabled="!meta || !instance" @update:modelValue="toggleSilenced">{{ i18n.ts.silenceThisInstance }}</MkSwitch>
|
||||
<MkSwitch v-model="isNSFW" :disabled="!instance" @update:modelValue="toggleNSFW">Mark as NSFW</MkSwitch>
|
||||
<MkButton @click="refreshMetadata"><i class="ph-arrows-counter-clockwise ph-bold ph-lg"></i> Refresh metadata</MkButton>
|
||||
</div>
|
||||
</FormSection>
|
||||
|
@ -149,6 +150,7 @@ let instance = $ref<Misskey.entities.Instance | null>(null);
|
|||
let suspended = $ref(false);
|
||||
let isBlocked = $ref(false);
|
||||
let isSilenced = $ref(false);
|
||||
let isNSFW = $ref(false);
|
||||
let faviconUrl = $ref<string | null>(null);
|
||||
|
||||
const usersPagination = {
|
||||
|
@ -172,6 +174,7 @@ async function fetch(): Promise<void> {
|
|||
suspended = instance.isSuspended;
|
||||
isBlocked = instance.isBlocked;
|
||||
isSilenced = instance.isSilenced;
|
||||
isNSFW = instance.isNSFW;
|
||||
faviconUrl = getProxiedImageUrlNullable(instance.faviconUrl, 'preview') ?? getProxiedImageUrlNullable(instance.iconUrl, 'preview');
|
||||
}
|
||||
|
||||
|
@ -201,6 +204,14 @@ async function toggleSuspend(): Promise<void> {
|
|||
});
|
||||
}
|
||||
|
||||
async function toggleNSFW(): Promise<void> {
|
||||
if (!instance) throw new Error('No instance?');
|
||||
await os.api('admin/federation/update-instance', {
|
||||
host: instance.host,
|
||||
isNSFW: isNSFW,
|
||||
});
|
||||
}
|
||||
|
||||
function refreshMetadata(): void {
|
||||
if (!instance) throw new Error('No instance?');
|
||||
os.api('admin/federation/refresh-remote-instance-metadata', {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue