From 58941116c894474e1cee13c33b952d951dbec850 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Sun, 17 Mar 2019 18:10:26 +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=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/SettingsPage/SettingsPage.vue | 62 +++++++++++++++++-- client/element.js | 3 + 2 files changed, 59 insertions(+), 6 deletions(-) diff --git a/client/components/Reader/SettingsPage/SettingsPage.vue b/client/components/Reader/SettingsPage/SettingsPage.vue index d487c2e3..a8c79bf2 100644 --- a/client/components/Reader/SettingsPage/SettingsPage.vue +++ b/client/components/Reader/SettingsPage/SettingsPage.vue @@ -45,13 +45,39 @@ Ключ доступа позволяет восстановить профили с настройками и список читаемых книг на другом устройстве. Для этого необходимо передать его через почту, мессенджер или другим способом. -
+ + + + + Скрыть + Показать + ключ доступа/ссылку + + + + +
{{ partialStorageKey }} (часть вашего ключа)
+
+
+
{{ serverStorageKey }}
+
+ Скопировать ключ +
+
+
Переход по ссылке позволит автоматически ввести ключ доступа: +
+
+ Скопировать ссылку +
+
+
+
- - Показать ключ доступа/ссылку - + Ввести ключ доступа @@ -63,7 +89,7 @@
Рекомендуется сохранить ключ в надежном месте, чтобы всегда иметь возможность восстановить настройки, например, после переустановки ОС или чистки/смены браузера.
- ПРЕДУПРЕЖДЕНИЕ! При утере ключа, НИКТО не сможет восстановить ваши настройки, т.к. все данные сжимаются + ПРЕДУПРЕЖДЕНИЕ! При утере ключа, НИКТО не сможет восстановить ваши настройки, т.к. все данные сжимаются и шифруются ключом доступа перед отправкой на сервер.
@@ -419,6 +445,7 @@ import Vue from 'vue'; import Component from 'vue-class-component'; //import _ from 'lodash'; +import {copyTextToClipboard} from '../../../share/utils'; import Window from '../../share/Window.vue'; import rstore from '../../../store/modules/reader'; @@ -464,6 +491,8 @@ class SettingsPage extends Vue { webFonts = []; fonts = []; + serverStorageKeyVisible = false; + created() { this.commit = this.$store.commit; this.reader = this.$store.state.reader; @@ -484,6 +513,10 @@ class SettingsPage extends Vue { this.vertShift = this.fontShifts[font] || 0; } + get mode() { + return this.$store.state.config.mode; + } + get settings() { return this.$store.state.reader.settings; } @@ -512,6 +545,10 @@ class SettingsPage extends Vue { return this.$store.state.reader.serverStorageKey; } + get setStorageKeyLink() { + return 'http://omnireader.ru/#/reader?setStorageKey=' + this.serverStorageKey; + } + get predefineTextColors() { return [ '#ffffff', @@ -645,8 +682,18 @@ class SettingsPage extends Vue { } } - async showServerStorageKey() { + async copyToClip(text, prefix) { + const result = await copyTextToClipboard(text); + const suf = (prefix.substr(-1) == 'а' ? 'а' : ''); + const msg = (result ? `${prefix} успешно скопирован${suf} в буфер обмена` : 'Копирование не удалось'); + if (result) + this.$notify.success({message: msg}); + else + this.$notify.error({message: msg}); + } + async showServerStorageKey() { + this.serverStorageKeyVisible = !this.serverStorageKeyVisible; } async enterServerStorageKey() { @@ -724,4 +771,7 @@ class SettingsPage extends Vue { padding: 15px; } +.center { + text-align: center; +} \ No newline at end of file diff --git a/client/element.js b/client/element.js index 579c2214..02aeb0fb 100644 --- a/client/element.js +++ b/client/element.js @@ -86,6 +86,9 @@ import './theme/form-item.css'; import ElColorPicker from 'element-ui/lib/color-picker'; import './theme/color-picker.css'; +//import ElDialog from 'element-ui/lib/dialog'; +//import './theme/dialog.css'; + import Notification from 'element-ui/lib/notification'; import './theme/notification.css';