feat(platform): harden telemetry pipeline and unify Semi UI workspaces

This commit is contained in:
lingniu
2026-07-18 00:26:36 +08:00
parent 65b4e4f055
commit 159c80b0ae
136 changed files with 21616 additions and 1785 deletions

View File

@@ -1,6 +1,6 @@
import type { VehicleRealtimeRow } from '../../api/types';
import { describe, expect, it } from 'vitest';
import { formatNumber, statusLabel, vehicleStatus } from './monitor';
import { formatNumber, normalizeMonitorBounds, statusLabel, vehicleStatus } from './monitor';
function vehicle(overrides: Partial<VehicleRealtimeRow> = {}): VehicleRealtimeRow {
return {
@@ -37,4 +37,11 @@ describe('monitor domain', () => {
expect(formatNumber(12560)).toBe('12,560');
expect(statusLabel('driving')).toBe('行驶');
});
it('normalizes valid WGS-84 viewport bounds and drops unsafe map ranges', () => {
expect(normalizeMonitorBounds('113,22,114,24')).toBe('113.000000,22.000000,114.000000,24.000000');
expect(normalizeMonitorBounds('105,31,103,29')).toBe('');
expect(normalizeMonitorBounds('-181,0,181,1')).toBe('');
expect(normalizeMonitorBounds('113,22,Infinity,24')).toBe('');
});
});