Fix statistics graphPayloads never being populated and add redesigned telemetry partial

Made-with: Cursor
This commit is contained in:
2026-03-27 18:58:35 -04:00
parent 36255eebcf
commit 3cb201d766
2 changed files with 316 additions and 2 deletions

View File

@@ -906,7 +906,8 @@ class Statistics extends Component
// Reduced cache TTL from 60 to 30 seconds for fresher data and faster updates
$data = Cache::remember($cacheKey, 30, function () use ($timeRange, $aggregation) {
$proxmox = new Proxmox;
$stats = $proxmox->request('/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/rrddata', data: [
$vmType = $this->server->node->vmType();
$stats = $proxmox->request('/nodes/' . $this->server->node->name . '/' . $vmType . '/' . $this->server->vm_id . '/rrddata', data: [
'timeframe' => $timeRange,
'cf' => $aggregation === 'maximum' ? 'MAX' : 'AVERAGE',
]);
@@ -938,7 +939,9 @@ class Statistics extends Component
$data = [];
}
$this->dispatch('proxmox:stats:' . $this->server->id . ':' . $graphType, $data);
$this->graphPayloads[$graphType] = is_array($data) ? $data : [];
$this->dispatch('proxmox:stats:' . $this->server->id . ':' . $graphType, $this->graphPayloads[$graphType]);
}
#[On('render-chart-events')]