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:
@@ -111,7 +111,7 @@
|
||||
<?php if($OSKernel){echo " <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 " <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> ";
|
||||
echo "<span class='badge rounded-pill bg-secondary text-light fs-5'>BackupType : ".$backup[0]['BackupType']."</span> ";
|
||||
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> ";
|
||||
echo "<span class='badge rounded-pill bg-secondary text-light fs-5'>BackupType : " . $backup[0]['BackupType'] . "</span> ";
|
||||
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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user