fix #9 #15
@ -212,19 +212,24 @@ function buildData(table, images, data, sort, filter, exact_match) {
|
|||||||
data = filterData(data);
|
data = filterData(data);
|
||||||
}
|
}
|
||||||
if (filter) {
|
if (filter) {
|
||||||
if (exact_match) {
|
let test = "", channel = "";
|
||||||
data = data.filter((d) => {
|
const args = filter.split(" ");
|
||||||
const test = d.test === filter;
|
if (args.length > 1) {
|
||||||
const channel = d.channel === filter;
|
test = args[0];
|
||||||
return test || channel;
|
channel = args[1]
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
data = data.filter((d) => {
|
test = filter;
|
||||||
const test = d.test.includes(filter);
|
channel = filter;
|
||||||
const channel = d.channel.includes(filter);
|
|
||||||
return test || channel;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
data = data.filter((d) => {
|
||||||
|
const test_result = exact_match ? d.test === test : d.test.includes(test);
|
||||||
|
const channel_result = exact_match ? d.channel === channel : d.channel.includes(channel);
|
||||||
|
if (args.length > 1) {
|
||||||
|
return test_result && channel_result;
|
||||||
|
} else {
|
||||||
|
return test_result || channel_result;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
table.replaceChildren(...buildTestResultsTable(data));
|
table.replaceChildren(...buildTestResultsTable(data));
|
||||||
|
Loading…
Reference in New Issue
Block a user