mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 09:06:15 +01:00
feat: short more info
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
"ip": "IP <strong>%1</strong>",
|
"ip": "IP <strong>%1</strong>",
|
||||||
"nodes-responded": "%1 nodes responded within %2ms!",
|
"nodes-responded": "%1 nodes responded within %2ms!",
|
||||||
"host": "host",
|
"host": "host",
|
||||||
|
"primary": "primary / run jobs",
|
||||||
"pid": "pid",
|
"pid": "pid",
|
||||||
"nodejs": "nodejs",
|
"nodejs": "nodejs",
|
||||||
"online": "online",
|
"online": "online",
|
||||||
|
|||||||
@@ -79,6 +79,12 @@ async function getNodeInfo() {
|
|||||||
release: os.release(),
|
release: os.release(),
|
||||||
load: os.loadavg().map(function (load) { return load.toFixed(2); }).join(', '),
|
load: os.loadavg().map(function (load) { return load.toFixed(2); }).join(', '),
|
||||||
},
|
},
|
||||||
|
nodebb: {
|
||||||
|
isCluster: nconf.get('isCluster'),
|
||||||
|
isPrimary: nconf.get('isPrimary'),
|
||||||
|
runJobs: nconf.get('runJobs'),
|
||||||
|
jobsDisabled: nconf.get('jobsDisabled'),
|
||||||
|
},
|
||||||
};
|
};
|
||||||
data.process.cpuUsage.user /= 1000000;
|
data.process.cpuUsage.user /= 1000000;
|
||||||
data.process.cpuUsage.user = data.process.cpuUsage.user.toFixed(2);
|
data.process.cpuUsage.user = data.process.cpuUsage.user.toFixed(2);
|
||||||
@@ -109,5 +115,5 @@ async function getGitInfo() {
|
|||||||
getAsync('git rev-parse HEAD'),
|
getAsync('git rev-parse HEAD'),
|
||||||
getAsync('git rev-parse --abbrev-ref HEAD'),
|
getAsync('git rev-parse --abbrev-ref HEAD'),
|
||||||
]);
|
]);
|
||||||
return { hash: hash, branch: branch };
|
return { hash: hash, hashShort: hash.substr(0, 6), branch: branch };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<td>[[admin/development/info:host]]</td>
|
<td>[[admin/development/info:host]]</td>
|
||||||
|
<td class="text-center">[[admin/development/info:primary]]</td>
|
||||||
<td>[[admin/development/info:pid]]</td>
|
<td>[[admin/development/info:pid]]</td>
|
||||||
<td>[[admin/development/info:nodejs]]</td>
|
<td>[[admin/development/info:nodejs]]</td>
|
||||||
<td>[[admin/development/info:online]]</td>
|
<td>[[admin/development/info:online]]</td>
|
||||||
@@ -25,6 +26,10 @@
|
|||||||
<!-- BEGIN info -->
|
<!-- BEGIN info -->
|
||||||
<tr>
|
<tr>
|
||||||
<td>{info.os.hostname}:{info.process.port}</td>
|
<td>{info.os.hostname}:{info.process.port}</td>
|
||||||
|
<td class="text-center">
|
||||||
|
{{{if info.nodebb.isPrimary}}}<i class="fa fa-check"></i>{{{else}}}<i class="fa fa-times"></i>{{{end}}} /
|
||||||
|
{{{if info.nodebb.runJobs}}}<i class="fa fa-check"></i>{{{else}}}<i class="fa fa-times"></i>{{{end}}}
|
||||||
|
</td>
|
||||||
<td>{info.process.pid}</td>
|
<td>{info.process.pid}</td>
|
||||||
<td>{info.process.version}</td>
|
<td>{info.process.version}</td>
|
||||||
<td>
|
<td>
|
||||||
@@ -32,7 +37,7 @@
|
|||||||
<span title="[[admin/development/info:guests]]">{info.stats.onlineGuestCount}</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>
|
||||||
</td>
|
</td>
|
||||||
<td>{info.git.branch}@<a href="https://github.com/NodeBB/NodeBB/commit/{info.git.hash}" target="_blank">{info.git.hash}</a></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.user} / {info.process.cpuUsage.system}</td>
|
<td>{info.process.cpuUsage.user} / {info.process.cpuUsage.system}</td>
|
||||||
<td>{info.process.memoryUsage.humanReadable} mb</td>
|
<td>{info.process.memoryUsage.humanReadable} mb</td>
|
||||||
<td>{info.os.load}</td>
|
<td>{info.os.load}</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user