mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
Improved mobile app
This commit is contained in:
parent
25b467b592
commit
53c7eae4d2
7 changed files with 442 additions and 65 deletions
|
@ -886,13 +886,10 @@
|
|||
//QS('column_l').padding = '0';
|
||||
QS('column_l').width = 'calc(100% - 30px)';
|
||||
}
|
||||
drawDeviceTimeline();
|
||||
}
|
||||
|
||||
function getNodeFromId(id) {
|
||||
for (var i in nodes) { if (nodes[i]._id == id) return nodes[i]; }
|
||||
return null;
|
||||
}
|
||||
|
||||
function getNodeFromId(id) { for (var i in nodes) { if (nodes[i]._id == id) return nodes[i]; } return null; }
|
||||
function reload() { window.location.href = window.location.href; }
|
||||
|
||||
function onStateChanged(server, state) {
|
||||
|
@ -1279,6 +1276,7 @@
|
|||
|
||||
// Change the node
|
||||
node.name = message.event.node.name;
|
||||
node.rname = message.event.node.rname;
|
||||
node.host = message.event.node.host;
|
||||
node.desc = message.event.node.desc;
|
||||
node.publicip = message.event.node.publicip;
|
||||
|
@ -1600,8 +1598,8 @@
|
|||
}
|
||||
|
||||
// If there is nothing to display, explain the problem
|
||||
if ((r == '') && (meshcount > 0)) {
|
||||
if ((Q('SearchInput').value == '') && (sort == 3)) {
|
||||
if ((r == '') && (meshcount > 0) && (Q('SearchInput').value != '')) {
|
||||
if (sort == 3) {
|
||||
r = '<div style="margin:30px">No devices are included in any groups, click on a device\'s \"Groups\" to add to a group.</div>';
|
||||
} else {
|
||||
r = '<div style="margin:30px">No devices matching this search.</div>';
|
||||
|
@ -2874,11 +2872,15 @@
|
|||
var str = '';
|
||||
var provisioningStates = { 0: 'Not Activated (Pre)', 1: 'Not Activated (In)', 2: 'Activated' };
|
||||
if (node.intelamt.ver != null && node.intelamt.state == null) { str += '<i>Unknown State</i>, v' + node.intelamt.ver; } else
|
||||
if (node.intelamt.ver == null || node.intelamt.state == null) { str += '<i>Unknown Version & State</i>'; } else {
|
||||
|
||||
if ((node.intelamt.ver == null) && (node.intelamt.state == 2)) { str += '<i>Activated</i>'; }
|
||||
else if ((node.intelamt.ver == null) || (node.intelamt.state == null)) { str += '<i>Unknown Version & State</i>'; }
|
||||
else {
|
||||
str += provisioningStates[node.intelamt.state];
|
||||
if (node.intelamt.flags) { if (node.intelamt.flags & 2) { str += ' <span title="Intel AMT is activated in Client Control Mode">CCM</span>'; } else if (node.intelamt.flags & 4) { str += ' <span title="Intel AMT is activated in Admin Control Mode">ACM</span>'; } }
|
||||
str += (', v' + node.intelamt.ver);
|
||||
}
|
||||
|
||||
if (node.intelamt.tls == 1) { str += ', <span title="Intel AMT is setup with TLS network security">TLS</span>'; }
|
||||
if (node.intelamt.state == 2) {
|
||||
if (node.intelamt.user == null || node.intelamt.user == '') {
|
||||
|
@ -2977,7 +2979,7 @@
|
|||
QV('MainDevDesktop', ((mesh.mtype == 1) || (node.agent == null) || (node.agent.caps == null) || ((node.agent.caps & 1) != 0)) && (meshrights & 8));
|
||||
QV('MainDevTerminal', ((mesh.mtype == 1) || (node.agent == null) || (node.agent.caps == null) || ((node.agent.caps & 2) != 0)) && (meshrights & 8));
|
||||
QV('MainDevFiles', ((mesh.mtype == 2) && ((node.agent == null) || (node.agent.caps == null) || ((node.agent.caps & 4) != 0))) && (meshrights & 8));
|
||||
QV('MainDevAmt', (node.intelamt != null) && (node.intelamt.state == 2) && (meshrights & 8));
|
||||
QV('MainDevAmt', (node.intelamt != null) && ((node.intelamt.state == 2) || (node.conn & 2)) && (meshrights & 8));
|
||||
QV('MainDevConsole', (consoleRights && (mesh.mtype == 2) && ((node.agent == null) || (node.agent.caps == null) || ((node.agent.caps & 8) != 0))) && (meshrights & 8));
|
||||
QV('p15uploadCore', (node.agent != null) && (node.agent.caps != null) && ((node.agent.caps & 16) != 0) && (userinfo.siteadmin == 0xFFFFFFFF));
|
||||
QH('p15coreName', ((node.agent != null) && (node.agent.core != null))?node.agent.core:'');
|
||||
|
@ -2996,7 +2998,7 @@
|
|||
QV('filesActionsBtn', (meshrights & 72) != 0);
|
||||
|
||||
// Request the power timeline
|
||||
if ((powerTimelineNode != currentNode._id) && (powerTimelineReq != currentNode._id)) { powerTimelineReq = currentNode._id; meshserver.send({ action: 'powertimeline', nodeid: currentNode._id }); }
|
||||
if ((powerTimelineNode != currentNode._id) && (powerTimelineReq != currentNode._id)) { QH('p10html2', ''); powerTimelineReq = currentNode._id; meshserver.send({ action: 'powertimeline', nodeid: currentNode._id }); }
|
||||
|
||||
// Reset the desktop tools
|
||||
QV('DeskTools', false);
|
||||
|
@ -3072,6 +3074,7 @@
|
|||
|
||||
// Draw device power bars. The bars are 766px wide.
|
||||
function drawDeviceTimeline() {
|
||||
if ((currentNode == null) || (xxcurrentView < 10) || (xxcurrentView > 19)) return;
|
||||
var timeline = null, now = Date.now();
|
||||
if (currentNode._id == powerTimelineNode) { timeline = powerTimeline; }
|
||||
|
||||
|
@ -3096,6 +3099,7 @@
|
|||
|
||||
// Draw the timeline
|
||||
var x = '', count = 1, date = new Date();
|
||||
var totalWidth = Q('masthead').offsetWidth - (160 + 9 + 9 + 14); // Compute the total width of the power bar
|
||||
date.setHours(0, 0, 0, 0);
|
||||
for (var i = 0; i < 7; i++) {
|
||||
var datavalue = '', start = date.getTime(), end = start + (1000 * 60 * 60 * 24);
|
||||
|
@ -3104,7 +3108,7 @@
|
|||
if (isTimeBlockInside(start, end, block[0], block[1]) == true) {
|
||||
var ts = Math.max(start, block[0]);
|
||||
var te = Math.min(Math.min(end, block[1]), now);
|
||||
var width = Math.round((te - ts) / 112794);
|
||||
var width = Math.round(((te - ts) * totalWidth) / 86400000);
|
||||
if (width > 0) {
|
||||
var title = powerStateStrings2[block[2]] + ' from ' + new Date(ts).toLocaleTimeString() + ' to ' + new Date(te).toLocaleTimeString() + '.';
|
||||
datavalue += '<div title="' + title + '" style=display:table-cell;width:' + width + 'px;background-color:' + powerColor(block[2]) + ';height:16px></div>';
|
||||
|
@ -4657,6 +4661,7 @@
|
|||
|
||||
var currentMesh;
|
||||
function p20updateMesh() {
|
||||
if (currentMesh == null) return;
|
||||
QH('p20meshName', EscapeHtml(currentMesh.name));
|
||||
var meshtype = 'Unknown #' + currentMesh.mtype;
|
||||
var meshrights = currentMesh.links['user/{{{domain}}}/' + userinfo.name.toLowerCase()].rights;
|
||||
|
@ -5710,7 +5715,10 @@
|
|||
if (((b & 8) || x) && f) f(x, t);
|
||||
}
|
||||
|
||||
function center() { QS('dialog').left = ((((getDocWidth() - 400) / 2)) + "px"); deskAdjust(); }
|
||||
function center() {
|
||||
QS('dialog').left = ((((getDocWidth() - 400) / 2)) + "px"); deskAdjust();
|
||||
drawDeviceTimeline();
|
||||
}
|
||||
function messagebox(t, m) { QH('id_dialogMessage', m); setDialogMode(1, t, 1); }
|
||||
function statusbox(t, m) { QH('id_dialogMessage', m); setDialogMode(1, t); }
|
||||
function getDocWidth() { if (window.innerWidth) return window.innerWidth; if (document.documentElement && document.documentElement.clientWidth && document.documentElement.clientWidth != 0) return document.documentElement.clientWidth; return document.getElementsByTagName('body')[0].clientWidth; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue