Remove test.php and enhance null safety and sorting across components

- Deleted `test.php` as it was no longer in use.
- Enhanced null safety checks in `Inventory.php`, `StdOut-detail.php`, `Backups.php`, and `SwitchsSAN.php` to prevent potential warnings.
- Refactored `SwitchsSAN.php` to improve sorting logic for ports based on errors, vFabric, and Port ID.
- Added seasonal snow effect script in `all.php` with toggle functionality for user engagement.
- Updated navigation bar (`navbar.html`) to include a new VIO page link.
- Introduced a new `VIO.php` page to display VIO monitoring details with table export and sorting features.
This commit is contained in:
2026-03-31 11:33:57 +02:00
parent d5b45dbc22
commit 10c228f255
47 changed files with 950 additions and 702 deletions

View File

@@ -52,7 +52,7 @@
<!-- Display -->
<div class="col py-3">
<!-- Page Title -->
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;">Cluster Resources <small><small>(Hyper-V excluded)</small></small></span></h1>
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;"><?php echo $ti_18; ?></span></h1>
<!-- Main content -->
<div class="container-fluid">
@@ -78,11 +78,11 @@
<table class='table table-bordered table-hover table-sm' id='t1' data-height="620" data-toggle="table" data-search="true" data-show-columns="true" data-export-types="['xlsx','csv','json']" data-show-export="true" data-sortable="true" data-sort-name="VM">
<thead> <!-- Header -->
<tr>
<th data-field="Server" data-sortable="true">Cluster</th>
<th data-field="Folder" data-sortable="true">Resource</th>
<th data-field="ACL" data-sortable="true">Owner Node</th>
<th data-field="AD" data-sortable="true">State</th>
<th data-field="Enabled" data-sortable="true">Last Checked</th>
<th data-field="Server" data-sortable="true"><?php echo $w_cluster; ?></th>
<th data-field="Folder" data-sortable="true"><?php echo $w_resource; ?></th>
<th data-field="ACL" data-sortable="true"><?php echo $w_owner; ?></th>
<th data-field="AD" data-sortable="true"><?php echo $w_state; ?></th>
<th data-field="Enabled" data-sortable="true">Date</th>
</tr>
</thead>

View File

@@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Page Title -->
<title>Web Infra Reports</title>
<title>Web Infra Reports IT</title>
<link rel="shortcut icon" type="image/png" href="/include/favicon-32x32.png">
<!-- JQuery -->
@@ -105,36 +105,46 @@
?>
<!-- Main content -->
<!-- OS, Host, Site, Maintenance -->
<div id="OS" class="fs-4">
<span class="badge rounded-pill bg-secondary text-light"><?= $OSName ?></span>
<?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'] ?? "?";
if($Qvm[0]['Owner'] == $Qvm[0]['PreferredOwner']){
echo "&nbsp;<span class='badge rounded-pill bg-success text-light'>Host : ".$Qvm[0]['Owner']."</span>";
<!-- OS, Host, Site, Maintenance -->
<div id="OS" class="fs-4 d-flex justify-content-between align-items-center">
<div>
<span class="badge rounded-pill bg-secondary text-light"><?= $OSName ?></span>
<?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'] ?? "?";
if($Qvm[0]['Owner'] == $Qvm[0]['PreferredOwner']){
echo "&nbsp;<span class='badge rounded-pill bg-success text-light'>$w_host : ".$Qvm[0]['Owner']."</span>";
}else{
echo "&nbsp;<span class='badge rounded-pill bg-warning text-dark'>$w_host : ".$Qvm[0]['Owner']."</span>";
}
}else{
echo "&nbsp;<span class='badge rounded-pill bg-warning text-dark'>Host : ".$Qvm[0]['Owner']."</span>";
if(is_array($Qx)){
echo "&nbsp;<span class='badge rounded-pill bg-success text-light'>$w_host : ".$Qx[0]['Owner']."</span>";
$site = substr($Qx[0]['Owner'],0,3);
}else{
echo "&nbsp;<span class='badge rounded-pill bg-success text-light'>Physical</span>";
echo "&nbsp;<span class='badge rounded-pill bg-success text-light'>".Invoke_GLPI("select a.name from glpi_computermodels a left join glpi_computers b on a.id = b.computermodels_id where b.name = '$server'")[0]['name']."</span>";
}
}
}else{
if(is_array($Qx)){
echo "&nbsp;<span class='badge rounded-pill bg-success text-light'>Host : ".$Qx[0]['Owner']."</span>";
$site = substr($Qx[0]['Owner'],0,3);
}else{
echo "&nbsp;<span class='badge rounded-pill bg-success text-light'>Physical</span>";
echo "&nbsp;<span class='badge rounded-pill bg-success text-light'>".Invoke_GLPI("select a.name from glpi_computermodels a left join glpi_computers b on a.id = b.computermodels_id where b.name = '$server'")[0]['name']."</span>";
?>
<?php if(isset($site)){echo "<span class='badge rounded-pill bg-secondary text-light'>Site : $site</span>";} ?>
<?php if(is_array($Qvm) && $Qvm[0]['IsClustered'] != 'True'){echo "&nbsp;<span class='badge rounded-pill bg-warning text-dark'>Unclustered VM</span>";} ?>
<?php
if(is_array($m) && ($m[0]['scom'] == "Y" || $m[0]['zabbix'] == "Y" || $m[0]['aixcmdb'] == "Y")){
echo "&nbsp;<span class='badge rounded-pill bg-primary text-dark blinking'>Maintenance ON</span>";
}
}
?>
<?php if(isset($site)){echo "<span class='badge rounded-pill bg-secondary text-light'>Site : $site</span>";} ?>
<?php if(is_array($Qvm) && $Qvm[0]['IsClustered'] != 'True'){echo "&nbsp;<span class='badge rounded-pill bg-warning text-dark'>Unclustered VM</span>";} ?>
<?php
$m = Invoke_Infra("select * from Maintenance_Status where server ='$server'");
if($m[0]['scom'] == "Y" || $m[0]['zabbix'] == "Y" || $m[0]['aixcmdb'] == "Y"){
echo "&nbsp;<span class='badge rounded-pill bg-primary text-dark blinking'>Maintenance ON</span>";
}
?>
?>
</div>
<div class="ms-3">
<a href="https://azt-qat-s1spt.armony.net/servermanager/connections/server/<?= strtoupper($server) ?>.armony.net/tools/overview"
target="_blank"
class="badge rounded-pill bg-primary text-light text-decoration-none">
<i class="bi bi-cpu-fill"></i> Admin Center
</a>
</div>
</div>
<hr>
@@ -154,7 +164,7 @@
<div class="chart-container col">
<div class="card mb-3" style="border: 3px solid black">
<div class="card-header text-dark text-center fs-5 bg-info">
<i class="fs-7 bi-memory text-black"></i><b> Memory : <?= $memory ?></b>
<i class="fs-7 bi-memory text-black"></i><b> <?php echo $w_memory;?> : <?= $memory ?></b>
</div>
<div class="card-body bg-dark fs-4">
<canvas id="ramChart"></canvas>
@@ -226,27 +236,27 @@
<!-- Last boot, last rollup, next rollup -->
<?php
if(is_array($Qw) && $Qw[0]['lastBoot'] != ""){
echo "<span class='badge rounded-pill bg-secondary text-light fs-5'>Last Boot : ".$Qw[0]['lastBoot']."</span>";
echo "<span class='badge rounded-pill bg-secondary text-light fs-5'>$w_lastReboot : ".$Qw[0]['lastBoot']."</span>";
}elseif(is_array($Qx) && $Qx[0]['LastBoot'] != ""){
echo "<span class='badge rounded-pill bg-secondary text-light fs-5'>Last Boot : ".$Qx[0]['LastBoot']."</span>";
echo "<span class='badge rounded-pill bg-secondary text-light fs-5'>$w_lastReboot : ".$Qx[0]['LastBoot']."</span>";
}
if(is_array($Qw) && $Qw[0]['LastKBUpdate'] != ""){
echo "&nbsp;<span class='badge rounded-pill bg-secondary text-light fs-5'>Last Update : ".$Qw[0]['LastKBUpdate']."</span>";
echo "&nbsp;<span class='badge rounded-pill bg-secondary text-light fs-5'>$w_lastUpdate : ".$Qw[0]['LastKBUpdate']."</span>";
}elseif(is_array($Qx) && $Qx[0]['LastUpdate'] != ""){
echo "<span class='badge rounded-pill bg-secondary text-light fs-5'>Last Update : ".$Qx[0]['LastUpdate']."</span>";
echo "<span class='badge rounded-pill bg-secondary text-light fs-5'>$w_lastUpdate : ".$Qx[0]['LastUpdate']."</span>";
}
if($OSType == "Windows"){
$date = Invoke_Entry01("select next from rollupdate where Server='$server'");
if(is_array($date)){
if($date != ""){
echo "&nbsp;<span class='badge rounded-pill bg-secondary text-light fs-5'>Next Rollup : ".$date[0]['next']."</span>";
echo "&nbsp;<span class='badge rounded-pill bg-secondary text-light fs-5'>$w_nextRollup : ".$date[0]['next']."</span>";
}
}
}
if($OSType == "Linux"){
$date = Invoke_Infra("select Next from rollup_linux_calendar where Server='$server'")[0]['Next'];
if($date != ""){
echo "&nbsp;<span class='badge rounded-pill bg-secondary text-light fs-5'>Next Rollup : $date </span>";
echo "&nbsp;<span class='badge rounded-pill bg-secondary text-light fs-5'>$w_nextRollup : $date </span>";
}
}
?>
@@ -309,6 +319,19 @@
}
?>
<!-- Network configuration for Windows -->
<?php
if(is_array($Qw)){
$answer = Invoke_Entry01("SELECT Server,IpAddress,Gateway,DHCP,Subnet,MacAddress,DNSSuffix,DNS FROM networkcards where Server='$server'");
echo "<span class='badge rounded-pill bg-secondary text-light fs-5'>IP : " . $answer[0]['IpAddress'] . "</span>&nbsp;";
echo "<span class='badge rounded-pill bg-secondary text-light fs-5'>Mask : " . $answer[0]['Subnet'] . "</span>&nbsp;";
echo "<span class='badge rounded-pill bg-secondary text-light fs-5'>Gateway : " . $answer[0]['Gateway'] . "</span>&nbsp;";
echo "<span class='badge rounded-pill bg-secondary text-light fs-5'>DNS : " . $answer[0]['DNS'] . "</span>&nbsp;";
echo "<span class='badge rounded-pill bg-secondary text-light fs-5'>Mac : " . $answer[0]['MacAddress'] . "</span>&nbsp;";
}
?>
<!-- End of main content -->
</div>
</div>

View File

@@ -45,7 +45,12 @@
}
if (isset($_GET['term'])) {
$term = $_GET['term'];
$query = "SELECT hostname AS serv FROM cmdb_srvall WHERE hostname LIKE '%$term%' UNION SELECT hostname AS serv FROM x_SRVALL WHERE hostname LIKE '%$term%'";
$query = "SELECT hostname AS serv FROM cmdb_srvall
WHERE hostname LIKE '%$term%' AND (DECOM IS NULL OR DATEDIFF(day, DECOM, GETDATE()) <30)
UNION
SELECT hostname AS serv FROM x_SRVALL
WHERE hostname LIKE '%$term%' AND (DECOM IS NULL OR DATEDIFF(day, DECOM, GETDATE()) <30)";
$conn = DB_INFRA();
$rs = odbc_exec($conn, $query);
while ($row = odbc_fetch_array($rs)) {