Skip to content

Commit

Permalink
Fix #343
Browse files Browse the repository at this point in the history
  • Loading branch information
simon987 committed Apr 15, 2023
1 parent ebc9468 commit 9813646
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 24 deletions.
42 changes: 23 additions & 19 deletions sist2-vue/src/components/FeaturedFieldsLine.vue
Original file line number Diff line number Diff line change
@@ -1,42 +1,46 @@
<template>
<div class="featured-line" v-html="featuredLineHtml"></div>
<div class="featured-line" v-html="featuredLineHtml"></div>
</template>

<script>
import {humanDate, humanFileSize} from "@/util";
function scopedEval(context, expr) {
const evaluator = Function.apply(null, [...Object.keys(context), "expr", "return eval(expr)"]);
return evaluator.apply(null, [...Object.values(context), expr]);
const evaluator = Function.apply(null, [...Object.keys(context), "expr", "return eval(expr)"]);
return evaluator.apply(null, [...Object.values(context), expr]);
}
export default {
name: "FeaturedFieldsLine",
props: ["doc"],
computed: {
featuredLineHtml() {
const scope = {doc: this.doc._source, humanDate: humanDate, humanFileSize: humanFileSize};
return this.$store.getters.optFeaturedFields
.replaceAll(/\$\{([^}]*)}/g, (match, g1) => {
return scopedEval(scope, g1);
});
name: "FeaturedFieldsLine",
props: ["doc"],
computed: {
featuredLineHtml() {
if (this.$store.getters.optFeaturedFields === undefined) {
return "";
}
const scope = {doc: this.doc._source, humanDate: humanDate, humanFileSize: humanFileSize};
return this.$store.getters.optFeaturedFields
.replaceAll(/\$\{([^}]*)}/g, (match, g1) => {
return scopedEval(scope, g1);
});
}
}
}
}
</script>

<style scoped>
.featured-line {
font-size: 90%;
font-family: 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif;
color: #424242;
padding-left: 2px;
font-size: 90%;
font-family: 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif;
color: #424242;
padding-left: 2px;
}
.theme-black .featured-line {
color: #bebebe;
color: #bebebe;
}
</style>
15 changes: 12 additions & 3 deletions sist2-vue/src/views/SearchPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export default Vue.extend({
this.search(true);
});
}).catch(error => {
console.log(error.response);
console.log(error);
if (error.response.status == 503 || error.response.status == 500) {
this.showEsConnectionError = true;
Expand Down Expand Up @@ -267,11 +267,20 @@ export default Vue.extend({
},
size: 0
}).then(res => {
return {
const range = {
min: res.aggregations.dateMin.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() {
if (!this.$store.state.uiReachedScrollEnd && this.search && !this.searchBusy) {
Expand Down
4 changes: 2 additions & 2 deletions src/sist.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@
#include <ctype.h>
#include "git_hash.h"

#define VERSION "3.0.2"
#define VERSION "3.0.3"
static const char *const Version = VERSION;
static const int VersionMajor = 3;
static const int VersionMinor = 0;
static const int VersionPatch = 1;
static const int VersionPatch = 3;

#ifndef SIST_PLATFORM
#define SIST_PLATFORM unknown
Expand Down

0 comments on commit 9813646

Please sign in to comment.