This commit is contained in:
simon987 2023-04-15 12:39:47 -04:00
parent ebc9468251
commit 9813646c11
3 changed files with 36 additions and 23 deletions

View File

@ -1,42 +1,46 @@
<template> <template>
<div class="featured-line" v-html="featuredLineHtml"></div> <div class="featured-line" v-html="featuredLineHtml"></div>
</template> </template>
<script> <script>
import {humanDate, humanFileSize} from "@/util"; import {humanDate, humanFileSize} from "@/util";
function scopedEval(context, expr) { function scopedEval(context, expr) {
const evaluator = Function.apply(null, [...Object.keys(context), "expr", "return eval(expr)"]); const evaluator = Function.apply(null, [...Object.keys(context), "expr", "return eval(expr)"]);
return evaluator.apply(null, [...Object.values(context), expr]); return evaluator.apply(null, [...Object.values(context), expr]);
} }
export default { export default {
name: "FeaturedFieldsLine", name: "FeaturedFieldsLine",
props: ["doc"], props: ["doc"],
computed: { computed: {
featuredLineHtml() { featuredLineHtml() {
const scope = {doc: this.doc._source, humanDate: humanDate, humanFileSize: humanFileSize}; if (this.$store.getters.optFeaturedFields === undefined) {
return "";
}
return this.$store.getters.optFeaturedFields const scope = {doc: this.doc._source, humanDate: humanDate, humanFileSize: humanFileSize};
.replaceAll(/\$\{([^}]*)}/g, (match, g1) => {
return scopedEval(scope, g1); return this.$store.getters.optFeaturedFields
}); .replaceAll(/\$\{([^}]*)}/g, (match, g1) => {
return scopedEval(scope, g1);
});
}
} }
}
} }
</script> </script>
<style scoped> <style scoped>
.featured-line { .featured-line {
font-size: 90%; font-size: 90%;
font-family: 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif; font-family: 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif;
color: #424242; color: #424242;
padding-left: 2px; padding-left: 2px;
} }
.theme-black .featured-line { .theme-black .featured-line {
color: #bebebe; color: #bebebe;
} }
</style> </style>

View File

@ -149,7 +149,7 @@ export default Vue.extend({
this.search(true); this.search(true);
}); });
}).catch(error => { }).catch(error => {
console.log(error.response); console.log(error);
if (error.response.status == 503 || error.response.status == 500) { if (error.response.status == 503 || error.response.status == 500) {
this.showEsConnectionError = true; this.showEsConnectionError = true;
@ -267,11 +267,20 @@ export default Vue.extend({
}, },
size: 0 size: 0
}).then(res => { }).then(res => {
return { const range = {
min: res.aggregations.dateMin.value, min: res.aggregations.dateMin.value,
max: res.aggregations.dateMax.value, max: res.aggregations.dateMax.value,
} }
})
if (range.min == null) {
range.min = 0;
range.max = 1;
} else if (range.min == range.max) {
range.max += 1;
}
return range;
});
}, },
appendFunc() { appendFunc() {
if (!this.$store.state.uiReachedScrollEnd && this.search && !this.searchBusy) { if (!this.$store.state.uiReachedScrollEnd && this.search && !this.searchBusy) {

View File

@ -51,11 +51,11 @@
#include <ctype.h> #include <ctype.h>
#include "git_hash.h" #include "git_hash.h"
#define VERSION "3.0.2" #define VERSION "3.0.3"
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 = 1; static const int VersionPatch = 3;
#ifndef SIST_PLATFORM #ifndef SIST_PLATFORM
#define SIST_PLATFORM unknown #define SIST_PLATFORM unknown