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.

Connect primary CPU source projection to composed drawer qualification

pulse-triage[bot]8db5a22c4273
diff --git a/frontend-modern/browser-tests/build-drawer-integration.mjs b/frontend-modern/browser-tests/build-drawer-integration.mjs
index 36c774d417..d9315c5e72 100644
--- a/frontend-modern/browser-tests/build-drawer-integration.mjs
+++ b/frontend-modern/browser-tests/build-drawer-integration.mjs
@@ -96,6 +96,11 @@ try {
fs.mkdirSync(path.join(outDir, 'docs'), { recursive: true });
for (const doc of ['VM_DISK_MONITORING.md', 'TROUBLESHOOTING.md'])
fs.copyFileSync(path.join(root, 'public/docs', doc), path.join(outDir, 'docs', doc));
+ const producer = path.join(process.env.PULSE_PROOF_INPUTS ?? '', 'temperature.json');
+ if (!fs.existsSync(producer))
+ throw new Error('Exact containing temperature producer input missing');
+ fs.copyFileSync(producer, path.join(outDir, 'temperature-producer.json'));
+ binding.temperatureProducer = hash(fs.readFileSync(producer));
const artifacts = (directory) => {
for (const entry of fs.readdirSync(directory, { withFileTypes: true })) {
const file = path.join(directory, entry.name);
diff --git a/frontend-modern/browser-tests/drawer-integration.cjs b/frontend-modern/browser-tests/drawer-integration.cjs
index 87c7219aaf..bc61a6ee0a 100644
--- a/frontend-modern/browser-tests/drawer-integration.cjs
+++ b/frontend-modern/browser-tests/drawer-integration.cjs
@@ -343,6 +343,10 @@ const hash = (bytes) => crypto.createHash('sha256').update(bytes).digest('hex');
historyMode = 'empty';
await page.goto(origin + '/node', { waitUntil: 'networkidle' });
+ await page.waitForFunction(() => window.__temperatureProducer);
+ record.temperatureProducer = await page.evaluate(() => window.__temperatureProducer);
+ assert.equal(record.temperatureProducer.resource.temperature, 55);
+ assert.equal(record.temperatureProducer.projected.cpuTemperature, 55);
const node = page.getByTestId('node-drawer-overview'),
nodeDetails = page.getByTestId('node-technical-details');
await node.waitFor();
diff --git a/frontend-modern/browser-tests/drawer-integration.tsx b/frontend-modern/browser-tests/drawer-integration.tsx
index fccdf2ed20..78b84d5103 100644
--- a/frontend-modern/browser-tests/drawer-integration.tsx
+++ b/frontend-modern/browser-tests/drawer-integration.tsx
@@ -1,10 +1,11 @@
// Final Overview history/caption/update-access bytes through real consuming components.
// This fixture never operates on a guest, credential, service or backup.
-import { createSignal, Show } from 'solid-js';
+import { createSignal, onMount, Show } from 'solid-js';
import { render } from 'solid-js/web';
import { Router, Route } from '@solidjs/router';
import { DarkModeContext } from '../src/contexts/appRuntime';
import { useWorkloads } from '../src/hooks/useWorkloads';
+import { nodeFromResource } from '../src/utils/resourceStateAdapters';
import { GuestRow } from '../src/components/Workloads/GuestRow';
import { GuestDrawer } from '../src/components/Workloads/GuestDrawer';
import { NodeDrawer } from '../src/components/Workloads/NodeDrawer';
@@ -161,8 +162,11 @@ function NodeFixture() {
available: true,
cpuPackage: 55,
cores: [{ core: 0, temp: 50 }],
+ hasCPU: true,
hasGPU: true,
- gpu: 95,
+ gpu: [{ device: 'fixture-gpu', edge: 95 }],
+ nvme: [{ device: 'fixture-nvme', temp: 91 }],
+ lastUpdate: '2026-10-13T12:00:00Z',
},
memory: { total: capacity, used: capacity / 4, free: capacity * 0.75, usage: 25 },
disk: { total: capacity, used: capacity / 2, free: capacity / 2, usage: 50 },
@@ -189,6 +193,14 @@ function NodeFixture() {
pendingUpdatesReason: 'permission_denied',
pendingUpdatesCheckedAt: new Date(Date.now() - 60000).toISOString(),
});
+ onMount(async () => {
+ const resource = await (await fetch('/temperature-producer.json')).json();
+ const projected = nodeFromResource(resource);
+ if (!projected || projected.cpuTemperature !== 55)
+ throw new Error('Producer-to-node CPU projection mismatch');
+ setNode((previous) => ({ ...previous, cpuTemperature: projected.cpuTemperature }));
+ (window as any).__temperatureProducer = { resource, projected };
+ });
(window as any).__integration = {
update: (delta: Partial<Node>) => setNode((previous) => ({ ...previous, ...delta })),
evidence: node,
diff --git a/frontend-modern/browser-tests/drawer-temperature-producer.go b/frontend-modern/browser-tests/drawer-temperature-producer.go
new file mode 100644
index 0000000000..d83d2d373c
--- /dev/null
+++ b/frontend-modern/browser-tests/drawer-temperature-producer.go
@@ -0,0 +1,37 @@
+// Read-only synthetic primary-CPU producer for the containing browser fixture.
+// Run from the public module root. No monitor, database, API call or guest operation.
+package main
+
+import (
+ "encoding/json"
+ "fmt"
+ "time"
+
+ "github.com/rcourtman/pulse-go-rewrite/internal/models"
+ "github.com/rcourtman/pulse-go-rewrite/internal/unifiedresources"
+)
+
+func main() {
+ temperature := &models.Temperature{Available: true, HasCPU: true, CPUPackage: 55,
+ Cores: []models.CoreTemp{{Core: 0, Temp: 50}}, HasGPU: true,
+ GPU: []models.GPUTemp{{Device: "fixture-gpu", Edge: 95}},
+ NVMe: []models.NVMeTemp{{Device: "fixture-nvme", Temp: 91}}, LastUpdate: time.Now().UTC()}
+ node := models.Node{ID: "fixture-pve1", Name: "pve1", Instance: "fixture", Type: "node", Status: "online", LastSeen: time.Now().UTC(), Temperature: temperature}
+ adapter := unifiedresources.NewMonitorAdapter(nil)
+ adapter.PopulateFromSnapshot(models.StateSnapshot{Nodes: []models.Node{node}})
+ resource, _, ok := adapter.GetByReference(node.ID)
+ if !ok || resource.Temperature == nil || *resource.Temperature != 55 {
+ panic("primary CPU projection did not preserve the supplied node")
+ }
+ proxmox, err := json.Marshal(resource.Proxmox)
+ if err != nil {
+ panic(err)
+ }
+ input := models.ResourceConvertInput{ID: resource.ID, Type: string(resource.Type), Name: resource.Name, Status: string(resource.Status), Temperature: resource.Temperature, Proxmox: proxmox, LastSeen: resource.LastSeen}
+ frontend := models.ConvertResourceToFrontend(input)
+ b, err := json.Marshal(frontend)
+ if err != nil {
+ panic(err)
+ }
+ fmt.Printf("DRAWER_TEMPERATURE_PRODUCER_JSON %s\n", b)
+}