mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
Improved web socket error handling, Selfupdate can now be set to specific version.
This commit is contained in:
parent
75ee8dfd78
commit
635c8fb441
6 changed files with 44 additions and 27 deletions
|
@ -195,13 +195,13 @@
|
|||
<strong><font style="font-size:12px;font-family:Arial,Helvetica,sans-serif">{{{title2}}}</font></strong>
|
||||
</div>
|
||||
</div>
|
||||
<img class=noselect style="position:absolute;right:0;top:10px;bottom:50px;color:#c8c8c8;font-size:44px;margin-right:8px;cursor:pointer" onclick=topMenu() src="/images/3bars-30.png" width=30 height=30 />
|
||||
<img id="topMenuIcon" class=noselect style="position:absolute;right:0;top:10px;bottom:50px;color:#c8c8c8;font-size:44px;margin-right:8px;cursor:pointer;display:none" onclick=topMenu() src="/images/3bars-30.png" width=30 height=30 />
|
||||
</div>
|
||||
<div id=page_content style="overflow-y:scroll;position:absolute;bottom:32px;top:50px;width:100%">
|
||||
<div id=column_l style="width:100%;padding:0;position:absolute;bottom:0px;top:0px">
|
||||
<div id=p0 style=display:none;width:100%;height:100%>
|
||||
<div style="display:flex;align-items:center;width:100%;height:100%">
|
||||
<div id=p0message style=text-align:center;width:100%>Server disconnected, <href onclick=reload() style=cursor:pointer><u>click to reconnect</u></href>.</div>
|
||||
<div id=p0message style=text-align:center;width:100%><span id="p0span">Server disconnected</span>, <href onclick=reload() style=cursor:pointer><u>click to reconnect</u></href>.</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id=p1 style=display:none;width:100%;height:100%>
|
||||
|
@ -617,13 +617,12 @@
|
|||
applyDesktopSettings();
|
||||
}
|
||||
|
||||
function onStateChanged(server, state) {
|
||||
function onStateChanged(server, state, prevState, errorCode) {
|
||||
if (state == 0) {
|
||||
// Control web socket disconnected
|
||||
setDialogMode(0); // Close any dialog boxes if present
|
||||
go(0); // Go to disconnection panel
|
||||
setTimeout(serverPoll, 5000); // Start polling for the server
|
||||
|
||||
if (prevState == 2) { setTimeout(serverPoll, 5000); } else { QH('p0span', 'Unable to connect web socket'); }
|
||||
// Clean up here
|
||||
|
||||
} else if (state == 2) {
|
||||
|
@ -633,6 +632,7 @@
|
|||
meshserver.send({ action: 'files' });
|
||||
if (xxcurrentView < 2) { go(2); }
|
||||
}
|
||||
QV('topMenuIcon', state == 2);
|
||||
}
|
||||
|
||||
// Poll the server, if it responds, refresh the page.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue