summaryrefslogtreecommitdiff
path: root/web/share/js/kvm
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2022-10-08 06:09:33 +0300
committerMaxim Devaev <[email protected]>2022-10-08 06:09:33 +0300
commita39d3dffbe837c15576615656df5a924bcd44831 (patch)
tree407258ff32ac271ec2ccf6069a00e56ce1f04722 /web/share/js/kvm
parent16d9c3815f5bb5ba98f0923efc9f0fad8e2f48a2 (diff)
pikvm/pikvm#803: Ability to use LEDs in GPIO title
Diffstat (limited to 'web/share/js/kvm')
-rw-r--r--web/share/js/kvm/gpio.js11
1 files changed, 10 insertions, 1 deletions
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("<span></span>");
+ }
+ last_is_label = (item.type === "label");
+ title.push(__createItem(item));
+ }
+ $("gpio-menu-button").innerHTML = title.join(" ");
}
let content = "<table class=\"kv\">";