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>
|
||||
|
||||
131
Hyper-V/Memory-Hunt-VMs.php
Normal file
131
Hyper-V/Memory-Hunt-VMs.php
Normal file
@@ -0,0 +1,131 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Page Title -->
|
||||
<title>Web Infra Reports IT</title>
|
||||
<link rel="shortcut icon" type="image/png" href="/include/favicon-32x32.png">
|
||||
|
||||
<!-- JQuery -->
|
||||
<script src="/js/jquery-3.6.1.min.js"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/css/bootstrap-icons/bootstrap-icons.css">
|
||||
<link rel="stylesheet" href="/css/preloader.css">
|
||||
<script src="/js/bootstrap.bundle.min.js"></script>
|
||||
<!-- Bootstrap-tables -->
|
||||
<link rel="stylesheet" href="/css/bootstrap-table.min.css">
|
||||
<script src="/js/bootstrap-table.min.js"></script>
|
||||
<script src="/js/bootstrap-table-fr-FR.min.js"></script>
|
||||
<script src="/js/tableExport.min.js"></script>
|
||||
<script src="/js/bootstrap-table-export.min.js"></script>
|
||||
<script src="/js/libs/js-xlsx/xlsx.core.min.js"></script>
|
||||
</head>
|
||||
|
||||
<body class="bg-light text-dark">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php"; ?> <!-- Include All -->
|
||||
<?php // DATA
|
||||
|
||||
|
||||
$answers = Invoke_Infra("SELECT
|
||||
m.*, COALESCE(s.OS, CONCAT(x.name, ' ', x.ver)) AS OS,
|
||||
CASE
|
||||
WHEN o.model = 'Virtual Machine' OR o.typ = 'MACHINE VIRTUELLE' THEN 'VM'
|
||||
WHEN o.model IS NOT NULL AND o.model <> '' THEN o.model
|
||||
ELSE 'Inconnu' -- Ou une autre valeur par défaut si tout est vide
|
||||
END AS hardware_type
|
||||
FROM cmdb_memoryusage m
|
||||
LEFT JOIN cmdb_srvall s ON m.vm_name = s.hostname
|
||||
LEFT JOIN x_cmdb_OS x ON m.vm_name = x.hostname
|
||||
LEFT JOIN cmdb_obsolescence o on m.vm_name = o.name
|
||||
where m.vm_name not like '%-v%-%' order by m.Potential_Savings_GB desc");
|
||||
?>
|
||||
|
||||
<!-- HTML -->
|
||||
<div class="container-fluid" id="content">
|
||||
<div class="row flex-nowrap">
|
||||
<!-- Left NAVBAR -->
|
||||
<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>
|
||||
<!-- Display -->
|
||||
<div class="col py-3">
|
||||
<!-- Page Title -->
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;"><?php echo $ti_6;?> </span></h1>
|
||||
|
||||
<!-- Main content -->
|
||||
<div class="container-fluid">
|
||||
<!-- TABLE -->
|
||||
<div>
|
||||
<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="name" data-sortable="true"><?php echo $w_name;?></th>
|
||||
<th data-field="Assigned" data-sortable="true"><?php echo $w_assignedGB;?></th>
|
||||
<th data-field="MinUsed" data-sortable="true"><?php echo $w_minUsedGB;?></th>
|
||||
<th data-field="AvgUsed" data-sortable="true"><?php echo $w_avgUsedGB;?></th>
|
||||
<th data-field="MaxUsed" data-sortable="true"><?php echo $w_maxUsedGB;?></th>
|
||||
<th data-field="Savings" data-sortable="true"><?php echo $w_potentialSavingsGB;?></th>
|
||||
<th data-field="StorageTotal" data-sortable="true"><?php echo $w_storageTotalGB;?></th>
|
||||
<th data-field="StorageUsed" data-sortable="true"><?php echo $w_storageUsedGB;?></th>
|
||||
<th data-field="OS" data-sortable="true" data-visible="false"><?php echo $w_os;?></th>
|
||||
<th data-field="Hardware" data-sortable="true" data-visible="false"><?php echo $w_hardware;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody> <!-- Body -->
|
||||
<?php
|
||||
foreach ($answers as $row) {
|
||||
echo "<tr><td>".$row['VM_Name']."</td>";
|
||||
echo "<td>".$row['Assigned_GB']."</td>";
|
||||
echo "<td>".$row['Min_Usage_GB']."</td>";
|
||||
echo "<td>".$row['Avg_Usage_GB']."</td>";
|
||||
echo "<td>".$row['Max_Usage_GB']."</td>";
|
||||
echo "<td>".$row['Potential_Savings_GB']."</td>";
|
||||
echo "<td>".$row['Storage_Total_GB']."</td>";
|
||||
echo "<td>".$row['Storage_Used_GB']."</td>";
|
||||
echo "<td>".$row['OS']."</td>";
|
||||
echo "<td>".$row['hardware_type']."</td></tr>";
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End of main content -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script src="/js/switch.js"></script>
|
||||
</HTML>
|
||||
|
||||
<SCRIPT>
|
||||
let table = $('#t1');
|
||||
$(document).ready(function() {
|
||||
table.DataTable({
|
||||
scrollY: '50vh',
|
||||
scrollCollapse: true,
|
||||
paging: false,
|
||||
});
|
||||
});
|
||||
|
||||
$(function () {
|
||||
let options = table.bootstrapTable('getOptions');
|
||||
options.height= document.getElementById('content').clientHeight-170;
|
||||
table.bootstrapTable('refreshOptions',options);
|
||||
});
|
||||
|
||||
function tableresize() {
|
||||
let options = table.bootstrapTable('getOptions');
|
||||
options.height= document.getElementById('content').clientHeight-170;
|
||||
table.bootstrapTable('refreshOptions',options);
|
||||
}
|
||||
|
||||
window.addEventListener("resize", tableresize);
|
||||
</SCRIPT>
|
||||
@@ -67,13 +67,13 @@
|
||||
<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='vm' data-sortable='true'>VM</th>
|
||||
<th data-field='Last Backup' data-sortable='true'>Last Backup</th>
|
||||
<th data-field='Last Result' data-sortable='true'>Last Result</th>
|
||||
<th data-field='Last Good' data-sortable='true'>Last Good Backup</th>
|
||||
<th data-field='Size' data-sortable='true'>Size</th>
|
||||
<th data-field='Host' data-sortable='true'>Host</th>
|
||||
<th data-field='Policy' data-sortable='true' data-visible='false'>Policy</th>
|
||||
<th data-field='vm' data-sortable='true'><?php echo $w_VMs;?></th>
|
||||
<th data-field='Last Backup' data-sortable='true'><?php echo $w_backuplu;?></th>
|
||||
<th data-field='Last Result' data-sortable='true'><?php echo $w_lastResult;?></th>
|
||||
<th data-field='Last Good' data-sortable='true'><?php echo $w_lastGoodBackup;?></th>
|
||||
<th data-field='Size' data-sortable='true'><?php echo $w_size;?></th>
|
||||
<th data-field='Host' data-sortable='true'><?php echo $w_host;?></th>
|
||||
<th data-field='Policy' data-sortable='true' data-visible='false'><?php echo $w_policy;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -228,7 +228,7 @@
|
||||
</div>
|
||||
<?php
|
||||
$success = $total - $er - $outdated -$excluded ;
|
||||
$ERR = "VMs backups (<span class='text-light'>".$total." Success</span> - <span class='text-danger'>".$er." issues</span> - <span class='text-warning'>".$outdated." outdated </span>- <span class='text-info'>".$excluded.' excluded</span>)';
|
||||
$ERR = "$w_vmBackup (<span class='text-light'>".$total." $w_success</span> - <span class='text-danger'>".$er." $w_issues</span> - <span class='text-warning'>".$outdated." $w_outdated </span>- <span class='text-info'>".$excluded." $w_excluded</span>)";
|
||||
?>
|
||||
</body>
|
||||
<script src="/js/switch.js"></script>
|
||||
|
||||
@@ -7,7 +7,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 -->
|
||||
@@ -41,7 +41,7 @@
|
||||
<div class="col py-3">
|
||||
<!-- Page Title -->
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold"
|
||||
style="width:100%;"><?php echo $_GET['cluster'] . " Details"; ?></span></h1>
|
||||
style="width:100%;"><?php echo $_GET['cluster']; ?></span></h1>
|
||||
|
||||
<!-- Main content -->
|
||||
<?php
|
||||
@@ -56,10 +56,8 @@
|
||||
|
||||
?>
|
||||
<div class="container-fluid" style="zoom:100%">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold"
|
||||
style="width:100%;"><?php echo $_GET['cluster']; ?></span></h2>
|
||||
<?php
|
||||
echo "<b>Worst Failover scenario available memory : </b>" . ($clmem - $vmmem) . " / " . $clmem . " GB";
|
||||
echo "<b>$w_worstScenario : </b>" . ($clmem - $vmmem) . " / " . $clmem . " GB";
|
||||
$pcent = round(($clmem - $vmmem) / $clmem * 100);
|
||||
$pcent_restant = 100 - $pcent;
|
||||
if ($pcent <= 5) {
|
||||
@@ -86,11 +84,11 @@
|
||||
foreach ($clusters as $cluster) {
|
||||
echo "<div class='col-6'>";
|
||||
$nbvm = Invoke_Infra("select count(*) as nbvm, sum(memory) as vmmem from cmdb_vms where owner ='" . $cluster['node'] . "' and decomtime is null");
|
||||
echo '<h3><span class="badge text-bg-secondary font-weight-bold" style="width:100%;">' . $cluster['node'] . " - " . $nbvm[0]['nbvm'] . " VMs <small><small> <i class='bi bi-clock'></i> " . $cluster['ts'] . "</small></small></span></h3><br>";
|
||||
echo '<h3><span class="badge text-bg-secondary font-weight-bold" style="width:100%;">' . $cluster['node'] . " - " . $nbvm[0]['nbvm'] . " $w_VMs <small><small> <i class='bi bi-clock'></i> " . $cluster['ts'] . "</small></small></span></h3><br>";
|
||||
#Memory
|
||||
echo "<div class='row'>";
|
||||
echo "<div class='col'>";
|
||||
echo "<b>Free Memory : </b>" . ($cluster['node_ram'] - 32 - $nbvm[0]['vmmem']) . " / " . ($cluster['node_ram'] - 32) . " GB";
|
||||
echo "<b>$w_freeMem : </b>" . ($cluster['node_ram'] - 32 - $nbvm[0]['vmmem']) . " / " . ($cluster['node_ram'] - 32) . " GB";
|
||||
$pcent = round(($cluster['node_ram'] - 32 - $nbvm[0]['vmmem']) / ($cluster['node_ram'] - 32) * 100);
|
||||
$pcent_restant = 100 - $pcent;
|
||||
if ($pcent <= 5) {
|
||||
@@ -138,7 +136,7 @@
|
||||
$total = explode(";", $csv)[1];
|
||||
$used = explode(";", $csv)[2];
|
||||
$free = $total - $used;
|
||||
echo " Free : </b>" . $free . "/" . $total . " GB";
|
||||
echo " : </b>" . $free . "/" . $total . " GB";
|
||||
echo "</div>";
|
||||
echo "<div class='col'>";
|
||||
$pcent = round($free / $total * 100);
|
||||
@@ -157,7 +155,7 @@
|
||||
<div class='progress-bar bg-dark progress-bar-striped' role='progressbar' style='width: $pcent_restant%;' aria-valuenow='$pcent_restant' aria-valuemin='0' aria-valuemax='100'></div>
|
||||
<div class='progress-bar $color' role='progressbar' style='width: $pcent%;' aria-valuenow='$pcent' aria-valuemin='0' aria-valuemax='100'></div>
|
||||
</div>";
|
||||
echo "</div>";
|
||||
echo "</small></div>";
|
||||
} else {
|
||||
echo "<div class='col'></div><br>";
|
||||
}
|
||||
@@ -193,10 +191,10 @@
|
||||
echo '<span class="badge rounded-pill bg-primary text-light">LUN(s)</span> ';
|
||||
}
|
||||
if ($vm['IsClustered'] != "True") {
|
||||
echo '<span class="badge rounded-pill bg-danger text-dark"><small>Unclustered</small></span> ';
|
||||
echo "<span class='badge rounded-pill bg-danger text-dark'><small>$w_unclustered</small></span> ";
|
||||
} else {
|
||||
if ($vm['Owner'] != $vm['PreferredOwner']) {
|
||||
echo '<span class="badge rounded-pill bg-warning text-dark"><small>Wrong Owner</small></span> ';
|
||||
echo "<span class='badge rounded-pill bg-warning text-dark'><small>$w_wrongOwner</small></span> ";
|
||||
}
|
||||
}
|
||||
echo "</div>";
|
||||
|
||||
127
Hyper-V/memory-hunt-HV.php
Normal file
127
Hyper-V/memory-hunt-HV.php
Normal file
@@ -0,0 +1,127 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Page Title -->
|
||||
<title>Web Infra Reports IT</title>
|
||||
<link rel="shortcut icon" type="image/png" href="/include/favicon-32x32.png">
|
||||
|
||||
<!-- JQuery -->
|
||||
<script src="/js/jquery-3.6.1.min.js"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/css/bootstrap-icons/bootstrap-icons.css">
|
||||
<link rel="stylesheet" href="/css/preloader.css">
|
||||
<script src="/js/bootstrap.bundle.min.js"></script>
|
||||
<!-- Bootstrap-tables -->
|
||||
<link rel="stylesheet" href="/css/bootstrap-table.min.css">
|
||||
<script src="/js/bootstrap-table.min.js"></script>
|
||||
<script src="/js/bootstrap-table-fr-FR.min.js"></script>
|
||||
<script src="/js/tableExport.min.js"></script>
|
||||
<script src="/js/bootstrap-table-export.min.js"></script>
|
||||
<script src="/js/libs/js-xlsx/xlsx.core.min.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body class="bg-light text-dark">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php"; ?> <!-- Include All -->
|
||||
<?php // DATA
|
||||
$answers = Invoke_Infra("SELECT * FROM v_HyperV_Memory_Optimization order by Total_VM_Savings_GB desc");
|
||||
?>
|
||||
|
||||
<!-- HTML -->
|
||||
<div class="container-fluid" id="content">
|
||||
<div class="row flex-nowrap">
|
||||
<!-- Left NAVBAR -->
|
||||
<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>
|
||||
<!-- Display -->
|
||||
<div class="col py-3">
|
||||
<!-- Page Title -->
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;"><?php echo $ti_5 ;?> </span></h1>
|
||||
|
||||
<!-- Main content -->
|
||||
<div class="container-fluid">
|
||||
<!-- MODAL WAIT -->
|
||||
<div class="modal fade bs-example-modal-sm" id="wait" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static" style="padding-top: 15%;">
|
||||
<div class="modal-dialog modal-sm">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title mb-1 text-dark text-uppercase text-center">
|
||||
<i class="bi bi-hourglass-split"></i><br> Work in progress ...
|
||||
</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="progress">
|
||||
<div class="progress-bar progress-bar-secondary progress-bar-striped progress-bar-animated" style="width: 100%"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- TABLE -->
|
||||
<div>
|
||||
<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="name" data-sortable="true"><?php echo $w_host;?></th>
|
||||
<th data-field="VMs" data-sortable="true"><?php echo $w_VMs;?></th>
|
||||
<th data-field="Assigned" data-sortable="true"><?php echo $w_vmAssignedGB;?></th>
|
||||
<th data-field="MaxUsed" data-sortable="true"><?php echo $w_vmMaxUsedGB ;?></th>
|
||||
<th data-field="Savings" data-sortable="true"><?php echo $w_potentialSavingsGB;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody> <!-- Body -->
|
||||
<?php
|
||||
foreach ($answers as $row) {
|
||||
echo "<tr><td>".$row['HyperV_Host']."</td>";
|
||||
echo "<td>".$row['VM_Count']."</td>";
|
||||
echo "<td>".$row['Total_VM_Assigned_GB']."</td>";
|
||||
echo "<td>".$row['Total_VM_Max_Usage_GB']."</td>";
|
||||
echo "<td>".$row['Total_VM_Savings_GB']."</td></tr>";
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End of main content -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script src="/js/switch.js"></script>
|
||||
</HTML>
|
||||
|
||||
<SCRIPT>
|
||||
let table = $('#t1');
|
||||
$(document).ready(function() {
|
||||
table.DataTable({
|
||||
scrollY: '50vh',
|
||||
scrollCollapse: true,
|
||||
paging: false,
|
||||
});
|
||||
});
|
||||
|
||||
$(function () {
|
||||
let options = table.bootstrapTable('getOptions');
|
||||
options.height= document.getElementById('content').clientHeight-170;
|
||||
table.bootstrapTable('refreshOptions',options);
|
||||
});
|
||||
|
||||
function tableresize() {
|
||||
let options = table.bootstrapTable('getOptions');
|
||||
options.height= document.getElementById('content').clientHeight-170;
|
||||
table.bootstrapTable('refreshOptions',options);
|
||||
}
|
||||
|
||||
window.addEventListener("resize", tableresize);
|
||||
</SCRIPT>
|
||||
Reference in New Issue
Block a user