Merge branch 'develop' into feature/2024.9.0

# Conflicts:
#	packages/frontend/src/pages/instance-info.vue
This commit is contained in:
Hazelnoot 2024-10-11 14:06:21 -04:00
commit 148bf98f21
6 changed files with 27 additions and 22 deletions

View file

@ -258,6 +258,7 @@ defaultValueIs: "Default: {value}"
noCustomEmojis: "There are no emoji" noCustomEmojis: "There are no emoji"
noJobs: "There are no jobs" noJobs: "There are no jobs"
federating: "Federating" federating: "Federating"
blockingYou: "Blocking you"
blocked: "Blocked" blocked: "Blocked"
suspended: "Suspended" suspended: "Suspended"
all: "All" all: "All"
@ -1294,7 +1295,7 @@ _delivery:
none: "Publishing" none: "Publishing"
manuallySuspended: "Manually suspended" manuallySuspended: "Manually suspended"
goneSuspended: "Server is suspended due to server deletion" goneSuspended: "Server is suspended due to server deletion"
autoSuspendedForNotResponding: "Server is suspended due to no responding" autoSuspendedForNotResponding: "Server is suspended due to not responding"
_bubbleGame: _bubbleGame:
howToPlay: "How to play" howToPlay: "How to play"
hold: "Hold" hold: "Hold"

4
locales/index.d.ts vendored
View file

@ -1050,6 +1050,10 @@ export interface Locale extends ILocale {
* *
*/ */
"federating": string; "federating": string;
/**
* Blocking you
*/
"blockingYou": string;
/** /**
* *
*/ */

View file

@ -258,6 +258,7 @@ defaultValueIs: "デフォルト: {value}"
noCustomEmojis: "絵文字はありません" noCustomEmojis: "絵文字はありません"
noJobs: "ジョブはありません" noJobs: "ジョブはありません"
federating: "連合中" federating: "連合中"
blockingYou: "Blocking you"
blocked: "ブロック中" blocked: "ブロック中"
suspended: "配信停止" suspended: "配信停止"
all: "全て" all: "全て"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -46,9 +46,8 @@ SPDX-License-Identifier: AGPL-3.0-only
<div class="_buttons"> <div class="_buttons">
<MkButton inline :disabled="!instance" danger @click="deleteAllFiles">{{ i18n.ts.deleteAllFiles }}</MkButton> <MkButton inline :disabled="!instance" danger @click="deleteAllFiles">{{ i18n.ts.deleteAllFiles }}</MkButton>
<MkButton inline :disabled="!instance" danger @click="severAllFollowRelations">{{ i18n.ts.severAllFollowRelations }}</MkButton> <MkButton inline :disabled="!instance" danger @click="severAllFollowRelations">{{ i18n.ts.severAllFollowRelations }}</MkButton>
<MkButton v-if="suspensionState === 'none'" inline :disabled="!instance" danger @click="stopDelivery">{{ i18n.ts._delivery.stop }}</MkButton>
<MkButton v-if="suspensionState !== 'none'" inline :disabled="!instance" @click="resumeDelivery">{{ i18n.ts._delivery.resume }}</MkButton>
</div> </div>
<MkSwitch v-model="isSuspended" :disabled="!instance" @update:modelValue="toggleSuspended">{{ i18n.ts._delivery.stop }}</MkSwitch>
<MkInfo v-if="isBaseBlocked" warn>{{ i18n.ts.blockedByBase }}</MkInfo> <MkInfo v-if="isBaseBlocked" warn>{{ i18n.ts.blockedByBase }}</MkInfo>
<MkSwitch v-model="isBlocked" :disabled="!meta || !instance || isBaseBlocked" @update:modelValue="toggleBlock">{{ i18n.ts.blockThisInstance }}</MkSwitch> <MkSwitch v-model="isBlocked" :disabled="!meta || !instance || isBaseBlocked" @update:modelValue="toggleBlock">{{ i18n.ts.blockThisInstance }}</MkSwitch>
<MkInfo v-if="isBaseSilenced" warn>{{ i18n.ts.silencedByBase }}</MkInfo> <MkInfo v-if="isBaseSilenced" warn>{{ i18n.ts.silencedByBase }}</MkInfo>
@ -206,6 +205,7 @@ const chartSrc = ref<ChartSrc>('instance-requests');
const meta = ref<Misskey.entities.AdminMetaResponse | null>(null); const meta = ref<Misskey.entities.AdminMetaResponse | null>(null);
const instance = ref<Misskey.entities.FederationInstance | null>(null); const instance = ref<Misskey.entities.FederationInstance | null>(null);
const suspensionState = ref<'none' | 'manuallySuspended' | 'goneSuspended' | 'autoSuspendedForNotResponding'>('none'); const suspensionState = ref<'none' | 'manuallySuspended' | 'goneSuspended' | 'autoSuspendedForNotResponding'>('none');
const isSuspended = ref(false);
const isBlocked = ref(false); const isBlocked = ref(false);
const isSilenced = ref(false); const isSilenced = ref(false);
const isNSFW = ref(false); const isNSFW = ref(false);
@ -275,6 +275,7 @@ async function fetch(): Promise<void> {
host: props.host, host: props.host,
}); });
suspensionState.value = instance.value?.suspensionState ?? 'none'; suspensionState.value = instance.value?.suspensionState ?? 'none';
isSuspended.value = instance.value?.suspensionState !== 'none';
isBlocked.value = instance.value?.isBlocked ?? false; isBlocked.value = instance.value?.isBlocked ?? false;
isSilenced.value = instance.value?.isSilenced ?? false; isSilenced.value = instance.value?.isSilenced ?? false;
isNSFW.value = instance.value?.isNSFW ?? false; isNSFW.value = instance.value?.isNSFW ?? false;
@ -316,23 +317,13 @@ async function toggleMediaSilenced(): Promise<void> {
}); });
} }
async function stopDelivery(): Promise<void> { async function toggleSuspended(): Promise<void> {
if (!iAmModerator) return; if (!iAmModerator) return;
if (!instance.value) throw new Error('No instance?'); if (!instance.value) throw new Error('No instance?');
suspensionState.value = 'manuallySuspended'; suspensionState.value = isSuspended.value ? 'manuallySuspended' : 'none';
await misskeyApi('admin/federation/update-instance', { await misskeyApi('admin/federation/update-instance', {
host: instance.value.host, host: instance.value.host,
isSuspended: true, isSuspended: isSuspended.value,
});
}
async function resumeDelivery(): Promise<void> {
if (!iAmModerator) return;
if (!instance.value) throw new Error('No instance?');
suspensionState.value = 'none';
await misskeyApi('admin/federation/update-instance', {
host: instance.value.host,
isSuspended: false,
}); });
} }

View file

@ -30,12 +30,15 @@ SPDX-License-Identifier: AGPL-3.0-only
</button> </button>
</div> </div>
</div> </div>
<div v-if="$i && $i.id != user.id" class="info-badges"> <ul v-if="$i && $i.id != user.id" class="info-badges">
<span v-if="user.isFollowed">{{ i18n.ts.followsYou }}</span> <li v-if="user.isFollowed && user.isFollowing">{{ i18n.ts.mutuals }}</li>
<span v-if="user.isMuted">{{ i18n.ts.muted }}</span> <li v-else-if="user.isFollowing">{{ i18n.ts.following }}</li>
<span v-if="user.isRenoteMuted">{{ i18n.ts.renoteMuted }}</span> <li v-else-if="user.isFollowed">{{ i18n.ts.followsYou }}</li>
<span v-if="user.isBlocking">{{ i18n.ts.blocked }}</span> <li v-if="user.isMuted">{{ i18n.ts.muted }}</li>
</div> <li v-if="user.isRenoteMuted">{{ i18n.ts.renoteMuted }}</li>
<li v-if="user.isBlocking">{{ i18n.ts.blocked }}</li>
<li v-if="user.isBlocked && $i.isModerator">{{ i18n.ts.blockingYou }}</li>
</ul>
<div class="actions"> <div class="actions">
<button class="menu _button" @click="menu"><i class="ti ti-dots"></i></button> <button class="menu _button" @click="menu"><i class="ti ti-dots"></i></button>
<MkFollowButton v-if="$i?.id != user.id" v-model:user="user" :inline="true" :transparent="false" :full="true" class="koudoku"/> <MkFollowButton v-if="$i?.id != user.id" v-model:user="user" :inline="true" :transparent="false" :full="true" class="koudoku"/>
@ -474,12 +477,17 @@ onUnmounted(() => {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
padding: 0;
margin: 0;
> * { > * {
padding: 4px 8px; padding: 4px 8px;
color: #fff; color: #fff;
background: rgba(0, 0, 0, 0.7); background: rgba(0, 0, 0, 0.7);
font-size: 0.7em; font-size: 0.7em;
border-radius: var(--radius-sm); border-radius: var(--radius-sm);
list-style-type: none;
margin-left: 0;
} }
> :not(:first-child) { > :not(:first-child) {