Skip to content

Commit c3810d1

Browse files
committed
Merge branch 'release/1.5.4'
2 parents 636e34b + deeac0b commit c3810d1

File tree

21 files changed

+383
-79
lines changed

21 files changed

+383
-79
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
1.5.4 / 2023-04-12
2+
3+
- Добавлена возможность поиска по типу файла
4+
- Улучшена работа с inpx, теперь понимает файлы в каталогах (без zip-архива)
5+
- В readme добавлен раздел "Запуск без сборки релиза" для запуска inpx-web на любых платформах
6+
- Исправления мелких багов
7+
18
1.5.3 / 2023-03-02
29

310
- OPDS: исправление проблемы поиска для koreader

README.md

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ OPDS-сервер доступен по адресу [http://127.0.0.1:12380/opd
2929
* [Удаленная библиотека](#remotelib)
3030
* [Фильтр по авторам и книгам](#filter)
3131
* [Настройка https с помощью nginx](#https)
32-
* [Сборка проекта](#build)
32+
* [Сборка релизов](#build)
33+
* [Запуск без сборки релиза](#native_run)
3334
* [Разработка](#development)
3435

3536
<a id="capabilities" />
@@ -321,7 +322,7 @@ sudo service nginx reload
321322

322323
<a id="build" />
323324

324-
### Сборка проекта
325+
### Сборка релизов
325326
Сборка только в среде Linux.
326327
Необходима версия node.js не ниже 16.
327328

@@ -331,15 +332,36 @@ sudo service nginx reload
331332
git clone https://github.com/bookpauk/inpx-web
332333
cd inpx-web
333334
npm i
334-
```
335-
336-
#### Релизы
337-
```sh
338335
npm run release
339336
```
340337

341338
Результат сборки будет доступен в каталоге `dist/release`
342339

340+
<a id="native_run" />
341+
342+
### Запуск без сборки релиза
343+
Т.к. сборщик pkg поддерживает не все платформы, то не всегда удается собрать релиз.
344+
Однако, можно скачать и запустить inpx-web нативным путем, с помощью nodejs.
345+
Ниже пример для Ubuntu, для других линуксов различия не принципиальны:
346+
347+
```sh
348+
# установка nodejs v16 и выше:
349+
curl -s https://deb.nodesource.com/setup_16.x | sudo bash
350+
sudo apt install nodejs -y
351+
352+
# подготовка
353+
git clone https://github.com/bookpauk/inpx-web
354+
cd inpx-web
355+
npm i
356+
npm run build:client && node build/prepkg.js linux
357+
358+
# удалим файл development-среды, чтобы запускался в production-режиме
359+
rm ./server/config/application_env
360+
361+
# запуск inpx-web, тут же будет создан каталог .inpx-web
362+
node server --app-dir=.inpx-web
363+
```
364+
343365
<a id="development" />
344366

345367
### Разработка

client/components/Search/AuthorList/AuthorList.vue

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@
126126
</div>
127127
<!-- Формирование списка конец ------------------------------------------------------------------>
128128

129-
<div v-if="!refreshing && !tableData.length" class="row items-center q-ml-md" style="font-size: 120%">
129+
<div v-if="!refreshing && (!tableData.length || error)" class="row items-center q-ml-md" style="font-size: 120%">
130130
<q-icon class="la la-meh q-mr-xs" size="28px" />
131-
Поиск не дал результатов
131+
{{ (error ? error : 'Поиск не дал результатов') }}
132132
</div>
133133
</div>
134134
</template>
@@ -438,6 +438,7 @@ class AuthorList extends BaseList {
438438
if (this.refreshing)
439439
return;
440440
441+
this.error = '';
441442
this.refreshing = true;
442443
443444
(async() => {
@@ -467,7 +468,12 @@ class AuthorList extends BaseList {
467468
this.highlightPageScroller(query);
468469
}
469470
} catch (e) {
470-
this.$root.stdDialog.alert(e.message, 'Ошибка');
471+
this.list.queryFound = 0;
472+
this.list.totalFound = 0;
473+
this.searchResult = {found: []};
474+
await this.updateTableData();
475+
//this.$root.stdDialog.alert(e.message, 'Ошибка');
476+
this.error = `Ошибка: ${e.message}`;
471477
}
472478
}
473479
} finally {

client/components/Search/BaseList.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export default class BaseList {
4848
genreMap: Object,
4949
};
5050

51+
error = '';
5152
loadingMessage = '';
5253
loadingMessage2 = '';
5354

@@ -371,7 +372,8 @@ export default class BaseList {
371372
bookValue = emptyFieldValue;
372373

373374
bookValue = bookValue.toLowerCase();
374-
searchValue = searchValue.toLowerCase();
375+
if (searchValue[0] !== '~')
376+
searchValue = searchValue.toLowerCase();
375377

376378
//особая обработка префиксов
377379
if (searchValue[0] == '=') {
@@ -450,6 +452,13 @@ export default class BaseList {
450452
librateFound = searchLibrate.has(book.librate);
451453
}
452454

455+
//ext
456+
let extFound = !s.ext;
457+
if (!extFound) {
458+
const searchExt = new Set(s.ext.split('|'));
459+
extFound = searchExt.has(book.ext.toLowerCase() || emptyFieldValue);
460+
}
461+
453462
return (this.showDeleted || !book.del)
454463
&& authorFound
455464
&& filterBySearch(book.series, s.series)
@@ -458,6 +467,7 @@ export default class BaseList {
458467
&& langFound
459468
&& dateFound
460469
&& librateFound
470+
&& extFound
461471
;
462472
});
463473
}

client/components/Search/BookInfoDialog/BookInfoDialog.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<div class="poster-size">
2121
<div class="column justify-center items-center" :class="{'poster': coverSrc, 'no-poster': !coverSrc}" @click.stop.prevent="posterClick">
2222
<img v-if="coverSrc" :src="coverSrc" class="fit row justify-center items-center" style="object-fit: contain" @error="coverSrc = ''" />
23-
<div v-if="!coverSrc" class="fit row justify-center items-center text-grey-5" style="border: 1px solid #ccc; font-size: 300%">
23+
<div v-if="!coverSrc" class="fit row justify-center items-center text-grey-5 overflow-hidden" style="border: 1px solid #ccc; font-size: 300%">
2424
<i>{{ book.ext }}</i>
2525
</div>
2626
</div>

client/components/Search/ExtendedList/ExtendedList.vue

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
</div>
1515
<!-- Формирование списка конец ------------------------------------------------------------------>
1616

17-
<div v-if="!refreshing && !tableData.length" class="row items-center q-ml-md" style="font-size: 120%">
17+
<div v-if="!refreshing && (!tableData.length || error)" class="row items-center q-ml-md" style="font-size: 120%">
1818
<q-icon class="la la-meh q-mr-xs" size="28px" />
19-
Поиск не дал результатов
19+
{{ (error ? error : 'Поиск не дал результатов') }}
2020
</div>
2121
</div>
2222
</template>
@@ -74,6 +74,7 @@ class ExtendedList extends BaseList {
7474
if (this.refreshing)
7575
return;
7676
77+
this.error = '';
7778
this.refreshing = true;
7879
7980
(async() => {
@@ -103,7 +104,12 @@ class ExtendedList extends BaseList {
103104
this.highlightPageScroller(query);
104105
}
105106
} catch (e) {
106-
this.$root.stdDialog.alert(e.message, 'Ошибка');
107+
this.list.queryFound = 0;
108+
this.list.totalFound = 0;
109+
this.searchResult = {found: []};
110+
await this.updateTableData();
111+
//this.$root.stdDialog.alert(e.message, 'Ошибка');
112+
this.error = `Ошибка: ${e.message}`;
107113
}
108114
}
109115
} finally {

client/components/Search/Search.vue

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@
160160
<div class="q-mx-xs" />
161161
<q-input
162162
v-model="librateNames" :maxlength="inputMaxLength" :debounce="inputDebounce"
163-
class="q-mt-xs col-1" :bg-color="inputBgColor()" input-style="cursor: pointer" style="min-width: 90px;" label="Оценка" stack-label outlined dense clearable readonly
163+
class="q-mt-xs col-2" :bg-color="inputBgColor()" input-style="cursor: pointer" style="min-width: 140px;" label="Оценка" stack-label outlined dense clearable readonly
164164
@click.stop.prevent="selectLibRate"
165165
>
166166
<template v-if="librateNames" #append>
@@ -171,6 +171,21 @@
171171
{{ librateNames }}
172172
</q-tooltip>
173173
</q-input>
174+
175+
<div class="q-mx-xs" />
176+
<q-input
177+
v-model="search.ext" :maxlength="inputMaxLength" :debounce="inputDebounce"
178+
class="q-mt-xs col-2" :bg-color="inputBgColor()" input-style="cursor: pointer" style="min-width: 140px;" label="Тип файла" stack-label outlined dense clearable readonly
179+
@click.stop.prevent="selectExt"
180+
>
181+
<template v-if="search.ext" #append>
182+
<q-icon name="la la-times-circle" class="q-field__focusable-action" @click.stop.prevent="search.ext = ''" />
183+
</template>
184+
185+
<q-tooltip v-if="search.ext && showTooltips" :delay="500" anchor="bottom middle" content-style="font-size: 80%" max-width="400px">
186+
{{ search.ext }}
187+
</q-tooltip>
188+
</q-input>
174189
</div>
175190
<div v-show="!isExtendedSearch && !extendedParams && extendedParamsMessage" class="row q-mx-sm items-center clickable" @click.stop.prevent="extendedParams = true">
176191
+{{ extendedParamsMessage }}
@@ -331,6 +346,7 @@
331346
<SelectLangDialog v-model="selectLangDialogVisible" v-model:lang="search.lang" :lang-list="langList" :lang-default="langDefault" />
332347
<SelectLibRateDialog v-model="selectLibRateDialogVisible" v-model:librate="search.librate" />
333348
<SelectDateDialog v-model="selectDateDialogVisible" v-model:date="search.date" />
349+
<SelectExtDialog v-model="selectExtDialogVisible" v-model:ext="search.ext" :ext-list="extList" />
334350
<BookInfoDialog v-model="bookInfoDialogVisible" :book-info="bookInfo" />
335351
<SelectExtSearchDialog v-model="selectExtSearchDialogVisible" v-model:ext-search="extSearch" />
336352
</div>
@@ -351,6 +367,7 @@ import SelectGenreDialog from './SelectGenreDialog/SelectGenreDialog.vue';
351367
import SelectLangDialog from './SelectLangDialog/SelectLangDialog.vue';
352368
import SelectLibRateDialog from './SelectLibRateDialog/SelectLibRateDialog.vue';
353369
import SelectDateDialog from './SelectDateDialog/SelectDateDialog.vue';
370+
import SelectExtDialog from './SelectExtDialog/SelectExtDialog.vue';
354371
import BookInfoDialog from './BookInfoDialog/BookInfoDialog.vue';
355372
import SelectExtSearchDialog from './SelectExtSearchDialog/SelectExtSearchDialog.vue';
356373
@@ -384,6 +401,7 @@ const componentOptions = {
384401
SelectLangDialog,
385402
SelectLibRateDialog,
386403
SelectDateDialog,
404+
SelectExtDialog,
387405
BookInfoDialog,
388406
SelectExtSearchDialog,
389407
Dialog,
@@ -495,6 +513,7 @@ class Search {
495513
selectLangDialogVisible = false;
496514
selectLibRateDialogVisible = false;
497515
selectDateDialogVisible = false;
516+
selectExtDialogVisible = false;
498517
bookInfoDialogVisible = false;
499518
selectExtSearchDialogVisible = false;
500519
@@ -531,6 +550,7 @@ class Search {
531550
genreTree = [];
532551
genreMap = new Map();
533552
langList = [];
553+
extList = [];
534554
genreTreeInpxHash = '';
535555
showTooltips = true;
536556
@@ -561,7 +581,7 @@ class Search {
561581
this.commit = this.$store.commit;
562582
this.api = this.$root.api;
563583
564-
this.generateDefaults(this.search, ['author', 'series', 'title', 'genre', 'lang', 'date', 'librate']);
584+
this.generateDefaults(this.search, ['author', 'series', 'title', 'genre', 'lang', 'date', 'librate', 'ext']);
565585
this.search.setDefaults(this.search);
566586
567587
this.loadSettings();
@@ -705,6 +725,7 @@ class Search {
705725
result.push(s.genre ? 'Жанр' : '');
706726
result.push(s.date ? 'Дата поступления' : '');
707727
result.push(s.librate ? 'Оценка' : '');
728+
result.push(s.ext ? 'Тип файла' : '');
708729
709730
return result.filter(s => s).join(', ');
710731
}
@@ -941,6 +962,11 @@ class Search {
941962
this.selectLibRateDialogVisible = true;
942963
}
943964
965+
selectExt() {
966+
this.hideTooltip();
967+
this.selectExtDialogVisible = true;
968+
}
969+
944970
selectExtSearch() {
945971
this.hideTooltip();
946972
this.selectExtSearchDialogVisible = true;
@@ -1079,6 +1105,7 @@ class Search {
10791105
lang: (typeof(query.lang) == 'string' ? query.lang : this.langDefault),
10801106
date: query.date,
10811107
librate: query.librate,
1108+
ext: query.ext,
10821109
10831110
page: parseInt(query.page, 10),
10841111
limit: parseInt(query.limit, 10) || this.search.limit,
@@ -1170,6 +1197,7 @@ class Search {
11701197
}
11711198
11721199
this.langList = result.langList;
1200+
this.extList = result.extList;
11731201
this.genreTreeInpxHash = result.inpxHash;
11741202
}
11751203
} catch (e) {

0 commit comments

Comments
 (0)