+
From 925dd76f00209abcb443cac84b62a01086dcc35f Mon Sep 17 00:00:00 2001
From: syuilo <4439005+syuilo@users.noreply.github.com>
Date: Tue, 6 May 2025 16:51:01 +0900
Subject: [PATCH 03/11] =?UTF-8?q?=F0=9F=8E=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/components/global/MkError.vue | 30 +------
.../src/components/global/MkResult.vue | 79 +++++++++++++------
2 files changed, 58 insertions(+), 51 deletions(-)
diff --git a/packages/frontend/src/components/global/MkError.vue b/packages/frontend/src/components/global/MkError.vue
index bc3a282e40..6a5c4c18bf 100644
--- a/packages/frontend/src/components/global/MkError.vue
+++ b/packages/frontend/src/components/global/MkError.vue
@@ -4,20 +4,14 @@ SPDX-License-Identifier: AGPL-3.0-only
-->
-
-
-
![]()
-
{{ i18n.ts.somethingHappened }}
-
emit('retry')">{{ i18n.ts.retry }}
-
-
+
+ emit('retry')">{{ i18n.ts.retry }}
+
diff --git a/packages/frontend/src/components/global/MkResult.vue b/packages/frontend/src/components/global/MkResult.vue
index 6990d69bd3..89ac2eb3d3 100644
--- a/packages/frontend/src/components/global/MkResult.vue
+++ b/packages/frontend/src/components/global/MkResult.vue
@@ -4,37 +4,56 @@ SPDX-License-Identifier: AGPL-3.0-only
-->
-
-
![]()
-
-
![]()
-
+
+
+
![]()
+
+
![]()
+
+
![]()
+
-
{{ props.text ?? (type === 'empty' ? i18n.ts.nothing : type === 'notFound' ? i18n.ts.notFound : null) }}
-
-
+ {{ props.text ?? (type === 'empty' ? i18n.ts.nothing : type === 'notFound' ? i18n.ts.notFound : type === 'error' ? i18n.ts.somethingHappened : null) }}
+
+
+
+
+
diff --git a/packages/frontend/src/preferences/utility.ts b/packages/frontend/src/preferences/utility.ts
index adba908c3c..af5b178df6 100644
--- a/packages/frontend/src/preferences/utility.ts
+++ b/packages/frontend/src/preferences/utility.ts
@@ -74,12 +74,17 @@ export function getPreferencesProfileMenu(): MenuItem[] {
action: () => {
importProfile();
},
+ }, {
+ type: 'divider',
+ }, {
+ type: 'link',
+ text: i18n.ts._preferencesProfile.manageProfiles + '...',
+ icon: 'ti ti-settings-cog',
+ to: '/settings/profiles',
}];
if (prefer.s.devMode) {
menu.push({
- type: 'divider',
- }, {
text: 'Copy profile as text',
icon: 'ti ti-clipboard',
action: () => {
@@ -145,17 +150,30 @@ export async function cloudBackup() {
});
}
-export async function restoreFromCloudBackup() {
- if ($i == null) return;
-
- // TODO: 更新日時でソートして取得したい
+export async function listCloudBackups() {
const keys = await misskeyApi('i/registry/keys', {
scope: ['client', 'preferences', 'backups'],
});
- if (_DEV_) console.log(keys);
+ return keys.map(k => ({
+ name: k,
+ }));
+}
- if (keys.length === 0) {
+export async function deleteCloudBackup(key: string) {
+ await os.apiWithDialog('i/registry/remove', {
+ scope: ['client', 'preferences', 'backups'],
+ key,
+ });
+}
+
+export async function restoreFromCloudBackup() {
+ if ($i == null) return;
+
+ // TODO: 更新日時でソートしたい
+ const backups = await listCloudBackups();
+
+ if (backups.length === 0) {
os.alert({
type: 'warning',
title: i18n.ts._preferencesBackup.noBackupsFoundTitle,
@@ -166,9 +184,9 @@ export async function restoreFromCloudBackup() {
const select = await os.select({
title: i18n.ts._preferencesBackup.selectBackupToRestore,
- items: keys.map(k => ({
- text: k,
- value: k,
+ items: backups.map(backup => ({
+ text: backup.name,
+ value: backup.name,
})),
});
if (select.canceled) return;
diff --git a/packages/frontend/src/router.definition.ts b/packages/frontend/src/router.definition.ts
index d8bdbb7d02..462b8e713f 100644
--- a/packages/frontend/src/router.definition.ts
+++ b/packages/frontend/src/router.definition.ts
@@ -180,6 +180,10 @@ export const ROUTE_DEF = [{
path: '/custom-css',
name: 'preferences',
component: page(() => import('@/pages/settings/custom-css.vue')),
+ }, {
+ path: '/profiles',
+ name: 'profiles',
+ component: page(() => import('@/pages/settings/profiles.vue')),
}, {
path: '/accounts',
name: 'profile',