bootstrap: more fixes and icon changes

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

si458 committed Nov 15, 2024 at 16:04 UTC 727080ab6812ac3bf024a7d0ff0276a0f1e6f480
1 file changed +36 -33
views/default3.handlebars
+36 -33
@@ -1,4 +1,4 @@
1 -<!DOCTYPE html>
1 +<!DOCTYPE html>
2 <html lang="en" dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
3
4 <head>
@@ -487,7 +487,10 @@
487 <input type="button" onclick="showMultiDesktopSettings()" value="Settings" />&nbsp;
488 <input id=KvmSearchInput type=search placeholder=Filter onchange=onDeviceSearchChanged(event) onclick=onDeviceSearchChanged(event) onkeyup=onDeviceSearchChanged(event) autocomplete=off onfocus=onSearchFocus(1) onblur=onSearchFocus(0) />&nbsp;
489 <span id=KvmSearchInputClearButton style="display:none;position:relative">
490 - <img src="images/x16.png" type="button" onclick="clearDeviceSearch()" style="position:absolute;cursor:pointer;left:-18px;top:-8px" srcset="images/x32.png 2x" />
490 + <span class="fa-layers fa-fw" role="button" onclick="clearDeviceSearch()" style="position:absolute;left:-25px;top:-15px">
491 + <i class="fa-solid fa-circle" style="color:var(--bs-secondary-bg)"></i>
492 + <i class="fa-solid fa-xmark" style="color:var(--bs-body-color)"></i>
493 + </span>
494 </span>
495 </div>
496 <div id=devMapToolbar class=style14 style="display:none">
@@ -644,7 +647,7 @@
647 </div>
648 <div id=p2logintokens></div>
649 <strong>Device Groups</strong>
647 - <span id="p2createMeshLink1"> - <button class="btn btn-primary btn-sm" onclick="return account_createMesh()"> <i class="fa-fw fa-solid fa-plus-circle"></i>New</button></span>
650 + <span id="p2createMeshLink1"> - <button class="btn btn-primary btn-sm" onclick="return account_createMesh()"><i class="fa-fw fa-solid fa-plus-circle"></i> New</button></span>
651 <br /><br />
652 <div id=p2meshes></div>
653 <div id=p2noMeshFound style="display:none">No device groups.<span id="p2createMeshLink2"> <a href=#
@@ -709,8 +712,8 @@
712 <div style="float:right">
713 <input type=button class="btn btn-outline-primary btn-sm m-1"
714 onclick=showUserBroadcastDialog() style=margin-right:6px value="Broadcast" />
712 - <a href=# onclick=p4downloadUserInfo()><i class="fa-solid fa-download" title="Download user information" style="cursor:pointer"></i></a>
713 - <a href=# onclick=p4batchAccountCreate()><img id=p4UserBatchCreate style="cursor:pointer;display:none" title="Batch create many user accounts" src="images/link6.png" /></a>
715 + <a href=# onclick=p4downloadUserInfo()><i role=button class="fa-solid fa-download" title="Download user information"></i></a>
716 + <a href=# onclick=p4batchAccountCreate()><i role=button id=p4UserBatchCreate style="display:none" title="Batch create many user accounts" class="fa-solid fa-upload"></i></a>
717 <i style="cursor:pointer;margin-top:3px;margin-left:6px" id=usersListToolbarSettings class="fa-solid fa-cog" title="Settings" onclick="onUsersViewSettings()"></i>
718 </div>
719 <div>
@@ -1977,10 +1980,10 @@
1980 </div>
1981 </div>
1982 <div id=dialog4 style="">
1980 - <input id="d4WrapButton" type="button" value="Wrap On" onclick="d4ToggleWrap()" />
1981 - <input id="d4SizeButton" type="button" value="Small" onclick="d4ToggleSize()" />
1982 - <input id="d4EncodingButton" type="button" value="Raw" onclick="d4ToggleEncoding()" />
1983 - <input id="d4LineBreakButton" type="button" value="Windows" onclick="d4ToggleLineBreak()" />
1983 + <input id="d4WrapButton" class="btn btn-outline-primary me-2 mb-2" type="button" value="Wrap On" onclick="d4ToggleWrap()" />
1984 + <input id="d4SizeButton" class="btn btn-outline-primary me-2 mb-2" type="button" value="Small" onclick="d4ToggleSize()" />
1985 + <input id="d4EncodingButton" class="btn btn-outline-primary me-2 mb-2" type="button" value="Raw" onclick="d4ToggleEncoding()" />
1986 + <input id="d4LineBreakButton" class="btn btn-outline-primary me-2 mb-2" type="button" value="Windows" onclick="d4ToggleLineBreak()" />
1987 <textarea id=d4editorarea autocomplete="off" style="height:calc(100vh - 286px);width:100%;overflow:scroll;resize:none;white-space:pre"></textarea>
1988 </div>
1989 <div id=dialog7 style="">
@@ -3581,7 +3584,7 @@
3584 showModal('xxAddAgentModal', 'idx_dlgOkButton');
3585 } else {
3586 var x = '<div class="dialogText dialogTextLog"><pre id=d2ServerErrorsLogPre>' + EscapeHtml(message.data) + '</pre></div>';
3584 - x += '<br /><div style=float:right><img src=images/link4.png height=10 width=10 title="' + "Download error log" + '" style=cursor:pointer onclick=d2CopyServerErrorsToClip()></div>';
3587 + x += '<br /><div style=float:right><i role=button class="fa-fw fa-solid fa-download fa-sm" title="' + "Download error log" + '" onclick=d2CopyServerErrorsToClip()></i></div>';
3588 x += '<div><label><input id=d2clearErrorsCheck type=checkbox class="form-check-input me-2" onclick=server_showErrorsDlgUpdate() /> ' + "Check and click OK to clear error log." + '</label></div>';
3589 setModalContent('xxAddAgent', 'MeshCentral Server Errors', x);
3590 showModal('xxAddAgentModal', 'idx_dlgOkButton', server_showErrorsDlgEx);
@@ -3595,12 +3598,9 @@
3598 if (message.data == null) {
3599 setModalContent('xxAddAgent', 'Server Configuration', 'Server has no config file.', 'extra-large');
3600 } else {
3598 - var x = '<input id="d4WrapButton" class="btn btn-outline-primary me-2 mb-2" type="button" value="Wrap: ON" onclick="d4ToggleWrap()">';
3599 - x += '<input id="d4SizeButton" type="button" class="btn btn-outline-primary me-2 mb-2" value="Size: 100%" onclick="d4ToggleSize()">';
3600 - x += '<input id="d4EncodingButton" type="button" class="btn btn-outline-primary me-2 mb-2" value="Encoding: RAW" onclick="d4ToggleEncoding()" style="display: none;">';
3601 - x += '<textarea id="d4editorarea" autocomplete="off" class="form-control" style="height: calc(-286px + 100vh); width: 100%; overflow: auto; resize: none; font-size: 100%;" readonly="readonly"></textarea>';
3602 - setModalContent('xxAddAgent', 'Server Configuration', x, 'extra-large');
3601 + setModalContent('xxAddAgent', 'Server Configuration', 4, 'extra-large');
3602 QV('d4EncodingButton', false);
3603 + QV('d4LineBreakButton', false);
3604 Q('d4editorarea').value = message.data;
3605 Q('d4editorarea').setAttribute('readonly', 'readonly');
3606 }
@@ -6494,6 +6494,7 @@
6494 xxModal = new bootstrap.Modal(document.getElementById(modalId));
6495 document.getElementById(modalId).addEventListener('hidden.bs.modal', function (event) {
6496 if (xxModal) { xxModal.dispose(); xxModal = null; }
6497 + if (xxdialogMode != 0) { xxdialogMode = 0; }
6498 });
6499 }
6500 xxModal.show();
@@ -10039,6 +10040,8 @@
10040 if (xxdialogMode) return;
10041 var x = '';
10042 var y = '';
10043 + var v = currentNode[showEditNodeValueDialog_modes2[mode]];
10044 + if (v == null) v = '';
10045 if (mode == 3) {
10046 // Get a list of all possible device tags
10047 x = '<select id=dp10devicevalue multiple class="form-control" maxlength=' + showEditNodeValueDialog_modes4[mode] + ' class=form-control>';
@@ -10065,14 +10068,12 @@
10068 } else {
10069 x = addHtmlFormFloating(showEditNodeValueDialog_modes[mode], '<input id=dp10devicevalue class="form-control" maxlength=' + showEditNodeValueDialog_modes4[mode] + ' placeholder="' + showEditNodeValueDialog_modes3[mode] + '" onchange=p10editdevicevalueValidate(' + mode + ',event) onkeyup=p10editdevicevalueValidate(' + mode + ',event) class=form-control/>');
10070 setModalContent('xxAddAgent', 'Edit Device', x);
10071 + if (Array.isArray(v)) { v = v.join(', '); }
10072 + Q('dp10devicevalue').value = v;
10073 showModal('xxAddAgentModal', 'idx_dlgOkButton', function () {
10074 showEditNodeValueDialogEx(3, mode);
10075 });
10076 }
10072 - var v = currentNode[showEditNodeValueDialog_modes2[mode]];
10073 - if (v == null) v = '';
10074 - if (Array.isArray(v)) { v = v.join(', '); }
10075 - Q('dp10devicevalue').value = v;
10077 p10editdevicevalueValidate();
10078 showModal('xxAddAgentModal', 'idx_dlgOkButton', function () { showEditNodeValueDialogEx(3, mode); });
10079 Q('dp10devicevalue').focus();
@@ -14534,7 +14535,8 @@
14535 function updateLoginTokens() {
14536 var x = '', count = 1;
14537 if ((loginTokens != null) && (loginTokens.length > 0)) {
14537 - x += '<p><strong>' + "Active Login Tokens" + '</strong> - <span id="p2createMeshLink1"> <a href=# onclick="return account_createLoginToken()" class="newMeshBtn"> ' + "New" + '</a></span></p><div style=margin-left:40px><table class="table table-hover"><tbody><tr class="table-active"><th scope=col style=text-align:left;width:430px>' + "Name" + '</th><th scope=col style=text-align:left>' + "Username" + '</th></tr>';
14538 + x += '<p><strong>' + "Active Login Tokens" + '</strong> - <span id="p2createMeshLink1"> <button class="btn btn-primary btn-sm" onclick="return account_createLoginToken()"><i class="fa-fw fa-solid fa-plus-circle"></i> ' + "New" + '</button></span></p>';
14539 + x += '<div style=margin-left:40px><table class="table table-hover"><tbody><tr class="table-active"><th scope=col style=text-align:left;width:430px>' + "Name" + '</th><th scope=col style=text-align:left>' + "Username" + '</th></tr>';
14540 for (var i = 0; i < loginTokens.length; i++) {
14541 var ltoken = loginTokens[i];
14542 var trash = '<a href=# onclick=\'return p2removeLoginToken(event,"' + encodeURIComponentEx(ltoken.tokenUser) + '")\' title="' + "Remove login token" + '" style=cursor:pointer><i class="fa-solid fa-trash text-danger hoverButton"></i></a>';
@@ -14625,6 +14627,7 @@
14627 if (xxdialogMode) return false;
14628 xxdialogMode = 2; xxdialogTag = 'MeshCentralServerUpdate';
14629 setModalContent('xxAddAgent', 'MeshCentral Version', 'Loading...');
14630 + showModal('xxAddAgentModal', 'idx_dlgOkButton');
14631 meshserver.send({ action: 'serverversion' });
14632 return false;
14633 }
@@ -16832,7 +16835,7 @@
16835 }
16836
16837 function addUserHtml(user, sessions) {
16835 - var x = '', gray = ' gray', icon = 'm2', msg = '', self = (user._id != userinfo._id), lastAccess = '', permissions = '';
16838 + var x = '', gray = ' gray', msg = '', self = (user._id != userinfo._id), lastAccess = '', permissions = '';
16839 if (sessions != null) {
16840 gray = '';
16841 if (self) {
@@ -16889,11 +16892,11 @@
16892 if ((user.otpsecret > 0) || (user.otphkeys > 0) || ((user.otpekey == 1) && (features & 0x00800000)) || ((user.phone != null) && (features & 0x04000000))) { username += ' <i class="fa-solid fa-key" title="' + "2nd factor authentication enabled" + '" style="margin-top:2px"></i>'; }
16893 if (user.phone != null) { username += ' <i class="fa-solid fa-mobile-screen" title="' + "Verified phone number" + '" style="margin-top:2px"></i>'; }
16894 if ((user.siteadmin != null) && ((user.siteadmin & 32) != 0) && (user.siteadmin != 0xFFFFFFFF)) { username += ' <img src="images/padlock12.png" height=12 width=8 title="' + "Account is locked" + '" style="margin-top:2px" />'; }
16892 - if ((user.msghandle != null) && (features2 & 0x02000000)) { username += ' <img src="images/messaging12.png" height=12 width=12 title="' + "Verified messaging account" + '" style="margin-top:2px" />'; }
16895 + if ((user.msghandle != null) && (features2 & 0x02000000)) { username += ' <i class="fa-solid fa-comment fa-xs" title="' + "Verified messaging account" + '" style="margin-top:2px" />'; }
16896 x += '<tr tabindex=0 onkeypress="if (event.key==\'Enter\') gotoUser(\'' + encodeURIComponentEx(user._id) + '\')"><td>';
16897 x += '<div>';
16898 x += '<div class=baricon><input class="UserCheckbox form-check-input me-2" value=' + encodeURIComponentEx(user._id) + ' onclick=p3updateInfo() type=checkbox' + ((user._id == userinfo._id) ? ' disabled' : '') + '></div><div style=cursor:pointer onclick=gotoUser("' + encodeURIComponentEx(user._id) + '",false,event)>';
16896 - x += '<div class=baricon><div class="' + icon + gray + '"></div></div>';
16899 + x += '<div class=baricon><i class="fa-fw fa-solid fa-user ' + gray + '"></i></div>';
16900 x += '<div>';
16901 x += '<div><span style=line-height:24px>' + username + '</span>' + msg + '</div></div><td style=text-align:center>' + groups + '<td style=text-align:center>' + lastAccess + '<td style=text-align:center>' + permissions;
16902 return x;
@@ -17548,7 +17551,7 @@
17551 var x = '<tr tabindex=0 onkeypress="if (event.key==\'Enter\') gotoUserGroup(\'' + encodeURIComponentEx(group._id) + '\')"><td style=cursor:pointer>';
17552 x += '<div style=width:100%>';
17553 x += '<div class=baricon><input class="form-check-input me-2 UserGroupCheckbox" value=' + encodeURIComponentEx(group._id) + ' onclick=p50updateInfo() type=checkbox></div>';
17551 - x += '<div class=baricon onclick=gotoUserGroup("' + encodeURIComponentEx(group._id) + '")><div class=m4></div></div>';
17554 + x += '<div class=baricon onclick=gotoUserGroup("' + encodeURIComponentEx(group._id) + '")><i class="fa-solid fa-users"></i></div>';
17555 x += '<div onclick=gotoUserGroup("' + encodeURIComponentEx(group._id) + '")></div><div onclick=gotoUserGroup("' + encodeURIComponentEx(group._id) + '")></div>';
17556 x += '<div style=line-height:24px onclick=gotoUserGroup("' + encodeURIComponentEx(group._id) + '")><span style=font-size:16px>' + name + '</span></div></div><td style=text-align:center>' + usercount + '<td style=text-align:center>' + meshcount + '<td style=text-align:center>' + devicecount;
17557 return x;
@@ -17742,7 +17745,7 @@
17745 if (currentUserGroup.membershipType == null) { trash = '<a href=# onclick=\'return p51deleteUser(event,"' + encodeURIComponentEx(sortedusers[i].id) + '")\' title="' + "Remove user rights to this device group" + '" style=cursor:pointer><img src=images/trash.png border=0 height=10 width=10></a>'; }
17746 var username = EscapeHtml(decodeURIComponent(sortedusers[i].name));
17747 if (users != null) { username = '<a href=# onclick=\'gotoUser("' + encodeURIComponentEx(sortedusers[i].id) + '");haltEvent(event);\'>' + username + '</a>'; }
17745 - x += '<tr ' + (((count % 2) == 0) ? 'style=background-color:#DDD' : '') + '><td><div title="' + "User" + '" class=m2></div><div>&nbsp;' + username + '<div></div></div></td><td><div style=float:right>' + trash + '</div></td></tr>';
17748 + x += '<tr ' + (((count % 2) == 0) ? 'style=background-color:#DDD' : '') + '><td><i class="fa-solid fa-user fa-fw" title="' + "User" + '"></i>&nbsp;' + username + '</td><td><div style=float:right>' + trash + '</div></td></tr>';
17749 ++count;
17750 }
17751
@@ -18736,8 +18739,8 @@
18739 x += '<div style=width:100%;text-align:center;margin-top:20px><i>' + "No recordings." + '</i></div>';
18740 } else {
18741 // Display the users using the sorted list
18739 - x += '<table class=p3usersTable cellpadding=0 cellspacing=0>';
18740 - x += '<th>' + "Session" + '<th style=width:110px>' + nobreak("Start Time") + '<th style=width:110px>' + "Duration" + '<th style=width:110px>' + "Size";
18742 + x += '<table class="table table-hover" cellpadding=0 cellspacing=0><thead class="text-center"><tr>';
18743 + x += '<th>' + "Session" + '</th><th style=width:110px>' + nobreak("Start Time") + '</th><th style=width:110px>' + "Duration" + '</th><th style=width:110px>' + "Size" + '</th></tr></thead><tbody>';
18744 if (p52recordings != null) {
18745 var recdate = null;
18746 for (var i in p52recordings) {
@@ -18746,7 +18749,7 @@
18749 x += addRecordingHtml(i, rec);
18750 }
18751 }
18749 - x += '</table>';
18752 + x += '</tbody></table>';
18753 }
18754 QH('p52recordings', x);
18755
@@ -18793,17 +18796,17 @@
18796 if (rec.protocol == 101) { sessionName += ' - ' + "Intel&reg; AMT Redirection"; }
18797 if (rec.protocol == 200) { sessionName += ' - ' + "Messenger"; }
18798
18796 - var actions = '', icon = 'm0';
18799 + var actions = '', icon = 'fa-circle-xmark text-danger';
18800 if (rec.present == 1) {
18798 - icon = 'm1';
18799 - actions = '<div style=cursor:pointer;float:right><a onclick=downloadFile("recordings.ashx?file=' + encodeURIComponentEx(rec.filename) + '")><img src=images/link4.png height=10 width=10 title="Download Recording"></a>&nbsp;</div>';
18800 - actions += '<div style=cursor:pointer;float:right><a href="player.htm?stream=' + encodeURIComponentEx(rec.filename) + '") rel=\"noreferrer noopener\" target=\"mcplay-' + encodeURIComponentEx(rec.filename) + '\"><img src=images/link7.png height=10 width=10 title="Play Recording"></a>&nbsp;</div>';
18801 + icon = 'fa-circle-check text-success';
18802 + actions = '<div style=cursor:pointer;float:right><a onclick=downloadFile("recordings.ashx?file=' + encodeURIComponentEx(rec.filename) + '")><i class="fa-fw fa-solid fa-download fa-sm" title="Download Recording"></i></a>&nbsp;</div>';
18803 + actions += '<div style=cursor:pointer;float:right><a href="player.htm?stream=' + encodeURIComponentEx(rec.filename) + '") rel=\"noreferrer noopener\" target=\"mcplay-' + encodeURIComponentEx(rec.filename) + '\"><i class="fa-fw fa-solid fa-play fa-sm" title="Play Recording"></i></a>&nbsp;</div>';
18804 }
18805 var x = '<tr tabindex=0 onmouseover=userMouseHover2(this,1) onmouseout=userMouseHover2(this,0) onkeypress="if (event.key==\'Enter\') showRecordingDialog(event,\'' + i + '\')"><td style=cursor:pointer>';
18806 x += '<div class=bar style=width:100%>';
18807 //x += '<div class=baricon><input class=RecordingCheckbox value="' + encodeURIComponentEx(rec.filename) + '" onclick=p52updateInfo() type=checkbox></div>';
18808 x += '<div></div>';
18806 - x += '<div class=baricon onclick=showRecordingDialog(event,"' + i + '")><div class=' + icon + '></div></div>';
18809 + x += '<div class=baricon onclick=showRecordingDialog(event,"' + i + '")><i class="fa-fw fa-solid ' + icon + '"></i></div>';
18810 x += '<div class=g1 onclick=showRecordingDialog(event,"' + i + '")></div><div class=g2 onclick=showRecordingDialog("' + i + '")></div>';
18811 x += '<div style=line-height:24px onclick=showRecordingDialog(event,"' + i + '")>' + actions + '<div style=font-size:16px>' + sessionName + '</div></div></div><td style=text-align:center>' + sessionStartStr + '<td style=text-align:center>' + sessionLengthStr + '<td style=text-align:center>' + sessionSize;
18812 return x;