feat(workbench): expand SCADA monitoring and investigation presentation

This commit is contained in:
2026-11-07 19:50:14 +08:00
parent 0801e161ec
commit ba71e2d529
133 changed files with 6754 additions and 1438 deletions
@@ -10,4 +10,14 @@ describe("frontend chart boundary", () => {
expect(parseFrontendChart({ ...chart, series: [{ name: "D1", data: [20, Infinity] }] })).toBeNull();
expect(parseFrontendChart({ ...chart, x_data: Array(101).fill("t") })).toBeNull();
});
it("accepts sparse history with real timestamp metadata and rejects invented or misaligned timestamps", () => {
const series = { name: "前一天", type: "scatter", data: [null, 31],
sample_times: [null, "2026-06-13T12:00:00+08:00"] };
expect(parseFrontendChart({ ...chart, y_axis_name: "压力(m)", series: [chart.series[0], series] })).not.toBeNull();
for (const sample_times of [["2026-06-13T11:45:00+08:00", series.sample_times[1]],
[null], [null, "2026-06-13T12:00:00"], [null, "2026-02-30T12:00:00+08:00"]]) {
expect(parseFrontendChart({ ...chart, series: [{ ...series, sample_times }] })).toBeNull();
}
expect(parseFrontendChart({ ...chart, series: [{ ...series, type: "pie" }] })).toBeNull();
});
});