mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 21:33:00 +02:00
have domain-server report non-skewed uptime
This commit is contained in:
parent
c8fbb64bbf
commit
2738f65c10
3 changed files with 5 additions and 5 deletions
|
@ -31,7 +31,7 @@
|
|||
<td><%- node.username %></td>
|
||||
<td><%- node.public.ip %><span class='port'>:<%- node.public.port %></span></td>
|
||||
<td><%- node.local.ip %><span class='port'>:<%- node.local.port %></span></td>
|
||||
<td><%- ((Date.now() - node.wake_timestamp) / 1000).toLocaleString() %></td>
|
||||
<td><%- node.uptime %></td>
|
||||
<td><%- (typeof node.pending_credits == 'number' ? node.pending_credits.toLocaleString() : 'N/A') %></td>
|
||||
<td><span class='glyphicon glyphicon-remove' data-uuid="<%- node.uuid %>"></span></td>
|
||||
</tr>
|
||||
|
|
|
@ -9,9 +9,9 @@ $(document).ready(function(){
|
|||
|
||||
json.nodes.sort(function(a, b){
|
||||
if (a.type === b.type) {
|
||||
if (a.wake_timestamp < b.wake_timestamp) {
|
||||
if (a.uptime > b.uptime) {
|
||||
return 1;
|
||||
} else if (a.wake_timestamp > b.wake_timestamp) {
|
||||
} else if (a.uptime < b.uptime) {
|
||||
return -1;
|
||||
} else {
|
||||
return 0;
|
||||
|
|
|
@ -1480,7 +1480,7 @@ const char JSON_KEY_PUBLIC_SOCKET[] = "public";
|
|||
const char JSON_KEY_LOCAL_SOCKET[] = "local";
|
||||
const char JSON_KEY_POOL[] = "pool";
|
||||
const char JSON_KEY_PENDING_CREDITS[] = "pending_credits";
|
||||
const char JSON_KEY_WAKE_TIMESTAMP[] = "wake_timestamp";
|
||||
const char JSON_KEY_UPTIME[] = "uptime";
|
||||
const char JSON_KEY_USERNAME[] = "username";
|
||||
const char JSON_KEY_VERSION[] = "version";
|
||||
QJsonObject DomainServer::jsonObjectForNode(const SharedNodePointer& node) {
|
||||
|
@ -1502,7 +1502,7 @@ QJsonObject DomainServer::jsonObjectForNode(const SharedNodePointer& node) {
|
|||
nodeJson[JSON_KEY_LOCAL_SOCKET] = jsonForSocket(node->getLocalSocket());
|
||||
|
||||
// add the node uptime in our list
|
||||
nodeJson[JSON_KEY_WAKE_TIMESTAMP] = QString::number(node->getWakeTimestamp());
|
||||
nodeJson[JSON_KEY_UPTIME] = QString::number((QDateTime::currentMSecsSinceEpoch() - node->getWakeTimestamp()) / 1000.0);
|
||||
|
||||
// if the node has pool information, add it
|
||||
DomainServerNodeData* nodeData = reinterpret_cast<DomainServerNodeData*>(node->getLinkedData());
|
||||
|
|
Loading…
Reference in a new issue