mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
Added xterm terminal and fixed device link.
This commit is contained in:
parent
b6ff01775f
commit
2f37cd882e
10 changed files with 1444 additions and 990 deletions
|
@ -148,34 +148,9 @@ var CreateAgentRedirect = function (meshserver, module, serverPublicNamePort, au
|
|||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
if (typeof e.data == 'object') {
|
||||
var f = new FileReader();
|
||||
if (f.readAsBinaryString) {
|
||||
// Chrome & Firefox (Draft)
|
||||
f.onload = function (e) { obj.xxOnSocketData(e.target.result); }
|
||||
f.readAsBinaryString(new Blob([e.data]));
|
||||
} else if (f.readAsArrayBuffer) {
|
||||
// Chrome & Firefox (Spec)
|
||||
f.onloadend = function (e) { obj.xxOnSocketData(e.target.result); }
|
||||
f.readAsArrayBuffer(e.data);
|
||||
} else {
|
||||
// IE10, readAsBinaryString does not exist, use an alternative.
|
||||
var binary = '';
|
||||
var bytes = new Uint8Array(e.data);
|
||||
var length = bytes.byteLength;
|
||||
for (var i = 0; i < length; i++) { binary += String.fromCharCode(bytes[i]); }
|
||||
obj.xxOnSocketData(binary);
|
||||
}
|
||||
} else {
|
||||
// If we get a string object, it maybe the WebRTC confirm. Ignore it.
|
||||
obj.xxOnSocketData(e.data);
|
||||
}
|
||||
*/
|
||||
|
||||
if (typeof e.data == 'object') {
|
||||
if (fileReaderInuse == true) { fileReaderAcc.push(e.data); return; }
|
||||
if (fileReader.readAsBinaryString) {
|
||||
if (fileReader.readAsBinaryString && (obj.m.ProcessBinaryData == null)) {
|
||||
// Chrome & Firefox (Draft)
|
||||
fileReaderInuse = true;
|
||||
fileReader.readAsBinaryString(new Blob([e.data]));
|
||||
|
@ -209,6 +184,7 @@ var CreateAgentRedirect = function (meshserver, module, serverPublicNamePort, au
|
|||
obj.xxOnSocketData = function (data) {
|
||||
if (!data || obj.connectstate == -1) return;
|
||||
if (typeof data === 'object') {
|
||||
if (obj.m.ProcessBinaryData) { return obj.m.ProcessBinaryData(data); }
|
||||
// This is an ArrayBuffer, convert it to a string array (used in IE)
|
||||
var binary = '', bytes = new Uint8Array(data), length = bytes.byteLength;
|
||||
for (var i = 0; i < length; i++) { binary += String.fromCharCode(bytes[i]); }
|
||||
|
|
2
public/scripts/xterm-addon-fit.js
Normal file
2
public/scripts/xterm-addon-fit.js
Normal file
|
@ -0,0 +1,2 @@
|
|||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.FitAddon=t():e.FitAddon=t()}(window,function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.prototype.activate=function(e){this._terminal=e},e.prototype.dispose=function(){},e.prototype.fit=function(){var e=this.proposeDimensions();if(e&&this._terminal){var t=this._terminal._core;this._terminal.rows===e.rows&&this._terminal.cols===e.cols||(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}},e.prototype.proposeDimensions=function(){if(this._terminal&&this._terminal.element&&this._terminal.element.parentElement){var e=this._terminal._core,t=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(t.getPropertyValue("height")),n=Math.max(0,parseInt(t.getPropertyValue("width"))),o=window.getComputedStyle(this._terminal.element),i=r-(parseInt(o.getPropertyValue("padding-top"))+parseInt(o.getPropertyValue("padding-bottom"))),a=n-(parseInt(o.getPropertyValue("padding-right"))+parseInt(o.getPropertyValue("padding-left")))-e.viewport.scrollBarWidth;return{cols:Math.max(2,Math.floor(a/e._renderService.dimensions.actualCellWidth)),rows:Math.max(1,Math.floor(i/e._renderService.dimensions.actualCellHeight))}}},e}();t.FitAddon=n}])});
|
||||
//# sourceMappingURL=xterm-addon-fit.js.map
|
2
public/scripts/xterm.js
Normal file
2
public/scripts/xterm.js
Normal file
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue