Files
NodeBB/public/src/admin/modules/instance.js

69 lines
1.5 KiB
JavaScript
Raw Normal View History

2015-06-08 15:50:33 -04:00
"use strict";
define('admin/modules/instance', function () {
2015-06-08 15:50:33 -04:00
var instance = {};
instance.reload = function (callback) {
2015-06-08 15:50:33 -04:00
app.alert({
alert_id: 'instance_reload',
type: 'info',
title: 'Reloading... <i class="fa fa-spin fa-refresh"></i>',
message: 'NodeBB is reloading.',
2017-02-17 19:31:21 -07:00
timeout: 5000,
2015-06-08 15:50:33 -04:00
});
$(window).one('action:reconnected', function () {
app.alert({
alert_id: 'instance_reload',
type: 'success',
title: '<i class="fa fa-check"></i> Success',
message: 'NodeBB has reloaded successfully.',
2017-02-17 19:31:21 -07:00
timeout: 5000,
});
2015-06-08 15:50:33 -04:00
if (typeof callback === 'function') {
callback();
}
});
socket.emit('admin.reload');
2015-06-08 15:53:07 -04:00
};
2015-06-08 15:52:39 -04:00
instance.restart = function (callback) {
2015-06-08 15:52:39 -04:00
app.alert({
alert_id: 'instance_restart',
type: 'info',
title: 'Rebuilding... <i class="fa fa-spin fa-refresh"></i>',
2016-12-15 13:03:14 +03:00
message: 'NodeBB is rebuilding front-end assets (css, javascript, etc).',
2017-02-17 19:31:21 -07:00
timeout: 10000,
2015-06-08 15:52:39 -04:00
});
$(window).one('action:reconnected', function () {
2015-06-08 15:52:39 -04:00
app.alert({
alert_id: 'instance_restart',
type: 'success',
title: '<i class="fa fa-check"></i> Success',
message: 'NodeBB has successfully restarted.',
2017-02-17 19:31:21 -07:00
timeout: 10000,
2015-06-08 15:52:39 -04:00
});
if (typeof callback === 'function') {
callback();
}
});
socket.emit('admin.restart', function () {
app.alert({
alert_id: 'instance_restart',
type: 'info',
title: 'Build Complete!... <i class="fa fa-spin fa-refresh"></i>',
message: 'NodeBB is reloading.',
2017-02-17 19:31:21 -07:00
timeout: 10000,
});
});
2015-06-08 15:53:07 -04:00
};
2016-12-15 13:03:14 +03:00
2015-06-08 15:50:33 -04:00
return instance;
});