Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c2adf8d5b8 | ||
|
|
5c8d257923 | ||
|
|
55dae33e60 | ||
|
|
57d8e9061f | ||
|
|
4642679842 | ||
|
|
ba18743fab | ||
|
|
e739356733 | ||
|
|
cae4aed8d2 | ||
|
|
6c6a08d8e0 | ||
|
|
deafbae945 | ||
|
|
0b23c609f1 | ||
|
|
0359061321 | ||
|
|
bc7a5f6be4 | ||
|
|
be36f8f6e8 | ||
|
|
3b8d084c76 | ||
|
|
ce1cdca6a0 |
@@ -101,7 +101,7 @@
|
||||
</template>
|
||||
</q-input>
|
||||
|
||||
<q-btn :disabled="!bookUrl" color="green-7" no-caps size="14px" @click="submitUrl">
|
||||
<q-btn :disabled="!bookUrl" color="green-7" no-caps size="14px" @click="submitUrl()">
|
||||
Открыть
|
||||
<q-tooltip :delay="1500" anchor="bottom middle" content-style="font-size: 80%">
|
||||
Открыть в читалке
|
||||
@@ -312,6 +312,7 @@ class ExternalLibs {
|
||||
inpxUrl = '';
|
||||
|
||||
created() {
|
||||
this.commit = this.$store.commit;
|
||||
this.oldStartLink = '';
|
||||
this.justOpened = true;
|
||||
this.$root.addEventHook('key', this.keyHook);
|
||||
@@ -404,6 +405,8 @@ class ExternalLibs {
|
||||
this.ready = true;
|
||||
if (d.data)
|
||||
this.libs = _.cloneDeep(d.data);
|
||||
if (d.sets)
|
||||
this.updateSets(d.sets);
|
||||
} else if (d.type == 'notify') {
|
||||
this.$root.notify.success(d.data, '', {position: 'bottom-right'});
|
||||
}
|
||||
@@ -448,6 +451,11 @@ class ExternalLibs {
|
||||
}
|
||||
}
|
||||
|
||||
updateSets(sets) {
|
||||
if (sets.nightMode !== this.nightMode)
|
||||
this.commit('reader/nightModeToggle');
|
||||
}
|
||||
|
||||
commitLibs(libs) {
|
||||
this.sendMessage({type: 'libs', data: libs});
|
||||
}
|
||||
@@ -496,6 +504,10 @@ class ExternalLibs {
|
||||
return this.$store.state.config.mode;
|
||||
}
|
||||
|
||||
get nightMode() {
|
||||
return this.$store.state.reader.settings.nightMode;
|
||||
}
|
||||
|
||||
get header() {
|
||||
let result = [this.ready ? 'Сетевая библиотека' : 'Загрузка...'];
|
||||
if (this.ready && this.selectedLink) {
|
||||
|
||||
@@ -119,8 +119,12 @@ class LibsPage {
|
||||
return this.$store.state.reader.libs;
|
||||
}
|
||||
|
||||
get nightMode() {
|
||||
return this.$store.state.reader.settings.nightMode;
|
||||
}
|
||||
|
||||
sendLibs() {
|
||||
this.sendMessage({type: 'libs', data: _.cloneDeep(this.libs)});
|
||||
this.sendMessage({type: 'libs', data: _.cloneDeep(this.libs), sets: {nightMode: this.nightMode}});
|
||||
}
|
||||
|
||||
close() {
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
export const versionHistory = [
|
||||
{
|
||||
version: '1.1.0',
|
||||
version: '1.1.2',
|
||||
releaseDate: '2023-01-22',
|
||||
showUntil: '2023-01-21',
|
||||
content:
|
||||
`
|
||||
<ul>
|
||||
<li>исправление багов</li>
|
||||
</ul>
|
||||
|
||||
`
|
||||
},
|
||||
|
||||
{
|
||||
version: '1.1.1',
|
||||
releaseDate: '2023-01-11',
|
||||
showUntil: '2023-01-15',
|
||||
content:
|
||||
|
||||
18
package-lock.json
generated
18
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "liberama",
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.2",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "liberama",
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.2",
|
||||
"hasInstallScript": true,
|
||||
"license": "CC0-1.0",
|
||||
"dependencies": {
|
||||
@@ -22,7 +22,7 @@
|
||||
"fs-extra": "^10.1.0",
|
||||
"he": "^1.2.0",
|
||||
"iconv-lite": "^0.6.3",
|
||||
"jembadb": "^5.1.5",
|
||||
"jembadb": "^5.1.7",
|
||||
"localforage": "^1.10.0",
|
||||
"lodash": "^4.17.21",
|
||||
"minimist": "^1.2.7",
|
||||
@@ -5989,9 +5989,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/jembadb": {
|
||||
"version": "5.1.5",
|
||||
"resolved": "https://registry.npmjs.org/jembadb/-/jembadb-5.1.5.tgz",
|
||||
"integrity": "sha512-Vb+TkTg3JVXLPTG5BiqboZjJ2wvZRONnLd2+qU4gTuaqt2JSniigbniKSl3kACAEFfuRXEjfs9dLlKWjBX2Aiw==",
|
||||
"version": "5.1.7",
|
||||
"resolved": "https://registry.npmjs.org/jembadb/-/jembadb-5.1.7.tgz",
|
||||
"integrity": "sha512-TNZjiKQ7Zfh89Q1x25PKKtsbkxiC5uOnx953dxJEP6RqfcdR6uVpr4cf+kmyq6IQ1GhwhXTELnoTIdvLWrpEvw==",
|
||||
"engines": {
|
||||
"node": ">=16.16.0"
|
||||
}
|
||||
@@ -15154,9 +15154,9 @@
|
||||
}
|
||||
},
|
||||
"jembadb": {
|
||||
"version": "5.1.5",
|
||||
"resolved": "https://registry.npmjs.org/jembadb/-/jembadb-5.1.5.tgz",
|
||||
"integrity": "sha512-Vb+TkTg3JVXLPTG5BiqboZjJ2wvZRONnLd2+qU4gTuaqt2JSniigbniKSl3kACAEFfuRXEjfs9dLlKWjBX2Aiw=="
|
||||
"version": "5.1.7",
|
||||
"resolved": "https://registry.npmjs.org/jembadb/-/jembadb-5.1.7.tgz",
|
||||
"integrity": "sha512-TNZjiKQ7Zfh89Q1x25PKKtsbkxiC5uOnx953dxJEP6RqfcdR6uVpr4cf+kmyq6IQ1GhwhXTELnoTIdvLWrpEvw=="
|
||||
},
|
||||
"jest-util": {
|
||||
"version": "29.3.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "liberama",
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.2",
|
||||
"author": "Book Pauk <bookpauk@gmail.com>",
|
||||
"license": "CC0-1.0",
|
||||
"repository": "bookpauk/liberama",
|
||||
@@ -65,7 +65,7 @@
|
||||
"fs-extra": "^10.1.0",
|
||||
"he": "^1.2.0",
|
||||
"iconv-lite": "^0.6.3",
|
||||
"jembadb": "^5.1.5",
|
||||
"jembadb": "^5.1.7",
|
||||
"localforage": "^1.10.0",
|
||||
"lodash": "^4.17.21",
|
||||
"minimist": "^1.2.7",
|
||||
|
||||
@@ -24,6 +24,7 @@ class JembaReaderStorage {
|
||||
|
||||
getCache(id) {
|
||||
const obj = this.cacheMap.get(id);
|
||||
//обновляем время доступа и при чтении тоже
|
||||
if (obj)
|
||||
obj.time = Date.now();
|
||||
return obj;
|
||||
@@ -118,6 +119,7 @@ class JembaReaderStorage {
|
||||
//identity необходимо для работы при нестабильной связи,
|
||||
//одному и тому же клиенту разрешается перезаписывать данные при расхождении на 0 или 1 ревизию
|
||||
const obj = this.getCache(id) || {};
|
||||
const oldIdentity = obj.identity;
|
||||
const sameClient = (identity && obj.identity === identity);
|
||||
if (identity && obj.identity !== identity) {
|
||||
obj.identity = identity;
|
||||
@@ -126,8 +128,12 @@ class JembaReaderStorage {
|
||||
|
||||
const revDiff = items[id].rev - check.items[id].rev;
|
||||
const allowUpdate = force || revDiff === 1 || (sameClient && (revDiff === 0 || revDiff === 1));
|
||||
if (!allowUpdate)
|
||||
|
||||
if (!allowUpdate) {
|
||||
log(LM_ERR, `JembaReaderStorage-Reject: revDiff: ${revDiff}, sameClient: ${sameClient}, oldIdentity: ${oldIdentity}, identity: ${identity}`);
|
||||
|
||||
return {state: 'reject', items: check.items};
|
||||
}
|
||||
}
|
||||
|
||||
const db = this.db;
|
||||
|
||||
Reference in New Issue
Block a user