Lifecycle planning, and consistent empty and loading states

- Inventory: end of support and replacement cost per asset; a Lifecycle page showing what ages out year by year and what replacing it will cost; support ending within 90 days in the weekly digest
- Lists: a shared empty state saying what is missing, why, and the one thing to do; "nothing matches" with a clear button; skeleton rows instead of empty-looking lists while loading

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-10-18 23:18:42 +02:00
1 parent 92726568b7
commit 846af02851
50 files changed
+4434 -233

No files matched your search

+25
View File
@@ -909,6 +909,24 @@ export interface ChangeEntry {
serverId: number | null;
}
export interface LifecycleItem {
id: number;
name: string;
kind: string;
endsOn: string;
basis: "support" | "warranty";
daysLeft: number;
cost: number | null;
costBasis: "replacement" | "purchase" | null;
}
export interface LifecycleReport {
past: LifecycleItem[];
years: { year: number; items: LifecycleItem[]; totalCost: number; unpriced: number }[];
later: LifecycleItem[];
undated: { id: number; name: string; kind: string }[];
currency: string;
}
export type AssetKind = "server" | "storage" | "network" | "power" | "client" | "other";
export type DependencyNodeType = "server" | "integration";
@@ -965,6 +983,10 @@ export interface Asset {
purchaseDate: string | null;
purchasePrice: number | null;
warrantyUntil: string | null;
/** When the maker stops patching it, or you plan to retire it; the lifecycle report goes by this. */
endOfSupport: string | null;
/** What replacing it is expected to cost. */
replacementCost: number | null;
location: string | null;
rackUnit: string | null;
powerWatts: number | null;
@@ -988,6 +1010,8 @@ export interface AssetInput {
purchaseDate?: string | null;
purchasePrice?: number | null;
warrantyUntil?: string | null;
endOfSupport?: string | null;
replacementCost?: number | null;
location?: string | null;
rackUnit?: string | null;
powerWatts?: number | null;
@@ -1885,6 +1909,7 @@ export const api = {
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" }),
lifecycle: (years = 5) => request<LifecycleReport>(`/api/inventory/lifecycle?years=${years}`),
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) }),
},