This commit is contained in:
psychobunny
2015-04-17 13:21:45 -04:00
parent ee7d356781
commit c188fa2a1f
3 changed files with 78 additions and 61 deletions

View File

@@ -61,61 +61,6 @@ define('admin/general/dashboard', ['semver'], function(semver) {
}
});
$('.restart').on('click', function() {
bootbox.confirm('Are you sure you wish to restart NodeBB?', function(confirm) {
if (confirm) {
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
});
});
socket.emit('admin.restart');
}
});
});
$('.reload').on('click', function() {
app.alert({
alert_id: 'instance_reload',
type: 'info',
title: 'Reloading... <i class="fa fa-spin fa-refresh"></i>',
message: 'NodeBB is reloading.',
timeout: 5000
});
socket.emit('admin.reload', function(err) {
if (!err) {
app.alert({
alert_id: 'instance_reload',
type: 'success',
title: '<i class="fa fa-check"></i> Success',
message: 'NodeBB has successfully reloaded.',
timeout: 5000
});
} else {
app.alert({
alert_id: 'instance_reload',
type: 'danger',
title: '[[global:alert.error]]',
message: '[[error:reload-failed, ' + err.message + ']]'
});
}
});
});
setupGraphs();
};