Dependencies beyond servers, web push, inventory auto-fill with QR labels, Windows agent health
- Dependencies: servers and integrations can depend on each other; alerts are folded under the root cause, and a failure explained by something down isn't announced - Web push: hand-written VAPID and RFC 8291 encryption, per-device subscriptions, a fifth notification channel, service worker handlers - Inventory: maker/model/serial from the agents fill blank fields, "Refresh from agent", QR label printing and ?asset= deep links - Windows agent (v4) reports failed services, disk health, Storage Spaces pools and hardware identity; Linux agent (v5) reports hardware identity Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5cc51c57de
commit
ec9c2f73f0
55 files changed
+12553
-65
No files matched your search
+48
-1
@@ -409,6 +409,22 @@ export interface WebhookSettings {
|
||||
secret: string;
|
||||
}
|
||||
|
||||
export interface WebPushSettings {
|
||||
enabled: boolean;
|
||||
/** An email address or https address a push service can reach whoever runs this on. Blank is fine. */
|
||||
contact: string;
|
||||
}
|
||||
|
||||
/** A browser or phone that has asked for push notifications. */
|
||||
export interface PushDevice {
|
||||
id: number;
|
||||
label: string | null;
|
||||
host: string;
|
||||
endpoint: string;
|
||||
createdAt: string;
|
||||
lastSuccessAt: string | null;
|
||||
}
|
||||
|
||||
export interface NotificationEvents {
|
||||
dnsAdd: boolean;
|
||||
dnsUpdate: boolean;
|
||||
@@ -473,6 +489,7 @@ export interface AppSettings {
|
||||
ntfy: NtfySettings;
|
||||
smtp: SmtpSettings;
|
||||
webhook: WebhookSettings;
|
||||
webPush: WebPushSettings;
|
||||
notifications: NotificationEvents;
|
||||
providerColors: Record<string, string>;
|
||||
integrationColors: Record<string, string>;
|
||||
@@ -760,6 +777,21 @@ export interface BackupCoverage {
|
||||
|
||||
export type AssetKind = "server" | "storage" | "network" | "power" | "client" | "other";
|
||||
|
||||
export type DependencyNodeType = "server" | "integration";
|
||||
export interface DependencyNode {
|
||||
key: string;
|
||||
type: DependencyNodeType;
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
export interface DependenciesResponse {
|
||||
/** "A needs B", written here. */
|
||||
dependencies: { id: number; from: { type: DependencyNodeType; id: number; name: string }; to: { type: DependencyNodeType; id: number; name: string }; createdAt: string }[];
|
||||
/** The "runs on" links of servers, set on the server itself. */
|
||||
runsOn: { from: { key: string; name: string }; to: { key: string; name: string } }[];
|
||||
nodes: DependencyNode[];
|
||||
}
|
||||
|
||||
/** A piece of hardware in the inventory. */
|
||||
export interface Asset {
|
||||
id: number;
|
||||
@@ -780,6 +812,8 @@ export interface Asset {
|
||||
updatedAt: string;
|
||||
/** The server it is, when it is one and that server still exists. */
|
||||
server: { id: number; name: string } | null;
|
||||
/** What that server's agent says the machine is, and the fields where that differs from what is written here. Null with no agent word. */
|
||||
agent: { manufacturer: string | null; model: string | null; serial: string | null; differs: { manufacturer?: string; model?: string; serial?: string } } | null;
|
||||
}
|
||||
|
||||
/** What an entry is saved from: blank text and nulls mean "no value". */
|
||||
@@ -1263,7 +1297,7 @@ export interface PrivacyOverview {
|
||||
tlsCertificateChecks: number;
|
||||
servers: number;
|
||||
serversWithAgent: number;
|
||||
channels: Record<"gotify" | "ntfy" | "smtp" | "webhook", { enabled: boolean; host: string | null }>;
|
||||
channels: Record<"gotify" | "ntfy" | "smtp" | "webhook" | "webPush", { enabled: boolean; host: string | null }>;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1651,11 +1685,24 @@ export const api = {
|
||||
backups: {
|
||||
coverage: (staleDays: number, refresh = false) => request<BackupCoverage>(`/api/backups/coverage?staleDays=${staleDays}${refresh ? "&refresh=1" : ""}`),
|
||||
},
|
||||
push: {
|
||||
key: () => request<{ publicKey: string }>("/api/push/key"),
|
||||
mine: () => request<{ enabled: boolean; subscriptions: PushDevice[] }>("/api/push/mine"),
|
||||
subscribe: (data: { endpoint: string; keys: { p256dh: string; auth: string }; label?: string }) => request<{ id: number }>("/api/push/subscribe", { method: "POST", body: JSON.stringify(data) }),
|
||||
remove: (id: number) => request<void>(`/api/push/${id}`, { method: "DELETE" }),
|
||||
test: () => request<{ sent: number; removed: number; failed: number }>("/api/push/test", { method: "POST" }),
|
||||
},
|
||||
dependencies: {
|
||||
list: () => request<DependenciesResponse>("/api/dependencies"),
|
||||
create: (data: { fromType: DependencyNodeType; fromId: number; toType: DependencyNodeType; toId: number }) => request<{ id: number }>("/api/dependencies", { method: "POST", body: JSON.stringify(data) }),
|
||||
remove: (id: number) => request<void>(`/api/dependencies/${id}`, { method: "DELETE" }),
|
||||
},
|
||||
inventory: {
|
||||
list: () => request<{ assets: Asset[]; config: InventoryConfig; servers: { id: number; name: string }[] }>("/api/inventory"),
|
||||
create: (data: AssetInput) => request<{ asset: Asset }>("/api/inventory", { method: "POST", body: JSON.stringify(data) }),
|
||||
update: (id: number, data: AssetInput) => request<{ asset: Asset }>(`/api/inventory/${id}`, { method: "PUT", body: JSON.stringify(data) }),
|
||||
remove: (id: number) => request<void>(`/api/inventory/${id}`, { method: "DELETE" }),
|
||||
refreshFromAgent: (id: number) => request<{ asset: Asset; changed: string[] }>(`/api/inventory/${id}/refresh-from-agent`, { method: "POST" }),
|
||||
setConfig: (data: InventoryConfig) => request<{ config: InventoryConfig }>("/api/inventory/config", { method: "PUT", body: JSON.stringify(data) }),
|
||||
},
|
||||
runbooks: {
|
||||
|
||||
Reference in new issue
Block a user