|
|
@ -40,14 +40,21 @@ define('forum/admin/index', 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({
|
|
|
|
app.alert({
|
|
|
|
timeout: 5000,
|
|
|
|
alert_id: 'instance_restart',
|
|
|
|
|
|
|
|
type: 'info',
|
|
|
|
title: 'Restarting... <i class="fa fa-spin fa-refresh"></i>',
|
|
|
|
title: 'Restarting... <i class="fa fa-spin fa-refresh"></i>',
|
|
|
|
message: 'NodeBB is restarting.',
|
|
|
|
message: 'NodeBB is restarting.',
|
|
|
|
type: 'info'
|
|
|
|
timeout: 5000
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$(window).one('action:reconnected', function() {
|
|
|
|
$(window).one('action:reconnected', function() {
|
|
|
|
app.alertSuccess('NodeBB has successfully restarted.');
|
|
|
|
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');
|
|
|
|
socket.emit('admin.restart');
|
|
|
@ -58,21 +65,27 @@ define('forum/admin/index', function() {
|
|
|
|
$('.reload').on('click', function() {
|
|
|
|
$('.reload').on('click', function() {
|
|
|
|
app.alert({
|
|
|
|
app.alert({
|
|
|
|
alert_id: 'instance_reload',
|
|
|
|
alert_id: 'instance_reload',
|
|
|
|
title: 'Reloading... <i class="fa fa-spin fa-refresh"></i>',
|
|
|
|
|
|
|
|
message: 'NodeBB is restarting.',
|
|
|
|
|
|
|
|
type: 'info',
|
|
|
|
type: 'info',
|
|
|
|
|
|
|
|
title: 'Reloading... <i class="fa fa-spin fa-refresh"></i>',
|
|
|
|
|
|
|
|
message: 'NodeBB is reloading.',
|
|
|
|
timeout: 5000
|
|
|
|
timeout: 5000
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
socket.emit('admin.reload', function(err) {
|
|
|
|
socket.emit('admin.reload', function(err) {
|
|
|
|
if (!err) {
|
|
|
|
if (!err) {
|
|
|
|
app.alertSuccess('NodeBB has successfully reloaded.');
|
|
|
|
app.alert({
|
|
|
|
|
|
|
|
alert_id: 'instance_reload',
|
|
|
|
|
|
|
|
type: 'success',
|
|
|
|
|
|
|
|
title: '<i class="fa fa-check"></i> Success',
|
|
|
|
|
|
|
|
message: 'NodeBB has successfully reloaded.',
|
|
|
|
|
|
|
|
timeout: 5000
|
|
|
|
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
app.alert({
|
|
|
|
app.alert({
|
|
|
|
alert_id: 'instance_reload',
|
|
|
|
alert_id: 'instance_reload',
|
|
|
|
|
|
|
|
type: 'danger',
|
|
|
|
title: '[[global:alert.error]]',
|
|
|
|
title: '[[global:alert.error]]',
|
|
|
|
message: err.message,
|
|
|
|
message: err.message
|
|
|
|
type: 'danger'
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|