Использование параметра 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> </div>
<q-btn-toggle <q-btn-toggle
v-if="extendedSearch"
v-model="selectedList" v-model="selectedList"
class="q-ml-md" class="q-ml-md"
toggle-color="primary" toggle-color="primary"
@@ -415,6 +416,10 @@ class Search {
return this.$store.state.config; return this.$store.state.config;
} }
get extendedSearch() {
return this.config.extendedSearch;
}
get settings() { get settings() {
return this.$store.state.settings; return this.$store.state.settings;
} }
@@ -442,7 +447,7 @@ class Search {
async updateListFromRoute(to) { async updateListFromRoute(to) {
const newPath = to.path; const newPath = to.path;
let newList = this.getListRoute(newPath); let newList = this.getListRoute(newPath);
newList = (newList ? newList : 'author'); newList = (newList && this.extendedSearch ? newList : 'author');
if (this.selectedList != newList) if (this.selectedList != newList)
this.selectedList = newList; this.selectedList = newList;
} }

View File

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

View File

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