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

Added ?hide=x support to agent invite pages.

This commit is contained in:
Ylian Saint-Hilaire 2022-01-24 18:23:16 -08:00
parent f55e6302ac
commit 18c2bf4d73
4 changed files with 57 additions and 12 deletions

View file

@ -72,7 +72,7 @@
</div>
</div>
</div>
<div id="column_l" style="max-height:calc(100vh - 135px);overflow-y:auto">
<div id="column_l" style="overflow-y:auto">
<h1>Welcome</h1>
<p>
This is a portal for computer remote management and support.
@ -117,6 +117,24 @@
function start() {
if (urlargs.c != null) { Q('inviteCode').value = urlargs.c; }
// Setup page visuals
var hide = 0;
var globalHide = parseInt('{{{hide}}}');
if (globalHide || urlargs.hide) {
if (urlargs.hide) { hide = parseInt(urlargs.hide); }
if (globalHide) { hide = (hide | globalHide); }
}
urlargs.hide = hide;
QV('masthead', !(hide & 1));
QV('topbar', !(hide & 2));
QV('footer', !(hide & 4));
if ((hide & 4) != 0) { QC('body').add('nofooter'); } else { QC('body').remove('nofooter'); }
if (hide != 0) {
// Fix the main grid to zero-height elements we want to hide.
QS('container')['grid-template-rows'] = ((hide & 1) ? '0' : '66') + 'px fit-content(48px) auto ' + ((hide & 4) ? '0' : '45') + 'px';
QS('container')['-ms-grid-rows'] = ((hide & 1) ? '0' : '66') + 'px fit-content(48px) auto ' + ((hide & 4) ? '0' : '45') + 'px';
}
var messageid = parseInt('{{{messageid}}}');
var okmessages = [''];
var failmessages = ["Invalid invitation code."];