mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 01:00:29 +08:00
nowait
This commit is contained in:
parent
7baf4bc07e
commit
cee24e56d2
@ -99,8 +99,7 @@ export function Gpio() {
|
|||||||
tools.setOnClick($(`gpio-switch-${channel}`), () => __switchChannel(channel));
|
tools.setOnClick($(`gpio-switch-${channel}`), () => __switchChannel(channel));
|
||||||
}
|
}
|
||||||
for (let channel of buttons) {
|
for (let channel of buttons) {
|
||||||
let wait = (model.scheme.outputs[channel].pulse.delay <= 1);
|
tools.setOnClick($(`gpio-button-${channel}`), () => __pulseChannel(channel));
|
||||||
tools.setOnClick($(`gpio-button-${channel}`), () => __pulseChannel(channel, wait));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
self.setState(__state);
|
self.setState(__state);
|
||||||
@ -150,8 +149,8 @@ export function Gpio() {
|
|||||||
__sendPost(`/api/gpio/switch?channel=${channel}&state=${to}`);
|
__sendPost(`/api/gpio/switch?channel=${channel}&state=${to}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
var __pulseChannel = function(channel, wait) {
|
var __pulseChannel = function(channel) {
|
||||||
__sendPost(`/api/gpio/pulse?channel=${channel}&wait=${wait ? "1" : "0"}`);
|
__sendPost(`/api/gpio/pulse?channel=${channel}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
var __sendPost = function(url) {
|
var __sendPost = function(url) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user