mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-07-04 10:29:44 +02:00
Merge branch 'master' into develop
This commit is contained in:
@@ -6,7 +6,7 @@ const uploadsController = require('../controllers/uploads');
|
||||
const helpers = require('./helpers');
|
||||
|
||||
module.exports = function (app, middleware, controllers) {
|
||||
const middlewares = [middleware.authenticateRequest];
|
||||
const middlewares = [middleware.autoLocale, middleware.authenticateRequest];
|
||||
const router = express.Router();
|
||||
app.use('/api', router);
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
const topics = require('../../topics');
|
||||
const io = require('..');
|
||||
const webserver = require('../../webserver');
|
||||
|
||||
const totals = {};
|
||||
|
||||
@@ -94,6 +95,7 @@ SocketRooms.getLocalStats = function () {
|
||||
onlineGuestCount: 0,
|
||||
onlineRegisteredCount: 0,
|
||||
socketCount: 0,
|
||||
connectionCount: webserver.getConnectionCount(),
|
||||
users: {
|
||||
categories: 0,
|
||||
recent: 0,
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<td class="fw-bold">[[admin/development/info:process-memory]]</td>
|
||||
<td class="fw-bold">[[admin/development/info:system-memory]]</td>
|
||||
<td class="fw-bold">[[admin/development/info:load]]</td>
|
||||
<td class="fw-bold">[[admin/development/info:uptime]]</td>
|
||||
<td class="fw-bold text-end">[[admin/development/info:uptime]]</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="text-xs">
|
||||
@@ -34,7 +34,8 @@
|
||||
<td>
|
||||
<span title="[[admin/development/info:registered]]">{info.stats.onlineRegisteredCount}</span> /
|
||||
<span title="[[admin/development/info:guests]]">{info.stats.onlineGuestCount}</span> /
|
||||
<span title="[[admin/development/info:sockets]]">{info.stats.socketCount}</span>
|
||||
<span title="[[admin/development/info:sockets]]">{info.stats.socketCount}</span> /
|
||||
<span title="[[admin/development/info:connection-count]]">{info.stats.connectionCount}</span>
|
||||
</td>
|
||||
<td>{info.git.branch}@<a href="https://github.com/NodeBB/NodeBB/commit/{info.git.hash}" target="_blank">{info.git.hashShort}</a></td>
|
||||
<td>{info.process.cpuUsage}%</td>
|
||||
@@ -46,7 +47,7 @@
|
||||
<span title="[[admin/development/info:total-memory-os]]">{info.os.totalmem} gb</span>
|
||||
</td>
|
||||
<td>{info.os.load}</td>
|
||||
<td>{info.process.uptimeHumanReadable}</td>
|
||||
<td class="text-end">{info.process.uptimeHumanReadable}</td>
|
||||
</tr>
|
||||
{{{ end }}}
|
||||
</tbody>
|
||||
|
||||
@@ -76,6 +76,10 @@ exports.destroy = function (callback) {
|
||||
}
|
||||
};
|
||||
|
||||
exports.getConnectionCount = function () {
|
||||
return Object.keys(connections).length;
|
||||
};
|
||||
|
||||
exports.listen = async function () {
|
||||
emailer.registerApp(app);
|
||||
setupExpressApp(app);
|
||||
|
||||
Reference in New Issue
Block a user