add collapseGroups to web ui #5361

Signed-off-by: si458 <simonsmith5521@gmail.com>

si458 committed Jan 6, 2026 at 20:26 UTC 2db9420715a82daebfec817880ec9e45023f9f9b
5 files changed +18 -1
meshcentral-config-schema.json
+5
@@ -1922,6 +1922,11 @@
1922 "default": false,
1923 "description": "When enabled, this will show the notes panel in the device view"
1924 },
1925 + "collapseGroups": {
1926 + "type": "boolean",
1927 + "default": false,
1928 + "description": "When enabled, device groups will be collapsed by default in the devices tab."
1929 + },
1930 "userSessionsSort": {
1931 "type": "string",
1932 "default": "SessionId",
sample-config-advanced.json
+1
@@ -206,6 +206,7 @@
206 "_minify": true,
207 "_hidePowerTimeline": true,
208 "_showNotesPanel": true,
209 + "_collapseGroups": true,
210 "_userSessionsSort": "Username",
211 "_newAccounts": true,
212 "_newAccountsUserGroups": [ "ugrp//xxxxxxxxxxxxxxxxx" ],
views/default.handlebars
+5
@@ -1595,6 +1595,7 @@
1595 var installedPluginList = null;
1596 var goBackStack = [];
1597 var CollapsedGroups = {};
1598 + var collapseGroups = '{{{collapseGroups}}}';
1599 try { CollapsedGroups = JSON.parse(getstore('_collapse', '{}')); } catch(ex) {}
1600 var deviceViewSettings = {};
1601 try { deviceViewSettings = JSON.parse(getstore('_deviceViewSettings', '{}')); } catch(ex) {}
@@ -2677,6 +2678,10 @@
2678 updateDevicePageState();
2679
2680 mainUpdate(1 | 2 | 4 | 64);
2681 +
2682 + // If groups are to be collapsed by default, do it now
2683 + if (collapseGroups === 'true' && Object.keys(CollapsedGroups).length === 0 && typeof(getstore('_collapse')) === 'undefined') { cmexpandaction(2); }
2684 +
2685 break;
2686 }
2687 case 'powertimeline': {
views/default3.handlebars
+5
@@ -2106,6 +2106,7 @@
2106 var installedPluginList = null;
2107 var goBackStack = [];
2108 var CollapsedGroups = {};
2109 + var collapseGroups = '{{{collapseGroups}}}';
2110 try { CollapsedGroups = JSON.parse(getstore('_collapse', '{}')); } catch (ex) { }
2111 var deviceViewSettings = {};
2112 try { deviceViewSettings = JSON.parse(getstore('_deviceViewSettings', '{}')); } catch (ex) { }
@@ -3343,6 +3344,10 @@
3344 updateDevicePageState();
3345
3346 mainUpdate(1 | 2 | 4 | 64);
3347 +
3348 + // If groups are to be collapsed by default, do it now
3349 + if (collapseGroups === 'true' && Object.keys(CollapsedGroups).length === 0 && typeof(getstore('_collapse')) === 'undefined') { cmexpandaction(2); }
3350 +
3351 break;
3352 }
3353 case 'powertimeline': {
webserver.js
+2 -1
@@ -3271,7 +3271,8 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
3271 hidePowerTimeline: (domain.hidepowertimeline ? 'true' : 'false'),
3272 showNotesPanel: (domain.shownotespanel ? 'true' : 'false'),
3273 userSessionsSort: (domain.usersessionssort ? domain.usersessionssort : 'SessionId'),
3274 - webrtcconfig: webRtcConfig
3274 + webrtcconfig: webRtcConfig,
3275 + collapseGroups: (domain.collapsegroups ? 'true' : 'false')
3276 }, dbGetFunc.req, domain, uiViewMode), user);
3277 }
3278 xdbGetFunc.req = req;