Tag tree fix for #64, validate required argument in exec-script

This commit is contained in:
2020-06-25 20:11:30 -04:00
parent d3c8928fe8
commit 8ffe780ab2
11 changed files with 70 additions and 19 deletions

View File

@@ -512,3 +512,7 @@ svg {
#graphs-card svg text {
fill: #eee;
}
.wholerow {
outline: none !important;
}

View File

@@ -375,3 +375,7 @@ mark {
float: right;
margin-bottom: 10px;
}
.wholerow {
outline: none !important;
}

File diff suppressed because one or more lines are too long

View File

@@ -160,7 +160,7 @@ function getTags(hit, mimeCategory) {
if (tokens.length > 1) {
const bg = "#" + tokens[1];
const fg = lum(tokens[1]) > 40 ? "#000" : "#fff";
const fg = lum(tokens[1]) > 50 ? "#000" : "#fff";
userTag.setAttribute("style", `background-color: ${bg}; color: ${fg}`);
}

View File

@@ -234,6 +234,9 @@ $.jsonPost("es", {
selection: {
mode: 'checkbox'
},
checkbox: {
autoCheckChildren: false
},
data: tagMap
});
new InspireTreeDOM(tagTree, {
@@ -251,7 +254,47 @@ function addTag(map, tag, id, count) {
id: id,
text: tags.length !== 1 ? tags[0] : `${tags[0]} (${count})`,
name: tags[0],
children: []
children: [],
isLeaf: tags.length === 1,
//Overwrite base functions
blur: function() {},
select: function() {
this.state("selected", true);
return this.check()
},
deselect: function() {
this.state("selected", false);
return this.uncheck()
},
uncheck: function () {
if (!this.isLeaf) {
return;
}
baseStateChange('checked', false, 'unchecked', this, false);
this.state('indeterminate', false);
if (this.hasParent()) {
this.getParent().refreshIndeterminateState();
}
this._tree.end();
return this;
},
check: function () {
if (!this.isLeaf) {
return;
}
baseStateChange('checked', true, 'checked', this, false);
if (this.hasParent()) {
this.getParent().refreshIndeterminateState();
}
this._tree.end();
return this;
}
};
let found = false;
@@ -374,7 +417,7 @@ function search(after = null) {
let tags = getSelectedNodes(tagTree);
if (!tags.includes("any")) {
filters.push({terms: {"tag": tags}});
tags.forEach(term => filters.push({term: {"tag": term}}))
}
if (date_min && date_max) {

View File

@@ -11,7 +11,7 @@
<nav class="navbar navbar-expand-lg">
<a class="navbar-brand" href="/">sist2</a>
<span class="badge badge-pill version">2.5.0</span>
<span class="badge badge-pill version">2.5.1</span>
<span class="tagline">Lightning-fast file system indexer and search tool </span>
<a class="btn ml-auto" href="/stats">Stats</a>
<button class="btn" type="button" data-toggle="modal" data-target="#settings" onclick="loadSettings()">Settings</button>

View File

@@ -10,7 +10,7 @@
<nav class="navbar navbar-expand-lg">
<a class="navbar-brand" href="/">sist2</a>
<span class="badge badge-pill version">2.5.0</span>
<span class="badge badge-pill version">2.5.1</span>
<span class="tagline">Lightning-fast file system indexer and search tool </span>
<a style="margin-left: auto" class="btn" href="/">Back</a>
<button class="btn" type="button" data-toggle="modal" data-target="#settings"