Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Move the metric status declarations clear of main's alert resolution

rcourtman8b61559f5aa0
diff --git a/frontend-modern/browser-verification/57680ea92a178c44.json b/frontend-modern/browser-verification/57680ea92a178c44.json
new file mode 100644
index 0000000000..30970a532a
--- /dev/null
+++ b/frontend-modern/browser-verification/57680ea92a178c44.json
@@ -0,0 +1,34 @@
+{
+ "version": 1,
+ "base_sha": "50b3fd822697e60a9675374e7b17de306da4f625",
+ "verified_at": "2026-10-06T19:11:04Z",
+ "result": "passed",
+ "changed_paths": [
+ "frontend-modern/src/types/api.ts"
+ ],
+ "content_sha256": {
+ "frontend-modern/src/types/api.ts": "e91be59f68e507aa1403e564ff1f9d25e2701cf68173911cf660030e6463323a"
+ },
+ "routes": [
+ "/proxmox"
+ ],
+ "viewports": [
+ {
+ "width": 1440,
+ "height": 900
+ },
+ {
+ "width": 375,
+ "height": 812
+ }
+ ],
+ "states": [
+ "Type-only change: MetricAlertStatus and the Alert.metricStatus field moved to different positions in types/api.ts so they no longer abut main's Alert.resolution insertion",
+ "vite build of the tree before and after this change produces byte-identical output (diff -rq over every emitted asset), so no rendered surface can differ",
+ "The rendered surfaces themselves were verified live earlier on this branch (receipts 4766668c29936861 and 68deecd720b4873b): /proxmox node drawer and TEMP cell through breaching, held, recovering and resolved at 1440x900 and 375x812"
+ ],
+ "interactions": [
+ "Built frontend-modern with vite before and after the move and compared every output file",
+ "Relies on the earlier live passes for drawer expansion, TEMP cell hover text and narrow layout; no runtime bytes changed since"
+ ]
+}
diff --git a/frontend-modern/src/types/api.ts b/frontend-modern/src/types/api.ts
index a455f1c4a2..2ac721a40f 100644
--- a/frontend-modern/src/types/api.ts
+++ b/frontend-modern/src/types/api.ts
@@ -1376,16 +1376,20 @@ export interface Alert {
ackUser?: string;
correlation?: AlertCorrelation;
metadata?: Record<string, unknown>;
- operationalRecord?: OperationalRecord;
- latestTransition?: LifecycleTransition;
- transitions?: LifecycleTransition[];
- evidence?: EvidenceEnvelope[];
/**
* Live evaluation behind an open threshold alert. `value`, `message` and
* `lastSeen` keep the last reading that met the trigger; this is the
* reading being evaluated now and why the alert has not cleared.
*/
metricStatus?: MetricAlertStatus;
+ operationalRecord?: OperationalRecord;
+ latestTransition?: LifecycleTransition;
+ transitions?: LifecycleTransition[];
+ evidence?: EvidenceEnvelope[];
+}
+
+export interface ResolvedAlert extends Alert {
+ resolvedTime: string;
}
export type MetricAlertPhase = 'breaching' | 'latched' | 'recovering';
@@ -1408,10 +1412,6 @@ export interface MetricAlertStatus {
recoveryElapsedSeconds?: number;
}
-export interface ResolvedAlert extends Alert {
- resolvedTime: string;
-}
-
// One entry from the append-only alert event log
// (GET /api/alerts/events): a lifecycle transition or a notification
// decision, including suppressions with the mechanism that held them.
diff --git a/internal/models/models.go b/internal/models/models.go
index a08334e25a..bf5567c7de 100644
--- a/internal/models/models.go
+++ b/internal/models/models.go
@@ -107,11 +107,17 @@ type Alert struct {
Acknowledged bool `json:"acknowledged"`
AckTime *time.Time `json:"ackTime,omitempty"`
AckUser string `json:"ackUser,omitempty"`
+ // MetricStatus is the live evaluation behind an open threshold alert.
+ MetricStatus *MetricAlertStatus `json:"metricStatus,omitempty"`
// Metadata carries alert-engine annotations (notably resourceType) so the
// frontend can classify an alert without re-deriving resource identity.
Metadata map[string]interface{} `json:"metadata,omitempty"`
- // MetricStatus is the live evaluation behind an open threshold alert.
- MetricStatus *MetricAlertStatus `json:"metricStatus,omitempty"`
+}
+
+// ResolvedAlert represents a recently resolved alert
+type ResolvedAlert struct {
+ Alert
+ ResolvedTime time.Time `json:"resolvedTime"`
}
// Metric alert phases. A threshold alert stays open after its reading drops
@@ -164,12 +170,6 @@ func (s *MetricAlertStatus) Clone() *MetricAlertStatus {
return &clone
}
-// ResolvedAlert represents a recently resolved alert
-type ResolvedAlert struct {
- Alert
- ResolvedTime time.Time `json:"resolvedTime"`
-}
-
// Node represents a Proxmox VE node
type Node struct {
ID string `json:"id"`