From a39d3dffbe837c15576615656df5a924bcd44831 Mon Sep 17 00:00:00 2001 From: Maxim Devaev Date: Sat, 8 Oct 2022 06:09:33 +0300 Subject: pikvm/pikvm#803: Ability to use LEDs in GPIO title --- web/share/js/kvm/gpio.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'web/share/js/kvm') diff --git a/web/share/js/kvm/gpio.js b/web/share/js/kvm/gpio.js index 15eabd79..08ec42a8 100644 --- a/web/share/js/kvm/gpio.js +++ b/web/share/js/kvm/gpio.js @@ -72,7 +72,16 @@ export function Gpio(__recorder) { self.setModel = function(model) { tools.feature.setEnabled($("gpio-dropdown"), model.view.table.length); if (model.view.table.length) { - $("gpio-menu-button").innerHTML = `${model.view.header.title}`; + let title = []; + let last_is_label = false; + for (let item of model.view.header.title) { + if (last_is_label && item.type === "label") { + title.push(""); + } + last_is_label = (item.type === "label"); + title.push(__createItem(item)); + } + $("gpio-menu-button").innerHTML = title.join(" "); } let content = ""; -- cgit v1.2.3