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';