mirror of
https://github.com/simon987/sist2.git
synced 2025-04-18 01:36:42 +00:00
Add error message in home page on ES connection error #331
This commit is contained in:
parent
5b3b9911bd
commit
faf438a798
3
.gitattributes
vendored
3
.gitattributes
vendored
@ -1,3 +0,0 @@
|
|||||||
CMakeModules/* linguist-vendored
|
|
||||||
**/*_generated.c linguist-vendored
|
|
||||||
**/*_generated.h linguist-vendored
|
|
@ -19,7 +19,7 @@ COPY sist2-admin sist2-admin
|
|||||||
RUN cd sist2-vue/ && npm install && npm run build
|
RUN cd sist2-vue/ && npm install && npm run build
|
||||||
RUN cd sist2-admin/frontend/ && npm install && npm run build
|
RUN cd sist2-admin/frontend/ && npm install && npm run build
|
||||||
|
|
||||||
RUN mkdir build && cd build && cmake -DSIST_PLATFORM=x64_linux -DSIST_DEBUG=off -DBUILD_TESTS=off -DCMAKE_TOOLCHAIN_FILE=/vcpkg/scripts/buildsystems/vcpkg.cmake ..
|
RUN mkdir build && cd build && cmake -DSIST_PLATFORM=x64_linux_docker -DSIST_DEBUG=off -DBUILD_TESTS=off -DCMAKE_TOOLCHAIN_FILE=/vcpkg/scripts/buildsystems/vcpkg.cmake ..
|
||||||
RUN cd build && make -j$(nproc)
|
RUN cd build && make -j$(nproc)
|
||||||
RUN strip build/sist2 || mv build/sist2_debug build/sist2
|
RUN strip build/sist2 || mv build/sist2_debug build/sist2
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ MAINTAINER simon987 <me@simon987.net>
|
|||||||
|
|
||||||
WORKDIR /build/
|
WORKDIR /build/
|
||||||
ADD . /build/
|
ADD . /build/
|
||||||
RUN mkdir build && cd build && cmake -DSIST_PLATFORM=arm64_linux -DSIST_DEBUG=off -DBUILD_TESTS=off -DCMAKE_TOOLCHAIN_FILE=/vcpkg/scripts/buildsystems/vcpkg.cmake ..
|
RUN mkdir build && cd build && cmake -DSIST_PLATFORM=arm64_linux_docker -DSIST_DEBUG=off -DBUILD_TESTS=off -DCMAKE_TOOLCHAIN_FILE=/vcpkg/scripts/buildsystems/vcpkg.cmake ..
|
||||||
RUN cd build && make -j$(nproc)
|
RUN cd build && make -j$(nproc)
|
||||||
RUN strip build/sist2 || mv build/sist2_debug build/sist2
|
RUN strip build/sist2 || mv build/sist2_debug build/sist2
|
||||||
|
|
||||||
|
@ -1,57 +1,61 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<Lightbox></Lightbox>
|
<Lightbox></Lightbox>
|
||||||
<HelpDialog :show="showHelp" @close="showHelp = false"></HelpDialog>
|
<HelpDialog :show="showHelp" @close="showHelp = false"></HelpDialog>
|
||||||
|
|
||||||
<b-card v-if="uiLoading">
|
<b-card v-if="uiLoading">
|
||||||
<Preloader></Preloader>
|
<Preloader></Preloader>
|
||||||
</b-card>
|
</b-card>
|
||||||
|
|
||||||
<b-card v-show="!uiLoading" id="search-panel">
|
<b-alert v-show="!uiLoading && showEsConnectionError" show variant="danger" class="mt-2">
|
||||||
<SearchBar @show-help="showHelp=true"></SearchBar>
|
{{ $t("toast.esConnErr") }}
|
||||||
<b-row>
|
</b-alert>
|
||||||
<b-col style="height: 70px;" sm="6">
|
|
||||||
<SizeSlider></SizeSlider>
|
|
||||||
</b-col>
|
|
||||||
<b-col>
|
|
||||||
<PathTree @search="search(true)"></PathTree>
|
|
||||||
</b-col>
|
|
||||||
</b-row>
|
|
||||||
<b-row>
|
|
||||||
<b-col sm="6">
|
|
||||||
<DateSlider></DateSlider>
|
|
||||||
<b-row>
|
|
||||||
<b-col>
|
|
||||||
<IndexPicker></IndexPicker>
|
|
||||||
</b-col>
|
|
||||||
</b-row>
|
|
||||||
</b-col>
|
|
||||||
<b-col>
|
|
||||||
<b-tabs justified>
|
|
||||||
<b-tab :title="$t('mimeTypes')">
|
|
||||||
<MimePicker></MimePicker>
|
|
||||||
</b-tab>
|
|
||||||
<b-tab :title="$t('tags')">
|
|
||||||
<TagPicker :show-search-bar="$store.state.optShowTagPickerFilter"></TagPicker>
|
|
||||||
</b-tab>
|
|
||||||
</b-tabs>
|
|
||||||
</b-col>
|
|
||||||
</b-row>
|
|
||||||
</b-card>
|
|
||||||
|
|
||||||
<div v-show="docs.length === 0 && !uiLoading">
|
<b-card v-show="!uiLoading && !showEsConnectionError" id="search-panel">
|
||||||
<Preloader v-if="searchBusy" class="mt-3"></Preloader>
|
<SearchBar @show-help="showHelp=true"></SearchBar>
|
||||||
|
<b-row>
|
||||||
|
<b-col style="height: 70px;" sm="6">
|
||||||
|
<SizeSlider></SizeSlider>
|
||||||
|
</b-col>
|
||||||
|
<b-col>
|
||||||
|
<PathTree @search="search(true)"></PathTree>
|
||||||
|
</b-col>
|
||||||
|
</b-row>
|
||||||
|
<b-row>
|
||||||
|
<b-col sm="6">
|
||||||
|
<DateSlider></DateSlider>
|
||||||
|
<b-row>
|
||||||
|
<b-col>
|
||||||
|
<IndexPicker></IndexPicker>
|
||||||
|
</b-col>
|
||||||
|
</b-row>
|
||||||
|
</b-col>
|
||||||
|
<b-col>
|
||||||
|
<b-tabs justified>
|
||||||
|
<b-tab :title="$t('mimeTypes')">
|
||||||
|
<MimePicker></MimePicker>
|
||||||
|
</b-tab>
|
||||||
|
<b-tab :title="$t('tags')">
|
||||||
|
<TagPicker :show-search-bar="$store.state.optShowTagPickerFilter"></TagPicker>
|
||||||
|
</b-tab>
|
||||||
|
</b-tabs>
|
||||||
|
</b-col>
|
||||||
|
</b-row>
|
||||||
|
</b-card>
|
||||||
|
|
||||||
<ResultsCard></ResultsCard>
|
<div v-show="docs.length === 0 && !uiLoading">
|
||||||
|
<Preloader v-if="searchBusy" class="mt-3"></Preloader>
|
||||||
|
|
||||||
|
<ResultsCard></ResultsCard>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="docs.length > 0">
|
||||||
|
<ResultsCard></ResultsCard>
|
||||||
|
|
||||||
|
<DocCardWall v-if="optDisplay==='grid'" :docs="docs" :append="appendFunc"></DocCardWall>
|
||||||
|
<DocList v-else :docs="docs" :append="appendFunc"></DocList>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="docs.length > 0">
|
|
||||||
<ResultsCard></ResultsCard>
|
|
||||||
|
|
||||||
<DocCardWall v-if="optDisplay==='grid'" :docs="docs" :append="appendFunc"></DocCardWall>
|
|
||||||
<DocList v-else :docs="docs" :append="appendFunc"></DocList>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
@ -78,234 +82,244 @@ import HelpDialog from "@/components/HelpDialog.vue";
|
|||||||
|
|
||||||
|
|
||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
components: {
|
components: {
|
||||||
HelpDialog,
|
HelpDialog,
|
||||||
DocList,
|
DocList,
|
||||||
TagPicker,
|
TagPicker,
|
||||||
DateSlider,
|
DateSlider,
|
||||||
SizeSlider, PathTree, ResultsCard, MimePicker, Lightbox, DocCardWall, IndexPicker, SearchBar, Preloader
|
SizeSlider, PathTree, ResultsCard, MimePicker, Lightbox, DocCardWall, IndexPicker, SearchBar, Preloader
|
||||||
},
|
},
|
||||||
data: () => ({
|
data: () => ({
|
||||||
loading: false,
|
loading: false,
|
||||||
uiLoading: true,
|
uiLoading: true,
|
||||||
search: undefined as any,
|
search: undefined as any,
|
||||||
docs: [] as EsHit[],
|
docs: [] as EsHit[],
|
||||||
docIds: new Set(),
|
docIds: new Set(),
|
||||||
docChecksums: new Set(),
|
docChecksums: new Set(),
|
||||||
searchBusy: false,
|
searchBusy: false,
|
||||||
Sist2Query: Sist2Query,
|
Sist2Query: Sist2Query,
|
||||||
showHelp: false
|
showHelp: false,
|
||||||
}),
|
showEsConnectionError: false
|
||||||
computed: {
|
|
||||||
...mapGetters(["indices", "optDisplay"]),
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
// Handle touch events
|
|
||||||
window.ontouchend = () => this.$store.commit("busTouchEnd");
|
|
||||||
window.ontouchcancel = this.$store.commit("busTouchEnd");
|
|
||||||
|
|
||||||
this.search = _debounce(async (clear: boolean) => {
|
|
||||||
if (clear) {
|
|
||||||
await this.clearResults();
|
|
||||||
}
|
|
||||||
|
|
||||||
await this.searchNow(Sist2Query.searchQuery());
|
|
||||||
|
|
||||||
}, 350, {leading: false});
|
|
||||||
|
|
||||||
this.$store.dispatch("loadFromArgs", this.$route).then(() => {
|
|
||||||
this.$store.subscribe(() => this.$store.dispatch("updateArgs", this.$router));
|
|
||||||
this.$store.subscribe((mutation) => {
|
|
||||||
if ([
|
|
||||||
"setSizeMin", "setSizeMax", "setDateMin", "setDateMax", "setSearchText", "setPathText",
|
|
||||||
"setSortMode", "setOptHighlight", "setOptFragmentSize", "setFuzzy", "setSize", "setSelectedIndices",
|
|
||||||
"setSelectedMimeTypes", "setSelectedTags", "setOptQueryMode", "setOptSearchInPath",
|
|
||||||
].includes(mutation.type)) {
|
|
||||||
if (this.searchBusy) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.search(true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
this.setIndices(this.$store.getters["sist2Info"].indices)
|
|
||||||
|
|
||||||
this.getDateRange().then((range: { min: number, max: number }) => {
|
|
||||||
this.setDateBoundsMin(range.min);
|
|
||||||
this.setDateBoundsMax(range.max);
|
|
||||||
|
|
||||||
const doBlankSearch = !this.$store.state.optUpdateMimeMap;
|
|
||||||
|
|
||||||
Sist2Api.getMimeTypes(Sist2Query.searchQuery(doBlankSearch)).then(({mimeMap}) => {
|
|
||||||
this.$store.commit("setUiMimeMap", mimeMap);
|
|
||||||
this.uiLoading = false;
|
|
||||||
this.search(true);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
...mapActions({
|
|
||||||
setSist2Info: "setSist2Info",
|
|
||||||
}),
|
}),
|
||||||
...mapMutations({
|
computed: {
|
||||||
setIndices: "setIndices",
|
...mapGetters(["indices", "optDisplay"]),
|
||||||
setDateBoundsMin: "setDateBoundsMin",
|
|
||||||
setDateBoundsMax: "setDateBoundsMax",
|
|
||||||
setTags: "setTags",
|
|
||||||
}),
|
|
||||||
showErrorToast() {
|
|
||||||
this.$bvToast.toast(
|
|
||||||
this.$t("toast.esConnErr"),
|
|
||||||
{
|
|
||||||
title: this.$t("toast.esConnErrTitle"),
|
|
||||||
noAutoHide: true,
|
|
||||||
toaster: "b-toaster-bottom-right",
|
|
||||||
headerClass: "toast-header-error",
|
|
||||||
bodyClass: "toast-body-error",
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
showSyntaxErrorToast: function (): void {
|
mounted() {
|
||||||
this.$bvToast.toast(
|
// Handle touch events
|
||||||
this.$t("toast.esQueryErr"),
|
window.ontouchend = () => this.$store.commit("busTouchEnd");
|
||||||
{
|
window.ontouchcancel = this.$store.commit("busTouchEnd");
|
||||||
title: this.$t("toast.esQueryErrTitle"),
|
|
||||||
noAutoHide: true,
|
|
||||||
toaster: "b-toaster-bottom-right",
|
|
||||||
headerClass: "toast-header-warning",
|
|
||||||
bodyClass: "toast-body-warning",
|
|
||||||
});
|
|
||||||
},
|
|
||||||
async searchNow(q: any) {
|
|
||||||
this.searchBusy = true;
|
|
||||||
await this.$store.dispatch("incrementQuerySequence");
|
|
||||||
this.$store.commit("busSearch");
|
|
||||||
|
|
||||||
Sist2Api.esQuery(q).then(async (resp: EsResult) => {
|
this.search = _debounce(async (clear: boolean) => {
|
||||||
await this.handleSearch(resp);
|
if (clear) {
|
||||||
this.searchBusy = false;
|
await this.clearResults();
|
||||||
}).catch(err => {
|
}
|
||||||
if (err.response.status === 500 && this.$store.state.optQueryMode === "advanced") {
|
|
||||||
this.showSyntaxErrorToast();
|
|
||||||
} else {
|
|
||||||
this.showErrorToast();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
async clearResults() {
|
|
||||||
this.docs = [];
|
|
||||||
this.docIds.clear();
|
|
||||||
this.docChecksums.clear();
|
|
||||||
await this.$store.dispatch("clearResults");
|
|
||||||
this.$store.commit("setUiReachedScrollEnd", false);
|
|
||||||
},
|
|
||||||
async handleSearch(resp: EsResult) {
|
|
||||||
if (resp.hits.hits.length == 0 || resp.hits.hits.length < this.$store.state.optSize) {
|
|
||||||
this.$store.commit("setUiReachedScrollEnd", true);
|
|
||||||
}
|
|
||||||
|
|
||||||
resp.hits.hits = resp.hits.hits.filter(hit => !this.docIds.has(hit._id));
|
await this.searchNow(Sist2Query.searchQuery());
|
||||||
|
|
||||||
if (this.$store.state.optHideDuplicates) {
|
}, 350, {leading: false});
|
||||||
resp.hits.hits = resp.hits.hits.filter(hit => {
|
|
||||||
|
|
||||||
if (!("checksum" in hit._source)) {
|
this.$store.dispatch("loadFromArgs", this.$route).then(() => {
|
||||||
return true;
|
this.$store.subscribe(() => this.$store.dispatch("updateArgs", this.$router));
|
||||||
}
|
this.$store.subscribe((mutation) => {
|
||||||
|
if ([
|
||||||
|
"setSizeMin", "setSizeMax", "setDateMin", "setDateMax", "setSearchText", "setPathText",
|
||||||
|
"setSortMode", "setOptHighlight", "setOptFragmentSize", "setFuzzy", "setSize", "setSelectedIndices",
|
||||||
|
"setSelectedMimeTypes", "setSelectedTags", "setOptQueryMode", "setOptSearchInPath",
|
||||||
|
].includes(mutation.type)) {
|
||||||
|
if (this.searchBusy) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const isDupe = !this.docChecksums.has(hit._source.checksum);
|
this.search(true);
|
||||||
this.docChecksums.add(hit._source.checksum);
|
}
|
||||||
return isDupe;
|
});
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
for (const hit of resp.hits.hits) {
|
this.setIndices(this.$store.getters["sist2Info"].indices)
|
||||||
if (hit._props.isPlayableImage || hit._props.isPlayableVideo) {
|
|
||||||
hit._seq = await this.$store.dispatch("getKeySequence");
|
|
||||||
this.$store.commit("addLightboxSource", {
|
|
||||||
source: `f/${hit._id}`,
|
|
||||||
thumbnail: hit._props.hasThumbnail
|
|
||||||
? `t/${hit._source.index}/${hit._id}`
|
|
||||||
: null,
|
|
||||||
caption: {
|
|
||||||
component: LightboxCaption,
|
|
||||||
props: {hit: hit}
|
|
||||||
},
|
|
||||||
type: hit._props.isVideo ? "video" : "image"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
await this.$store.dispatch("remountLightbox");
|
this.getDateRange().then((range: { min: number, max: number }) => {
|
||||||
this.$store.commit("setLastQueryResult", resp);
|
this.setDateBoundsMin(range.min);
|
||||||
|
this.setDateBoundsMax(range.max);
|
||||||
|
|
||||||
this.docs.push(...resp.hits.hits);
|
const doBlankSearch = !this.$store.state.optUpdateMimeMap;
|
||||||
|
|
||||||
resp.hits.hits.forEach(hit => this.docIds.add(hit._id));
|
Sist2Api.getMimeTypes(Sist2Query.searchQuery(doBlankSearch)).then(({mimeMap}) => {
|
||||||
|
this.$store.commit("setUiMimeMap", mimeMap);
|
||||||
|
this.uiLoading = false;
|
||||||
|
this.search(true);
|
||||||
|
});
|
||||||
|
}).catch(error => {
|
||||||
|
console.log(error.response);
|
||||||
|
|
||||||
|
if (error.response.status == 503 || error.response.status == 500) {
|
||||||
|
this.showEsConnectionError = true;
|
||||||
|
this.uiLoading = false;
|
||||||
|
} else {
|
||||||
|
this.showErrorToast();
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
getDateRange(): Promise<{ min: number, max: number }> {
|
methods: {
|
||||||
return sist2.esQuery({
|
...mapActions({
|
||||||
// TODO: filter current selected indices
|
setSist2Info: "setSist2Info",
|
||||||
aggs: {
|
}),
|
||||||
dateMin: {min: {field: "mtime"}},
|
...mapMutations({
|
||||||
dateMax: {max: {field: "mtime"}},
|
setIndices: "setIndices",
|
||||||
|
setDateBoundsMin: "setDateBoundsMin",
|
||||||
|
setDateBoundsMax: "setDateBoundsMax",
|
||||||
|
setTags: "setTags",
|
||||||
|
}),
|
||||||
|
showErrorToast() {
|
||||||
|
this.$bvToast.toast(
|
||||||
|
this.$t("toast.esConnErr"),
|
||||||
|
{
|
||||||
|
title: this.$t("toast.esConnErrTitle"),
|
||||||
|
noAutoHide: true,
|
||||||
|
toaster: "b-toaster-bottom-right",
|
||||||
|
headerClass: "toast-header-error",
|
||||||
|
bodyClass: "toast-body-error",
|
||||||
|
});
|
||||||
},
|
},
|
||||||
size: 0
|
showSyntaxErrorToast: function (): void {
|
||||||
}).then(res => {
|
this.$bvToast.toast(
|
||||||
return {
|
this.$t("toast.esQueryErr"),
|
||||||
min: res.aggregations.dateMin.value,
|
{
|
||||||
max: res.aggregations.dateMax.value,
|
title: this.$t("toast.esQueryErrTitle"),
|
||||||
|
noAutoHide: true,
|
||||||
|
toaster: "b-toaster-bottom-right",
|
||||||
|
headerClass: "toast-header-warning",
|
||||||
|
bodyClass: "toast-body-warning",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
async searchNow(q: any) {
|
||||||
|
this.searchBusy = true;
|
||||||
|
await this.$store.dispatch("incrementQuerySequence");
|
||||||
|
this.$store.commit("busSearch");
|
||||||
|
|
||||||
|
Sist2Api.esQuery(q).then(async (resp: EsResult) => {
|
||||||
|
await this.handleSearch(resp);
|
||||||
|
this.searchBusy = false;
|
||||||
|
}).catch(err => {
|
||||||
|
if (err.response.status === 500 && this.$store.state.optQueryMode === "advanced") {
|
||||||
|
this.showSyntaxErrorToast();
|
||||||
|
} else {
|
||||||
|
this.showErrorToast();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
async clearResults() {
|
||||||
|
this.docs = [];
|
||||||
|
this.docIds.clear();
|
||||||
|
this.docChecksums.clear();
|
||||||
|
await this.$store.dispatch("clearResults");
|
||||||
|
this.$store.commit("setUiReachedScrollEnd", false);
|
||||||
|
},
|
||||||
|
async handleSearch(resp: EsResult) {
|
||||||
|
if (resp.hits.hits.length == 0 || resp.hits.hits.length < this.$store.state.optSize) {
|
||||||
|
this.$store.commit("setUiReachedScrollEnd", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
resp.hits.hits = resp.hits.hits.filter(hit => !this.docIds.has(hit._id));
|
||||||
|
|
||||||
|
if (this.$store.state.optHideDuplicates) {
|
||||||
|
resp.hits.hits = resp.hits.hits.filter(hit => {
|
||||||
|
|
||||||
|
if (!("checksum" in hit._source)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
const isDupe = !this.docChecksums.has(hit._source.checksum);
|
||||||
|
this.docChecksums.add(hit._source.checksum);
|
||||||
|
return isDupe;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const hit of resp.hits.hits) {
|
||||||
|
if (hit._props.isPlayableImage || hit._props.isPlayableVideo) {
|
||||||
|
hit._seq = await this.$store.dispatch("getKeySequence");
|
||||||
|
this.$store.commit("addLightboxSource", {
|
||||||
|
source: `f/${hit._id}`,
|
||||||
|
thumbnail: hit._props.hasThumbnail
|
||||||
|
? `t/${hit._source.index}/${hit._id}`
|
||||||
|
: null,
|
||||||
|
caption: {
|
||||||
|
component: LightboxCaption,
|
||||||
|
props: {hit: hit}
|
||||||
|
},
|
||||||
|
type: hit._props.isVideo ? "video" : "image"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
await this.$store.dispatch("remountLightbox");
|
||||||
|
this.$store.commit("setLastQueryResult", resp);
|
||||||
|
|
||||||
|
this.docs.push(...resp.hits.hits);
|
||||||
|
|
||||||
|
resp.hits.hits.forEach(hit => this.docIds.add(hit._id));
|
||||||
|
},
|
||||||
|
getDateRange(): Promise<{ min: number, max: number }> {
|
||||||
|
return sist2.esQuery({
|
||||||
|
// TODO: filter current selected indices
|
||||||
|
aggs: {
|
||||||
|
dateMin: {min: {field: "mtime"}},
|
||||||
|
dateMax: {max: {field: "mtime"}},
|
||||||
|
},
|
||||||
|
size: 0
|
||||||
|
}).then(res => {
|
||||||
|
return {
|
||||||
|
min: res.aggregations.dateMin.value,
|
||||||
|
max: res.aggregations.dateMax.value,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
appendFunc() {
|
||||||
|
if (!this.$store.state.uiReachedScrollEnd && this.search && !this.searchBusy) {
|
||||||
|
this.searchNow(Sist2Query.searchQuery());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
beforeRouteUpdate(to, from, next) {
|
||||||
|
if (this.$store.state.uiLightboxIsOpen) {
|
||||||
|
this.$store.commit("_setUiShowLightbox", false);
|
||||||
|
next(false);
|
||||||
|
} else {
|
||||||
|
next();
|
||||||
}
|
}
|
||||||
})
|
|
||||||
},
|
},
|
||||||
appendFunc() {
|
|
||||||
if (!this.$store.state.uiReachedScrollEnd && this.search && !this.searchBusy) {
|
|
||||||
this.searchNow(Sist2Query.searchQuery());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
beforeRouteUpdate(to, from, next) {
|
|
||||||
if (this.$store.state.uiLightboxIsOpen) {
|
|
||||||
this.$store.commit("_setUiShowLightbox", false);
|
|
||||||
next(false);
|
|
||||||
} else {
|
|
||||||
next();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
||||||
#search-panel {
|
#search-panel {
|
||||||
box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .08) !important;
|
box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .08) !important;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toast-header-info, .toast-body-info {
|
.toast-header-info, .toast-body-info {
|
||||||
background: #2196f3;
|
background: #2196f3;
|
||||||
color: #fff !important;
|
color: #fff !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toast-header-error, .toast-body-error {
|
.toast-header-error, .toast-body-error {
|
||||||
background: #a94442;
|
background: #a94442;
|
||||||
color: #f2dede !important;
|
color: #f2dede !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toast-header-error {
|
.toast-header-error {
|
||||||
color: #fff !important;
|
color: #fff !important;
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
margin-bottom: -1em;
|
margin-bottom: -1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toast-header-error .close {
|
.toast-header-error .close {
|
||||||
text-shadow: none;
|
text-shadow: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toast-header-warning, .toast-body-warning {
|
.toast-header-warning, .toast-body-warning {
|
||||||
background: #FF8F00;
|
background: #FF8F00;
|
||||||
color: #FFF3E0 !important;
|
color: #FFF3E0 !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
@ -51,11 +51,11 @@
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include "git_hash.h"
|
#include "git_hash.h"
|
||||||
|
|
||||||
#define VERSION "3.0.0"
|
#define VERSION "3.0.1"
|
||||||
static const char *const Version = VERSION;
|
static const char *const Version = VERSION;
|
||||||
static const int VersionMajor = 3;
|
static const int VersionMajor = 3;
|
||||||
static const int VersionMinor = 0;
|
static const int VersionMinor = 0;
|
||||||
static const int VersionPatch = 0;
|
static const int VersionPatch = 1;
|
||||||
|
|
||||||
#ifndef SIST_PLATFORM
|
#ifndef SIST_PLATFORM
|
||||||
#define SIST_PLATFORM unknown
|
#define SIST_PLATFORM unknown
|
||||||
|
@ -668,6 +668,9 @@ static void ev_router(struct mg_connection *nc, int ev, void *ev_data, UNUSED(vo
|
|||||||
mg_send(nc, r->body, r->size);
|
mg_send(nc, r->body, r->size);
|
||||||
} else if (r->status_code == 0) {
|
} else if (r->status_code == 0) {
|
||||||
sist_log("serve.c", LOG_SIST_ERROR, "Could not connect to elasticsearch!");
|
sist_log("serve.c", LOG_SIST_ERROR, "Could not connect to elasticsearch!");
|
||||||
|
|
||||||
|
mg_http_reply(nc, 503, HTTP_SERVER_HEADER HTTP_TEXT_TYPE_HEADER,
|
||||||
|
"Elasticsearch connection error, see server logs.");
|
||||||
} else {
|
} else {
|
||||||
sist_logf("serve.c", LOG_SIST_WARNING, "ElasticSearch error during query (%d)", r->status_code);
|
sist_logf("serve.c", LOG_SIST_WARNING, "ElasticSearch error during query (%d)", r->status_code);
|
||||||
if (r->size != 0) {
|
if (r->size != 0) {
|
||||||
|
2
third-party/libscan/CMakeLists.txt
vendored
2
third-party/libscan/CMakeLists.txt
vendored
@ -106,7 +106,7 @@ find_library(MUPDF_LIB NAMES liblibmupdf.a)
|
|||||||
find_library(CMS_LIB NAMES lcms2)
|
find_library(CMS_LIB NAMES lcms2)
|
||||||
find_library(JAS_LIB NAMES jasper)
|
find_library(JAS_LIB NAMES jasper)
|
||||||
find_library(GUMBO_LIB NAMES gumbo)
|
find_library(GUMBO_LIB NAMES gumbo)
|
||||||
find_library(GOMP_LIB NAMES libgomp.a gomp PATHS /usr/lib/gcc/x86_64-linux-gnu/11/ /usr/lib/gcc/x86_64-linux-gnu/5/ /usr/lib/gcc/x86_64-linux-gnu/9/ /usr/lib/gcc/x86_64-linux-gnu/10/ /usr/lib/gcc/aarch64-linux-gnu/7/ /usr/lib/gcc/aarch64-linux-gnu/9/ /usr/lib/gcc/x86_64-linux-gnu/7/ /usr/lib/gcc/aarch64-linux-gnu/11/)
|
find_library(GOMP_LIB NAMES libgomp.a gomp PATHS /usr/lib/gcc/x86_64-linux-gnu/11/ /usr/lib/gcc/x86_64-linux-gnu/5/ /usr/lib/gcc/x86_64-linux-gnu/9/ /usr/lib/gcc/x86_64-linux-gnu/10/ /usr/lib/gcc/aarch64-linux-gnu/7/ /usr/lib/gcc/aarch64-linux-gnu/9/ /usr/lib/gcc/x86_64-linux-gnu/7/ /usr/lib/gcc/aarch64-linux-gnu/11/ /usr/lib/gcc/x86_64-linux-gnu/8/ /usr/lib/gcc/aarch64-linux-gnu/7/)
|
||||||
find_package(Leptonica CONFIG REQUIRED)
|
find_package(Leptonica CONFIG REQUIRED)
|
||||||
find_package(FFMPEG REQUIRED)
|
find_package(FFMPEG REQUIRED)
|
||||||
find_package(libraw CONFIG REQUIRED)
|
find_package(libraw CONFIG REQUIRED)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user