MeshPlayer can now play MeshCentral terminal sessions.

Ylian Saint-Hilaire committed Aug 13, 2019 at 14:22 UTC 78198a3b13f3ec517e3bd7ec9a531010e5037f32
1 file changed +9 -13
public/player.htm
+9 -13
@@ -31,15 +31,15 @@
31 <div id=deskarea2 style="">
32 <div class="areaProgress"><div id="progressbar" style=""></div></div>
33 </div>
34 - <div id=deskarea3x style="max-height:calc(100vh - 54px);height:calc(100vh - 54px);position:relative">
34 + <div id=deskarea3x style="max-height:calc(100vh - 54px);height:calc(100vh - 54px);" onclick="togglePause()">
35 <div id="bigok" style="display:none;left:calc((100vh / 2))"><b>&checkmark;</b></div>
36 <div id="bigfail" style="display:none;left:calc((100vh / 2))"><b>&#10007;</b></div>
37 <div id="metadatadiv" style="padding:20px;color:lightgrey;text-align:left;display:none"></div>
38 <div id=DeskParent onclick="togglePause()">
39 <canvas id=Desk width=640 height=480></canvas>
40 </div>
41 - <div id=TermParent onclick="togglePause()" style="margin:0;overflow:hidden;height:100px;left:0;position:absolute;right:0;top:0;background-color:red">
42 - <pre id=Term style="background-color:blue"></pre>
41 + <div id=TermParent onclick="togglePause()" style="display:none">
42 + <pre id=Term></pre>
43 </div>
44 <div id=p11DeskConsoleMsg style="display:none;cursor:pointer;position:absolute;left:30px;top:17px;color:yellow;background-color:rgba(0,0,0,0.6);padding:10px;border-radius:5px" onclick=clearConsoleMsg()></div>
45 </div>
@@ -180,7 +180,6 @@
180 else if (p == 101) { p = 'Intel&reg; AMT Redirection'; }
181 x += addInfoNoEsc('Protocol', p);
182 }
183 - console.log('desk');
183 QV('DeskParent', true);
184 QV('TermParent', false);
185 if (recFileMetadata.protocol == 1) {
@@ -191,8 +190,6 @@
190 QE('PauseButton', false);
191 QE('RestartButton', false);
192 recFileStartTime = recFileLastTime = time;
194 - agentTerminal = CreateAmtRemoteTerminal('Term', {});
195 - agentTerminal.State = 3;
193 }
194 else if (recFileMetadata.protocol == 2) {
195 // MeshCentral remote desktop
@@ -288,6 +285,7 @@
285 waitTimerArgs = null;
286 currentDeltaTimeTotalSec = 0;
287 recFileEndTime = 0;
288 + agentTerminal = null;
289 if (waitTimer != null) { clearTimeout(waitTimer); waitTimer = null; }
290 QH('deskstatus', '');
291 QE('PlayButton', false);
@@ -297,8 +295,6 @@
295 QH('timespan', '00:00:00');
296 QV('metadatadiv', true);
297 QH('metadatadiv', '<span style=\"font-family:Arial,Helvetica Neue,Helvetica,sans-serif;font-size:28px\">MeshCentral Session Player</span><br /><br /><span style=color:gray>Drag & drop a .mcrec file or click "Open File..."</span>');
300 - QH('Term', '');
301 - console.log('desk');
298 QV('DeskParent', true);
299 QV('TermParent', false);
300 }
@@ -384,10 +380,11 @@
380 QE('PlayButton', false);
381 QE('PauseButton', true);
382 QE('RestartButton', false);
387 - if (recFileProtocol == 1) {
388 - console.log('term');
383 + if ((recFileProtocol == 1) && (agentTerminal == null)) {
384 QV('DeskParent', false);
385 QV('TermParent', true);
386 + agentTerminal = CreateAmtRemoteTerminal('Term', {});
387 + agentTerminal.State = 3;
388 }
389 readNextBlock(processBlock);
390 }
@@ -419,8 +416,6 @@
416 QE('RestartButton', false);
417 QS('progressbar').width = '0px';
418 QH('timespan', '00:00:00');
422 - QH('Term', '');
423 - console.log('desk');
419 QV('DeskParent', true);
420 QV('TermParent', false);
421 if (agentDesktop) {
@@ -431,6 +426,8 @@
426 amtDesktop.onScreenSizeChange = deskAdjust;
427 amtDesktop.State = 3;
428 amtDesktop.Start();
429 + } else if (agentTerminal) {
430 + agentTerminal = null;
431 }
432 }
433
@@ -443,7 +440,6 @@
440 }
441
442 function deskAdjust() {
446 - return;
443 var parentH = Q('DeskParent').clientHeight, parentW = Q('DeskParent').clientWidth;
444 var deskH = Q('Desk').height, deskW = Q('Desk').width;
445