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:
@@ -6,7 +6,7 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<title>Web Infra Reports</title>
|
||||
<title>Web Infra Reports IT</title>
|
||||
<link rel="shortcut icon" type="image/png" href="/include/favicon-32x32.png">
|
||||
|
||||
<script src="/js/jquery-3.6.1.min.js"></script>
|
||||
@@ -29,7 +29,7 @@
|
||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark vh-100 position-sticky top-0" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?> </div>
|
||||
<div class="col py-3">
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;">Hyper-V Clusters</span></h1>
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;"><?php echo $ti_4;?></span></h1>
|
||||
<div class="container-fluid" style="zoom:90%">
|
||||
<div class="row">
|
||||
<?php
|
||||
@@ -37,7 +37,6 @@
|
||||
// STEP 1: Fetch all required data with minimal database queries
|
||||
// =================================================================
|
||||
|
||||
// Query 1: Get aggregated data for all clusters at once. (Unchanged)
|
||||
$cluster_query = "
|
||||
SELECT
|
||||
cluster,
|
||||
@@ -62,7 +61,6 @@
|
||||
";
|
||||
$all_clusters_data = Invoke_Infra($cluster_query);
|
||||
|
||||
// Query 2: Get VM distribution for all relevant clusters at once. (Unchanged)
|
||||
$vm_repart_query = "
|
||||
SELECT
|
||||
v.Cluster,
|
||||
@@ -95,7 +93,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
// MODIFICATION : Requête finale sans la jointure pour éviter les doublons
|
||||
$vm_issues_query = "
|
||||
SELECT
|
||||
v.Cluster,
|
||||
@@ -178,11 +175,11 @@
|
||||
|
||||
// --- Display Logic ---
|
||||
if ($vms_left > 2) {
|
||||
$vleft_html = "<span class='text-success'><b>(" . $vms_left . "</b> VMs left)</span>";
|
||||
$vleft_html = "<span class='text-success'><b>(" . $vms_left . "</b> $w_VMleft)</span>";
|
||||
} elseif ($vms_left >= 1) {
|
||||
$vleft_html = "<span class='text-warning'><b>(" . $vms_left . "</b> VMs left)</span>";
|
||||
$vleft_html = "<span class='text-warning'><b>(" . $vms_left . "</b> $w_VMleft)</span>";
|
||||
} else {
|
||||
$vleft_html = "<span class='text-danger'><b>(" . $vms_left . "</b> VMs left)</span>";
|
||||
$vleft_html = "<span class='text-danger'><b>(" . $vms_left . "</b> $w_VMleft)</span>";
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -192,7 +189,7 @@
|
||||
<div class='card-header text-white bg-dark border-secondary'>
|
||||
<h4 class="text-center"><?php echo htmlspecialchars($cluster_name); ?></h4>
|
||||
<h6 class="text-center">
|
||||
<b><?php echo $node_count; ?></b> Nodes / <b><?php echo $total_vms; ?></b> VMs <?php echo $vleft_html; ?>
|
||||
<b><?php echo $node_count; ?></b> <?php echo $w_nodes;?> / <b><?php echo $total_vms; ?></b> <?php echo $w_VMs ;?> <?php echo $vleft_html; ?>
|
||||
</h6>
|
||||
|
||||
<?php
|
||||
@@ -222,7 +219,7 @@
|
||||
$mem_used_percentage = 100 - $free_mem_percentage;
|
||||
?>
|
||||
<div class='row mb-2 align-items-center'>
|
||||
<div class='col-7'><b>Free Mem:</b> <?php echo $free_mem . " / " . $cluster_usable_mem; ?> GB</div>
|
||||
<div class='col-7'><b><?php echo $w_freeMem;?> :</b> <?php echo $free_mem . " / " . $cluster_usable_mem; ?> GB</div>
|
||||
<div class='col-5'>
|
||||
<div class='progress' style='border: 2px solid <?php echo $mem_border; ?>; height: 20px;'>
|
||||
<div class='progress-bar bg-dark progress-bar-striped' style='width: <?php echo $mem_used_percentage; ?>%;'></div>
|
||||
@@ -245,7 +242,7 @@
|
||||
$disk_used_percentage = 100 - $free_storage_percentage;
|
||||
?>
|
||||
<div class='row mb-2 align-items-center'>
|
||||
<div class='col-7'><b>Free CSV:</b> <?php echo $display_free . " / " . $display_capacity . " " . $disk_unit; ?></div>
|
||||
<div class='col-7'><b><?php echo $w_freeCSV;?> :</b> <?php echo $display_free . " / " . $display_capacity . " " . $disk_unit; ?></div>
|
||||
<div class='col-5'>
|
||||
<div class='progress' style='border: 2px solid <?php echo $disk_border; ?>; height: 20px;'>
|
||||
<div class='progress-bar bg-dark progress-bar-striped' style='width: <?php echo $disk_used_percentage; ?>%;'></div>
|
||||
@@ -260,15 +257,15 @@
|
||||
$wrong_owner_count = $vm_issues[$cluster_name]['wrong_owner'] ?? 0;
|
||||
|
||||
if ($unclustered_count > 0) {
|
||||
echo "<div class='col-7'><span class='badge text-bg-danger'>Unclustered: $unclustered_count</span></div>";
|
||||
echo "<div class='col-7'><span class='badge text-bg-danger'>$w_unclustered: $unclustered_count</span></div>";
|
||||
}else{
|
||||
echo "<div class='col-7'><span class='badge text-bg-success'>Unclustered: $unclustered_count</span></div>";
|
||||
echo "<div class='col-7'><span class='badge text-bg-success'>$w_unclustered: $unclustered_count</span></div>";
|
||||
}
|
||||
|
||||
if ($wrong_owner_count > 0) {
|
||||
echo "<div class='col-5'><span class='badge text-bg-warning'>Wrong Owner: {$wrong_owner_count}</span></div>";
|
||||
echo "<div class='col-5'><span class='badge text-bg-warning'>$w_wrongOwner: {$wrong_owner_count}</span></div>";
|
||||
}else{
|
||||
echo "<div class='col-5'><span class='badge text-bg-success'>Wrong Owner: {$wrong_owner_count}</span></div>";
|
||||
echo "<div class='col-5'><span class='badge text-bg-success'>$w_wrongOwner: {$wrong_owner_count}</span></div>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
@@ -285,7 +282,7 @@
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<br><br>
|
||||
<h3 class="text-center">Total VMs Left: <?php echo $total_vms_left; ?></h3>
|
||||
<h3 class="text-center">Total <?php echo $w_VMleft;?>: <?php echo $total_vms_left; ?></h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user