From d229aab8c95bc069187df32d1aa085f68db794bf Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Fri, 15 Mar 2019 19:11:27 +0700 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=20=D0=BD?= =?UTF-8?q?=D0=B0=D0=B4=20=D0=BF=D1=80=D0=BE=D1=84=D0=B8=D0=BB=D1=8F=D0=BC?= =?UTF-8?q?=D0=B8=20=D0=B8=20=D0=BA=D0=BB=D1=8E=D1=87=D0=BE=D0=BC=20=D0=B4?= =?UTF-8?q?=D0=BE=D1=81=D1=82=D1=83=D0=BF=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Reader/ServerStorage/ServerStorage.vue | 10 ++ .../Reader/SettingsPage/SettingsPage.vue | 98 ++++++++++++++++++- 2 files changed, 104 insertions(+), 4 deletions(-) diff --git a/client/components/Reader/ServerStorage/ServerStorage.vue b/client/components/Reader/ServerStorage/ServerStorage.vue index c3dccab5..cdfc32a0 100644 --- a/client/components/Reader/ServerStorage/ServerStorage.vue +++ b/client/components/Reader/ServerStorage/ServerStorage.vue @@ -53,6 +53,10 @@ class ServerStorage extends Vue { return this.$store.state.reader.profilesRev; } + get currentProfile() { + return this.$store.state.reader.currentProfile; + } + notifySuccessIfNeeded(rev1, rev2) { if (rev1 != rev2) this.$notify.success({message: 'Данные синхронизированы с сервером'}); @@ -67,6 +71,9 @@ class ServerStorage extends Vue { } async loadProfiles() { + if (!this.currentProfile) + return; + let prof = await this.storageGet({'profiles': {}}); if (prof.state == 'success') { @@ -83,6 +90,9 @@ class ServerStorage extends Vue { } async saveProfiles() { + if (!this.currentProfile) + return; + if (!this.savingProfiles) { this.savingProfiles = true; diff --git a/client/components/Reader/SettingsPage/SettingsPage.vue b/client/components/Reader/SettingsPage/SettingsPage.vue index e24ac197..f2b938d2 100644 --- a/client/components/Reader/SettingsPage/SettingsPage.vue +++ b/client/components/Reader/SettingsPage/SettingsPage.vue @@ -7,7 +7,68 @@ - + + + +
Профили устройств
+ + +
+ Выберите или добавьте профиль устройства, чтобы начать синхронизацию данных с сервером. + При выборе "Нет" синхронизация отключается. +
+
+ + + + + + + + + + + Добавить + Удалить + +
+ + +
Ключ доступа
+ + +
+ Ключ доступа позволяет восстановить профили с настройками и список читаемых книг + на другом устройстве. Для этого необходимо передать его через почту, мессенджер или другим способом. +
+
+ {{ partialStorageKey }} (часть вашего ключа) +
+
+ + Показать ключ доступа/ссылку + + + Ввести ключ доступа + + + Сгенерировать новый ключ + + + +
+ Рекомендуется сохранить ключ в надежном месте, чтобы всегда иметь возможность восстановить настройки, + например, после переустановки ОС или чистки/смены браузера.
+ ПРЕДУПРЕЖДЕНИЕ! При утере ключа, НИКТО не сможет восстановить ваши настройки, т.к. все данные сжимаются + и шифруются ключом доступа перед отправкой на сервер. +
+
+
+
+ @@ -246,7 +307,7 @@ - +
Анимация
@@ -283,7 +344,7 @@
- + @@ -340,7 +401,7 @@ - + Установить по-умолчанию @@ -401,6 +462,8 @@ class SettingsPage extends Vue { webFonts = []; fonts = []; + currentProfile = ''; + created() { this.commit = this.$store.commit; this.reader = this.$store.state.reader; @@ -425,6 +488,22 @@ class SettingsPage extends Vue { return this.$store.state.reader.settings; } + get profiles() { + return this.$store.state.reader.profiles; + } + + get profilesArray() { + return Object.keys(this.profiles); + } + + get partialStorageKey() { + return this.serverStorageKey.substr(0, 7) + '***'; + } + + get serverStorageKey() { + return this.$store.state.reader.serverStorageKey; + } + get predefineTextColors() { return [ '#ffffff', @@ -476,6 +555,12 @@ class SettingsPage extends Vue { } } + addProfile() { + } + + delProfile() { + } + keyHook(event) { if (event.type == 'keydown' && event.code == 'Escape') { this.close(); @@ -504,6 +589,11 @@ class SettingsPage extends Vue { position: relative; } +.text { + font-size: 90%; + line-height: 130%; +} + .el-form { border-top: 2px solid #bbbbbb; margin-bottom: 5px;