mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-08-14 07:10:58 +00:00
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:
@@ -187,7 +187,7 @@ func (s *NodeService) GetAll() ([]*model.Node, error) {
|
|||||||
}
|
}
|
||||||
expired := row.ExpiryTime > 0 && row.ExpiryTime <= now
|
expired := row.ExpiryTime > 0 && row.ExpiryTime <= now
|
||||||
exhausted := row.Total > 0 && row.Up+row.Down >= row.Total
|
exhausted := row.Total > 0 && row.Up+row.Down >= row.Total
|
||||||
if expired || exhausted || !row.Enable {
|
if expired || exhausted {
|
||||||
depletedByNode[nodeID]++
|
depletedByNode[nodeID]++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ func (s *NodeService) recountByGuid(nodes []*model.Node, selfGuid string) {
|
|||||||
}
|
}
|
||||||
expired := row.ExpiryTime > 0 && row.ExpiryTime <= now
|
expired := row.ExpiryTime > 0 && row.ExpiryTime <= now
|
||||||
exhausted := row.Total > 0 && row.Up+row.Down >= row.Total
|
exhausted := row.Total > 0 && row.Up+row.Down >= row.Total
|
||||||
if expired || exhausted || !row.Enable {
|
if expired || exhausted {
|
||||||
depletedByGuid[guid]++
|
depletedByGuid[guid]++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user