1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Collapse/expand improvements and fixes.

This commit is contained in:
Ylian Saint-Hilaire 2021-05-06 19:34:46 -07:00
parent a76265ca6f
commit a62d70eb9d
5 changed files with 27 additions and 30 deletions

View file

@ -255,8 +255,8 @@
<tr>
<td class=h1></td>
<td id=devListToolbar class=style14 style="display:none">
&nbsp;&nbsp;
<input type="button" id="CollapseAllButton" onclick="collapseallButtonFunction();" value="Collapse All" />&nbsp;
<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)" />
<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)" />
<input type="button" id="SelectAllButton" onclick="selectallButtonFunction();" value="Select All" />&nbsp;
<input type=button id=GroupActionButton disabled="disabled" value="Group Action" onclick=groupActionFunction() />&nbsp;
<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 @@
<span id="devsCustomUIBar"></span>
</td>
<td id=kvmListToolbar class=style14 style="display:none">
&nbsp;&nbsp;<input type="button" onclick="connectAllKvmFunction()" value="Connect All" />&nbsp;
<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)" />
<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)" />
<input type="button" onclick="connectAllKvmFunction()" value="Connect All" />&nbsp;
<input type="button" onclick="disconnectAllKvmFunction()" value="Disconnect All" />&nbsp;
<label><input type="checkbox" id="autoConnectDesktopCheckbox" onclick="autoConnectDesktops(event)" title="Automatic connect" />Auto&nbsp;</label>
<input type="button" onclick="showMultiDesktopSettings()" value="Settings" />&nbsp;
@ -1574,7 +1576,7 @@
updateDeskShortcutKeys();
// Override the collapse button text
updateCollapseallButtonText();
updateCollapseAllButton();
}
function refreshCookieSession() {
@ -3875,12 +3877,12 @@
r += '<td><div style=padding:10px><i>' + "No Intel&reg; AMT devices in this device group";
if ((meshrights & 4) != 0) { r += ', <a href=# style=cursor:pointer onclick=\'return addDeviceToMesh("' + mesh._id + '")\'>' + "add one" + '</a>'; }
} else if (mesh.mtype == 2) {
r += '<td>';
r += '<div id=DevxCol' + deviceHeaderId2 + ((collapsed === true)?' style=display:none':'') + '>'; // Open collapse div
r += '<td><div id=DevxCol' + deviceHeaderId2 + ((collapsed === true)?' style=display:none':'') + '>'; // Open collapse div
r += '<div style=padding:10px><i>' + "No devices in this device group";
if ((meshrights & 4) != 0) { r += ', <a href=# style=cursor:pointer onclick=\'return addAgentToMesh("' + mesh._id + '")\'>' + "add one" + '</a>'; }
} else if (mesh.mtype == 3) {
r += '<td><div style=padding:10px><i>' + "No local devices in this device group";
r += '<td><div id=DevxCol' + deviceHeaderId2 + ((collapsed === true)?' style=display:none':'') + '>'; // Open collapse div
r += '<div style=padding:10px><i>' + "No local devices in this device group";
if ((meshrights & 4) != 0) { r += ', <a href=# style=cursor:pointer onclick=\'return addLocalDeviceToMesh("' + mesh._id + '")\'>' + "add one" + '</a>'; }
}
r += '.</i></div></td>';
@ -4316,7 +4318,7 @@
}
Q('DevxColImg' + id).src = x?'images/c2.png':'images/c1.png';
putstore('_collapse', JSON.stringify(CollapsedGroups));
updateCollapseallButtonText();
updateCollapseAllButton();
onDevicesScrollEx();
}
@ -4857,20 +4859,12 @@
return "Unknown";
}
function collapseallButtonFunction() {
if (Q('CollapseAllButton').value == "Collapse All") {
cmexpandaction(2);
} else {
cmexpandaction(1);
}
}
function updateCollapseallButtonText() {
if ((JSON.stringify(getstore('_collapse', '{}')).length - 4) > 0) {
Q('CollapseAllButton').value = "Expand All";
} else {
Q('CollapseAllButton').value = "Collapse All";
}
function updateCollapseAllButton() {
var x = (Object.keys(CollapsedGroups).length > 0)
QV('CollapseAllButton', !x);
QV('ExpandAllButton', x);
QV('CollapseAllButton2', !x);
QV('ExpandAllButton2', x);
}
function selectallButtonFunction() {
@ -5478,7 +5472,7 @@
}
}
putstore('_collapse', JSON.stringify(CollapsedGroups));
updateCollapseallButtonText();
updateCollapseAllButton();
mainUpdate(4);
}