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

New toast notifications

This commit is contained in:
Ylian Saint-Hilaire 2018-04-19 18:19:15 -07:00
parent b6b2706d19
commit bd82453c3b
30 changed files with 725 additions and 33 deletions

BIN
public/images/mesh-200.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

View file

@ -81,9 +81,6 @@ var CreateAgentRedirect = function (meshserver, module, serverPublicNamePort) {
}
}
// Close the WebRTC connection, should be called if a problem occurs during WebRTC setup.
obj.xxCloseWebRTC = function () { obj.Stop(); }
obj.xxOnMessage = function (e) {
//if (obj.debugmode == 1) { console.log('Recv', e.data); }
//console.log('Recv', e.data, obj.State);
@ -111,7 +108,8 @@ var CreateAgentRedirect = function (meshserver, module, serverPublicNamePort) {
}
obj.webrtc.oniceconnectionstatechange = function () {
if (obj.webrtc != null) {
if ((obj.webrtc.iceConnectionState == 'disconnected') || (obj.webrtc.iceConnectionState == 'failed')) { obj.xxCloseWebRTC(); }
if (obj.webrtc.iceConnectionState == 'disconnected') { obj.Stop(); }
else if (obj.webrtc.iceConnectionState == 'failed') { obj.xxCloseWebRTC(); }
}
}
obj.webrtc.createOffer(function (offer) {
@ -206,13 +204,18 @@ var CreateAgentRedirect = function (meshserver, module, serverPublicNamePort) {
if (obj.onStateChanged != null) obj.onStateChanged(obj, obj.State);
}
obj.Stop = function (x) {
if (obj.debugmode == 1) { console.log('stop', x); }
// Close WebRTC
// Close the WebRTC connection, should be called if a problem occurs during WebRTC setup.
obj.xxCloseWebRTC = function () {
if (obj.webchannel != null) { try { obj.webchannel.close(); } catch (e) { } obj.webchannel = null; }
if (obj.webrtc != null) { try { obj.webrtc.close(); } catch (e) { } obj.webrtc = null; }
obj.webRtcActive = false;
}
obj.Stop = function (x) {
if (obj.debugmode == 1) { console.log('stop', x); }
// Clean up WebRTC
obj.xxCloseWebRTC();
//obj.debug("Agent Redir Socket Stopped");
obj.connectstate = -1;