ui: Don't show filters when there is only one item

This commit is contained in:
Jeremy Wall 2024-02-25 09:03:18 -05:00
parent 557d704a1b
commit ac52aea6c8

View File

@ -208,9 +208,13 @@ class TimeseriesGraph extends HTMLElement {
// We need to maintain a stable order for these
var children = [];
for (var key of Object.keys(this.#filterLabels).sort()) {
// If there are multiple items to filter by then show the selectElement.
// otherwise there is no point.
if (this.#filterLabels[key].length > 1) {
const element = this.#filterSelectElements[key] || this.buildSelectElement(key);
children.push(element);
}
}
this.#menuContainer.replaceChildren(...children);
}