mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 01:00:29 +08:00
pikvm/pikvm#1312: Option to close GPIO menu after click
This commit is contained in:
parent
5f44ac9f63
commit
b9d425e7dc
@ -383,15 +383,19 @@ class UserGpio:
|
||||
def __make_item_output(self, parts: list[str]) -> dict:
|
||||
assert len(parts) >= 1
|
||||
confirm = False
|
||||
hide = False
|
||||
text = "Click"
|
||||
if len(parts) == 2:
|
||||
text = parts[1]
|
||||
elif len(parts) == 3:
|
||||
confirm = (parts[1] == "confirm")
|
||||
opts = parts[1].split(",")
|
||||
confirm = ("confirm" in opts)
|
||||
hide = ("hide" in opts)
|
||||
text = parts[2]
|
||||
return {
|
||||
"type": UserGpioModes.OUTPUT,
|
||||
"channel": parts[0],
|
||||
"confirm": confirm,
|
||||
"hide": hide,
|
||||
"text": text,
|
||||
}
|
||||
|
||||
@ -150,7 +150,10 @@ export function Gpio(__recorder) {
|
||||
if (item.scheme.pulse.delay) {
|
||||
controls.push(`
|
||||
<td><button disabled id="gpio-button-${item.channel}" class="gpio-button"
|
||||
data-channel="${item.channel}" data-confirm="${confirm}">${item.text}</button></td>
|
||||
${item.hide ? "data-force-hide-menu" : ""}
|
||||
data-channel="${item.channel}" data-confirm="${confirm}">
|
||||
${(item.hide ? "• " : "") + item.text}
|
||||
</button></td>
|
||||
`);
|
||||
}
|
||||
return `<table><tr>${controls.join("<td> </td>")}</tr></table>`;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user