Collapse/expand improvements and fixes.

Ylian Saint-Hilaire committed May 6, 2021 at 19:34 UTC a62d70eb9d0a2a7a9f33ff8bd4940965f3c285b3
5 files changed +27 -30
MeshCentralServer.njsproj
-1
@@ -555,7 +555,6 @@
555 <Content Include="views\agentinvite.handlebars" />
556 <Content Include="views\default-mobile.handlebars" />
557 <Content Include="views\default.handlebars" />
558 - <Content Include="views\desktop.handlebars" />
558 <Content Include="views\download.handlebars" />
559 <Content Include="views\download2.handlebars" />
560 <Content Include="views\error404-mobile.handlebars" />
public/images/icon-collapse.png
Binary files /dev/null and b/public/images/icon-collapse.png differ
public/images/icon-expand.png
Binary files /dev/null and b/public/images/icon-expand.png differ
translate/translate.json
+10 -6
@@ -6216,7 +6216,7 @@
6216 "zh-chs": "自动",
6217 "zh-cht": "自動",
6218 "xloc": [
6219 - "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->kvmListToolbar->5"
6219 + "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->kvmListToolbar->9"
6220 ]
6221 },
6222 {
@@ -6300,7 +6300,7 @@
6300 "zh-chs": "自动连接",
6301 "zh-cht": "自動連接",
6302 "xloc": [
6303 - "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->kvmListToolbar->5"
6303 + "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->kvmListToolbar->9"
6304 ]
6305 },
6306 {
@@ -8746,6 +8746,8 @@
8746 "zh-chs": "全部收缩",
8747 "zh-cht": "全部收縮",
8748 "xloc": [
8749 + "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar",
8750 + "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->kvmListToolbar",
8751 "default.handlebars->expandAllContextMenu->3"
8752 ]
8753 },
@@ -16375,6 +16377,8 @@
16377 "zh-chs": "展开全部",
16378 "zh-cht": "展開全部",
16379 "xloc": [
16380 + "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar",
16381 + "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->kvmListToolbar",
16382 "default.handlebars->expandAllContextMenu->1"
16383 ]
16384 },
@@ -28589,7 +28593,7 @@
28593 "xloc": [
28594 "default-mobile.handlebars->container->page_content->column_l->p2->xdevicesBar->1->5",
28595 "default.handlebars->31->642",
28592 - "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar->11->1"
28596 + "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar->15->1"
28597 ]
28598 },
28599 {
@@ -28773,7 +28777,7 @@
28777 "zh-cht": "線上",
28778 "xloc": [
28779 "default-mobile.handlebars->container->page_content->column_l->p2->xdevicesBar->1->7",
28776 - "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar->13->1",
28780 + "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar->17->1",
28781 "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar->DevFilterSelect->3"
28782 ]
28783 },
@@ -28837,7 +28841,7 @@
28841 "zh-chs": "仅显示在线设备",
28842 "zh-cht": "只顯示在線裝置",
28843 "xloc": [
28840 - "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar->13"
28844 + "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar->17"
28845 ]
28846 },
28847 {
@@ -36776,7 +36780,7 @@
36780 "zh-chs": "显示设备操作系统名称",
36781 "zh-cht": "顯示裝置操作系統名稱",
36782 "xloc": [
36779 - "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar->11"
36783 + "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar->15"
36784 ]
36785 },
36786 {
views/default.handlebars
+17 -23
@@ -255,8 +255,8 @@
255 <tr>
256 <td class=h1></td>
257 <td id=devListToolbar class=style14 style="display:none">
258 - &nbsp;&nbsp;
259 - <input type="button" id="CollapseAllButton" onclick="collapseallButtonFunction();" value="Collapse All" />&nbsp;
258 + <img style="cursor:pointer;margin-top:4px;display:none" title="Collapse All" id="CollapseAllButton" src="images/icon-collapse.png" loading=lazy width=9 height=11 onclick="cmexpandaction(2)" />
259 + <img style="cursor:pointer;margin-top:4px;display:none" title="Expand All" id="ExpandAllButton" src="images/icon-expand.png" loading=lazy width=9 height=11 onclick="cmexpandaction(1)" />
260 <input type="button" id="SelectAllButton" onclick="selectallButtonFunction();" value="Select All" />&nbsp;
261 <input type=button id=GroupActionButton disabled="disabled" value="Group Action" onclick=groupActionFunction() />&nbsp;
262 <input id=SearchInput type=search autocomplete=off placeholder=Filter onchange=onDeviceSearchChanged(event) onkeyup=onDeviceSearchChanged(event) onfocus=onSearchFocus(1) onblur=onSearchFocus(0) />&nbsp;
@@ -277,7 +277,9 @@
277 <span id="devsCustomUIBar"></span>
278 </td>
279 <td id=kvmListToolbar class=style14 style="display:none">
280 - &nbsp;&nbsp;<input type="button" onclick="connectAllKvmFunction()" value="Connect All" />&nbsp;
280 + <img style="cursor:pointer;margin-top:4px;display:none" title="Collapse All" id="CollapseAllButton2" src="images/icon-collapse.png" loading=lazy width=9 height=11 onclick="cmexpandaction(2)" />
281 + <img style="cursor:pointer;margin-top:4px;display:none" title="Expand All" id="ExpandAllButton2" src="images/icon-expand.png" loading=lazy width=9 height=11 onclick="cmexpandaction(1)" />
282 + <input type="button" onclick="connectAllKvmFunction()" value="Connect All" />&nbsp;
283 <input type="button" onclick="disconnectAllKvmFunction()" value="Disconnect All" />&nbsp;
284 <label><input type="checkbox" id="autoConnectDesktopCheckbox" onclick="autoConnectDesktops(event)" title="Automatic connect" />Auto&nbsp;</label>
285 <input type="button" onclick="showMultiDesktopSettings()" value="Settings" />&nbsp;
@@ -1574,7 +1576,7 @@
1576 updateDeskShortcutKeys();
1577
1578 // Override the collapse button text
1577 - updateCollapseallButtonText();
1579 + updateCollapseAllButton();
1580 }
1581
1582 function refreshCookieSession() {
@@ -3875,12 +3877,12 @@
3877 r += '<td><div style=padding:10px><i>' + "No Intel&reg; AMT devices in this device group";
3878 if ((meshrights & 4) != 0) { r += ', <a href=# style=cursor:pointer onclick=\'return addDeviceToMesh("' + mesh._id + '")\'>' + "add one" + '</a>'; }
3879 } else if (mesh.mtype == 2) {
3878 - r += '<td>';
3879 - r += '<div id=DevxCol' + deviceHeaderId2 + ((collapsed === true)?' style=display:none':'') + '>'; // Open collapse div
3880 + r += '<td><div id=DevxCol' + deviceHeaderId2 + ((collapsed === true)?' style=display:none':'') + '>'; // Open collapse div
3881 r += '<div style=padding:10px><i>' + "No devices in this device group";
3882 if ((meshrights & 4) != 0) { r += ', <a href=# style=cursor:pointer onclick=\'return addAgentToMesh("' + mesh._id + '")\'>' + "add one" + '</a>'; }
3883 } else if (mesh.mtype == 3) {
3883 - r += '<td><div style=padding:10px><i>' + "No local devices in this device group";
3884 + r += '<td><div id=DevxCol' + deviceHeaderId2 + ((collapsed === true)?' style=display:none':'') + '>'; // Open collapse div
3885 + r += '<div style=padding:10px><i>' + "No local devices in this device group";
3886 if ((meshrights & 4) != 0) { r += ', <a href=# style=cursor:pointer onclick=\'return addLocalDeviceToMesh("' + mesh._id + '")\'>' + "add one" + '</a>'; }
3887 }
3888 r += '.</i></div></td>';
@@ -4316,7 +4318,7 @@
4318 }
4319 Q('DevxColImg' + id).src = x?'images/c2.png':'images/c1.png';
4320 putstore('_collapse', JSON.stringify(CollapsedGroups));
4319 - updateCollapseallButtonText();
4321 + updateCollapseAllButton();
4322 onDevicesScrollEx();
4323 }
4324
@@ -4857,20 +4859,12 @@
4859 return "Unknown";
4860 }
4861
4860 - function collapseallButtonFunction() {
4861 - if (Q('CollapseAllButton').value == "Collapse All") {
4862 - cmexpandaction(2);
4863 - } else {
4864 - cmexpandaction(1);
4865 - }
4866 - }
4867 -
4868 - function updateCollapseallButtonText() {
4869 - if ((JSON.stringify(getstore('_collapse', '{}')).length - 4) > 0) {
4870 - Q('CollapseAllButton').value = "Expand All";
4871 - } else {
4872 - Q('CollapseAllButton').value = "Collapse All";
4873 - }
4862 + function updateCollapseAllButton() {
4863 + var x = (Object.keys(CollapsedGroups).length > 0)
4864 + QV('CollapseAllButton', !x);
4865 + QV('ExpandAllButton', x);
4866 + QV('CollapseAllButton2', !x);
4867 + QV('ExpandAllButton2', x);
4868 }
4869
4870 function selectallButtonFunction() {
@@ -5478,7 +5472,7 @@
5472 }
5473 }
5474 putstore('_collapse', JSON.stringify(CollapsedGroups));
5481 - updateCollapseallButtonText();
5475 + updateCollapseAllButton();
5476 mainUpdate(4);
5477 }
5478