fix #9 #15

Merged
provod merged 3 commits from NightFox/HLRTest:master into master 2024-02-16 01:30:18 +01:00
Showing only changes of commit a25dee6640 - Show all commits

View File

@ -212,19 +212,24 @@ function buildData(table, images, data, sort, filter, exact_match) {
data = filterData(data);
}
if (filter) {
if (exact_match) {
data = data.filter((d) => {
const test = d.test === filter;
const channel = d.channel === filter;
return test || channel;
});
let test = "", channel = "";
const args = filter.split(" ");
if (args.length > 1) {
test = args[0];
channel = args[1]
} else {
data = data.filter((d) => {
const test = d.test.includes(filter);
const channel = d.channel.includes(filter);
return test || channel;
});
test = filter;
channel = filter;
}
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));