diff --git a/package.json b/package.json index 293f1248..df6c3f27 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "meshcentral", - "version": "0.3.2-y", + "version": "0.3.3-b", "keywords": [ "Remote Management", "Intel AMT", @@ -20,6 +20,7 @@ "sample-config.json", "license.txt", "readme.txt", + "amt", "agents", "public", "views", diff --git a/public/scripts/agent-desktop-0.0.2.js b/public/scripts/agent-desktop-0.0.2.js index 1e0ee7c2..f3d3ee88 100644 --- a/public/scripts/agent-desktop-0.0.2.js +++ b/public/scripts/agent-desktop-0.0.2.js @@ -450,11 +450,14 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) { if (obj.State != 3) return; if (Action != null && obj.Canvas != null) { if (!event) { var event = window.event; } + var ScaleFactorHeight = (obj.Canvas.canvas.height / obj.CanvasId.clientHeight); var ScaleFactorWidth = (obj.Canvas.canvas.width / obj.CanvasId.clientWidth); var Offsets = obj.GetPositionOfControl(obj.Canvas.canvas); var X = ((event.pageX - Offsets[0]) * ScaleFactorWidth); var Y = ((event.pageY - Offsets[1]) * ScaleFactorHeight); + if (event.addx) { X += event.addx; } + if (event.addy) { Y += event.addy; } if (X >= 0 && X <= obj.Canvas.canvas.width && Y >= 0 && Y <= obj.Canvas.canvas.height) { var Button = 0; diff --git a/public/scripts/amt-desktop-0.0.2.js b/public/scripts/amt-desktop-0.0.2.js index 45caccf1..0d19b0ed 100644 --- a/public/scripts/amt-desktop-0.0.2.js +++ b/public/scripts/amt-desktop-0.0.2.js @@ -779,9 +779,13 @@ var CreateAmtRemoteDesktop = function (divid, scrolldiv) { obj.mouseup = function (e) { obj.buttonmask &= (0xFFFF - (1 << e.button)); return obj.mousemove(e); } obj.mousemove = function (e) { if (obj.state != 4) return true; - var pos = obj.getPositionOfControl(Q(obj.canvasid)); - obj.mx = (e.pageX - pos[0]) * (obj.canvas.canvas.height / Q(obj.canvasid).offsetHeight); - obj.my = ((e.pageY - pos[1] + (scrolldiv ? scrolldiv.scrollTop : 0)) * (obj.canvas.canvas.width / Q(obj.canvasid).offsetWidth)); + var ScaleFactorHeight = (obj.canvas.canvas.height / Q(obj.canvasid).offsetHeight); + var ScaleFactorWidth = (obj.canvas.canvas.width / Q(obj.canvasid).offsetWidth); + var Offsets = obj.getPositionOfControl(Q(obj.canvasid)); + obj.mx = ((event.pageX - Offsets[0]) * ScaleFactorWidth); + obj.my = ((event.pageY - Offsets[1]) * ScaleFactorHeight); + if (event.addx) { obj.mx += event.addx; } + if (event.addy) { obj.my += event.addy; } // ###BEGIN###{DesktopRotation} if (obj.noMouseRotate != true) { diff --git a/views/default-min.handlebars b/views/default-min.handlebars index 8c94c54c..45241dcd 100644 --- a/views/default-min.handlebars +++ b/views/default-min.handlebars @@ -1 +1 @@ - {{{title}}}
{{{title}}}
{{{title2}}}

{{{logoutControl}}}

 

\ No newline at end of file + {{{title}}}
{{{title}}}
{{{title2}}}

{{{logoutControl}}}

 

\ No newline at end of file diff --git a/views/default-mobile-min.handlebars b/views/default-mobile-min.handlebars index 98200821..a38620d2 100644 --- a/views/default-mobile-min.handlebars +++ b/views/default-mobile-min.handlebars @@ -1 +1 @@ - {{{title}}}
{{{title}}}
{{{title2}}}
\ No newline at end of file + {{{title}}}
{{{title}}}
{{{title2}}}
\ No newline at end of file diff --git a/views/default.handlebars b/views/default.handlebars index fdc3f69b..8eb00f07 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -428,7 +428,7 @@
  -
+
@@ -913,7 +913,8 @@ var attemptWebRTC = ((features & 128) != 0); var passRequirements = "{{{passRequirements}}}"; if (passRequirements != "") { passRequirements = JSON.parse(decodeURIComponent(passRequirements)); } - var deskAspectRatio = (getstore('deskAspectRatio', 'false') == 'true'); + var deskAspectRatio = 0; + try { deskAspectRatio = parseInt(getstore('deskAspectRatio', '0')); } catch (ex) { } var uiMode = parseInt(getstore('uiMode', 1)); var webPageStackMenu = false; var webPageFullScreen = true; @@ -1035,8 +1036,8 @@ // Toggle the web page to full screen function toggleAspectRatio(toggle) { - if (toggle === 1) { deskAspectRatio = !deskAspectRatio; putstore('deskAspectRatio', deskAspectRatio); } - deskAdjust() + if (toggle === 1) { deskAspectRatio = ((deskAspectRatio + 1) % 3); putstore('deskAspectRatio', deskAspectRatio); } + deskAdjust(); } // If FullScreen, toggle menu to be horisontal or vertical @@ -4584,15 +4585,23 @@ } function deskAdjust() { - if (deskAspectRatio) { + var parentH = Q('DeskParent').clientHeight, parentW = Q('DeskParent').clientWidth; + var deskH = Q('Desk').height, deskW = Q('Desk').width; + + if (deskAspectRatio == 2) { + // Scale mode QS('Desk').width = '100%'; QS('Desk').height = '100%'; QS('deskarea3x').height = null; + QS('DeskParent').overflow = 'hidden'; + } else if (deskAspectRatio == 1) { + // Zoomed mode + QS('Desk')['margin-top'] = '0px'; + QS('Desk').height = deskH + 'px'; + QS('Desk').width = deskW + 'px'; + QS('DeskParent').overflow = 'scroll'; } else { - var parentH = Q('DeskParent').clientHeight; - var parentW = Q('DeskParent').clientWidth; - var deskH = Q('Desk').height; - var deskW = Q('Desk').width; + // Fixed aspect ratio if (parentH / parentW > deskH / deskW) { var hNew = (deskH * parentW / deskW) + 'px'; if (webPageFullScreen || fullscreen) { @@ -4612,6 +4621,7 @@ } QS('Desk').width = wNew; } + QS('DeskParent').overflow = 'hidden'; } } @@ -4771,7 +4781,7 @@ function deskDisplayInfo(sender, info, selDisplay, selItem) { var txt = Q('termdisplays').value; if (info.length > 0) { var options = ''; for (var x in info) { options += '' + info[x] + ''; } QH('termdisplays', options); } - QV('termdisplays', info.length > 0); + QV('termdisplays', info.length > 1); } function deskGetDisplayNumbers(e) { desktop.m.GetDisplayNumbers(); } @@ -4795,10 +4805,10 @@ dblClickDetectArgs.y = e.clientY; } - function dmousedown(e) { if (!xxdialogMode && desktop != null && Q('DeskControl').checked) { if ((webRtcDesktop != null) && (webRtcDesktop.softdesktop != null)) { webRtcDesktop.softdesktop.m.mousedown(e); desktop.m.sendKeepAlive(); } else { desktop.m.mousedown(e); } } dblClickDetect(e); } - function dmouseup(e) { if (!xxdialogMode && desktop != null && Q('DeskControl').checked) if ((webRtcDesktop != null) && (webRtcDesktop.softdesktop != null)) { webRtcDesktop.softdesktop.m.mouseup(e); desktop.m.sendKeepAlive(); } else { desktop.m.mouseup(e); } } - function dmousemove(e) { if (!xxdialogMode && desktop != null && Q('DeskControl').checked) { if ((webRtcDesktop != null) && (webRtcDesktop.softdesktop != null)) { webRtcDesktop.softdesktop.m.mousemove(e); desktop.m.sendKeepAlive(); } else { desktop.m.mousemove(e); } } } - function dmousewheel(e) { if (!xxdialogMode && desktop != null && Q('DeskControl').checked) { if ((webRtcDesktop != null) && (webRtcDesktop.softdesktop != null)) { webRtcDesktop.softdesktop.m.mousewheel(e); desktop.m.sendKeepAlive(); } else { if (desktop.m.mousewheel) { desktop.m.mousewheel(e); } } haltEvent(e); return true; } return false; } + function dmousedown(e) { e.addx = Q('DeskParent').scrollLeft; e.addy = Q('DeskParent').scrollTop; if (!xxdialogMode && desktop != null && Q('DeskControl').checked) { if ((webRtcDesktop != null) && (webRtcDesktop.softdesktop != null)) { webRtcDesktop.softdesktop.m.mousedown(e); desktop.m.sendKeepAlive(); } else { desktop.m.mousedown(e); } } dblClickDetect(e); } + function dmouseup(e) { e.addx = Q('DeskParent').scrollLeft; e.addy = Q('DeskParent').scrollTop; if (!xxdialogMode && desktop != null && Q('DeskControl').checked) if ((webRtcDesktop != null) && (webRtcDesktop.softdesktop != null)) { webRtcDesktop.softdesktop.m.mouseup(e); desktop.m.sendKeepAlive(); } else { desktop.m.mouseup(e); } } + function dmousemove(e) { e.addx = Q('DeskParent').scrollLeft; e.addy = Q('DeskParent').scrollTop; if (!xxdialogMode && desktop != null && Q('DeskControl').checked) { if ((webRtcDesktop != null) && (webRtcDesktop.softdesktop != null)) { webRtcDesktop.softdesktop.m.mousemove(e); desktop.m.sendKeepAlive(); } else { desktop.m.mousemove(e); } } } + function dmousewheel(e) { e.addx = Q('DeskParent').scrollLeft; e.addy = Q('DeskParent').scrollTop; if (!xxdialogMode && desktop != null && Q('DeskControl').checked) { if ((webRtcDesktop != null) && (webRtcDesktop.softdesktop != null)) { webRtcDesktop.softdesktop.m.mousewheel(e); desktop.m.sendKeepAlive(); } else { if (desktop.m.mousewheel) { desktop.m.mousewheel(e); } } haltEvent(e); return true; } return false; } function drotate(x) { if (!xxdialogMode && desktop != null) { desktop.m.setRotation(desktop.m.rotation + x); deskAdjust(); deskAdjust(); } } function stopProcess(id, name) { setDialogMode(2, "Process Control", 3, stopProcessEx, 'Stop process #' + id + ' "' + name + '"?', id); } function stopProcessEx(buttons, tag) { meshserver.send({ action: 'msg', type:'pskill', nodeid: currentNode._id, value: tag }); setTimeout(refreshDeskTools, 300); }