diff --git a/package.json b/package.json index f5966821..00057982 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "meshcentral", - "version": "0.4.6-m", + "version": "0.4.6-n", "keywords": [ "Remote Management", "Intel AMT", diff --git a/public/images/c1.png b/public/images/c1.png new file mode 100644 index 00000000..56f8cec6 Binary files /dev/null and b/public/images/c1.png differ diff --git a/public/images/c2.png b/public/images/c2.png new file mode 100644 index 00000000..8883ca4a Binary files /dev/null and b/public/images/c2.png differ diff --git a/views/default.handlebars b/views/default.handlebars index 61b1afb0..38cf5d9b 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -2785,6 +2785,7 @@ if (sort == 0) { // Mesh header if (node.meshid != current) { + if ((view == 1) && (current != null)) { r += ''; } // Close collapse div deviceHeaderSet(); var extra = ''; if (view == 2) { r += ''; } @@ -2793,11 +2794,15 @@ if (view == 2) { r += '
'; } r += '
'; r += '' + extra; - r += '' + EscapeHtml(meshes[node.meshid].name) + '' + getMeshActions(mesh2, meshrights) + '
'; + r += ''; + var collapsed = CollapsedGroups[node.meshid]; + r += ''; // Collapse action + r += '' + EscapeHtml(meshes[node.meshid].name) + '' + getMeshActions(mesh2, meshrights) + '
'; if (view == 2) { r += ''; } current = node.meshid; displayedMeshes[current] = 1; c = 0; + if (view == 1) { r += '
'; } // Open collapse div } } else if (sort == 1) { // Power header @@ -2876,6 +2881,8 @@ if (typeof deviceHeaderCount[node.state] == 'undefined') { deviceHeaderCount[node.state] = 1; } else { deviceHeaderCount[node.state]++; } } + if ((view == 1) && (current != null)) { r += '
'; } // Close collapse div + // Above 32 devices, gray out the auto connect feature. if (kvmDivs.length >= 32) { Q('autoConnectDesktopCheckbox').checked = false; } QE('autoConnectDesktopCheckbox', kvmDivs.length < 32); @@ -2908,13 +2915,21 @@ // Display all empty device groups, we need to do this because users can add devices to these at any time. if ((sort == 0) && (Q('SearchInput').value == '') && (view < 3)) { + var deviceHeaderId2 = deviceHeaderId; for (var i in meshes) { var mesh = meshes[i], meshlink = mesh.links[userinfo._id]; if (meshlink != null) { var meshrights = meshlink.rights; if (displayedMeshes[mesh._id] == null) { if ((current != '') && (r != '')) { r += ''; } - r += '
' + EscapeHtml(mesh.name) + ''; + r += ''; if (mesh.mtype == 1) { @@ -2922,10 +2937,14 @@ if ((meshrights & 4) != 0) { r += ', ' + "add one" + ''; } } if (mesh.mtype == 2) { - r += ''; + if (view == 1) { r += ''; } // End collapsing area + current = mesh._id; count++; } @@ -3036,6 +3055,14 @@ oldviewmode = view; } + var CollapsedGroups = {}; + function toggleCollapseGroup(id, id2) { + var x = (QS('DevxCol' + id)['display'] == 'none'); + if (x) { delete CollapsedGroups[id2]; } else { CollapsedGroups[id2] = true; } + Q('DevxColImg' + id).src = x?'images/c2.png':'images/c1.png'; + QV('DevxCol' + id, x); + } + function toggleKvmDevice(node) { if (typeof node == 'string') { node = getNodeFromId(node); } // Convert nodeid to node if needed var mesh = meshes[node.meshid], meshrights = mesh.links[userinfo._id].rights;
'; + + // Collapsing header & start collapsing area + deviceHeaderId2++; + var collapsed = CollapsedGroups[mesh._id]; + r += ''; // Collapse action + + r += '' + EscapeHtml(mesh.name) + ''; r += getMeshActions(mesh, meshrights); r += '
' + "No devices in this group"; + r += '
'; + if (view == 1) { r += '
'; } // Open collapse div + r += '
' + "No devices in this group"; if ((meshrights & 4) != 0) { r += ', ' + "add one" + ''; } } r += '.