feat(csms): add system settings management for OCPP 1.6J heartbeat interval

This commit is contained in:
2026-03-17 01:42:29 +08:00
parent 4d940e2cd4
commit dee947ce3e
12 changed files with 2308 additions and 5 deletions

View File

@@ -202,6 +202,14 @@ export type TariffConfig = {
updatedAt?: string;
};
export type Ocpp16jSettings = {
heartbeatInterval: number;
};
export type SystemSettings = {
ocpp16j: Ocpp16jSettings;
};
// ── API functions ──────────────────────────────────────────────────────────
export type ChartRange = "30d" | "7d" | "24h";
@@ -349,4 +357,9 @@ export const api = {
put: (data: { slots: TariffSlot[]; prices: Record<PriceTier, TierPricing> }) =>
apiFetch<TariffConfig>("/api/tariff", { method: "PUT", body: JSON.stringify(data) }),
},
settings: {
get: () => apiFetch<SystemSettings>("/api/settings"),
put: (data: SystemSettings) =>
apiFetch<SystemSettings>("/api/settings", { method: "PUT", body: JSON.stringify(data) }),
},
};