fix(ui): использовать серверное время и не подменять отсутствующий Ping
This commit is contained in:
1 parent
7f18fcb6db
commit
30cc99c68e
9 files changed
+60
-11
No files matched your search
@@ -1739,6 +1739,7 @@ function UptimePageContent({ selectedProbeId, allProbesHref }: { selectedProbeId
|
||||
: ""
|
||||
setSpeedRuns((prev) => prev.map((r) => r.id === runId ? ({
|
||||
...r,
|
||||
startedAt: result.createdAt ? Date.parse(result.createdAt) : r.startedAt,
|
||||
txAvgMbps: tx,
|
||||
rxAvgMbps: rx,
|
||||
status: "done",
|
||||
@@ -1752,7 +1753,8 @@ function UptimePageContent({ selectedProbeId, allProbesHref }: { selectedProbeId
|
||||
...(pingNote ? [pingNote] : []),
|
||||
],
|
||||
}) : r))
|
||||
const ts = new Date().toISOString()
|
||||
// Legacy receipts have no server timestamp; retain receipt time for compatibility.
|
||||
const ts = result.createdAt ?? new Date().toISOString()
|
||||
setSpeedProbes((prev) => prev.map((p) => p.id === probe.id ? ({
|
||||
...p,
|
||||
lastRunAt: ts,
|
||||
@@ -1762,7 +1764,7 @@ function UptimePageContent({ selectedProbeId, allProbesHref }: { selectedProbeId
|
||||
lastError: "",
|
||||
lastPingRttMs: ap?.rttMs ?? null,
|
||||
lastPingLossPct: ap?.lossPct ?? null,
|
||||
lastPingAt: ts,
|
||||
lastPingAt: ap ? ts : null,
|
||||
lastPingError: ap?.error ?? "",
|
||||
}) : p))
|
||||
} else {
|
||||
@@ -2166,8 +2168,8 @@ function UptimePageContent({ selectedProbeId, allProbesHref }: { selectedProbeId
|
||||
const maxVal = Math.max(viewTx ?? 0, viewRx ?? 0, 1)
|
||||
const canRun = probe.enabled && !!probe.srcServerId && !!probe.dstServerId && probe.srcServerId !== probe.dstServerId
|
||||
const viewAfterBtPing =
|
||||
useRun && run.status === "done" && run.afterBtPing
|
||||
? run.afterBtPing
|
||||
useRun && run.status === "done"
|
||||
? run.afterBtPing ?? null
|
||||
: probe.lastPingAt
|
||||
? {
|
||||
rttMs: probe.lastPingRttMs ?? null,
|
||||
|
||||
Reference in new issue
Block a user