From fd4e551fa1718a3f82357e267aaba9a24367ce02 Mon Sep 17 00:00:00 2001 From: urnotsam Date: Fri, 12 Jul 2024 15:36:26 -0400 Subject: [PATCH] Split up the returned oos but node type. --- public/sync-detail.js | 19 ++++++++++++++++--- views/sync-details.html | 6 +++--- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/public/sync-detail.js b/public/sync-detail.js index e3da560..0e6a7ac 100644 --- a/public/sync-detail.js +++ b/public/sync-detail.js @@ -270,7 +270,9 @@ }, isUnexpectedOOS(node, CAndCEOnly = false) { const currentCounter = this.networkStatus.counter - let unexpectedOOSCount = 0 + let CUnexpectedOOSCount = 0 + let EUnexpectedOOSCount = 0 + let CEUnexpectedOOSCount = 0 for (let radix of node.radixes) { if (CAndCEOnly && !(radix.inConsensusRange || radix.inEdgeRange)) continue @@ -280,12 +282,23 @@ const hasRecentSync = radix.recentRuntimeSync if (!recentlyActive && !hasRecentSync) { - unexpectedOOSCount++ + if (radix.inConsensusRange && radix.isEdgeRange) { + CEUnexpectedOOSCount++ + } else if (radix.inConsensusRange) { + CUnexpectedOOSCount++ + } else if (radix.inEdgeRange) { + EUnexpectedOOSCount++ + } } } } - return unexpectedOOSCount + return { + total: CUnexpectedOOSCount + EUnexpectedOOSCount + CEUnexpectedOOSCount, + C: CUnexpectedOOSCount, + E: EUnexpectedOOSCount, + CE: CEUnexpectedOOSCount, + } }, async start() { let res = await requestWithToken(`${monitorServerUrl}/report`) diff --git a/views/sync-details.html b/views/sync-details.html index 8b2f364..513954a 100644 --- a/views/sync-details.html +++ b/views/sync-details.html @@ -152,7 +152,7 @@ Radixes - + All C/CE @@ -174,8 +174,8 @@ {{ node.stillNeedsInitialPatchPostActive }} {{ node.cycleFinishedSyncing }} {{ node.recentRuntimeSync }} - {{ isUnexpectedOOS(node) ? `true (${isUnexpectedOOS(node)})` : false}} - {{ isUnexpectedOOS(node, true) ? `true (${isUnexpectedOOS(node)})` : false}} + {{ isUnexpectedOOS(node).total ? `true (${isUnexpectedOOS(node).total})` : false}} + {{ isUnexpectedOOS(node, true).total ? `true (${isUnexpectedOOS(node).total})` : false}}