admin: added vex-dialog in admin panel when WSD shutdowns

Signed-off-by: Rash419 <rasheshpadia419@gmail.com>
Change-Id: I16f9a2a55b7b17fe10ae14266c7db574bd2751ac
This commit is contained in:
Rash419 2020-11-07 18:13:45 +05:30 committed by Pranam Lashkari
parent 4c5bf4f116
commit 725cbe6457
7 changed files with 22 additions and 10 deletions

View file

@ -12,6 +12,7 @@
<title>Collabora Online - Admin console</title>
<script src="%SERVICE_ROOT%/loleaflet/%VERSION%/admin-bundle.js"></script>
<link rel=StyleSheet href="%SERVICE_ROOT%/loleaflet/%VERSION%/admin/css/bulma.min.css" type="text/css" />
<link rel=StyleSheet href="%SERVICE_ROOT%/loleaflet/%VERSION%/vex.css" type="text/css" />
<style>
@font-face {

View file

@ -519,6 +519,7 @@ var AdminSocketAnalytics = AdminSocketBase.extend({
onSocketClose: function() {
clearInterval(this._basicStatsIntervalId);
this.base.call(this);
}
});

View file

@ -15,7 +15,7 @@ if (typeof String.prototype.startsWith !== 'function') {
var AdminSocketBase = Base.extend({
socket: null,
constructor: function(host) {
constructor: function (host) {
// because i am abstract
if (this.constructor === AdminSocketBase) {
throw new Error('Cannot instantiate abstract class');
@ -33,24 +33,32 @@ var AdminSocketBase = Base.extend({
}
},
onSocketOpen: function() {
onSocketOpen: function () {
// Authenticate
var cookie = Util.getCookie('jwt');
this.socket.send('auth ' + cookie);
},
onSocketMessage: function() {
onSocketMessage: function () {
/* Implemented by child */
},
onSocketClose: function() {
this.socket.onerror = function() {};
this.socket.onclose = function() {};
this.socket.onmessage = function() {};
onSocketClose: function () {
this.socket.onerror = function () { };
this.socket.onclose = function () { };
this.socket.onmessage = function () { };
this.vexInstance = vex.open({
content: _('Server has been shutdown please reload the page'),
contentClassName: 'loleaflet-user-idle',
showCloseButton: false,
overlayClosesOnClick: false,
escapeButtonCloses: false,
});
this.socket.close();
},
onSocketError: function() {
onSocketError: function () {
vex.dialog.alert(_('Connection error'));
}
});

View file

@ -41,7 +41,7 @@ var AdminSocketHistory = AdminSocketBase.extend({
},
onSocketClose: function() {
this.base.call(this);
}
});

View file

@ -113,7 +113,7 @@ var AdminSocketLog = AdminSocketBase.extend({
},
onSocketClose: function() {
this.base.call(this);
}
});

View file

@ -388,6 +388,7 @@ var AdminSocketOverview = AdminSocketBase.extend({
onSocketClose: function() {
clearInterval(this._basicStatsIntervalId);
clearInterval(this._docElapsedTimeIntervalId);
this.base.call(this);
}
});

View file

@ -100,6 +100,7 @@ var AdminSocketSettings = AdminSocketBase.extend({
onSocketClose: function() {
clearInterval(this._basicStatsIntervalId);
this.base.call(this);
}
});