[
'header' => "Content-type: application/json\r\n",
'method' => 'GET',
],
];
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
if ($result === FALSE) {
die('Error Fetching data');
}
return json_decode($result, true); // Decode JSON as an associative array
}
?>
SSD Health Dashboard
This is a historical list of every disk ever scanned by this device.
For a live dashboard, please visit home.
';
// Table header (optional but handy)
echo '
| Disk ID |
Model String |
Serial Number |
TB Written |
Disk Capacity |
Disk Flavor |
SMART Result |
';
// Table body - one row per SSD
echo '
';
foreach ($ssdData as $ssd) {
// Escape the values so the page stays safe
$id = htmlspecialchars($ssd['id']);
$model = htmlspecialchars($ssd['model']);
$serial = htmlspecialchars($ssd['serial']);
$tbw = htmlspecialchars($ssd['TBW']);
$cap = htmlspecialchars($ssd['capacity']);
$flavor = htmlspecialchars($ssd['flavor']);
$smart = htmlspecialchars($ssd['smart']);
echo "
| {$id} |
{$model} |
{$serial} |
{$tbw} |
{$cap} |
{$flavor} |
{$smart} |
";
}
echo '';
?>