fix(nodes): count only expired/exhausted as 'ended', not disabled clients

The per-node depleted (ended) count folded disabled clients in with expired/exhausted (expired || exhausted || !Enable), so the Nodes page 'ended' chip was inflated and inconsistent with the inbound page, where disabled and depleted are separate buckets. Count only expired/exhausted in both GetAll and recountByGuid so 'ended' means the same thing on both pages.
This commit is contained in:
MHSanaei
2026-06-22 17:26:55 +02:00
parent 5aa87774d7
commit f96e877370
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -187,7 +187,7 @@ func (s *NodeService) GetAll() ([]*model.Node, error) {
}
expired := row.ExpiryTime > 0 && row.ExpiryTime <= now
exhausted := row.Total > 0 && row.Up+row.Down >= row.Total
if expired || exhausted || !row.Enable {
if expired || exhausted {
depletedByNode[nodeID]++
}
}
+1 -1
View File
@@ -221,7 +221,7 @@ func (s *NodeService) recountByGuid(nodes []*model.Node, selfGuid string) {
}
expired := row.ExpiryTime > 0 && row.ExpiryTime <= now
exhausted := row.Total > 0 && row.Up+row.Down >= row.Total
if expired || exhausted || !row.Enable {
if expired || exhausted {
depletedByGuid[guid]++
}
}