fix(ui): сбрасывать снимок при изменении параметров speed-пробы
This commit is contained in:
1 parent
090206c893
commit
7f18fcb6db
11 files changed
+106
-22
No files matched your search
@@ -56,3 +56,15 @@ export const speedTestCommandSchema = z.object({
|
||||
durationSec: speedPositiveInteger.pipe(z.number().min(3).max(2147483647)).default(10),
|
||||
}).refine(row => row.srcServerId !== row.dstServerId, "Источник и назначение должны отличаться")
|
||||
export type SpeedTestCommand = z.infer<typeof speedTestCommandSchema>
|
||||
|
||||
export type SpeedMeasurementParameters = {
|
||||
srcServerId: string | number; dstServerId: string | number; srcInterface?: string; dstInterface?: string;
|
||||
protocol: "tcp" | "udp"; direction: "both" | "transmit" | "receive"; durationSec: string | number
|
||||
}
|
||||
/** Compare validated configuration across HTTP read/write forms; enable/order are not measurement parameters. */
|
||||
export function sameSpeedMeasurement(a: SpeedMeasurementParameters, b: SpeedMeasurementParameters): boolean {
|
||||
return String(a.srcServerId) === String(b.srcServerId) && String(a.dstServerId) === String(b.dstServerId)
|
||||
&& (a.srcInterface ?? "").trim() === (b.srcInterface ?? "").trim()
|
||||
&& (a.dstInterface ?? "").trim() === (b.dstInterface ?? "").trim()
|
||||
&& a.protocol === b.protocol && a.direction === b.direction && Number(a.durationSec) === Number(b.durationSec)
|
||||
}
|
||||
Reference in new issue
Block a user