1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

More user groups improvements.

This commit is contained in:
Ylian Saint-Hilaire 2020-01-02 01:26:12 -08:00
parent 91e73cfa40
commit 578c7c733c
3 changed files with 96 additions and 86 deletions

View file

@ -7981,7 +7981,7 @@
function p20validateAddMeshUserDialog() {
var meshrights = null;
if (xxdialogTag === 1) {
if ((xxdialogTag === 1) || (xxdialogTag === 3)) {
meshrights = GetMeshRights(decodeURIComponent(Q('dp2groupid').value));
} else {
meshrights = GetMeshRights(currentMesh);
@ -9087,17 +9087,19 @@
function updateUserGroups() {
// Sort the list of group names
var sortedGroups = [];
var sortedGroups = [], x = '';
for (var i in usergroups) { sortedGroups.push(usergroups[i]); }
sortedGroups.sort(nameSort);
// Display the groups using the sorted list
var x = '<table class=p3usersTable cellpadding=0 cellspacing=0>', addHeader = true;
x += '<th>' + "Name" + '<th style=width:80px>' + "Device Groups" + '<th style=width:80px>' + "Users";
for (var i in sortedGroups) { x += addUserGroupHtml(sortedGroups[i]); }
x += '</table>';
if (sortedGroups.length == 0) { x += '<br />' + "No groups found." + '<br />'; }
if (sortedGroups.length == 0) {
x += '<br />' + "No groups found." + '<br />';
} else {
// Display the groups using the sorted list
x += '<table class=p3usersTable cellpadding=0 cellspacing=0>';
x += '<th>' + "Name" + '<th style=width:80px>' + "Device Groups" + '<th style=width:80px>' + "Users";
for (var i in sortedGroups) { x += addUserGroupHtml(sortedGroups[i]); }
x += '</table>';
}
QH('p50groups', x);
// Update current user panel if needed