Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f650124428 | ||
|
|
795d109c76 | ||
|
|
6868b3effc | ||
|
|
26747b7013 | ||
|
|
5198f8aa60 |
@@ -38,6 +38,9 @@
|
|||||||
<el-tooltip v-show="showToolButton['recentBooks']" content="Открыть недавние" :open-delay="1000" effect="light">
|
<el-tooltip v-show="showToolButton['recentBooks']" content="Открыть недавние" :open-delay="1000" effect="light">
|
||||||
<el-button ref="recentBooks" class="tool-button" :class="buttonActiveClass('recentBooks')" @click="buttonClick('recentBooks')"><i class="el-icon-document"></i></el-button>
|
<el-button ref="recentBooks" class="tool-button" :class="buttonActiveClass('recentBooks')" @click="buttonClick('recentBooks')"><i class="el-icon-document"></i></el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
|
<el-tooltip v-show="showToolButton['offlineMode']" content="Автономный режим (без интернета)" :open-delay="1000" effect="light">
|
||||||
|
<el-button ref="offlineMode" class="tool-button" :class="buttonActiveClass('offlineMode')" @click="buttonClick('offlineMode')"><i class="el-icon-connection"></i></el-button>
|
||||||
|
</el-tooltip>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-tooltip content="Настроить" :open-delay="1000" effect="light">
|
<el-tooltip content="Настроить" :open-delay="1000" effect="light">
|
||||||
@@ -257,6 +260,7 @@ class Reader extends Vue {
|
|||||||
searchActive = false;
|
searchActive = false;
|
||||||
copyTextActive = false;
|
copyTextActive = false;
|
||||||
recentBooksActive = false;
|
recentBooksActive = false;
|
||||||
|
offlineModeActive = false;
|
||||||
settingsActive = false;
|
settingsActive = false;
|
||||||
helpActive = false;
|
helpActive = false;
|
||||||
clickMapActive = false;
|
clickMapActive = false;
|
||||||
@@ -696,6 +700,11 @@ class Reader extends Vue {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
offlineModeToggle() {
|
||||||
|
this.offlineModeActive = !this.offlineModeActive;
|
||||||
|
this.$refs.serverStorage.offlineModeActive = this.offlineModeActive;
|
||||||
|
}
|
||||||
|
|
||||||
settingsToggle() {
|
settingsToggle() {
|
||||||
this.settingsActive = !this.settingsActive;
|
this.settingsActive = !this.settingsActive;
|
||||||
if (this.settingsActive) {
|
if (this.settingsActive) {
|
||||||
@@ -781,11 +790,14 @@ class Reader extends Vue {
|
|||||||
case 'copyText':
|
case 'copyText':
|
||||||
this.copyTextToggle();
|
this.copyTextToggle();
|
||||||
break;
|
break;
|
||||||
|
case 'refresh':
|
||||||
|
this.refreshBook();
|
||||||
|
break;
|
||||||
case 'recentBooks':
|
case 'recentBooks':
|
||||||
this.recentBooksToggle();
|
this.recentBooksToggle();
|
||||||
break;
|
break;
|
||||||
case 'refresh':
|
case 'offlineMode':
|
||||||
this.refreshBook();
|
this.offlineModeToggle();
|
||||||
break;
|
break;
|
||||||
case 'settings':
|
case 'settings':
|
||||||
this.settingsToggle();
|
this.settingsToggle();
|
||||||
@@ -806,6 +818,7 @@ class Reader extends Vue {
|
|||||||
case 'search':
|
case 'search':
|
||||||
case 'copyText':
|
case 'copyText':
|
||||||
case 'recentBooks':
|
case 'recentBooks':
|
||||||
|
case 'offlineMode':
|
||||||
case 'settings':
|
case 'settings':
|
||||||
if (this[`${button}Active`])
|
if (this[`${button}Active`])
|
||||||
classResult = classActive;
|
classResult = classActive;
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ class ServerStorage extends Vue {
|
|||||||
if (eventName == 'recent-changed') {
|
if (eventName == 'recent-changed') {
|
||||||
if (itemKey) {
|
if (itemKey) {
|
||||||
if (!this.recentDeltaInited) {
|
if (!this.recentDeltaInited) {
|
||||||
|
await this.loadRecent();
|
||||||
this.warning('Функции сохранения на сервер пока недоступны');
|
this.warning('Функции сохранения на сервер пока недоступны');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -175,12 +176,12 @@ class ServerStorage extends Vue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
warning(message) {
|
warning(message) {
|
||||||
if (this.showServerStorageMessages)
|
if (this.showServerStorageMessages && !this.offlineModeActive)
|
||||||
this.$notify.warning({message});
|
this.$notify.warning({message});
|
||||||
}
|
}
|
||||||
|
|
||||||
error(message) {
|
error(message) {
|
||||||
if (this.showServerStorageMessages)
|
if (this.showServerStorageMessages && !this.offlineModeActive)
|
||||||
this.$notify.error({message});
|
this.$notify.error({message});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -362,9 +363,11 @@ class ServerStorage extends Vue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async loadRecent(skipRevCheck = false, doNotifySuccess = true) {
|
async loadRecent(skipRevCheck = false, doNotifySuccess = true) {
|
||||||
if (!this.keyInited || !this.serverSyncEnabled)
|
if (!this.keyInited || !this.serverSyncEnabled || this.loadingRecent)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
this.loadingRecent = true;
|
||||||
|
try {
|
||||||
const oldRecentRev = bookManager.recentRev;
|
const oldRecentRev = bookManager.recentRev;
|
||||||
const oldRecentDeltaRev = bookManager.recentDeltaRev;
|
const oldRecentDeltaRev = bookManager.recentDeltaRev;
|
||||||
//проверим ревизию на сервере
|
//проверим ревизию на сервере
|
||||||
@@ -430,6 +433,9 @@ class ServerStorage extends Vue {
|
|||||||
|
|
||||||
if (doNotifySuccess)
|
if (doNotifySuccess)
|
||||||
this.debouncedNotifySuccess();
|
this.debouncedNotifySuccess();
|
||||||
|
} finally {
|
||||||
|
this.loadingRecent = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async saveRecent(itemKey, recurse) {
|
async saveRecent(itemKey, recurse) {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ export const versionHistory = [
|
|||||||
`
|
`
|
||||||
<ul>
|
<ul>
|
||||||
<li>исправления багов</li>
|
<li>исправления багов</li>
|
||||||
|
<li>на панель управления добавлена кнопка "Автономный режим"</li>
|
||||||
</ul>
|
</ul>
|
||||||
`
|
`
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ const toolButtons = [
|
|||||||
{name: 'copyText', show: false, text: 'Скопировать текст со страницы'},
|
{name: 'copyText', show: false, text: 'Скопировать текст со страницы'},
|
||||||
{name: 'refresh', show: true, text: 'Принудительно обновить книгу'},
|
{name: 'refresh', show: true, text: 'Принудительно обновить книгу'},
|
||||||
{name: 'recentBooks', show: true, text: 'Открыть недавние'},
|
{name: 'recentBooks', show: true, text: 'Открыть недавние'},
|
||||||
|
{name: 'offlineMode', show: false, text: 'Автономный режим (без интернета)'},
|
||||||
];
|
];
|
||||||
|
|
||||||
const fonts = [
|
const fonts = [
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user