mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
Add flags to meshes to prefer agentname when synced and to override synced name temporarily
This commit is contained in:
parent
c55065505b
commit
b4c489fba4
2 changed files with 23 additions and 2 deletions
|
|
@ -7486,7 +7486,7 @@
|
|||
// Add node name
|
||||
var nname = EscapeHtml(node.name), nnameEx;
|
||||
if (nname.length == 0) { nname = '<i>' + "None" + '</i>'; }
|
||||
if (((meshrights & 4) != 0) && ((!mesh.flags) || ((mesh.flags & 2) == 0))) { nname = '<span tabindex=0 title="' + "Click here to edit the server-side device name" + '" onclick=showEditNodeValueDialog(0) onkeyup="if (event.key == \'Enter\') showEditNodeValueDialog(0)" style=cursor:pointer>' + nname + ' <img class=hoverButton src="images/link5.png" /></span>'; }
|
||||
if (((meshrights & 4) != 0) && ((!mesh.flags) || ((mesh.flags & 2) == 0 || (mesh.flags & 16)))) { nname = '<span tabindex=0 title="' + "Click here to edit the server-side device name" + '" onclick=showEditNodeValueDialog(0) onkeyup="if (event.key == \'Enter\') showEditNodeValueDialog(0)" style=cursor:pointer>' + nname + ' <img class=hoverButton src="images/link5.png" /></span>'; }
|
||||
nnameEx = nname;
|
||||
if (mesh) { nname += '<span style=color:#AAA;font-size:small> - ' + EscapeHtml(mesh.name) + '</span>'; }
|
||||
QH('p10deviceName', nname);
|
||||
|
|
@ -13561,6 +13561,8 @@
|
|||
if (currentMesh.flags) {
|
||||
if (currentMesh.flags & 1) { meshFeatures.push("Auto-Remove"); }
|
||||
if (currentMesh.flags & 2) { meshFeatures.push((currentMesh.mtype == 4)?"Port Name Sync":"Hostname Sync"); }
|
||||
if (currentMesh.flags & 8) { meshFeatures.push("Prefer agentname"); }
|
||||
if (currentMesh.flags & 16) { meshFeatures.push("Allow override"); }
|
||||
if ((serverinfo.devGroupSessionRecording == 1) && (currentMesh.flags & 4)) { meshFeatures.push("Record Sessions"); }
|
||||
}
|
||||
if ((typeof currentMesh.expireDevs == 'number') && (currentMesh.expireDevs > 0)) { meshFeatures.push("Remove inactive"); }
|
||||
|
|
@ -14042,6 +14044,10 @@
|
|||
}
|
||||
if ((currentMesh.mtype == 2) || (currentMesh.mtype == 4)) {
|
||||
x += '<div><label><input type=checkbox id=d20flag2 onchange=p20editmeshfeaturesValidate() ' + ((flags & 2) ? 'checked' : '') + '>' + ((currentMesh.mtype == 4)?"Sync server device name to port name":"Sync server device name to hostname") + '</label><br></div>';
|
||||
if (currentMesh.mtype == 2) {
|
||||
x += '<div style="margin-left:8px"><label><input type=checkbox id=d20flag8 onchange=p20editmeshfeaturesValidate() ' + ((flags & 8) ? 'checked' : '') + '>' + "Prefer name reportet by agent (--agentName)" + '</label><br></div>';
|
||||
x += '<div style="margin-left:8px"><label><input type=checkbox id=d20flag16 onchange=p20editmeshfeaturesValidate() ' + ((flags & 16) ? 'checked' : '') + '>' + "Allow to override until next connection" + '</label><br></div>';
|
||||
}
|
||||
x += '<div><label><input type=checkbox id=d20flag1 onchange=p20editmeshfeaturesValidate() ' + ((flags & 1) ? 'checked' : '') + '>' + "Remove device on disconnect" + '</label><br></div>';
|
||||
}
|
||||
x += '<div><label><input type=checkbox id=d20expireDevice onchange=p20editmeshfeaturesValidate() ' + ((expire > 0) ? 'checked' : '') + '>' + "Automatically remove inactive devices" + '</label><br></div>';
|
||||
|
|
@ -14062,6 +14068,14 @@
|
|||
function p20editmeshfeaturesValidate() {
|
||||
var flags = 0, ok = true;
|
||||
if (((currentMesh.mtype == 2) || (currentMesh.mtype == 4)) && (Q('d20flag1').checked)) { flags += 1; }
|
||||
if (currentMesh.mtype == 2) {
|
||||
if (Q('d20flag2').checked) { flags += 2; }
|
||||
for (const flag of [8, 16]) {
|
||||
const element = Q('d20flag' + flag);
|
||||
element.disabled = !(flags & 2);
|
||||
element.checked = (!element.disabled) && (element.checked);
|
||||
}
|
||||
}
|
||||
QE('d20expireDevice', (flags & 1) == 0);
|
||||
var x = ((flags & 1) == 0) && Q('d20expireDevice').checked;
|
||||
QV('d20expireDeviceDev', x);
|
||||
|
|
@ -14074,6 +14088,8 @@
|
|||
if ((currentMesh.mtype == 2) || (currentMesh.mtype == 4)) {
|
||||
if (Q('d20flag1').checked) { flags += 1; }
|
||||
if (Q('d20flag2').checked) { flags += 2; }
|
||||
if (Q('d20flag8').checked) { flags += 8; }
|
||||
if (Q('d20flag16').checked) { flags += 16; }
|
||||
}
|
||||
if ((serverinfo.devGroupSessionRecording == 1) && (currentMesh.mtype != 4)) { if (Q('d20flag4').checked) { flags += 4; } }
|
||||
var expireDevs = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue