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 @@ + + + + {{ ts._preferencesBackups.saveNew }} + {{ ts._preferencesBackups.loadFile }} + + + + {{ ts._preferencesBackups.list }} + + menu($event, id)" + @contextmenu.prevent.stop="$event => menu($event, id)" + > + {{ profile.name }} + {{ t('_preferencesBackups.createdAt', { date: (new Date(profile.createdAt)).toLocaleDateString(), time: (new Date(profile.createdAt)).toLocaleTimeString() }) }} + {{ t('_preferencesBackups.updatedAt', { date: (new Date(profile.updatedAt)).toLocaleDateString(), time: (new Date(profile.updatedAt)).toLocaleTimeString() }) }} + + + + {{ ts._preferencesBackups.noBackups }} + + + + + + + + + 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',