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:
		
							parent
							
								
									a76265ca6f
								
							
						
					
					
						commit
						a62d70eb9d
					
				
					 5 changed files with 27 additions and 30 deletions
				
			
		| 
						 | 
					@ -555,7 +555,6 @@
 | 
				
			||||||
    <Content Include="views\agentinvite.handlebars" />
 | 
					    <Content Include="views\agentinvite.handlebars" />
 | 
				
			||||||
    <Content Include="views\default-mobile.handlebars" />
 | 
					    <Content Include="views\default-mobile.handlebars" />
 | 
				
			||||||
    <Content Include="views\default.handlebars" />
 | 
					    <Content Include="views\default.handlebars" />
 | 
				
			||||||
    <Content Include="views\desktop.handlebars" />
 | 
					 | 
				
			||||||
    <Content Include="views\download.handlebars" />
 | 
					    <Content Include="views\download.handlebars" />
 | 
				
			||||||
    <Content Include="views\download2.handlebars" />
 | 
					    <Content Include="views\download2.handlebars" />
 | 
				
			||||||
    <Content Include="views\error404-mobile.handlebars" />
 | 
					    <Content Include="views\error404-mobile.handlebars" />
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										
											BIN
										
									
								
								public/images/icon-collapse.png
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								public/images/icon-collapse.png
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 185 B  | 
							
								
								
									
										
											BIN
										
									
								
								public/images/icon-expand.png
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								public/images/icon-expand.png
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 189 B  | 
| 
						 | 
					@ -6216,7 +6216,7 @@
 | 
				
			||||||
      "zh-chs": "自动",
 | 
					      "zh-chs": "自动",
 | 
				
			||||||
      "zh-cht": "自動",
 | 
					      "zh-cht": "自動",
 | 
				
			||||||
      "xloc": [
 | 
					      "xloc": [
 | 
				
			||||||
        "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->kvmListToolbar->5"
 | 
					        "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->kvmListToolbar->9"
 | 
				
			||||||
      ]
 | 
					      ]
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
| 
						 | 
					@ -6300,7 +6300,7 @@
 | 
				
			||||||
      "zh-chs": "自动连接",
 | 
					      "zh-chs": "自动连接",
 | 
				
			||||||
      "zh-cht": "自動連接",
 | 
					      "zh-cht": "自動連接",
 | 
				
			||||||
      "xloc": [
 | 
					      "xloc": [
 | 
				
			||||||
        "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->kvmListToolbar->5"
 | 
					        "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->kvmListToolbar->9"
 | 
				
			||||||
      ]
 | 
					      ]
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
| 
						 | 
					@ -8746,6 +8746,8 @@
 | 
				
			||||||
      "zh-chs": "全部收缩",
 | 
					      "zh-chs": "全部收缩",
 | 
				
			||||||
      "zh-cht": "全部收縮",
 | 
					      "zh-cht": "全部收縮",
 | 
				
			||||||
      "xloc": [
 | 
					      "xloc": [
 | 
				
			||||||
 | 
					        "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar",
 | 
				
			||||||
 | 
					        "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->kvmListToolbar",
 | 
				
			||||||
        "default.handlebars->expandAllContextMenu->3"
 | 
					        "default.handlebars->expandAllContextMenu->3"
 | 
				
			||||||
      ]
 | 
					      ]
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
| 
						 | 
					@ -16375,6 +16377,8 @@
 | 
				
			||||||
      "zh-chs": "展开全部",
 | 
					      "zh-chs": "展开全部",
 | 
				
			||||||
      "zh-cht": "展開全部",
 | 
					      "zh-cht": "展開全部",
 | 
				
			||||||
      "xloc": [
 | 
					      "xloc": [
 | 
				
			||||||
 | 
					        "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar",
 | 
				
			||||||
 | 
					        "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->kvmListToolbar",
 | 
				
			||||||
        "default.handlebars->expandAllContextMenu->1"
 | 
					        "default.handlebars->expandAllContextMenu->1"
 | 
				
			||||||
      ]
 | 
					      ]
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
| 
						 | 
					@ -28589,7 +28593,7 @@
 | 
				
			||||||
      "xloc": [
 | 
					      "xloc": [
 | 
				
			||||||
        "default-mobile.handlebars->container->page_content->column_l->p2->xdevicesBar->1->5",
 | 
					        "default-mobile.handlebars->container->page_content->column_l->p2->xdevicesBar->1->5",
 | 
				
			||||||
        "default.handlebars->31->642",
 | 
					        "default.handlebars->31->642",
 | 
				
			||||||
        "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar->11->1"
 | 
					        "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar->15->1"
 | 
				
			||||||
      ]
 | 
					      ]
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
| 
						 | 
					@ -28773,7 +28777,7 @@
 | 
				
			||||||
      "zh-cht": "線上",
 | 
					      "zh-cht": "線上",
 | 
				
			||||||
      "xloc": [
 | 
					      "xloc": [
 | 
				
			||||||
        "default-mobile.handlebars->container->page_content->column_l->p2->xdevicesBar->1->7",
 | 
					        "default-mobile.handlebars->container->page_content->column_l->p2->xdevicesBar->1->7",
 | 
				
			||||||
        "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar->13->1",
 | 
					        "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar->17->1",
 | 
				
			||||||
        "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar->DevFilterSelect->3"
 | 
					        "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar->DevFilterSelect->3"
 | 
				
			||||||
      ]
 | 
					      ]
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
| 
						 | 
					@ -28837,7 +28841,7 @@
 | 
				
			||||||
      "zh-chs": "仅显示在线设备",
 | 
					      "zh-chs": "仅显示在线设备",
 | 
				
			||||||
      "zh-cht": "只顯示在線裝置",
 | 
					      "zh-cht": "只顯示在線裝置",
 | 
				
			||||||
      "xloc": [
 | 
					      "xloc": [
 | 
				
			||||||
        "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar->13"
 | 
					        "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar->17"
 | 
				
			||||||
      ]
 | 
					      ]
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
| 
						 | 
					@ -36776,7 +36780,7 @@
 | 
				
			||||||
      "zh-chs": "显示设备操作系统名称",
 | 
					      "zh-chs": "显示设备操作系统名称",
 | 
				
			||||||
      "zh-cht": "顯示裝置操作系統名稱",
 | 
					      "zh-cht": "顯示裝置操作系統名稱",
 | 
				
			||||||
      "xloc": [
 | 
					      "xloc": [
 | 
				
			||||||
        "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar->11"
 | 
					        "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar->15"
 | 
				
			||||||
      ]
 | 
					      ]
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -255,8 +255,8 @@
 | 
				
			||||||
                    <tr>
 | 
					                    <tr>
 | 
				
			||||||
                        <td class=h1></td>
 | 
					                        <td class=h1></td>
 | 
				
			||||||
                        <td id=devListToolbar class=style14 style="display:none">
 | 
					                        <td id=devListToolbar class=style14 style="display:none">
 | 
				
			||||||
                              
 | 
					                            <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)" />
 | 
				
			||||||
                            <input type="button" id="CollapseAllButton" onclick="collapseallButtonFunction();" value="Collapse All" /> 
 | 
					                            <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" /> 
 | 
					                            <input type="button" id="SelectAllButton" onclick="selectallButtonFunction();" value="Select All" /> 
 | 
				
			||||||
                            <input type=button id=GroupActionButton disabled="disabled" value="Group Action" onclick=groupActionFunction() /> 
 | 
					                            <input type=button id=GroupActionButton disabled="disabled" value="Group Action" onclick=groupActionFunction() /> 
 | 
				
			||||||
                            <input id=SearchInput type=search autocomplete=off placeholder=Filter onchange=onDeviceSearchChanged(event) onkeyup=onDeviceSearchChanged(event) onfocus=onSearchFocus(1) onblur=onSearchFocus(0) /> 
 | 
					                            <input id=SearchInput type=search autocomplete=off placeholder=Filter onchange=onDeviceSearchChanged(event) onkeyup=onDeviceSearchChanged(event) onfocus=onSearchFocus(1) onblur=onSearchFocus(0) /> 
 | 
				
			||||||
| 
						 | 
					@ -277,7 +277,9 @@
 | 
				
			||||||
                            <span id="devsCustomUIBar"></span>
 | 
					                            <span id="devsCustomUIBar"></span>
 | 
				
			||||||
                        </td>
 | 
					                        </td>
 | 
				
			||||||
                        <td id=kvmListToolbar class=style14 style="display:none">
 | 
					                        <td id=kvmListToolbar class=style14 style="display:none">
 | 
				
			||||||
                              <input type="button" onclick="connectAllKvmFunction()" value="Connect All" /> 
 | 
					                            <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" /> 
 | 
				
			||||||
                            <input type="button" onclick="disconnectAllKvmFunction()" value="Disconnect All" /> 
 | 
					                            <input type="button" onclick="disconnectAllKvmFunction()" value="Disconnect All" /> 
 | 
				
			||||||
                            <label><input type="checkbox" id="autoConnectDesktopCheckbox" onclick="autoConnectDesktops(event)" title="Automatic connect" />Auto </label>
 | 
					                            <label><input type="checkbox" id="autoConnectDesktopCheckbox" onclick="autoConnectDesktops(event)" title="Automatic connect" />Auto </label>
 | 
				
			||||||
                            <input type="button" onclick="showMultiDesktopSettings()" value="Settings" /> 
 | 
					                            <input type="button" onclick="showMultiDesktopSettings()" value="Settings" /> 
 | 
				
			||||||
| 
						 | 
					@ -1574,7 +1576,7 @@
 | 
				
			||||||
            updateDeskShortcutKeys();
 | 
					            updateDeskShortcutKeys();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            // Override the collapse button text
 | 
					            // Override the collapse button text
 | 
				
			||||||
            updateCollapseallButtonText();
 | 
					            updateCollapseAllButton();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        function refreshCookieSession() {
 | 
					        function refreshCookieSession() {
 | 
				
			||||||
| 
						 | 
					@ -3875,12 +3877,12 @@
 | 
				
			||||||
                                r += '<td><div style=padding:10px><i>' + "No Intel® AMT devices in this device group";
 | 
					                                r += '<td><div style=padding:10px><i>' + "No Intel® AMT devices in this device group";
 | 
				
			||||||
                                if ((meshrights & 4) != 0) { r += ', <a href=# style=cursor:pointer onclick=\'return addDeviceToMesh("' + mesh._id + '")\'>' + "add one" + '</a>'; }
 | 
					                                if ((meshrights & 4) != 0) { r += ', <a href=# style=cursor:pointer onclick=\'return addDeviceToMesh("' + mesh._id + '")\'>' + "add one" + '</a>'; }
 | 
				
			||||||
                            } else if (mesh.mtype == 2) {
 | 
					                            } else if (mesh.mtype == 2) {
 | 
				
			||||||
                                r += '<td>';
 | 
					                                r += '<td><div id=DevxCol' + deviceHeaderId2 + ((collapsed === true)?' style=display:none':'') + '>'; // Open collapse div
 | 
				
			||||||
                                r += '<div id=DevxCol' + deviceHeaderId2 + ((collapsed === true)?' style=display:none':'') + '>'; // Open collapse div
 | 
					 | 
				
			||||||
                                r += '<div style=padding:10px><i>' + "No devices in this device group";
 | 
					                                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>'; }
 | 
					                                if ((meshrights & 4) != 0) { r += ', <a href=# style=cursor:pointer onclick=\'return addAgentToMesh("' + mesh._id + '")\'>' + "add one" + '</a>'; }
 | 
				
			||||||
                            } else if (mesh.mtype == 3) {
 | 
					                            } 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>'; }
 | 
					                                if ((meshrights & 4) != 0) { r += ', <a href=# style=cursor:pointer onclick=\'return addLocalDeviceToMesh("' + mesh._id + '")\'>' + "add one" + '</a>'; }
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                            r += '.</i></div></td>';
 | 
					                            r += '.</i></div></td>';
 | 
				
			||||||
| 
						 | 
					@ -4316,7 +4318,7 @@
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            Q('DevxColImg' + id).src = x?'images/c2.png':'images/c1.png';
 | 
					            Q('DevxColImg' + id).src = x?'images/c2.png':'images/c1.png';
 | 
				
			||||||
            putstore('_collapse', JSON.stringify(CollapsedGroups));
 | 
					            putstore('_collapse', JSON.stringify(CollapsedGroups));
 | 
				
			||||||
            updateCollapseallButtonText();
 | 
					            updateCollapseAllButton();
 | 
				
			||||||
            onDevicesScrollEx();
 | 
					            onDevicesScrollEx();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4857,20 +4859,12 @@
 | 
				
			||||||
            return "Unknown";
 | 
					            return "Unknown";
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        function collapseallButtonFunction() {
 | 
					        function updateCollapseAllButton() {
 | 
				
			||||||
            if (Q('CollapseAllButton').value == "Collapse All") {
 | 
					            var x = (Object.keys(CollapsedGroups).length > 0)
 | 
				
			||||||
                cmexpandaction(2);
 | 
					            QV('CollapseAllButton', !x);
 | 
				
			||||||
            } else {
 | 
					            QV('ExpandAllButton', x);
 | 
				
			||||||
                cmexpandaction(1);
 | 
					            QV('CollapseAllButton2', !x);
 | 
				
			||||||
            }
 | 
					            QV('ExpandAllButton2', x);
 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        function updateCollapseallButtonText() {
 | 
					 | 
				
			||||||
            if ((JSON.stringify(getstore('_collapse', '{}')).length - 4) > 0) {
 | 
					 | 
				
			||||||
                Q('CollapseAllButton').value = "Expand All";
 | 
					 | 
				
			||||||
            } else {
 | 
					 | 
				
			||||||
                Q('CollapseAllButton').value = "Collapse All";
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        function selectallButtonFunction() {
 | 
					        function selectallButtonFunction() {
 | 
				
			||||||
| 
						 | 
					@ -5478,7 +5472,7 @@
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            putstore('_collapse', JSON.stringify(CollapsedGroups));
 | 
					            putstore('_collapse', JSON.stringify(CollapsedGroups));
 | 
				
			||||||
            updateCollapseallButtonText();
 | 
					            updateCollapseAllButton();
 | 
				
			||||||
            mainUpdate(4);
 | 
					            mainUpdate(4);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue