Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3caea77dde | ||
|
|
fdaa3b7f93 | ||
|
|
4f433b4456 | ||
|
|
309a9ad4fb | ||
|
|
b0e7431e72 | ||
|
|
158118d183 | ||
|
|
382e37fc5a | ||
|
|
3390676847 | ||
|
|
544a995312 | ||
|
|
f209d49bb5 | ||
|
|
42ed691fdc |
@@ -327,7 +327,6 @@ class Reader extends Vue {
|
|||||||
(async() => {
|
(async() => {
|
||||||
await bookManager.init(this.settings);
|
await bookManager.init(this.settings);
|
||||||
bookManager.addEventListener(this.bookManagerEvent);
|
bookManager.addEventListener(this.bookManagerEvent);
|
||||||
await this.$refs.serverStorage.init();
|
|
||||||
|
|
||||||
if (this.$root.rootRoute == '/reader') {
|
if (this.$root.rootRoute == '/reader') {
|
||||||
if (this.routeParamUrl) {
|
if (this.routeParamUrl) {
|
||||||
@@ -337,6 +336,7 @@ class Reader extends Vue {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await this.$refs.serverStorage.init();
|
||||||
this.checkSetStorageAccessKey();
|
this.checkSetStorageAccessKey();
|
||||||
this.checkActivateDonateHelpPage();
|
this.checkActivateDonateHelpPage();
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
@@ -510,7 +510,7 @@ class Reader extends Vue {
|
|||||||
this.debouncedUpdateRoute();
|
this.debouncedUpdateRoute();
|
||||||
}
|
}
|
||||||
|
|
||||||
async bookManagerEvent(eventName) {
|
async bookManagerEvent(eventName, value) {
|
||||||
if (eventName == 'set-recent' || eventName == 'recent-deleted') {
|
if (eventName == 'set-recent' || eventName == 'recent-deleted') {
|
||||||
const oldBook = (this.textPage ? this.textPage.lastBook : null);
|
const oldBook = (this.textPage ? this.textPage.lastBook : null);
|
||||||
const oldPos = (this.textPage ? this.textPage.bookPos : null);
|
const oldPos = (this.textPage ? this.textPage.bookPos : null);
|
||||||
@@ -539,6 +539,12 @@ class Reader extends Vue {
|
|||||||
if (this.recentBooksActive) {
|
if (this.recentBooksActive) {
|
||||||
await this.$refs.recentBooksPage.updateTableData();
|
await this.$refs.recentBooksPage.updateTableData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//сохранение в serverStorage
|
||||||
|
if (value) {
|
||||||
|
await utils.sleep(500);
|
||||||
|
await this.$refs.serverStorage.saveRecent(value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,10 +49,6 @@ class ServerStorage extends Vue {
|
|||||||
this.saveSettings();
|
this.saveSettings();
|
||||||
}, 500);
|
}, 500);
|
||||||
|
|
||||||
this.debouncedSaveRecent = _.debounce((itemKey) => {
|
|
||||||
this.saveRecent(itemKey);
|
|
||||||
}, 1000);
|
|
||||||
|
|
||||||
this.debouncedNotifySuccess = _.debounce(() => {
|
this.debouncedNotifySuccess = _.debounce(() => {
|
||||||
this.success('Данные синхронизированы с сервером');
|
this.success('Данные синхронизированы с сервером');
|
||||||
}, 1000);
|
}, 1000);
|
||||||
@@ -81,8 +77,6 @@ class ServerStorage extends Vue {
|
|||||||
} else {
|
} else {
|
||||||
await this.serverStorageKeyChanged();
|
await this.serverStorageKeyChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
bookManager.addEventListener(this.bookManagerEvent);
|
|
||||||
} finally {
|
} finally {
|
||||||
this.inited = true;
|
this.inited = true;
|
||||||
}
|
}
|
||||||
@@ -103,17 +97,6 @@ class ServerStorage extends Vue {
|
|||||||
this.cachedRecentMod = value;
|
this.cachedRecentMod = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
async bookManagerEvent(eventName, itemKey) {
|
|
||||||
if (!this.serverSyncEnabled)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (eventName == 'recent-changed') {
|
|
||||||
if (itemKey) {
|
|
||||||
this.debouncedSaveRecent(itemKey);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async generateNewServerStorageKey() {
|
async generateNewServerStorageKey() {
|
||||||
const key = utils.toBase58(utils.randomArray(32));
|
const key = utils.toBase58(utils.randomArray(32));
|
||||||
this.commit('reader/setServerStorageKey', key);
|
this.commit('reader/setServerStorageKey', key);
|
||||||
@@ -449,9 +432,14 @@ class ServerStorage extends Vue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async saveRecent(itemKey, recurse) {
|
async saveRecent(itemKey, recurse) {
|
||||||
|
while (!this.inited || this.savingRecent)
|
||||||
|
await utils.sleep(100);
|
||||||
|
|
||||||
if (!this.keyInited || !this.serverSyncEnabled || this.savingRecent)
|
if (!this.keyInited || !this.serverSyncEnabled || this.savingRecent)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
this.savingRecent = true;
|
||||||
|
try {
|
||||||
const bm = bookManager;
|
const bm = bookManager;
|
||||||
|
|
||||||
let needSaveRecent = false;
|
let needSaveRecent = false;
|
||||||
@@ -489,6 +477,10 @@ class ServerStorage extends Vue {
|
|||||||
//newRecent
|
//newRecent
|
||||||
let newRecent = {};
|
let newRecent = {};
|
||||||
if (!itemKey || (needSaveRecentPatch && Object.keys(newRecentPatch.data).length > 10)) {
|
if (!itemKey || (needSaveRecentPatch && Object.keys(newRecentPatch.data).length > 10)) {
|
||||||
|
//ждем весь bm.recent
|
||||||
|
while (!bookManager.loaded)
|
||||||
|
await utils.sleep(100);
|
||||||
|
|
||||||
newRecent = {rev: this.cachedRecent.rev + 1, data: bm.recent};
|
newRecent = {rev: this.cachedRecent.rev + 1, data: bm.recent};
|
||||||
newRecentPatch = {rev: this.cachedRecentPatch.rev + 1, data: {}};
|
newRecentPatch = {rev: this.cachedRecentPatch.rev + 1, data: {}};
|
||||||
newRecentMod = {rev: this.cachedRecentMod.rev + 1, data: {}};
|
newRecentMod = {rev: this.cachedRecentMod.rev + 1, data: {}};
|
||||||
@@ -508,8 +500,6 @@ class ServerStorage extends Vue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//сохранение
|
//сохранение
|
||||||
this.savingRecent = true;
|
|
||||||
try {
|
|
||||||
let result = {state: ''};
|
let result = {state: ''};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
export const versionHistory = [
|
export const versionHistory = [
|
||||||
{
|
{
|
||||||
showUntil: '2019-10-20',
|
showUntil: '2019-10-21',
|
||||||
header: '0.7.4 (2019-10-21)',
|
header: '0.7.5 (2019-10-22)',
|
||||||
content:
|
content:
|
||||||
`
|
`
|
||||||
<ul>
|
<ul>
|
||||||
|
|||||||
@@ -153,7 +153,7 @@
|
|||||||
<p>- ðåãèñòðàöèÿ íå òðåáóåòñÿ
|
<p>- ðåãèñòðàöèÿ íå òðåáóåòñÿ
|
||||||
|
|
||||||
<br><br> êà÷åñòâå URL ìîæíî çàäàâàòü html-ñòðàíè÷êó ñ êíèãîé, ëèáî ïðÿìóþ ññûëêó íà ôàéë èç îíëàéí-áèáëèîòåêè (íàïðèìåð, ñêîïèðîâàâ àäðåñ ññûëêè èëè êíîïêè "ñêà÷àòü fb2").
|
<br><br> êà÷åñòâå URL ìîæíî çàäàâàòü html-ñòðàíè÷êó ñ êíèãîé, ëèáî ïðÿìóþ ññûëêó íà ôàéë èç îíëàéí-áèáëèîòåêè (íàïðèìåð, ñêîïèðîâàâ àäðåñ ññûëêè èëè êíîïêè "ñêà÷àòü fb2").
|
||||||
Ïîääåðæèâàåìûå ôîðìàòû: <strong>html, txt, fb2, fb2.zip è äðóãèå</strong>
|
Ïîääåðæèâàåìûå ôîðìàòû: <b>fb2, html, txt, rtf, doc, docx, pdf, epub, mobi</b> è ñæàòèå: <b>zip, bz2, gz</b>
|
||||||
|
|
||||||
<br><br>Âû ìîæåòå äîáàâèòü â ñâîé áðàóçåð çàêëàäêó, óêàçàâ â åå ñâîéñòâàõ âìåñòî àäðåñà ñëåäóþùèé êîä:
|
<br><br>Âû ìîæåòå äîáàâèòü â ñâîé áðàóçåð çàêëàäêó, óêàçàâ â åå ñâîéñòâàõ âìåñòî àäðåñà ñëåäóþùèé êîä:
|
||||||
<br><p><strong>javascript:location.href='http://old.omnireader.ru/?url='+location.href;</strong>
|
<br><p><strong>javascript:location.href='http://old.omnireader.ru/?url='+location.href;</strong>
|
||||||
|
|||||||
@@ -18,14 +18,17 @@ server {
|
|||||||
proxy_pass http://localhost:44081;
|
proxy_pass http://localhost:44081;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /tmp {
|
location / {
|
||||||
root /home/liberama/public;
|
root /home/liberama/public;
|
||||||
|
|
||||||
|
location /tmp {
|
||||||
add_header Content-Type text/xml;
|
add_header Content-Type text/xml;
|
||||||
add_header Content-Encoding gzip;
|
add_header Content-Encoding gzip;
|
||||||
}
|
}
|
||||||
|
|
||||||
location / {
|
location ~* \.(?:manifest|appcache|html)$ {
|
||||||
root /home/liberama/public;
|
expires -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "Liberama",
|
"name": "Liberama",
|
||||||
"version": "0.7.4",
|
"version": "0.7.5",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10.0.0"
|
"node": ">=10.0.0"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user