merge upstream 2025-02-03
This commit is contained in:
commit
a4e86758c1
264 changed files with 15775 additions and 4919 deletions
|
|
@ -12,7 +12,16 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<MkButton @click="init"><i class="ti ti-refresh"></i> {{ i18n.ts.reloadAccountsList }}</MkButton>
|
||||
</div>
|
||||
|
||||
<MkUserCardMini v-for="user in accounts" :key="user.id" :user="user" :class="$style.user" @click.prevent="menu(user, $event)"/>
|
||||
<template v-for="[id, user] in accounts">
|
||||
<MkUserCardMini v-if="user != null" :key="user.id" :user="user" :class="$style.user" @click.prevent="menu(user, $event)"/>
|
||||
<button v-else v-panel class="_button" :class="$style.unknownUser" @click="menu(id, $event)">
|
||||
<div :class="$style.unknownUserAvatarMock"><i class="ti ti-user-question"></i></div>
|
||||
<div>
|
||||
<div :class="$style.unknownUserTitle">{{ i18n.ts.unknown }}</div>
|
||||
<div :class="$style.unknownUserSub">ID: <span class="_monospace">{{ id }}</span></div>
|
||||
</div>
|
||||
</button>
|
||||
</template>
|
||||
</div>
|
||||
</FormSuspense>
|
||||
</div>
|
||||
|
|
@ -29,9 +38,10 @@ import { getAccounts, removeAccount as _removeAccount, login, $i, getAccountWith
|
|||
import { i18n } from '@/i18n.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import MkUserCardMini from '@/components/MkUserCardMini.vue';
|
||||
import { MenuItem } from '@/types/menu';
|
||||
|
||||
const storedAccounts = ref<{ id: string, token: string }[] | null>(null);
|
||||
const accounts = ref<Misskey.entities.UserDetailed[]>([]);
|
||||
const accounts = ref(new Map<string, Misskey.entities.UserDetailed | null>());
|
||||
|
||||
const init = async () => {
|
||||
getAccounts().then(accounts => {
|
||||
|
|
@ -41,21 +51,35 @@ const init = async () => {
|
|||
userIds: storedAccounts.value.map(x => x.id),
|
||||
});
|
||||
}).then(response => {
|
||||
accounts.value = response;
|
||||
if (storedAccounts.value == null) return;
|
||||
accounts.value = new Map(storedAccounts.value.map(x => [x.id, response.find((y: Misskey.entities.UserDetailed) => y.id === x.id) ?? null]));
|
||||
});
|
||||
};
|
||||
|
||||
function menu(account: Misskey.entities.UserDetailed, ev: MouseEvent) {
|
||||
os.popupMenu([{
|
||||
text: i18n.ts.switch,
|
||||
icon: 'ti ti-switch-horizontal',
|
||||
action: () => switchAccount(account),
|
||||
}, {
|
||||
text: i18n.ts.logout,
|
||||
icon: 'ti ti-trash',
|
||||
danger: true,
|
||||
action: () => removeAccount(account),
|
||||
}], ev.currentTarget ?? ev.target);
|
||||
function menu(account: Misskey.entities.UserDetailed | string, ev: MouseEvent) {
|
||||
let menu: MenuItem[];
|
||||
|
||||
if (typeof account === 'string') {
|
||||
menu = [{
|
||||
text: i18n.ts.logout,
|
||||
icon: 'ti ti-trash',
|
||||
danger: true,
|
||||
action: () => removeAccount(account),
|
||||
}];
|
||||
} else {
|
||||
menu = [{
|
||||
text: i18n.ts.switch,
|
||||
icon: 'ti ti-switch-horizontal',
|
||||
action: () => switchAccount(account.id),
|
||||
}, {
|
||||
text: i18n.ts.logout,
|
||||
icon: 'ti ti-trash',
|
||||
danger: true,
|
||||
action: () => removeAccount(account.id),
|
||||
}];
|
||||
}
|
||||
|
||||
os.popupMenu(menu, ev.currentTarget ?? ev.target);
|
||||
}
|
||||
|
||||
function addAccount(ev: MouseEvent) {
|
||||
|
|
@ -68,9 +92,9 @@ function addAccount(ev: MouseEvent) {
|
|||
}], ev.currentTarget ?? ev.target);
|
||||
}
|
||||
|
||||
async function removeAccount(account: Misskey.entities.UserDetailed) {
|
||||
await _removeAccount(account.id);
|
||||
accounts.value = accounts.value.filter(x => x.id !== account.id);
|
||||
async function removeAccount(id: string) {
|
||||
await _removeAccount(id);
|
||||
accounts.value.delete(id);
|
||||
}
|
||||
|
||||
function addExistingAccount() {
|
||||
|
|
@ -90,9 +114,9 @@ function createAccount() {
|
|||
});
|
||||
}
|
||||
|
||||
async function switchAccount(account: Misskey.entities.UserDetailed) {
|
||||
async function switchAccount(id: string) {
|
||||
const fetchedAccounts = await getAccounts();
|
||||
const token = fetchedAccounts.find(x => x.id === account.id)!.token;
|
||||
const token = fetchedAccounts.find(x => x.id === id)!.token;
|
||||
switchAccountWithToken(token);
|
||||
}
|
||||
|
||||
|
|
@ -112,6 +136,49 @@ definePageMetadata(() => ({
|
|||
|
||||
<style lang="scss" module>
|
||||
.user {
|
||||
cursor: pointer;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.unknownUser {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
text-align: start;
|
||||
padding: 16px;
|
||||
background: var(--MI_THEME-panel);
|
||||
border-radius: 8px;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
.unknownUserAvatarMock {
|
||||
display: block;
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
text-align: center;
|
||||
font-size: 16px;
|
||||
margin-right: 12px;
|
||||
background-color: color-mix(in srgb, var(--MI_THEME-fg), transparent 85%);
|
||||
color: color-mix(in srgb, var(--MI_THEME-fg), transparent 25%);
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.unknownUserTitle {
|
||||
display: block;
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
.unknownUserSub {
|
||||
display: block;
|
||||
width: 100%;
|
||||
font-size: 95%;
|
||||
opacity: 0.7;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
line-height: 16px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<MkSwitch v-model="limitWidthOfReaction">{{ i18n.ts.limitWidthOfReaction }}</MkSwitch>
|
||||
</div>
|
||||
|
||||
<MkSelect v-model="instanceTicker">
|
||||
<MkSelect v-if="instance.federation !== 'none'" v-model="instanceTicker">
|
||||
<template #label>{{ i18n.ts.instanceTicker }}</template>
|
||||
<option value="none">{{ i18n.ts._instanceTicker.none }}</option>
|
||||
<option value="remote">{{ i18n.ts._instanceTicker.remote }}</option>
|
||||
|
|
@ -357,6 +357,7 @@ import MkInfo from '@/components/MkInfo.vue';
|
|||
import { searchEngineMap } from '@/scripts/search-engine-map.js';
|
||||
import { defaultStore } from '@/store.js';
|
||||
import * as os from '@/os.js';
|
||||
import { instance } from '@/instance.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { reloadAsk } from '@/scripts/reload-ask.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ const indexInfo = {
|
|||
icon: 'ti ti-settings',
|
||||
hideHeader: true,
|
||||
};
|
||||
const INFO = ref(indexInfo);
|
||||
const INFO = ref<PageMetadata>(indexInfo);
|
||||
const el = shallowRef<HTMLElement | null>(null);
|
||||
const childInfo = ref<null | PageMetadata>(null);
|
||||
|
||||
|
|
|
|||
|
|
@ -9,17 +9,24 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<template #icon><i class="ph-envelope ph-bold ph-lg"></i></template>
|
||||
<template #label>{{ i18n.ts.wordMute }}</template>
|
||||
|
||||
<XWordMute :muted="$i.mutedWords" @save="saveMutedWords"/>
|
||||
<div class="_gaps_m">
|
||||
<MkInfo>{{ i18n.ts.wordMuteDescription }}</MkInfo>
|
||||
<MkSwitch v-model="showSoftWordMutedWord">{{ i18n.ts.showMutedWord }}</MkSwitch>
|
||||
<XWordMute :muted="$i.mutedWords" @save="saveMutedWords"/>
|
||||
</div>
|
||||
</MkFolder>
|
||||
|
||||
<MkFolder>
|
||||
<template #icon><i class="ph-x-square ph-bold ph-lg"></i></template>
|
||||
<template #label>{{ i18n.ts.hardWordMute }}</template>
|
||||
|
||||
<XWordMute :muted="$i.hardMutedWords" @save="saveHardMutedWords"/>
|
||||
<div class="_gaps_m">
|
||||
<MkInfo>{{ i18n.ts.hardWordMuteDescription }}</MkInfo>
|
||||
<XWordMute :muted="$i.hardMutedWords" @save="saveHardMutedWords"/>
|
||||
</div>
|
||||
</MkFolder>
|
||||
|
||||
<MkFolder>
|
||||
<MkFolder v-if="instance.federation !== 'none'">
|
||||
<template #icon><i class="ti ti-planet-off"></i></template>
|
||||
<template #label>{{ i18n.ts.instanceMute }}</template>
|
||||
|
||||
|
|
@ -126,7 +133,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed } from 'vue';
|
||||
import { ref, computed, watch } from 'vue';
|
||||
import XInstanceMute from './mute-block.instance-mute.vue';
|
||||
import XWordMute from './mute-block.word-mute.vue';
|
||||
import MkPagination from '@/components/MkPagination.vue';
|
||||
|
|
@ -135,9 +142,13 @@ import { i18n } from '@/i18n.js';
|
|||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import MkUserCardMini from '@/components/MkUserCardMini.vue';
|
||||
import * as os from '@/os.js';
|
||||
import { infoImageUrl } from '@/instance.js';
|
||||
import { instance, infoImageUrl } from '@/instance.js';
|
||||
import { signinRequired } from '@/account.js';
|
||||
import MkInfo from '@/components/MkInfo.vue';
|
||||
import MkFolder from '@/components/MkFolder.vue';
|
||||
import MkSwitch from '@/components/MkSwitch.vue';
|
||||
import { defaultStore } from '@/store';
|
||||
import { reloadAsk } from '@/scripts/reload-ask.js';
|
||||
|
||||
const $i = signinRequired();
|
||||
|
||||
|
|
@ -160,6 +171,14 @@ const expandedRenoteMuteItems = ref([]);
|
|||
const expandedMuteItems = ref([]);
|
||||
const expandedBlockItems = ref([]);
|
||||
|
||||
const showSoftWordMutedWord = computed(defaultStore.makeGetterSetter('showSoftWordMutedWord'));
|
||||
|
||||
watch([
|
||||
showSoftWordMutedWord,
|
||||
], async () => {
|
||||
await reloadAsk({ reason: i18n.ts.reloadToApplySetting, unison: true });
|
||||
});
|
||||
|
||||
async function unrenoteMute(user, ev) {
|
||||
os.popupMenu([{
|
||||
text: i18n.ts.renoteUnmute,
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<template #caption>
|
||||
<div>{{ i18n.ts._accountSettings.requireSigninToViewContentsDescription1 }}</div>
|
||||
<div><i class="ti ti-alert-triangle" style="color: var(--MI_THEME-warn);"></i> {{ i18n.ts._accountSettings.requireSigninToViewContentsDescription2 }}</div>
|
||||
<div><i class="ti ti-alert-triangle" style="color: var(--MI_THEME-warn);"></i> {{ i18n.ts._accountSettings.requireSigninToViewContentsDescription3 }}</div>
|
||||
<div v-if="instance.federation !== 'none'"><i class="ti ti-alert-triangle" style="color: var(--MI_THEME-warn);"></i> {{ i18n.ts._accountSettings.requireSigninToViewContentsDescription3 }}</div>
|
||||
</template>
|
||||
</MkSwitch>
|
||||
|
||||
|
|
@ -93,7 +93,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
|
||||
<template #caption>
|
||||
<div>{{ i18n.ts._accountSettings.makeNotesFollowersOnlyBeforeDescription }}</div>
|
||||
<div><i class="ti ti-alert-triangle" style="color: var(--MI_THEME-warn);"></i> {{ i18n.ts._accountSettings.mayNotEffectForFederatedNotes }}</div>
|
||||
<div v-if="instance.federation !== 'none'"><i class="ti ti-alert-triangle" style="color: var(--MI_THEME-warn);"></i> {{ i18n.ts._accountSettings.mayNotEffectForFederatedNotes }}</div>
|
||||
</template>
|
||||
</FormSlot>
|
||||
|
||||
|
|
@ -129,7 +129,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
|
||||
<template #caption>
|
||||
<div>{{ i18n.ts._accountSettings.makeNotesHiddenBeforeDescription }}</div>
|
||||
<div><i class="ti ti-alert-triangle" style="color: var(--MI_THEME-warn);"></i> {{ i18n.ts._accountSettings.mayNotEffectForFederatedNotes }}</div>
|
||||
<div v-if="instance.federation !== 'none'"><i class="ti ti-alert-triangle" style="color: var(--MI_THEME-warn);"></i> {{ i18n.ts._accountSettings.mayNotEffectForFederatedNotes }}</div>
|
||||
</template>
|
||||
</FormSlot>
|
||||
</div>
|
||||
|
|
@ -171,6 +171,7 @@ import MkFolder from '@/components/MkFolder.vue';
|
|||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { defaultStore } from '@/store.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { instance } from '@/instance.js';
|
||||
import { signinRequired } from '@/account.js';
|
||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||
import FormSlot from '@/components/form/slot.vue';
|
||||
|
|
@ -224,7 +225,7 @@ watch([makeNotesFollowersOnlyBefore, makeNotesHiddenBefore], () => {
|
|||
});
|
||||
|
||||
async function update_requireSigninToViewContents(value: boolean) {
|
||||
if (value) {
|
||||
if (value === true && instance.federation !== 'none') {
|
||||
const { canceled } = await os.confirm({
|
||||
type: 'warning',
|
||||
text: i18n.ts.acknowledgeNotesAndEnable,
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<MkSelect v-model="statusbar.type" placeholder="Please select">
|
||||
<template #label>{{ i18n.ts.type }}</template>
|
||||
<option value="rss">RSS</option>
|
||||
<option value="federation">Federation</option>
|
||||
<option v-if="instance.federation !== 'none'" value="federation">Federation</option>
|
||||
<option value="userList">User list timeline</option>
|
||||
</MkSelect>
|
||||
|
||||
|
|
@ -96,6 +96,7 @@ import MkButton from '@/components/MkButton.vue';
|
|||
import MkRange from '@/components/MkRange.vue';
|
||||
import { defaultStore } from '@/store.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { instance } from '@/instance.js';
|
||||
import { deepClone } from '@/scripts/clone.js';
|
||||
|
||||
const props = defineProps<{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue