Files
Web-Infra-Reports-IT/Hyper-V/Memory-Hunt-VMs.php
sva-e025532 10c228f255 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.
2026-03-31 11:33:57 +02:00

131 lines
5.2 KiB
PHP

<!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>