mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-31 18:11:54 +08:00
refactoring
This commit is contained in:
@@ -65,17 +65,17 @@ export function Keyboard(__recordWsEvent) {
|
||||
__updateOnlineLeds();
|
||||
};
|
||||
|
||||
self.setState = function(state, hid_online, hid_busy) {
|
||||
self.setState = function(online, leds, hid_online, hid_busy) {
|
||||
if (!hid_online) {
|
||||
__online = null;
|
||||
} else {
|
||||
__online = (state.online && !hid_busy);
|
||||
__online = (online && !hid_busy);
|
||||
}
|
||||
__updateOnlineLeds();
|
||||
|
||||
for (let led of ["caps", "scroll", "num"]) {
|
||||
for (let el of $$$(`.hid-keyboard-${led}-led`)) {
|
||||
if (state.leds[led]) {
|
||||
if (leds[led]) {
|
||||
el.classList.add("led-green");
|
||||
el.classList.remove("led-gray");
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user