Added customui device deselection.

This commit is contained in:
Ylian Saint-Hilaire 2021-05-25 13:08:38 -07:00
parent a1cb07670d
commit 71b351add9
2 changed files with 7 additions and 7 deletions

View File

@ -295,12 +295,8 @@ function CreateMeshRelayEx(parent, ws, req, domain, user, cookie) {
}
}
// Check that both sides have websocket connections
if ((obj.ws == null) || (relayinfo.peer1.ws == null)) {
relayinfo.peer1.close();
obj.close();
return null;
}
// Check that both sides have websocket connections, this should never happen.
if ((obj.ws == null) || (relayinfo.peer1.ws == null)) { relayinfo.peer1.close(); obj.close(); return null; }
// Connect to peer
obj.peer = relayinfo.peer1;

View File

@ -1608,6 +1608,7 @@
if (typeof info.action == 'string') {
if (info.action == 'event') { meshserver.send({ action: 'uicustomevent', section: section, element: id.substring(4), selectedDevices: selectedDevices, logmsg: info.logmsg }); }
if (info.action.startsWith('dialog:')) { showCustomUiDialog(info.action.substring(7), { section: section, element: id.substring(4), selectedDevices: selectedDevices }); }
if (info.deselectdevices) { for (var i = 0; i < elements.length; i++) { elements[i].checked = false; } checkedNodeids = {}; p1updateInfo(); }
}
}
if ((section == 'devicebuttons') || (section == 'desktopbuttons') || (section == 'terminalbuttons') || (section == 'filesbuttons')) {
@ -1657,6 +1658,10 @@
}
}
meshserver.send(t);
if (dialog.deselectdevices) {
var elements = document.getElementsByClassName('DeviceCheckbox')
for (var i = 0; i < elements.length; i++) { elements[i].checked = false; } checkedNodeids = {}; p1updateInfo();
}
}
function adjustPanels() {
@ -14357,7 +14362,6 @@
}
function notificationSelectedEx(n, id) {
console.log(n);
if (n.nodeid != null) {
if (n.tag == 'desktop') gotoDevice(n.nodeid, 12); // Desktop
else if (n.tag == 'terminal') gotoDevice(n.nodeid, 11); // Terminal