"; $context = stream_context_create([ 'http' => [ 'timeout' => 5, 'header' => "User-Agent: PHP/" . PHP_VERSION . "\r\n" ] ]); $json = @file_get_contents($apiUrl, false, $context); if ($json === false) { die('

Could not fetch data from the API.

'); } $clients = json_decode($json, true); if ($clients === null || !is_array($clients)) { die('

Malformed JSON returned from the API.

'); } /* --------------------- 2. Resolve selected host ------------- */ $selectedHost = $_GET['host'] ?? ''; $selectedIdx = null; foreach ($clients as $idx => $client) { if (strtolower($client['hostname']) === strtolower($selectedHost)) { $selectedIdx = $idx; break; } } if ($selectedIdx === null) { // no match - default to the first host (or none) $selectedIdx = 0; $selectedHost = $clients[$selectedIdx]['hostname'] ?? ''; } $client = $clients[$selectedIdx] ?? null; $properties = $client['client_properties'][0] ?? []; $systemProperties = $properties['system_properties'] ?? []; $systemComponents = $properties['system_components'] ?? []; ?> Cosmostat - <?= h($selectedHost) ?>

Matt-Cloud Cosmostat Dashboard

This dashboard shows the local Matt-Cloud system stats.

Component Desriptor

To view the component descriptor, you may
curl -s https:///descriptor

This will return the entire JSON descriptor variable

System Properties

Live System Metrics

Connecting...

Components