mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-18 13:32:58 +01:00
added restart button to ACP (!!)
This commit is contained in:
@@ -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>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</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 = {};
|
||||
|
||||
Reference in New Issue
Block a user