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:
parent
4c5bf4f116
commit
725cbe6457
7 changed files with 22 additions and 10 deletions
|
@ -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 {
|
||||
|
|
|
@ -519,6 +519,7 @@ var AdminSocketAnalytics = AdminSocketBase.extend({
|
|||
|
||||
onSocketClose: function() {
|
||||
clearInterval(this._basicStatsIntervalId);
|
||||
this.base.call(this);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -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'));
|
||||
}
|
||||
});
|
||||
|
|
|
@ -41,7 +41,7 @@ var AdminSocketHistory = AdminSocketBase.extend({
|
|||
},
|
||||
|
||||
onSocketClose: function() {
|
||||
|
||||
this.base.call(this);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ var AdminSocketLog = AdminSocketBase.extend({
|
|||
},
|
||||
|
||||
onSocketClose: function() {
|
||||
|
||||
this.base.call(this);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -388,6 +388,7 @@ var AdminSocketOverview = AdminSocketBase.extend({
|
|||
onSocketClose: function() {
|
||||
clearInterval(this._basicStatsIntervalId);
|
||||
clearInterval(this._docElapsedTimeIntervalId);
|
||||
this.base.call(this);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -100,6 +100,7 @@ var AdminSocketSettings = AdminSocketBase.extend({
|
|||
|
||||
onSocketClose: function() {
|
||||
clearInterval(this._basicStatsIntervalId);
|
||||
this.base.call(this);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue