From f4bd147299e9f588efb2b4a877ece8b545f0d984 Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 17 Apr 2022 00:11:37 +0900 Subject: [PATCH 01/15] Fix settings page --- packages/client/src/pages/settings/index.vue | 30 ++++++++++++++++---- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/packages/client/src/pages/settings/index.vue b/packages/client/src/pages/settings/index.vue index 44c3be62fe..3786cf60f6 100644 --- a/packages/client/src/pages/settings/index.vue +++ b/packages/client/src/pages/settings/index.vue @@ -2,7 +2,10 @@
-
{{ $ts.settings }}
+
+ {{ $ts.settings }} + +
{{ childInfo.title }}
@@ -12,7 +15,7 @@
-
+
@@ -23,7 +26,7 @@ diff --git a/packages/client/src/pages/settings/index.vue b/packages/client/src/pages/settings/index.vue index 3786cf60f6..68be795008 100644 --- a/packages/client/src/pages/settings/index.vue +++ b/packages/client/src/pages/settings/index.vue @@ -9,15 +9,15 @@
{{ childInfo.title }}
-
{{ ts._preferencesRegistry.noRegistries }} From 0da0980f94692249f32031b866f2e6b999aafc14 Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 17 Apr 2022 05:32:44 +0900 Subject: [PATCH 09/15] remove console.log --- packages/client/src/pages/settings/preferences-registry.vue | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/client/src/pages/settings/preferences-registry.vue b/packages/client/src/pages/settings/preferences-registry.vue index fbf38520b2..26ddd1fd1f 100644 --- a/packages/client/src/pages/settings/preferences-registry.vue +++ b/packages/client/src/pages/settings/preferences-registry.vue @@ -65,7 +65,6 @@ let registries = $ref(null); os.api('i/registry/get-all', { scope }) .then(res => { registries = res || {}; - console.log(registries); }); function getDefaultStoreValues() { @@ -120,7 +119,6 @@ async function applyRegistry(id: string) { // defaultStore for (const [key, value] of Object.entries(registry.defaultStore)) { if (key in defaultStore.def && defaultStore.def[key].where !== 'account') { - console.log(key); defaultStore.set(key as keyof Registry['defaultStore'], value); } } From 532a2f049f2c4bafd2bab14bdf9f9bf1cdface48 Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 17 Apr 2022 05:37:52 +0900 Subject: [PATCH 10/15] =?UTF-8?q?=E9=81=A9=E7=94=A8=E2=86=92=E3=81=93?= =?UTF-8?q?=E3=81=AE=E3=83=87=E3=83=90=E3=82=A4=E3=82=B9=E3=81=AB=E9=81=A9?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/ja-JP.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 5754ed2bfc..18d8b3d9e3 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -899,7 +899,7 @@ _plugin: _preferencesRegistry: list: "一覧" saveNew: "新規保存" - apply: "適用" + apply: "このデバイスに適用" delete: "削除" save: "上書き保存" rename: "名称変更" From 3d4c09510b875ac995661c3371fd110314a578b2 Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 17 Apr 2022 06:31:35 +0900 Subject: [PATCH 11/15] add wallpaper --- .../src/pages/settings/preferences-registry.vue | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/client/src/pages/settings/preferences-registry.vue b/packages/client/src/pages/settings/preferences-registry.vue index 26ddd1fd1f..8b5b1c00a5 100644 --- a/packages/client/src/pages/settings/preferences-registry.vue +++ b/packages/client/src/pages/settings/preferences-registry.vue @@ -54,6 +54,7 @@ type Registry = { coldDeviceStorage: Partial; fontSize: string | null; useSystemFont: 't' | null; + wallpaper: string | null; }; type Registries = { @@ -99,6 +100,7 @@ async function saveNew() { coldDeviceStorage: ColdDeviceStorage.getAll(), fontSize: localStorage.getItem('fontSize'), useSystemFont: localStorage.getItem('useSystemFont') as 't' | null, + wallpaper: localStorage.getItem('wallpaper'), }; await os.api('i/registry/set', { scope, key: id, value: registry }); registries[id] = registry; @@ -142,6 +144,13 @@ async function applyRegistry(id: string) { localStorage.removeItem('useSystemFont'); } + // wallpaper + if (registry.wallpaper != null) { + localStorage.setItem('wallpaper', registry.wallpaper); + } else { + localStorage.removeItem('wallpaper'); + } + const { canceled: cancel2 } = await os.confirm({ type: 'info', text: ts.reloadToApplySetting, @@ -183,6 +192,9 @@ async function save(id: string) { updatedAt: (new Date()).toISOString(), defaultStore: getDefaultStoreValues(), coldDeviceStorage: ColdDeviceStorage.getAll(), + fontSize: localStorage.getItem('fontSize'), + useSystemFont: localStorage.getItem('useSystemFont') as 't' | null, + wallpaper: localStorage.getItem('wallpaper'), }; await os.api('i/registry/set', { scope, key: id, value: registry }); registries[id] = registry; From 426885bff5dac12298224985bfd833bec79a8b0f Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 17 Apr 2022 21:10:50 +0900 Subject: [PATCH 12/15] =?UTF-8?q?=E3=83=AD=E3=83=BC=E3=82=AB=E3=83=AB?= =?UTF-8?q?=E3=81=AEjson=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=82=92?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E3=83=BB=E8=AA=AD=E3=81=BF=E8=BE=BC=E3=81=BF?= =?UTF-8?q?=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/ja-JP.yml | 4 + .../pages/settings/preferences-registry.vue | 98 ++++++++++++++++++- 2 files changed, 99 insertions(+), 3 deletions(-) diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 18d8b3d9e3..a52c67d34b 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -899,10 +899,12 @@ _plugin: _preferencesRegistry: list: "一覧" saveNew: "新規保存" + loadFile: "ファイルを読み込み" apply: "このデバイスに適用" delete: "削除" save: "上書き保存" rename: "名称変更" + download: "ダウンロード" saveNewDescription: "現在のデバイスの状態をサーバーに保存します。" inputName: "レジストリ名を入力" cannotSave: "保存できません" @@ -914,6 +916,8 @@ _preferencesRegistry: noRegistries: "レジストリは登録されていません。「新規保存」で現在のクライアント設定をサーバーに保存できます。" createdAt: "作成日時: {date} {time}" updatedAt: "更新日時: {date} {time}" + cannotLoad: "読み込みできません" + invalidFile: "ファイル形式が違います。" _registry: scope: "スコープ" diff --git a/packages/client/src/pages/settings/preferences-registry.vue b/packages/client/src/pages/settings/preferences-registry.vue index 8b5b1c00a5..c01e4ee83d 100644 --- a/packages/client/src/pages/settings/preferences-registry.vue +++ b/packages/client/src/pages/settings/preferences-registry.vue @@ -1,6 +1,9 @@