mirror of
https://github.com/Ylianst/MeshCommander
synced 2025-12-06 06:03:20 +00:00
Improved KVM auto-reconnect.
This commit is contained in:
@@ -190,6 +190,7 @@ var CreateAmtRemoteDesktop = function (divid, scrolldiv) {
|
||||
_SendRefresh();
|
||||
|
||||
if (obj.onScreenSizeChange != null) { obj.onScreenSizeChange(obj, obj.ScreenWidth, obj.ScreenHeight); }
|
||||
if (obj.parent) { obj.parent.disconnectCode = 50001; } // Everything looks good, a disconnection here would be Intel AMT initiated.
|
||||
}
|
||||
else if (obj.state == 4) {
|
||||
switch (obj.acc[0]) {
|
||||
|
||||
@@ -28,7 +28,7 @@ var CreateAmtRedirect = function (module) {
|
||||
obj.authuri = '/RedirectionService';
|
||||
obj.digestRealmMatch = null;
|
||||
obj.onStateChanged = null;
|
||||
obj.disconnectCode = 0;
|
||||
obj.disconnectCode = 0; // 2 = BUSY, 3 = UNSUPPORTED, 256 = ERROR, 50000 = RLE16 fail, 50001 = AmtDisconnect.
|
||||
|
||||
function ToIntStr(v) { return String.fromCharCode((v & 0xFF), ((v >> 8) & 0xFF), ((v >> 16) & 0xFF), ((v >> 24) & 0xFF)); }
|
||||
function ToShortStr(v) { return String.fromCharCode((v & 0xFF), ((v >> 8) & 0xFF)); }
|
||||
@@ -47,6 +47,7 @@ var CreateAmtRedirect = function (module) {
|
||||
obj.xtlsoptions = tlsoptions;
|
||||
obj.xtlsFingerprint = tlsFingerprint;
|
||||
obj.connectstate = 0;
|
||||
obj.disconnectCode = 0;
|
||||
|
||||
if (obj.xtlsoptions && obj.xtlsoptions.meshServerConnect) {
|
||||
// Use the websocket wrapper to connect to MeshServer server
|
||||
|
||||
12
index.html
12
index.html
@@ -1028,7 +1028,7 @@
|
||||
</div>
|
||||
<div>
|
||||
<div id="idx_deskFullBtn2" onclick="deskToggleFull()" style="float:left;cursor:pointer;font-size:15px;display:none"> ✖</div>
|
||||
<input type="button" id="idx_connectbutton1" value="Connect" onclick="connectDesktop(event)" onkeypress="return false" onkeydown="return false" disabled="disabled">
|
||||
<input type="button" id="idx_connectbutton1" value="Connect" onclick="connectDesktopButton(event)" onkeypress="return false" onkeydown="return false" disabled="disabled">
|
||||
<span id="id_deskstatus">Disconnected.</span>
|
||||
</div>
|
||||
</td>
|
||||
@@ -2908,6 +2908,7 @@
|
||||
terminal.Stop();
|
||||
// ###END###{Terminal}
|
||||
// ###BEGIN###{Desktop}
|
||||
desktop.disconnectCode = 0;
|
||||
desktop.Stop();
|
||||
// ###END###{Desktop}
|
||||
}
|
||||
@@ -8213,6 +8214,8 @@
|
||||
*/
|
||||
// ###END###{DesktopInband}
|
||||
|
||||
function connectDesktopButton(e) { desktop.disconnectCode = 0; connectDesktop(e); }
|
||||
|
||||
var connectDesktopConsent = false;
|
||||
function connectDesktop(skipConsent) {
|
||||
if (!desktop || xxdialogMode) return;
|
||||
@@ -8394,6 +8397,7 @@
|
||||
// ###END###{Desktop-Multi}
|
||||
|
||||
function onDesktopStateChange(desktop, state) {
|
||||
var reconnect = false;
|
||||
//console.log("onDesktopStateChange: " + state);
|
||||
idx_connectbutton1.value = (state == 0) ? "Connect" : "Disconnect";
|
||||
var input = ((state == 3) && !urlvars['kvmviewonly']);
|
||||
@@ -8424,6 +8428,8 @@
|
||||
messagebox("Remote Desktop", "The device indicated that this type of connection of not supported.");
|
||||
} else if (desktop.disconnectCode == 50000) { // KVM-Disconnect
|
||||
messagebox("Remote Desktop", "KVM disconnection, they may indicate that Intel AMT is unable to capture the display (Try RLE8 encoding), or unsupported GPU.");
|
||||
} else if (desktop.disconnectCode == 50001) { // Intel AMT disconnect, try to connect again
|
||||
reconnect = true;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
@@ -8440,6 +8446,7 @@
|
||||
// ###END###{Mode-NodeWebkit}
|
||||
center();
|
||||
updateDesktopState();
|
||||
if (reconnect) { setTimeout(connectDesktop, 200); }
|
||||
}
|
||||
|
||||
// Update remote desktop status
|
||||
@@ -8488,7 +8495,7 @@
|
||||
if (desktopsettings.showfocus == false) { desktop.m.focusmode = 0; idx_deskFocusBtn.value = "All Focus"; }
|
||||
// ###END###{DesktopFocus}
|
||||
desktop.m.frameRateDelay = (desktopsettings.limitFrameRate == true)?200:0;
|
||||
if (desktop.State != 0) { desktop.Stop(); setTimeout(connectDesktop, 50); }
|
||||
if (desktop.State != 0) { desktop.disconnectCode = 0; desktop.Stop(); setTimeout(connectDesktop, 50); }
|
||||
}
|
||||
|
||||
function applyDesktopSettings() {
|
||||
@@ -13426,6 +13433,7 @@
|
||||
// ###END###{Mode-NodeWebkit}
|
||||
|
||||
// ###BEGIN###{Desktop}
|
||||
window['connectDesktopButton'] = connectDesktopButton;
|
||||
window['connectDesktop'] = connectDesktop;
|
||||
window['deskToggleFull'] = deskToggleFull;
|
||||
window['showDesktopSettings'] = showDesktopSettings;
|
||||
|
||||
Reference in New Issue
Block a user