mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-10 16:05:49 +01:00
instance.restart
This commit is contained in:
@@ -162,25 +162,9 @@
|
|||||||
$('.restart').off('click').on('click', function() {
|
$('.restart').off('click').on('click', function() {
|
||||||
bootbox.confirm('Are you sure you wish to restart NodeBB?', function(confirm) {
|
bootbox.confirm('Are you sure you wish to restart NodeBB?', function(confirm) {
|
||||||
if (confirm) {
|
if (confirm) {
|
||||||
app.alert({
|
require(['admin/modules/instance'], function(instance) {
|
||||||
alert_id: 'instance_restart',
|
instance.restart();
|
||||||
type: 'info',
|
|
||||||
title: 'Restarting... <i class="fa fa-spin fa-refresh"></i>',
|
|
||||||
message: 'NodeBB is restarting.',
|
|
||||||
timeout: 5000
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$(window).one('action:reconnected', function() {
|
|
||||||
app.alert({
|
|
||||||
alert_id: 'instance_restart',
|
|
||||||
type: 'success',
|
|
||||||
title: '<i class="fa fa-check"></i> Success',
|
|
||||||
message: 'NodeBB has successfully restarted.',
|
|
||||||
timeout: 5000
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
socket.emit('admin.restart');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -38,5 +38,31 @@ define('admin/modules/instance', function() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
instance.restart = function(callback) {
|
||||||
|
app.alert({
|
||||||
|
alert_id: 'instance_restart',
|
||||||
|
type: 'info',
|
||||||
|
title: 'Restarting... <i class="fa fa-spin fa-refresh"></i>',
|
||||||
|
message: 'NodeBB is restarting.',
|
||||||
|
timeout: 5000
|
||||||
|
});
|
||||||
|
|
||||||
|
$(window).one('action:reconnected', function() {
|
||||||
|
app.alert({
|
||||||
|
alert_id: 'instance_restart',
|
||||||
|
type: 'success',
|
||||||
|
title: '<i class="fa fa-check"></i> Success',
|
||||||
|
message: 'NodeBB has successfully restarted.',
|
||||||
|
timeout: 5000
|
||||||
|
});
|
||||||
|
|
||||||
|
if (typeof callback === 'function') {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
socket.emit('admin.restart');
|
||||||
|
}
|
||||||
|
|
||||||
return instance;
|
return instance;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user