mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-12-22 21:31:35 +03:00
Added dbstats command to server console.
This commit is contained in:
parent
e916836f0a
commit
bc6e403c4e
10
meshuser.js
10
meshuser.js
@ -689,7 +689,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
|
||||
|
||||
switch (cmd) {
|
||||
case 'help': {
|
||||
var fin = '', f = '', availcommands = 'help,info,versions,args,resetserver,showconfig,usersessions,closeusersessions,tasklimiter,setmaxtasks,cores,migrationagents,agentstats,webstats,mpsstats,swarmstats,acceleratorsstats,updatecheck,serverupdate,nodeconfig,heapdump,relays,autobackup,backupconfig,dupagents,dispatchtable,badlogins,showpaths,le,lecheck,leevents';
|
||||
var fin = '', f = '', availcommands = 'help,info,versions,args,resetserver,showconfig,usersessions,closeusersessions,tasklimiter,setmaxtasks,cores,migrationagents,agentstats,webstats,mpsstats,swarmstats,acceleratorsstats,updatecheck,serverupdate,nodeconfig,heapdump,relays,autobackup,backupconfig,dupagents,dispatchtable,badlogins,showpaths,le,lecheck,leevents,dbstats';
|
||||
availcommands = availcommands.split(',').sort();
|
||||
while (availcommands.length > 0) {
|
||||
if (f.length > 80) { fin += (f + ',\r\n'); f = ''; }
|
||||
@ -792,6 +792,14 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'dbstats': {
|
||||
parent.parent.db.getStats(function (stats) {
|
||||
var r2 = '';
|
||||
for (var i in stats) { r2 += (i + ': ' + stats[i] + '\r\n'); }
|
||||
try { ws.send(JSON.stringify({ action: 'serverconsole', value: r2, tag: command.tag })); } catch (ex) { }
|
||||
})
|
||||
break;
|
||||
}
|
||||
case 'serverupdate': {
|
||||
r = 'Performing server update...';
|
||||
if (parent.parent.performServerUpdate() == false) { r = 'Server self-update not possible.'; }
|
||||
|
Loading…
Reference in New Issue
Block a user