Использование параметра extendedSearch на клиенте

This commit is contained in:
Book Pauk
2022-10-25 17:20:53 +07:00
parent 53663b2867
commit 1b503dba8e
3 changed files with 10 additions and 2 deletions

View File

@@ -19,6 +19,7 @@
</div>
<q-btn-toggle
v-if="extendedSearch"
v-model="selectedList"
class="q-ml-md"
toggle-color="primary"
@@ -415,6 +416,10 @@ class Search {
return this.$store.state.config;
}
get extendedSearch() {
return this.config.extendedSearch;
}
get settings() {
return this.$store.state.settings;
}
@@ -442,7 +447,7 @@ class Search {
async updateListFromRoute(to) {
const newPath = to.path;
let newList = this.getListRoute(newPath);
newList = (newList ? newList : 'author');
newList = (newList && this.extendedSearch ? newList : 'author');
if (this.selectedList != newList)
this.selectedList = newList;
}

View File

@@ -27,7 +27,7 @@ module.exports = {
inpxCheckInterval: 60,//minutes
lowMemoryMode: false,
webConfigParams: ['name', 'version', 'branch', 'bookReadLink', 'dbVersion'],
webConfigParams: ['name', 'version', 'branch', 'bookReadLink', 'dbVersion', 'extendedSearch'],
allowRemoteLib: false,
remoteLib: false,

View File

@@ -145,6 +145,9 @@ class WebSocketController {
}
async seriesSearch(req, ws) {
if (!this.config.extendedSearch)
throw new Error(`Extended search disabled`);
if (!req.query)
throw new Error(`query is empty`);