Enhance resilience and UI in inventory and server detail pages:

- Add `Heartbeat` column to `/X/Inventory.php` with status-based row styling.
- Improve error handling and data validation for backup details in `Server-Detail.php`.
This commit is contained in:
2025-09-17 10:20:48 +02:00
parent 2c279320ce
commit 878106f83f
2 changed files with 28 additions and 8 deletions

View File

@@ -111,7 +111,7 @@
<?php if($OSKernel){echo "&nbsp;<span class='badge rounded-pill bg-secondary text-light'>$OSKernel</span>";} ?>
<?php
if(is_array($Qvm)){
$site = Invoke_Infra("SELECT site from cmdb_physical_site where hostname ='".$Qvm[0]['Owner']."'")[0]['site'];
$site = Invoke_Infra("SELECT site from cmdb_physical_site where hostname ='".$Qvm[0]['Owner']."'")[0]['site'] ?? "?";
if($Qvm[0]['Owner'] == $Qvm[0]['PreferredOwner']){
echo "&nbsp;<span class='badge rounded-pill bg-success text-light'>Host : ".$Qvm[0]['Owner']."</span>";
}else{
@@ -298,10 +298,14 @@
<!-- Backup for AIX, Linux -->
<?php
if(is_array($Qx)){
$backup = Invoke_Infra("select * from X_cmdb_Backupsys where HOSTNAME='$server'");
echo "<span class='badge rounded-pill bg-secondary text-light fs-5'>LastBackup : ".explode(".",$backup[0]['LastBackup'])[0]."</span>&nbsp;";
echo "<span class='badge rounded-pill bg-secondary text-light fs-5'>BackupType : ".$backup[0]['BackupType']."</span>&nbsp;";
echo "<span class='badge rounded-pill bg-secondary text-light fs-5'>Media : ".$backup[0]['Location']."</span>";
try {
$backup = Invoke_Infra("select * from X_cmdb_Backupsys where HOSTNAME='$server'");
if(is_array($backup) && $backup[0]['LastBackup']) {
echo "<span class='badge rounded-pill bg-secondary text-light fs-5'>LastBackup : " . explode(".", $backup[0]['LastBackup'])[0] . "</span>&nbsp;";
echo "<span class='badge rounded-pill bg-secondary text-light fs-5'>BackupType : " . $backup[0]['BackupType'] . "</span>&nbsp;";
echo "<span class='badge rounded-pill bg-secondary text-light fs-5'>Media : " . $backup[0]['Location'] . "</span>";
}
} catch (Exception $e) {} // Catch any potential errors during backup information retrieval
}
?>
@@ -311,4 +315,3 @@
</div>
<script src="/js/switch.js"></script>
</body>