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

Updates mesh agents, minor server fixes.

This commit is contained in:
Ylian Saint-Hilaire 2019-01-23 18:07:02 -08:00
parent 5a2d3512ca
commit 35e8f9b94a
23 changed files with 7429 additions and 21 deletions

View file

@ -160,7 +160,6 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) {
obj.ProcessScreenMsg = function (width, height) {
if (obj.debugmode > 0) { console.log("ScreenSize: " + width + " x " + height); }
console.log("ScreenSize: " + width + " x " + height);
obj.Canvas.setTransform(1, 0, 0, 1, 0, 0);
obj.rotation = 0;
obj.FirstDraw = true;
@ -183,7 +182,7 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) {
if (str.length < 4) return;
var cmdmsg = null, X = 0, Y = 0, command = ReadShort(str, 0), cmdsize = ReadShort(str, 2);
if ((cmdsize != str.length) && (obj.debugmode > 0)) { console.log(cmdsize, str.length, cmdsize == str.length); }
if (command >= 18) { if (command == 65) { console.error(str); alert(str); } else { console.error("Invalid KVM command " + command + " of size " + cmdsize); console.log("Invalid KVM data", str.length, str, rstr2hex(str)); return; } }
if ((command >= 18) && (command != 65)) { console.error("Invalid KVM command " + command + " of size " + cmdsize); console.log("Invalid KVM data", str.length, str, rstr2hex(str)); return; }
if (cmdsize > str.length) { console.error("KVM invalid command size", cmdsize, str.length); return; }
//meshOnDebug("KVM Command: " + command + " Len:" + cmdsize);
@ -250,13 +249,17 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) {
//obj.Debug("Got KVM Message: " + str.substring(4, cmdsize));
if (obj.onMessage != null) obj.onMessage(str.substring(4, cmdsize), obj);
break;
case 65: // Alert
console.error(str.substring(4));
alert(str.substring(4));
break;
}
return cmdsize;
}
// Keyboard and Mouse I/O.
obj.MouseButton = { "NONE": 0x00, "LEFT": 0x02, "RIGHT": 0x08, "MIDDLE": 0x20 };
obj.KeyAction = { "NONE": 0, "DOWN": 1, "UP": 2, "SCROLL": 3, "EXUP": 4, "EXDOWN": 5 };
obj.KeyAction = { "NONE": 0, "DOWN": 1, "UP": 2, "SCROLL": 3, "EXUP": 4, "EXDOWN": 5, "DBLCLICK": 6 };
obj.InputType = { "KEY": 1, "MOUSE": 2, "CTRLALTDEL": 10, "TOUCH": 15 };
obj.Alternate = 0;
@ -433,9 +436,19 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) {
}
var MouseMsg = "";
if (Action == obj.KeyAction.SCROLL) MouseMsg = String.fromCharCode(0x00, obj.InputType.MOUSE, 0x00, 0x0C, 0x00, ((Action == obj.KeyAction.DOWN) ? Button : ((Button * 2) & 0xFF)), ((X / 256) & 0xFF), (X & 0xFF), ((Y / 256) & 0xFF), (Y & 0xFF), ((Delta / 256) & 0xFF), (Delta & 0xFF));
else MouseMsg = String.fromCharCode(0x00, obj.InputType.MOUSE, 0x00, 0x0A, 0x00, ((Action == obj.KeyAction.DOWN) ? Button : ((Button * 2) & 0xFF)), ((X / 256) & 0xFF), (X & 0xFF), ((Y / 256) & 0xFF), (Y & 0xFF));
if (obj.Action == obj.KeyAction.NONE) { if (obj.Alternate == 0 || obj.ipad) { obj.send(MouseMsg); obj.Alternate = 1; } else { obj.Alternate = 0; } } else { obj.send(MouseMsg); }
if (Action == obj.KeyAction.DBLCLICK) {
MouseMsg = String.fromCharCode(0x00, obj.InputType.MOUSE, 0x00, 0x0A, 0x00, 0x88, ((X / 256) & 0xFF), (X & 0xFF), ((Y / 256) & 0xFF), (Y & 0xFF));
} else if (Action == obj.KeyAction.SCROLL) {
MouseMsg = String.fromCharCode(0x00, obj.InputType.MOUSE, 0x00, 0x0C, 0x00, 0x00, ((X / 256) & 0xFF), (X & 0xFF), ((Y / 256) & 0xFF), (Y & 0xFF), ((Delta / 256) & 0xFF), (Delta & 0xFF));
} else {
MouseMsg = String.fromCharCode(0x00, obj.InputType.MOUSE, 0x00, 0x0A, 0x00, ((Action == obj.KeyAction.DOWN) ? Button : ((Button * 2) & 0xFF)), ((X / 256) & 0xFF), (X & 0xFF), ((Y / 256) & 0xFF), (Y & 0xFF));
}
if (obj.Action == obj.KeyAction.NONE) {
if (obj.Alternate == 0 || obj.ipad) { obj.send(MouseMsg); obj.Alternate = 1; } else { obj.Alternate = 0; }
} else {
obj.send(MouseMsg);
}
}
}
}
@ -463,6 +476,7 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) {
obj.xxMouseMove = function (e) { if (obj.State == 3) obj.SendMouseMsg(obj.KeyAction.NONE, e); if (e.preventDefault) e.preventDefault(); if (e.stopPropagation) e.stopPropagation(); return false; }
obj.xxMouseUp = function (e) { if (obj.State == 3) obj.SendMouseMsg(obj.KeyAction.UP, e); if (e.preventDefault) e.preventDefault(); if (e.stopPropagation) e.stopPropagation(); return false; }
obj.xxMouseDown = function (e) { if (obj.State == 3) obj.SendMouseMsg(obj.KeyAction.DOWN, e); if (e.preventDefault) e.preventDefault(); if (e.stopPropagation) e.stopPropagation(); return false; }
obj.xxMouseDblClick = function (e) { if (obj.State == 3) obj.SendMouseMsg(obj.KeyAction.DBLCLICK, e); if (e.preventDefault) e.preventDefault(); if (e.stopPropagation) e.stopPropagation(); return false; }
obj.xxDOMMouseScroll = function (e) { if (obj.State == 3) { obj.SendMouseMsg(obj.KeyAction.SCROLL, e); return false; } return true; }
obj.xxMouseWheel = function (e) { if (obj.State == 3) { obj.SendMouseMsg(obj.KeyAction.SCROLL, e); return false; } return true; }
obj.xxKeyUp = function (e) { if (obj.State == 3) { obj.SendKeyMsg(obj.KeyAction.UP, e); } if (e.preventDefault) e.preventDefault(); if (e.stopPropagation) e.stopPropagation(); return false; }
@ -481,6 +495,7 @@ var CreateAgentRemoteDesktop = function (canvasid, scrolldiv) {
obj.handleKeyDown = function (e) { if (obj.stopInput == true || desktop.State != 3) return false; return obj.xxKeyDown(e); }
// Mouse handlers
obj.mousedblclick = function (e) { if (obj.stopInput == true) return false; return obj.xxMouseDblClick(e); }
obj.mousedown = function (e) { if (obj.stopInput == true) return false; return obj.xxMouseDown(e); }
obj.mouseup = function (e) { if (obj.stopInput == true) return false; return obj.xxMouseUp(e); }
obj.mousemove = function (e) { if (obj.stopInput == true) return false; return obj.xxMouseMove(e); }

View file

@ -773,6 +773,7 @@ var CreateAmtRemoteDesktop = function (divid, scrolldiv) {
obj.haltEvent = function (e) { if (e.preventDefault) e.preventDefault(); if (e.stopPropagation) e.stopPropagation(); return false; }
// RFB "PointerEvent" and mouse handlers
obj.mousedblclick = function (e) { }
obj.mousedown = function (e) { obj.buttonmask |= (1 << e.button); return obj.mousemove(e); }
obj.mouseup = function (e) { obj.buttonmask &= (0xFFFF - (1 << e.button)); return obj.mousemove(e); }
obj.mousemove = function (e) {

View file

@ -0,0 +1,745 @@
body {
margin: 0;
padding: 0;
border: 0;
color: black;
font-size: 13px;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
background-color: #d3d9d6;
}
#container {
background-color: #fff;
width: 960px;
min-width: 960px;
margin: 0 auto;
border-top: 0;
border-right: 1px solid #b7b7b7;
border-bottom: 0;
border-left: 1px solid #b7b7b7;
padding: 0;
}
#masthead {
width: auto;
margin: 0;
padding: 0;
overflow: auto;
text-align: right;
background-color: #036;
width: 960px;
}
#column_l {
position: relative;
float: left;
width: 930px;
margin: 0;
padding: 0 15px;
background-color: #fff;
}
#footer {
clear: both;
overflow: auto;
width: 100%;
text-align: center;
background-color: #113962;
padding-top: 5px;
padding-bottom: 5px;
}
#masthead img {
float: left;
}
#masthead p {
font-size: 11px;
color: #fff;
margin: 10px 10px 0;
}
#footer a {
color: #fff;
text-decoration: underline;
}
#footer a:hover {
color: #fff;
text-decoration: none;
}
a {
color: #036;
text-decoration: underline;
}
.i1 {
background: url(../images/icons50.png) 0px 0px;
height: 50px;
width: 50px;
cursor: pointer;
border: none;
}
.i2 {
background: url(../images/icons50.png) -50px 0px;
height: 50px;
width: 50px;
cursor: pointer;
border: none;
}
.i3 {
background: url(../images/icons50.png) -100px 0px;
height: 50px;
width: 50px;
cursor: pointer;
border: none;
}
.i4 {
background: url(../images/icons50.png) -150px 0px;
height: 50px;
width: 50px;
cursor: pointer;
border: none;
}
.i5 {
background: url(../images/icons50.png) -200px 0px;
height: 50px;
width: 50px;
cursor: pointer;
border: none;
}
.i6 {
background: url(../images/icons50.png) -250px 0px;
height: 50px;
width: 50px;
cursor: pointer;
border: none;
}
.j1 {
background: url(../images/icons16.png) 0px 0px;
height: 16px;
width: 16px;
cursor: pointer;
border: none;
}
.j2 {
background: url(../images/icons16.png) -16px 0px;
height: 16px;
width: 16px;
cursor: pointer;
border: none;
}
.j3 {
background: url(../images/icons16.png) -32px 0px;
height: 16px;
width: 16px;
cursor: pointer;
border: none;
}
.j4 {
background: url(../images/icons16.png) -48px 0px;
height: 16px;
width: 16px;
cursor: pointer;
border: none;
}
.j5 {
background: url(../images/icons16.png) -64px 0px;
height: 16px;
width: 16px;
cursor: pointer;
border: none;
}
.j6 {
background: url(../images/icons16.png) -80px 0px;
height: 16px;
width: 16px;
cursor: pointer;
border: none;
}
.lbbutton {
width:74px;
height:74px;
border-radius:5px;
background-color:white;
margin-left:8px;
margin-top:8px;
position:relative;
cursor:pointer;
opacity:0.5;
}
.lbbutton:hover {
opacity:1;
}
.lbbuttonsel {
opacity:0.9;
}
.lbbuttonsel2 {
width:82px;
border-radius:5px 0px 0px 5px;
opacity:1;
}
.lb1 {
background: url(../images/leftbar-62.jpg) -0px 0px;
height: 62px;
width: 62px;
cursor: pointer;
border: none;
}
.lb2 {
background: url(../images/leftbar-62.jpg) -75px 0px;
height: 62px;
width: 62px;
cursor: pointer;
border: none;
}
.lb3 {
background: url(../images/leftbar-62.jpg) -150px 0px;
height: 62px;
width: 62px;
cursor: pointer;
border: none;
}
.lb4 {
background: url(../images/leftbar-62.jpg) -225px 0px;
height: 62px;
width: 62px;
cursor: pointer;
border: none;
}
.lb5 {
background: url(../images/leftbar-62.jpg) -294px 0px;
height: 62px;
width: 62px;
cursor: pointer;
border: none;
}
.lb6 {
background: url(../images/leftbar-62.jpg) -360px 0px;
height: 62px;
width: 62px;
cursor: pointer;
border: none;
}
.m0 { background : url(../images/images16.png) -32px 0px; height : 16px; width : 16px; border:none; float:left }
.m1 { background : url(../images/images16.png) -16px 0px; height : 16px; width : 16px; border:none; float:left }
.m2 { background : url(../images/images16.png) -96px 0px; height : 16px; width : 16px; border:none; float:left }
.m3 { background : url(../images/images16.png) -112px 0px; height : 16px; width : 16px; border:none; float:left }
.si0 { background : url(../images/icons16.png) 0px 0px; height : 16px; width : 16px; border:none; float:left }
.si1 { background : url(../images/icons16.png) -16px 0px; height : 16px; width : 16px; border:none; float:left }
.si2 { background : url(../images/icons16.png) -32px 0px; height : 16px; width : 16px; border:none; float:left }
.si3 { background : url(../images/icons16.png) -48px 0px; height : 16px; width : 16px; border:none; float:left }
.si4 { background : url(../images/icons16.png) -64px 0px; height : 16px; width : 16px; border:none; float:left }
.mi { background : url(../images/meshicon50.png) 0px 0px; height: 50px; width: 50px; cursor:pointer; border:none }
#floatframe {
position: fixed;
top: 200px;
height: 300px;
z-index: 200;
display: none;
}
.style1 {
text-align: center;
}
.style2 {
text-align: center;
background-color: #808080;
font-weight: bold;
}
.style3 {
text-align: center;
color: white;
background-color: #808080;
font-weight: bold;
}
.style3x {
text-align: center;
color: white;
background-color: #808080;
font-weight: bold;
}
.style3x:hover {
background-color: #606060;
}
.style3sel {
text-align: center;
color: white;
background-color: #003366;
font-weight: bold;
}
.style4 {
color: white;
text-decoration: none;
}
.style5 {
text-align: center;
background-color: #808080;
font-weight: normal;
}
.style6 {
text-align: center;
background-color: #D3D9D6;
}
.style7 {
font-size: large;
background-color: #FFFFFF;
}
.style10 {
background-color: #C9C9C9;
}
.style11 {
font-size: large;
background-color: #C9C9C9;
}
.style14 {
text-align: left;
background-color: #D3D9D6;
}
.auto-style1 {
text-align: right;
background-color: #D3D9D6;
}
.fileIcon1 {
background: url(data:image/gif;base64,R0lGODlhEAAQAJEDAPb49Y2Sj9LT2f///yH5BAEAAAMALAAAAAAQABAAAAImnI+py+1vhJwyUYAzHTL4D3qdlJWaIFJqmKod607sDKIiDUP63hQAOw==);
height: 16px;
width: 16px;
cursor: pointer;
border: none;
float: left;
margin-top: 1px;
}
.fileIcon2 {
background: url(data:image/gif;base64,R0lGODlhEAAQAJEDAM2xV/Xur+XPgP///yH5BAEAAAMALAAAAAAQABAAAAJD3ISZIGHWUGihznesYDYATFVM+D2hJ4lgN1olxALAtAlmPCJvuMmJd6PJckDYwicrHhTD5o7plJmg0Uc0asNMkphHAQA7);
height: 16px;
width: 16px;
cursor: pointer;
border: none;
float: left;
margin-top: 1px;
}
.fileIcon3 {
background: url(data:image/gif;base64,R0lGODlhEAAQAJEDAPb19IGBgbq6uv///yH5BAEAAAMALAAAAAAQABAAAAIy3ISpxgcPH2ouQgFEw1YmxnUXKEaaEZZnVWZk66JwzKpvuwZzwOgwb/C1gIOA8Yg8DgoAOw==);
height: 16px;
width: 16px;
cursor: pointer;
border: none;
float: left;
margin-top: 1px;
}
.fileIcon4 {
background: url(../images/meshicon16.png);
height: 16px;
width: 16px;
cursor: pointer;
border: none;
float: left;
margin-top: 1px;
}
.filelist {
-moz-user-select: none;
-khtml-user-select: none;
-webkit-user-select: none;
-o-user-select: none;
cursor: default;
-khtml-user-drag: element;
background-color: white;
clear: both;
}
.noselect {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.fsize {
float: right;
text-align: right;
width: 180px;
}
.g1 {
background-position: 0% 0%;
width: 14px;
height: 100%;
float: left;
/* fallback (Opera) */
/* Mozilla: */
/* Chrome, Safari:*/
background-image: linear-gradient(to right, #ffffff 0%, #c9c9c9 100%);
background-color: #c9c9c9;
background-repeat: repeat;
background-attachment: scroll;
}
.g1s {
background-image: linear-gradient(to right, #ffffff 0%, #b9b9b9 100%);
}
.g2 {
background-position: 0% 0%;
width: 14px;
height: 100%;
float: right;
/* fallback (Opera) */
/* Mozilla: */
/* Chrome, Safari:*/
background-image: linear-gradient(to right, #c9c9c9 0%, #ffffff 100%);
background-color: #c9c9c9;
background-repeat: repeat;
background-attachment: scroll;
}
.g2s {
background-image: linear-gradient(to right, #b9b9b9 0%, #ffffff 100%);
}
.h1 {
background-position: 0% 0%;
width: 14px;
height: 100%;
/* fallback (Opera) */
/* Mozilla: */
/* Chrome, Safari:*/
background-image: linear-gradient(to right, #ffffff 0%, #d3d9d6 100%);
background-color: #d3d9d6;
background-repeat: repeat;
background-attachment: scroll;
}
.h2 {
background-position: 0% 0%;
width: 14px;
height: 100%;
/* fallback (Opera) */
/* Mozilla: */
/* Chrome, Safari:*/
background-image: linear-gradient(to right, #d3d9d6 0%, #ffffff 100%);
background-color: #d3d9d6;
background-repeat: repeat;
background-attachment: scroll;
}
.e1 {
font-size: large;
margin-top: 4px;
margin-bottom: 3px;
overflow: hidden;
word-wrap: hyphenate;
white-space: nowrap;
text-overflow: ellipsis;
max-width: 200px
}
.e2 {
float: left;
height: 100%;
}
.f1 { background-color: #c9c9c9; }
.f1s { background-color: #b9b9b9; }
.bar {
font-size: large;
background-color: #C9C9C9;
height: 24px;
float: left;
margin-bottom: 2px;
}
.bar2 {
font-size: large;
height: 24px;
float: left;
margin-bottom: 2px;
}
.bar18 {
font-size: large;
background-color: #C9C9C9;
height: 18px;
float: left;
margin-bottom: 2px;
}
.bar182 {
font-size: large;
height: 18px;
float: left;
margin-bottom: 2px;
}
.devHeaderx {
color: lightgray;
}
.DevSt {
border-bottom-style: solid;
border-bottom-width: 1px;
border-bottom-color: #DDDDDD;
}
.contextMenu {
background: #F9F9F9;
box-shadow: 0 0 12px rgba( 0, 0, 0, .3 );
border: 1px solid #ccc;
/*border-radius: 4px;*/
display: none;
position: absolute;
top: 0;
left: 0;
list-style: none;
margin: 0;
padding: 5px;
min-width: 100px;
max-width: 150px;
z-index: 500;
}
.cmtext {
color: #444;
display: inline-block;
padding-left: 8px;
padding-right: 8px;
padding-top: 5px;
padding-bottom: 5px;
text-decoration: none;
width: 85%;
cursor: default;
overflow: hidden;
position: relative;
}
.cmtext:hover {
color: #f9f9f9;
background: #444;
}
.gray {
/*filter: url("data:image/svg+xml;utf8,&lt;svg xmlns=\'http://www.w3.org/2000/svg\'&gt;&lt;filter id=\'grayscale\'&gt;&lt;feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/&gt;&lt;/filter&gt;&lt;/svg&gt;#grayscale");*/ /* Firefox 10+, Firefox on Android */
filter: gray; /* IE6-9 */
-webkit-filter: grayscale(100%) opacity(60%); /* Chrome 19+, Safari 6+, Safari 6+ iOS */
}
.unselectable {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.notifiyBox {
position: absolute;
z-index:1000;
top: 50px;
right: 26px;
width: 300px;
text-align: left;
background-color: #F0ECCD;
border: 4px solid #666;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
-webkit-box-shadow: 2px 2px 4px #888;
-moz-box-shadow: 2px 2px 4px #888;
box-shadow: 2px 2px 4px #888;
max-height:200px;
}
.notifiyBox:before {
content: ' ';
position: absolute;
width: 0;
height: 0;
right: 5px;
top: -30px;
border: 15px solid;
border-color: transparent #666 #666 transparent;
}
.notifiyBox:after {
content: ' ';
position: absolute;
width: 0;
height: 0;
right: 7px;
top: -24px;
border: 12px solid;
border-color: transparent #F0ECCD #F0ECCD transparent;
}
.notification {
width:100%;
min-height:30px;
}
.notification:hover {
background-color: #EFE8B6;
}
.deskToolsBar {
padding:3px;
}
.deskToolsBar:hover {
background-color: #EFE8B6;
}
.userTableHeader {
border-bottom: 1pt solid lightgray;
padding-top: 4px;
padding-bottom: 4px;
}
.viewSelector {
width:32px;
height:32px;
background-color:#DDD;
border-radius:3px;
float:left;
margin-left:5px;
cursor: pointer;
opacity: 0.3;
}
.viewSelectorSel {
background-color:#BBB;
opacity: 0.8;
}
.viewSelector:hover {
opacity: 0.5;
background-color:#AAA;
}
.viewSelector1 {
margin-left:2px;
margin-top:2px;
background: url(../images/views.png) -0px 0px;
height: 28px;
width: 28px;
}
.viewSelector2 {
margin-left:2px;
margin-top:2px;
background: url(../images/views.png) -28px 0px;
height: 28px;
width: 28px;
}
.viewSelector3 {
margin-left:2px;
margin-top:2px;
background: url(../images/views.png) -56px 0px;
height: 28px;
width: 28px;
}
.viewSelector4 {
margin-left:2px;
margin-top:2px;
background: url(../images/views.png) -84px 0px;
height: 28px;
width: 28px;
}
.viewSelector5 {
margin-left:2px;
margin-top:2px;
background: url(../images/views.png) -112px 0px;
height: 28px;
width: 28px;
}
.backButtonEx {
margin-left:2px;
margin-top:2px;
background: url(../images/views.png) -140px 0px;
height: 28px;
width: 28px;
}
.backButton {
width:32px;
height:32px;
background-color:#DDD;
border-radius:3px;
float:left;
margin-right:5px;
cursor: pointer;
opacity: 0.3;
}
.backButton:hover {
opacity: 0.5;
background-color:#AAA;
}
.hoverButton {
opacity: 0.5;
}
.hoverButton:hover {
opacity: 1;
}
.devgrid-container {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, auto));
}
.devgrid-container > div {
}