|
|
@ -37,18 +37,45 @@ define('forum/admin/index', function() {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$('.restart').on('click', function() {
|
|
|
|
$('.restart').on('click', function() {
|
|
|
|
|
|
|
|
bootbox.confirm('Are you sure you wish to restart NodeBB?', function(confirm) {
|
|
|
|
|
|
|
|
if (confirm) {
|
|
|
|
|
|
|
|
app.alert({
|
|
|
|
|
|
|
|
timeout: 5000,
|
|
|
|
|
|
|
|
title: 'Restarting... <i class="fa fa-spin fa-refresh"></i>',
|
|
|
|
|
|
|
|
message: 'NodeBB is restarting.',
|
|
|
|
|
|
|
|
type: 'info'
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(window).one('action:reconnected', function() {
|
|
|
|
|
|
|
|
app.alertSuccess('NodeBB has successfully restarted.');
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
socket.emit('admin.restart');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('.reload').on('click', function() {
|
|
|
|
app.alert({
|
|
|
|
app.alert({
|
|
|
|
timeout: 5000,
|
|
|
|
alert_id: 'instance_reload',
|
|
|
|
title: 'Restarting...',
|
|
|
|
title: 'Reloading... <i class="fa fa-spin fa-refresh"></i>',
|
|
|
|
message: 'NodeBB is restarting.',
|
|
|
|
message: 'NodeBB is restarting.',
|
|
|
|
type: 'info'
|
|
|
|
type: 'info',
|
|
|
|
|
|
|
|
timeout: 5000
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$(window).one('action:reconnected', function() {
|
|
|
|
socket.emit('admin.reload', function(err) {
|
|
|
|
app.alertSuccess('NodeBB has successfully restarted.');
|
|
|
|
if (!err) {
|
|
|
|
|
|
|
|
app.alertSuccess('NodeBB has successfully reloaded.');
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
app.alert({
|
|
|
|
|
|
|
|
alert_id: 'instance_reload',
|
|
|
|
|
|
|
|
title: '[[global:alert.error]]',
|
|
|
|
|
|
|
|
message: err.message,
|
|
|
|
|
|
|
|
type: 'danger'
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
socket.emit('admin.restart');
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|