feat: units system — mm/cm/m switchable, configurable grid, real measurements, formatted display

This commit is contained in:
A0 Orchestrator
2026-07-02 08:46:07 +02:00
parent 72e3d1da24
commit 0463a793bc
14 changed files with 661 additions and 76 deletions
+27
View File
@@ -608,6 +608,33 @@ export async function deleteGlobalBlock(token: string, id: string): Promise<void
export { API_BASE };
// ─── Settings (Key/Value) ────────────────────────────────
export interface Setting {
key: string;
value: string;
updated_at: string;
}
export async function getSetting(token: string, key: string): Promise<Setting | null> {
const res = await fetch(`${API_BASE}/api/settings/${encodeURIComponent(key)}`, {
method: 'GET',
headers: authHeaders(token),
});
if (res.status === 404) return null;
if (!res.ok) throw new Error(`Failed to fetch setting: ${key}`);
return res.json();
}
export async function setSetting(token: string, key: string, value: string): Promise<Setting> {
const res = await fetch(`${API_BASE}/api/settings/${encodeURIComponent(key)}`, {
method: 'PUT',
headers: authHeaders(token),
body: JSON.stringify({ value }),
});
if (!res.ok) throw new Error(`Failed to save setting: ${key}`);
return res.json();
}
// ─── AI Copilot ─────────────────────────────────────────
export interface AIChatMessage {
role: string;