@ -31,6 +31,10 @@ define(function() {
checkEl.append('<p>A new version (v' + latestVersion + ') has been released. Consider upgrading your NodeBB.</p>');
}
});
$('.restart').on('click', function() {
socket.emit('admin.restart');
};
Admin.updateRoomUsage = function(err, data) {
@ -22,6 +22,9 @@
<p>
Always make sure that your <strong>NodeBB</strong> is up to date for the latest security patches and bug fixes.
</p>
<p class="pull-right">
<button class="btn btn-warning restart">Restart NodeBB</button>
</div>
@ -336,4 +336,12 @@ var fs = require('fs'),
db.getFileName(callback);
Meta.restart = function() {
if (process.send) {
process.send('nodebb:restart');
} else {
winston.error('[meta.restart] Could not restart, are you sure NodeBB was started with `./nodebb start`?');
}(exports));
@ -31,6 +31,10 @@ SocketAdmin.before = function(socket, next) {
SocketAdmin.restart = function(socket, data, callback) {
meta.restart();
/* Topics */
SocketAdmin.topics = {};