fix(ui): отличать пустую историю трафика от нулевой
This commit is contained in:
1 parent
7c6f937cec
commit
ec8e28d15d
4 files changed
+35
-12
No files matched your search
@@ -762,8 +762,8 @@ const toLiveServer = (s: LiveTrafficServer): ServerTraffic => {
|
||||
rxTotal: s.rxTotal,
|
||||
txTotal: s.txTotal,
|
||||
sessions: s.sessions,
|
||||
rxSeries: s.rxSeries.length ? s.rxSeries : Array(60).fill(0),
|
||||
txSeries: s.txSeries.length ? s.txSeries : Array(60).fill(0),
|
||||
rxSeries: s.rxSeries,
|
||||
txSeries: s.txSeries,
|
||||
boundIfaces: [],
|
||||
}
|
||||
}
|
||||
@@ -771,8 +771,8 @@ const toLiveServer = (s: LiveTrafficServer): ServerTraffic => {
|
||||
const toLiveBound = (c: BoundIfaceTraffic): BoundIfaceTraffic => ({
|
||||
...c,
|
||||
interfaceType: (["ether", "gre", "wg", "other"].includes(c.interfaceType) ? c.interfaceType : "other") as InterfaceType,
|
||||
rxSeries: c.rxSeries.length ? c.rxSeries : Array(60).fill(0),
|
||||
txSeries: c.txSeries.length ? c.txSeries : Array(60).fill(0),
|
||||
rxSeries: c.rxSeries,
|
||||
txSeries: c.txSeries,
|
||||
})
|
||||
|
||||
const toLiveUser = (u: UserTraffic & { interfaces?: BoundIfaceTraffic[] }): UserTraffic => {
|
||||
@@ -781,8 +781,8 @@ const toLiveUser = (u: UserTraffic & { interfaces?: BoundIfaceTraffic[] }): User
|
||||
...u,
|
||||
role: ROLE_LABEL[u.role as keyof typeof ROLE_LABEL] ?? u.role,
|
||||
interfaces: ifaces,
|
||||
rxSeries: u.rxSeries.length ? u.rxSeries : Array(60).fill(0),
|
||||
txSeries: u.txSeries.length ? u.txSeries : Array(60).fill(0),
|
||||
rxSeries: u.rxSeries,
|
||||
txSeries: u.txSeries,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user