Improved online only filter

Ylian Saint-Hilaire committed May 9, 2020 at 12:12 UTC 753605eb248d67b963d8ae504e18aaf14ad47451
1 file changed +8 -3
views/default.handlebars
+8 -3
@@ -232,7 +232,7 @@
232 <input type=button id=GroupActionButton disabled="disabled" value="Group Action" onclick=groupActionFunction() />&nbsp;
233 <input id=SearchInput type=text placeholder=Filter onchange=onDeviceSearchChanged(event) onkeyup=onDeviceSearchChanged(event) autocomplete=off onfocus=onSearchFocus(1) onblur=onSearchFocus(0) />&nbsp;
234 <label><input type=checkbox id=RealNameCheckBox onclick=onRealNameCheckBox() /><span title="Show devices operating system name">OS Name</span></label>
235 - <label><input type=checkbox id=OnlineCheckBox onclick=onDeviceSearchChanged(event) /><span title="Only show devices that are online">Online</span></label>
235 + <label><input type=checkbox id=OnlineCheckBox onclick=onOnlineCheckBox(event) /><span title="Only show devices that are online">Online</span></label>
236 </td>
237 <td id=kvmListToolbar class=style14 style="display:none">
238 &nbsp;&nbsp;<input type="button" onclick="connectAllKvmFunction()" value="Connect All" />&nbsp;
@@ -1330,6 +1330,7 @@
1330 Q('KvmSearchInput').value = Q('SearchInput').value = getstore('_search', '');
1331 showRealNames = (getstore('showRealNames', 0) == 1);
1332 Q('RealNameCheckBox').checked = showRealNames;
1333 + Q('OnlineCheckBox').checked = (getstore('onlineOnly', 0) == 1);
1334 Q('viewselect').value = getstore('deviceView', 1);
1335 Q('DeskControl').checked = (getstore('DeskControl', 1) == 1);
1336 QV('accountChangeEmailAddressSpan', (features & 0x200000) == 0);
@@ -2642,7 +2643,7 @@
2643 node.lastconnect = Date.now();
2644
2645 // Web page update
2645 - masterUpdate(4 | 16);
2646 + masterUpdate(1 | 4 | 16);
2647 refreshDevice(node._id);
2648 }
2649 break;
@@ -2870,7 +2871,11 @@
2871 showRealNames = Q('RealNameCheckBox').checked;
2872 putstore('showRealNames', showRealNames ? 1 : 0);
2873 masterUpdate(6);
2873 - return;
2874 + }
2875 +
2876 + function onOnlineCheckBox(e) {
2877 + putstore('onlineOnly', Q('OnlineCheckBox').checked ? 1 : 0);
2878 + onDeviceSearchChanged(e);
2879 }
2880
2881 function onDeviceViewChange(i) {