Bulk snooze, alert rules judged on report, photos on notes

Bulk snooze: Snooze... and Wake on the ticked alerts, with undo that puts back
each alert's earlier snooze exactly.

Alert rules are judged for a server right after its agent reports, instead of at
the next 15-minute pass; only that server's rule findings change, and the check
is serialized with the pass so neither overwrites the other's state.

Photos on server and device notes: up to 12 each, shrunk in the browser,
accepted by their own bytes (JPEG/PNG/GIF/WebP, 4 MB), kept in the database and
removed with the server or device.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-10-24 22:53:09 +02:00
1 parent 251a4a9d73
commit a16996d975
27 files changed
+8442 -54

No files matched your search

+23
View File
@@ -1454,6 +1454,15 @@ export interface NoteItem {
updatedBy: string | null;
updatedAt: string;
}
/** A photo on a note, without its bytes (those are at `api.notePhotos.imageUrl`). */
export interface NotePhoto {
id: number;
caption: string | null;
contentType: string;
size: number;
createdBy: string | null;
createdAt: string;
}
export interface AgendaItem {
id: string;
kind: AgendaKind;
@@ -2896,6 +2905,20 @@ export const api = {
get: (targetType: "server" | "device", targetId: number) => request<{ note: NoteItem | null }>(`/api/notes?targetType=${targetType}&targetId=${targetId}`),
save: (targetType: "server" | "device", targetId: number, body: string) => request<{ note: NoteItem | null }>("/api/notes", { method: "PUT", body: JSON.stringify({ targetType, targetId, body }) }),
},
notePhotos: {
list: (targetType: "server" | "device", targetId: number) => request<{ photos: NotePhoto[] }>(`/api/note-photos?targetType=${targetType}&targetId=${targetId}`),
/** The bytes are the body, as they are (the app makes them small first). */
add: async (targetType: "server" | "device", targetId: number, photo: Blob): Promise<{ photo: NotePhoto }> => {
const res = await fetch(`/api/note-photos?targetType=${targetType}&targetId=${targetId}`, { method: "POST", headers: { "Content-Type": photo.type || "application/octet-stream" }, body: photo, credentials: "same-origin" });
if (res.status === 401) throw new UnauthorizedError("unauthorized");
if (res.status === 403) throw new ForbiddenError("forbidden");
if (!res.ok) throw new Error(`Request failed (${res.status}): ${await res.text().catch(() => "")}`);
return (await res.json()) as { photo: NotePhoto };
},
setCaption: (id: number, caption: string | null) => request<{ photo: NotePhoto }>(`/api/note-photos/${id}`, { method: "PUT", body: JSON.stringify({ caption }) }),
remove: (id: number) => request<void>(`/api/note-photos/${id}`, { method: "DELETE" }),
imageUrl: (id: number) => `/api/note-photos/${id}/image`,
},
network: {
overview: () => request<NetworkOverview>("/api/network"),
sync: (integrationId?: number) => request<{ statuses: Record<number, UnifiSyncStatus> }>("/api/network/sync", { method: "POST", body: JSON.stringify(integrationId ? { integrationId } : {}) }),