1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-07-26 05:35:22 +02:00
This commit is contained in:
syuilo
2026-07-26 10:04:13 +09:00
parent dad093c6f8
commit 1057295d5d
3 changed files with 22 additions and 1 deletions

View File

@@ -191,6 +191,7 @@ SPDX-License-Identifier: AGPL-3.0-only
role="menuitem"
tabindex="0"
:class="['_button', $style.item, { [$style.danger]: item.danger, [$style.active]: unref(item.active) }]"
:disabled="unref(item.disabled)"
@click.prevent="unref(item.active) ? close(false) : clicked(item.action, $event)"
@mouseenter.passive="onItemMouseEnter"
@mouseleave.passive="onItemMouseLeave"
@@ -702,6 +703,7 @@ function guardMouseMove(ev: MouseEvent) {
&:disabled {
cursor: not-allowed;
opacity: 0.5;
}
&.danger {

View File

@@ -3,7 +3,7 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { ref, watch } from 'vue';
import { computed, ref, watch } from 'vue';
import { mergeProfiles } from './manager.js';
import type { PreferencesProfile } from './manager.js';
import type { MenuItem } from '@/types/menu.js';
@@ -73,12 +73,30 @@ export function getPreferencesProfileMenu(): MenuItem[] {
text: i18n.ts._preferencesBackup.autoBackup,
caption: i18n.ts._preferencesBackup.autoBackup_description,
ref: autoBackupEnabled,
}, {
type: 'button',
icon: 'ti ti-cloud-up',
text: i18n.ts._preferencesBackup.forceBackup,
disabled: computed(() => !autoBackupEnabled.value),
action: () => {
cloudBackup();
},
}, {
type: 'divider',
}, {
type: 'switch',
icon: 'ti ti-cloud-down',
text: i18n.ts._preferencesBackup.autoSync,
caption: i18n.ts._preferencesBackup.autoSync_description,
ref: autoSyncEnabled,
}, {
type: 'button',
icon: 'ti ti-cloud-down',
text: i18n.ts._preferencesBackup.forceSync,
disabled: computed(() => !autoSyncEnabled.value),
action: () => {
cloudSync();
},
}],
}, {
text: i18n.ts.export,

View File

@@ -23,6 +23,7 @@ export interface MenuButton {
danger?: boolean;
active?: boolean | ComputedRef<boolean>;
avatar?: Misskey.entities.User;
disabled?: boolean | Ref<boolean>;
action: MenuAction;
}