В настройки веб-интерфейса добавлена опция "Скачивать книги в виде zip-архива"
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
------------------
|
------------------
|
||||||
|
|
||||||
- Улучшение поддержки reverse-proxy, в конфиг добавлены параметры server.root и opds.root для встраивания inpx-web в уже существующий веб-сервер
|
- Улучшение поддержки reverse-proxy, в конфиг добавлены параметры server.root и opds.root для встраивания inpx-web в уже существующий веб-сервер
|
||||||
|
- В настройки веб-интерфейса добавлена опция "Скачивать книги в виде zip-архива"
|
||||||
- Исправлен баг "Android-читалки не очень хорошо работают с OPDS" (#4)
|
- Исправлен баг "Android-читалки не очень хорошо работают с OPDS" (#4)
|
||||||
- В readme добавлена ссылка для донатов: [отблагодарить автора проекта](https://donatty.com/liberama)
|
- В readme добавлена ссылка для донатов: [отблагодарить автора проекта](https://donatty.com/liberama)
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import axios from 'axios';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
|
|
||||||
@@ -50,6 +51,7 @@ export default class BaseList {
|
|||||||
expandedAuthor = [];
|
expandedAuthor = [];
|
||||||
expandedSeries = [];
|
expandedSeries = [];
|
||||||
|
|
||||||
|
downloadAsZip = false;
|
||||||
showCounts = true;
|
showCounts = true;
|
||||||
showRates = true;
|
showRates = true;
|
||||||
showGenres = true;
|
showGenres = true;
|
||||||
@@ -81,6 +83,7 @@ export default class BaseList {
|
|||||||
|
|
||||||
this.expandedAuthor = _.cloneDeep(settings.expandedAuthor);
|
this.expandedAuthor = _.cloneDeep(settings.expandedAuthor);
|
||||||
this.expandedSeries = _.cloneDeep(settings.expandedSeries);
|
this.expandedSeries = _.cloneDeep(settings.expandedSeries);
|
||||||
|
this.downloadAsZip = settings.downloadAsZip;
|
||||||
this.showCounts = settings.showCounts;
|
this.showCounts = settings.showCounts;
|
||||||
this.showRates = settings.showRates;
|
this.showRates = settings.showRates;
|
||||||
this.showGenres = settings.showGenres;
|
this.showGenres = settings.showGenres;
|
||||||
@@ -133,13 +136,20 @@ export default class BaseList {
|
|||||||
const response = await this.api.getBookLink(book._uid);
|
const response = await this.api.getBookLink(book._uid);
|
||||||
|
|
||||||
const link = response.link;
|
const link = response.link;
|
||||||
const href = `${window.location.origin}${link}`;
|
let href = `${window.location.origin}${link}`;
|
||||||
|
|
||||||
|
//downloadAsZip
|
||||||
|
if (this.downloadAsZip && (action == 'download' || action == 'copyLink')) {
|
||||||
|
href += '/zip';
|
||||||
|
//подожлем формирования zip-файла
|
||||||
|
await axios.head(href);
|
||||||
|
}
|
||||||
|
|
||||||
|
//action
|
||||||
if (action == 'download') {
|
if (action == 'download') {
|
||||||
//скачивание
|
//скачивание
|
||||||
const d = this.$refs.download;
|
const d = this.$refs.download;
|
||||||
d.href = href;
|
d.href = href;
|
||||||
d.download = response.downFileName;
|
|
||||||
|
|
||||||
d.click();
|
d.click();
|
||||||
} else if (action == 'copyLink') {
|
} else if (action == 'copyLink') {
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<q-checkbox v-model="downloadAsZip" size="36px" label="Скачивать книги в виде zip-архива" />
|
||||||
<q-checkbox v-model="showCounts" size="36px" label="Показывать количество" />
|
<q-checkbox v-model="showCounts" size="36px" label="Показывать количество" />
|
||||||
<q-checkbox v-model="showRates" size="36px" label="Показывать оценки" />
|
<q-checkbox v-model="showRates" size="36px" label="Показывать оценки" />
|
||||||
<q-checkbox v-model="showInfo" size="36px" label="Показывать кнопку (инфо)" />
|
<q-checkbox v-model="showInfo" size="36px" label="Показывать кнопку (инфо)" />
|
||||||
@@ -60,6 +61,9 @@ const componentOptions = {
|
|||||||
limit(newValue) {
|
limit(newValue) {
|
||||||
this.commit('setSettings', {'limit': newValue});
|
this.commit('setSettings', {'limit': newValue});
|
||||||
},
|
},
|
||||||
|
downloadAsZip(newValue) {
|
||||||
|
this.commit('setSettings', {'downloadAsZip': newValue});
|
||||||
|
},
|
||||||
showCounts(newValue) {
|
showCounts(newValue) {
|
||||||
this.commit('setSettings', {'showCounts': newValue});
|
this.commit('setSettings', {'showCounts': newValue});
|
||||||
},
|
},
|
||||||
@@ -93,6 +97,7 @@ class SettingsDialog {
|
|||||||
|
|
||||||
//settings
|
//settings
|
||||||
limit = 20;
|
limit = 20;
|
||||||
|
downloadAsZip = false;
|
||||||
showCounts = true;
|
showCounts = true;
|
||||||
showRates = true;
|
showRates = true;
|
||||||
showInfo = true;
|
showInfo = true;
|
||||||
@@ -129,6 +134,7 @@ class SettingsDialog {
|
|||||||
|
|
||||||
this.limit = settings.limit;
|
this.limit = settings.limit;
|
||||||
|
|
||||||
|
this.downloadAsZip = settings.downloadAsZip;
|
||||||
this.showCounts = settings.showCounts;
|
this.showCounts = settings.showCounts;
|
||||||
this.showRates = settings.showRates;
|
this.showRates = settings.showRates;
|
||||||
this.showInfo = settings.showInfo;
|
this.showInfo = settings.showInfo;
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ const state = {
|
|||||||
limit: 20,
|
limit: 20,
|
||||||
expandedAuthor: [],
|
expandedAuthor: [],
|
||||||
expandedSeries: [],
|
expandedSeries: [],
|
||||||
|
downloadAsZip: false,
|
||||||
showCounts: true,
|
showCounts: true,
|
||||||
showRates: true,
|
showRates: true,
|
||||||
showInfo: true,
|
showInfo: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user