New virual machine icon, MeshCtrl.js fixes.
|
@ -213,7 +213,8 @@ if (args['_'].length == 0) {
|
|||
console.log(" MeshCtrl ListDevices");
|
||||
console.log(" MeshCtrl ListDevices -id [groupid] --json");
|
||||
console.log("\r\nOptional arguments:\r\n");
|
||||
console.log(" --id [groupid] - Filter by device group identifier.");
|
||||
console.log(" --id [groupid] - Filter by group identifier (or --group).");
|
||||
console.log(" --group [groupname] - Filter by group name (or --id).");
|
||||
console.log(" --count - Only return the device count.");
|
||||
console.log(" --json - Show result as JSON.");
|
||||
break;
|
||||
|
@ -565,7 +566,9 @@ function serverConnect() {
|
|||
case 'listdevicegroups': { ws.send(JSON.stringify({ action: 'meshes' })); break; }
|
||||
case 'listusersofdevicegroup': { ws.send(JSON.stringify({ action: 'meshes' })); break; }
|
||||
case 'listdevices': {
|
||||
if (args.id) {
|
||||
if (args.group) {
|
||||
ws.send(JSON.stringify({ action: 'nodes', meshname: args.group, responseid: 'meshctrl' })); break;
|
||||
} else if (args.id) {
|
||||
ws.send(JSON.stringify({ action: 'nodes', meshid: args.id, responseid: 'meshctrl' })); break;
|
||||
} else {
|
||||
ws.send(JSON.stringify({ action: 'meshes' }));
|
||||
|
|
56
meshuser.js
|
@ -482,32 +482,46 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
|
|||
case 'nodes':
|
||||
{
|
||||
var links = [], extraids = null, err = null;
|
||||
try {
|
||||
if (command.meshid == null) {
|
||||
// Request a list of all meshes this user as rights to
|
||||
links = parent.GetAllMeshIdWithRights(user);
|
||||
|
||||
// Add any nodes with direct rights or any nodes with user group direct rights
|
||||
if (obj.user.links != null) {
|
||||
for (var i in obj.user.links) {
|
||||
if (i.startsWith('node/')) { if (extraids == null) { extraids = []; } extraids.push(i); }
|
||||
else if (i.startsWith('ugrp/')) {
|
||||
const g = parent.userGroups[i];
|
||||
if ((g != null) && (g.links != null)) {
|
||||
for (var j in g.links) { if (j.startsWith('node/')) { if (extraids == null) { extraids = []; } extraids.push(j); } }
|
||||
// Resolve the device group name if needed
|
||||
if ((typeof command.meshname == 'string') && (command.meshid == null)) {
|
||||
for (var i in parent.meshes) {
|
||||
var m = parent.meshes[i];
|
||||
if ((m.mtype == 2) && (m.name == command.meshname) && parent.IsMeshViewable(user, m)) {
|
||||
if (command.meshid == null) { command.meshid = m._id; } else { err = 'Duplicate device groups found'; }
|
||||
}
|
||||
}
|
||||
if (command.meshid == null) { err = 'Invalid group id'; }
|
||||
}
|
||||
|
||||
if (err == null) {
|
||||
try {
|
||||
if (command.meshid == null) {
|
||||
// Request a list of all meshes this user as rights to
|
||||
links = parent.GetAllMeshIdWithRights(user);
|
||||
|
||||
// Add any nodes with direct rights or any nodes with user group direct rights
|
||||
if (obj.user.links != null) {
|
||||
for (var i in obj.user.links) {
|
||||
if (i.startsWith('node/')) { if (extraids == null) { extraids = []; } extraids.push(i); }
|
||||
else if (i.startsWith('ugrp/')) {
|
||||
const g = parent.userGroups[i];
|
||||
if ((g != null) && (g.links != null)) {
|
||||
for (var j in g.links) { if (j.startsWith('node/')) { if (extraids == null) { extraids = []; } extraids.push(j); } }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Request list of all nodes for one specific meshid
|
||||
meshid = command.meshid;
|
||||
if (common.validateString(meshid, 0, 128) == false) { err = 'Invalid group id'; } else {
|
||||
if (meshid.split('/').length == 1) { meshid = 'mesh/' + domain.id + '/' + command.meshid; }
|
||||
if (parent.IsMeshViewable(user, meshid)) { links.push(meshid); } else { err = 'Invalid group id'; }
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Request list of all nodes for one specific meshid
|
||||
meshid = command.meshid;
|
||||
if (common.validateString(meshid, 0, 128) == false) { err = 'Invalid group id'; } else {
|
||||
if (meshid.split('/').length == 1) { meshid = 'mesh/' + domain.id + '/' + command.meshid; }
|
||||
if (obj.IsMeshViewable(user, meshid)) { links.push(meshid); } else { err = 'Invalid group id'; }
|
||||
}
|
||||
}
|
||||
} catch (ex) { err = 'Validation exception: ' + ex; }
|
||||
} catch (ex) { err = 'Validation exception: ' + ex; }
|
||||
}
|
||||
|
||||
// Handle any errors
|
||||
if (err != null) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "meshcentral",
|
||||
"version": "0.5.1-x",
|
||||
"version": "0.5.1-y",
|
||||
"keywords": [
|
||||
"Remote Management",
|
||||
"Intel AMT",
|
||||
|
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 57 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 48 KiB |
|
@ -1194,6 +1194,14 @@ a {
|
|||
border: none;
|
||||
}
|
||||
|
||||
.i8 {
|
||||
background: url(../images/icons50.png) -350px 0px;
|
||||
height: 50px;
|
||||
width: 50px;
|
||||
cursor: pointer;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.j1 {
|
||||
background: url(../images/icons16.png) 0px 0px;
|
||||
height: 16px;
|
||||
|
@ -1250,6 +1258,14 @@ a {
|
|||
border: none;
|
||||
}
|
||||
|
||||
.j8 {
|
||||
background: url(../images/icons16.png) -112px 0px;
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
cursor: pointer;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.relayIcon16 {
|
||||
background: url(../images/icon-relay.png);
|
||||
height: 16px;
|
||||
|
@ -1458,6 +1474,14 @@ a {
|
|||
float: left;
|
||||
}
|
||||
|
||||
.si8 {
|
||||
background: url(../images/icons16.png) -112px 0px;
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
border: none;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.mi {
|
||||
background: url(../images/meshicon50.png) 0px 0px;
|
||||
height: 50px;
|
||||
|
|
|
@ -85,6 +85,13 @@
|
|||
border: none;
|
||||
}
|
||||
|
||||
.i8 {
|
||||
background: url(../images/icons50.png) -350px 0px;
|
||||
height: 50px;
|
||||
width: 50px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.m0 {
|
||||
background: url(../images/images16.png) -32px 0px;
|
||||
height: 16px;
|
||||
|
@ -2264,7 +2271,8 @@
|
|||
x += '<div style=display:inline-block class=i4 onclick=p10setIcon(4)></div><br />';
|
||||
x += '<div style=display:inline-block class=i5 onclick=p10setIcon(5)></div>';
|
||||
x += '<div style=display:inline-block class=i6 onclick=p10setIcon(6)></div>';
|
||||
x += '<div style=display:inline-block class=i7 onclick=p10setIcon(7)></div></table>';
|
||||
x += '<div style=display:inline-block class=i7 onclick=p10setIcon(7)></div>';
|
||||
x += '<div style=display:inline-block class=i8 onclick=p10setIcon(8)></div></table>';
|
||||
setDialogMode(2, "Icon Selection", 0, null, x);
|
||||
QV('id_dialogclose', true);
|
||||
}
|
||||
|
|
|
@ -5607,14 +5607,17 @@
|
|||
if (xxdialogMode) return;
|
||||
if ((GetNodeRights(currentNode) & 4) == 0) return;
|
||||
|
||||
var x = '<br><div style=display:inline-block;width:16px></div>';
|
||||
x += '<div tabindex=0 style=display:inline-block class=i1 onclick=p10setIcon(1) onkeypress="if (event.key==\'Enter\') p10setIcon(1)"></div>';
|
||||
x += '<div tabindex=0 style=display:inline-block class=i2 onclick=p10setIcon(2) onkeypress="if (event.key==\'Enter\') p10setIcon(2)"></div>';
|
||||
x += '<div tabindex=0 style=display:inline-block class=i3 onclick=p10setIcon(3) onkeypress="if (event.key==\'Enter\') p10setIcon(3)"></div>';
|
||||
x += '<div tabindex=0 style=display:inline-block class=i4 onclick=p10setIcon(4) onkeypress="if (event.key==\'Enter\') p10setIcon(4)"></div>';
|
||||
x += '<div tabindex=0 style=display:inline-block class=i5 onclick=p10setIcon(5) onkeypress="if (event.key==\'Enter\') p10setIcon(5)"></div>';
|
||||
x += '<div tabindex=0 style=display:inline-block class=i6 onclick=p10setIcon(6) onkeypress="if (event.key==\'Enter\') p10setIcon(6)"></div>';
|
||||
x += '<div tabindex=0 style=display:inline-block class=i7 onclick=p10setIcon(7) onkeypress="if (event.key==\'Enter\') p10setIcon(7)"></div><br><br>';
|
||||
var x = '<div style=text-align:center><br />';
|
||||
x += '<div tabindex=0 style="display:inline-block;margin:0 10px 0 10px" class=i1 onclick=p10setIcon(1) onkeypress="if (event.key==\'Enter\') p10setIcon(1)"></div>';
|
||||
x += '<div tabindex=0 style="display:inline-block;margin:0 10px 0 10px" class=i2 onclick=p10setIcon(2) onkeypress="if (event.key==\'Enter\') p10setIcon(2)"></div>';
|
||||
x += '<div tabindex=0 style="display:inline-block;margin:0 10px 0 10px" class=i3 onclick=p10setIcon(3) onkeypress="if (event.key==\'Enter\') p10setIcon(3)"></div>';
|
||||
x += '<div tabindex=0 style="display:inline-block;margin:0 10px 0 10px" class=i4 onclick=p10setIcon(4) onkeypress="if (event.key==\'Enter\') p10setIcon(4)"></div>';
|
||||
x += '<br />';
|
||||
x += '<div tabindex=0 style="display:inline-block;margin:0 10px 0 10px" class=i5 onclick=p10setIcon(5) onkeypress="if (event.key==\'Enter\') p10setIcon(5)"></div>';
|
||||
x += '<div tabindex=0 style="display:inline-block;margin:0 10px 0 10px" class=i6 onclick=p10setIcon(6) onkeypress="if (event.key==\'Enter\') p10setIcon(6)"></div>';
|
||||
x += '<div tabindex=0 style="display:inline-block;margin:0 10px 0 10px" class=i7 onclick=p10setIcon(6) onkeypress="if (event.key==\'Enter\') p10setIcon(7)"></div>';
|
||||
x += '<div tabindex=0 style="display:inline-block;margin:0 10px 0 10px" class=i8 onclick=p10setIcon(8) onkeypress="if (event.key==\'Enter\') p10setIcon(8)"></div>';
|
||||
x += '<br /><br /></div>';
|
||||
setDialogMode(2, "Icon Selection", 0, null, x);
|
||||
QV('id_dialogclose', true);
|
||||
}
|
||||
|
|