From 14c2f9e47ee4dc9f18e00cb5a06cc45feb06861e Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 31 Jul 2022 21:55:20 +0900 Subject: [PATCH] feature: Client Preferences Registry (#8511) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix settings page * nanka iroiro * clean up * clean up * feature: Client Preferences Registry on the account * add changelog * インデックスに戻ってもタイトルが残ってしまうのを修正 * fix createdAt -> updatedAt * remove console.log * 適用→このデバイスに適用 * add wallpaper * ローカルのjsonファイルを保存・読み込みできるように * clean up * use apiWithDialog * Update packages/client/src/pages/settings/preferences-registry.vue Co-authored-by: Andreas Nedbal * Update packages/client/src/pages/settings/preferences-registry.vue Co-authored-by: Andreas Nedbal * Update packages/client/src/pages/settings/preferences-registry.vue Co-authored-by: Andreas Nedbal * fix lint * :v: * change router * nanka iroiro * tweak Co-authored-by: syuilo Co-authored-by: Andreas Nedbal --- CHANGELOG.md | 1 + locales/ja-JP.yml | 20 + packages/client/src/pages/settings/index.vue | 5 + .../pages/settings/preferences-backups.vue | 444 ++++++++++++++++++ packages/client/src/router.ts | 4 + 5 files changed, 474 insertions(+) create mode 100644 packages/client/src/pages/settings/preferences-backups.vue diff --git a/CHANGELOG.md b/CHANGELOG.md index 57a4b2920..225e2fbae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## 12.x.x (unreleased) ### Improvements +- Client: Preferences Registry ### Bugfixes - diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 0c4a7c723..03c1fac68 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -561,6 +561,7 @@ author: "作者" leaveConfirm: "未保存の変更があります。破棄しますか?" manage: "管理" plugins: "プラグイン" +preferencesBackups: "設定のバックアップ" deck: "デッキ" undeck: "デッキ解除" useBlurEffectForModal: "モーダルにぼかし効果を使用" @@ -952,6 +953,25 @@ _plugin: installWarn: "信頼できないプラグインはインストールしないでください。" manage: "プラグインの管理" +_preferencesBackups: + list: "作成したバックアップ" + saveNew: "新規保存" + loadFile: "ファイルを読み込み" + apply: "このデバイスに適用" + save: "上書き保存" + inputName: "バックアップ名を入力" + cannotSave: "保存できません" + nameAlreadyExists: "バックアップ名「{name}」は既に存在します。違う名前を指定してください。" + applyConfirm: "バックアップ「{name}」を現在のデバイスに適用しますか?現在のデバイス設定は失われます。" + saveConfirm: "{name}に上書き保存しますか?" + deleteConfirm: "{name}を削除しますか?" + renameConfirm: "「{old}」を「{new}」に変更しますか?" + noBackups: "バックアップはありません。「新規保存」で現在のクライアント設定をサーバーに保存できます。" + createdAt: "作成日時: {date} {time}" + updatedAt: "更新日時: {date} {time}" + cannotLoad: "読み込みできません" + invalidFile: "ファイル形式が違います。" + _registry: scope: "スコープ" key: "キー" diff --git a/packages/client/src/pages/settings/index.vue b/packages/client/src/pages/settings/index.vue index 0ca91d0eb..862435eb3 100644 --- a/packages/client/src/pages/settings/index.vue +++ b/packages/client/src/pages/settings/index.vue @@ -171,6 +171,11 @@ const menuDef = computed(() => [{ }], }, { items: [{ + icon: 'fas fa-floppy-disk', + text: i18n.ts.preferencesBackups, + to: '/settings/preferences-backups', + active: currentPage?.route.name === 'preferences-backups', + }, { type: 'button', icon: 'fas fa-trash', text: i18n.ts.clearCache, diff --git a/packages/client/src/pages/settings/preferences-backups.vue b/packages/client/src/pages/settings/preferences-backups.vue new file mode 100644 index 000000000..3653e2dc1 --- /dev/null +++ b/packages/client/src/pages/settings/preferences-backups.vue @@ -0,0 +1,444 @@ + + + + + diff --git a/packages/client/src/router.ts b/packages/client/src/router.ts index a8743416f..6655a3619 100644 --- a/packages/client/src/router.ts +++ b/packages/client/src/router.ts @@ -145,6 +145,10 @@ export const routes = [{ path: '/deck', name: 'deck', component: page(() => import('./pages/settings/deck.vue')), + }, { + path: '/preferences-backups', + name: 'preferences-backups', + component: page(() => import('./pages/settings/preferences-backups.vue')), }, { path: '/other', name: 'other',