Standardize left navbar with sticky and full height styling across multiple pages. Optimize backend functions in global.php.
This commit is contained in:
@@ -30,7 +30,7 @@
|
|||||||
<div class="container-fluid" id="content">
|
<div class="container-fluid" id="content">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
<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"; ?>
|
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?>
|
||||||
</div>
|
</div>
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
<div class="container-fluid" id="content">
|
<div class="container-fluid" id="content">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
<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"; ?>
|
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?>
|
||||||
</div>
|
</div>
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
<div class="container-fluid" id="content">
|
<div class="container-fluid" id="content">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
<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"; ?>
|
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?>
|
||||||
</div>
|
</div>
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
<div class="container-fluid" id="content">
|
<div class="container-fluid" id="content">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
<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"; ?>
|
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?>
|
||||||
</div>
|
</div>
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
<div class="container-fluid" id="content">
|
<div class="container-fluid" id="content">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
<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"; ?>
|
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?>
|
||||||
</div>
|
</div>
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
<div class="container-fluid" id="content">
|
<div class="container-fluid" id="content">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
<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"; ?>
|
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?>
|
||||||
</div>
|
</div>
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
@@ -84,7 +84,7 @@
|
|||||||
$answers = Invoke_infra("SELECT * FROM VMs_Backup where ( Owner like 'DUN-VMH%' or Owner like 'MDK-VMH%' ) and name not like 'WS%' and owner not like '%WKG%' and owner not like '%VMH-WM%' and Exclusion ='' and (LastResult <> 'OK' or lastresult is null) and policy is not null order by lastresult,name");
|
$answers = Invoke_infra("SELECT * FROM VMs_Backup where ( Owner like 'DUN-VMH%' or Owner like 'MDK-VMH%' ) and name not like 'WS%' and owner not like '%WKG%' and owner not like '%VMH-WM%' and Exclusion ='' and (LastResult <> 'OK' or lastresult is null) and policy is not null order by lastresult,name");
|
||||||
foreach ($answers as $row) {
|
foreach ($answers as $row) {
|
||||||
$er++;
|
$er++;
|
||||||
$date1 = date_create($row['LastKnownGood']); $diff = date_diff($date1, date_create(date("Y-m-d")));
|
$date1 = date_create($row['LastKnownGood']??'01/01/1970'); $diff = date_diff($date1, date_create(date("Y-m-d")));
|
||||||
if ($diff->format("%R%a") >= 2 || $row['LastKnownGood'] == ''){
|
if ($diff->format("%R%a") >= 2 || $row['LastKnownGood'] == ''){
|
||||||
echo "<tr class='table-danger'>";
|
echo "<tr class='table-danger'>";
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
<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"; ?> <!-- Left Navbar -->
|
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?> <!-- Left Navbar -->
|
||||||
</div>
|
</div>
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
|
|||||||
@@ -34,190 +34,233 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
<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"; ?> <!-- Left Navbar -->
|
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?> <!-- Left Navbar -->
|
||||||
</div>
|
</div>
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
<div class="col py-3">
|
<div class="col py-3">
|
||||||
<!-- Page Title -->
|
<!-- Page Title -->
|
||||||
<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%;">Hyper-V Clusters</span></h1>
|
||||||
|
|
||||||
<!-- Main content -->
|
|
||||||
<?php
|
|
||||||
$clusters = Invoke_Infra("select distinct cluster from cmdb_HyperV_Hosts where cluster <> '' and cluster not like '%-WM%' and cluster not like '%-C1MAS%' and cluster not like '%-vrs%' and (cluster like 'DUN%' or cluster like 'DMV%') order by cluster");
|
|
||||||
?>
|
|
||||||
<div class="container-fluid" style="zoom:90%">
|
<div class="container-fluid" style="zoom:90%">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$count = 0;
|
// =================================================================
|
||||||
$totalleft = 0;
|
// STEP 1: Fetch all required data with minimal database queries (MSSQL SYNTAX)
|
||||||
foreach ($clusters as $cluster) {
|
// =================================================================
|
||||||
if ($count / 4 == (int) ($count / 4)) {
|
|
||||||
echo "</div><div class='row'>";
|
// Query 1: Get aggregated data for all clusters at once.
|
||||||
|
$cluster_query = "
|
||||||
|
SELECT
|
||||||
|
cluster,
|
||||||
|
COUNT(node) as node_count,
|
||||||
|
MIN(node_ram) as min_node_ram,
|
||||||
|
SUM(TRY_CAST(vm_count AS INT)) as total_vms,
|
||||||
|
SUM(TRY_CAST(vm_memory AS INT)) as total_vm_memory,
|
||||||
|
SUM(TRY_CAST(io_disk AS FLOAT)) as total_io_disk,
|
||||||
|
STRING_AGG(CAST(csvs AS VARCHAR(MAX)), '|') as all_csvs
|
||||||
|
FROM
|
||||||
|
cmdb_HyperV_Hosts
|
||||||
|
WHERE
|
||||||
|
cluster <> ''
|
||||||
|
AND cluster NOT LIKE '%-WM%'
|
||||||
|
AND cluster NOT LIKE '%-C1MAS%'
|
||||||
|
AND cluster NOT LIKE '%-vrs%'
|
||||||
|
AND (cluster LIKE 'DUN%' OR cluster LIKE 'DMV%')
|
||||||
|
GROUP BY
|
||||||
|
cluster
|
||||||
|
ORDER BY
|
||||||
|
cluster
|
||||||
|
";
|
||||||
|
$all_clusters_data = Invoke_Infra($cluster_query);
|
||||||
|
|
||||||
|
// Query 2: Get VM distribution for all relevant clusters at once.
|
||||||
|
$vm_repart_query = "
|
||||||
|
SELECT
|
||||||
|
v.Cluster,
|
||||||
|
v.Owner,
|
||||||
|
count(v.Owner) as vm_count
|
||||||
|
FROM
|
||||||
|
cmdb_vms v
|
||||||
|
INNER JOIN cmdb_HyperV_Hosts h ON v.Cluster = h.cluster
|
||||||
|
WHERE
|
||||||
|
v.decomtime IS NULL
|
||||||
|
AND h.cluster <> ''
|
||||||
|
AND h.cluster NOT LIKE '%-WM%'
|
||||||
|
AND h.cluster NOT LIKE '%-C1MAS%'
|
||||||
|
AND h.cluster NOT LIKE '%-vrs%'
|
||||||
|
AND (h.cluster LIKE 'DUN%' OR h.cluster LIKE 'DMV%')
|
||||||
|
GROUP BY
|
||||||
|
v.Cluster, v.Owner
|
||||||
|
ORDER BY
|
||||||
|
v.Cluster, v.Owner
|
||||||
|
";
|
||||||
|
$raw_vm_distribution = Invoke_Infra($vm_repart_query);
|
||||||
|
|
||||||
|
// Process the VM distribution data into an easy-to-use associative array
|
||||||
|
$vm_distribution = [];
|
||||||
|
if (is_array($raw_vm_distribution)) {
|
||||||
|
foreach ($raw_vm_distribution as $repart) {
|
||||||
|
$vm_distribution[$repart['Cluster']][] = [
|
||||||
|
'owner' => $repart['Owner'],
|
||||||
|
'vm_count' => $repart['vm_count']
|
||||||
|
];
|
||||||
}
|
}
|
||||||
$data = Invoke_Infra("select * from cmdb_HyperV_Hosts where cluster = '" . $cluster['cluster'] . "'");
|
}
|
||||||
$clumem = (invoke_infra("select min(node_ram) as nmem from cmdb_HyperV_Hosts where cluster ='".$cluster['cluster']."'"))[0]['nmem'];
|
// =================================================================
|
||||||
$nb = (invoke_infra("select count(node) as nb from cmdb_HyperV_Hosts where cluster ='".$cluster['cluster']."'"))[0]['nb'];
|
// STEP 2: Loop through the pre-fetched data and display it
|
||||||
$clmem = $clumem-32; if($nb == 4){$clmem = $clmem*2;}
|
// =================================================================
|
||||||
$nodes = count($data);
|
$total_vms_left = 0;
|
||||||
$vms = 0;
|
$cluster_count = 0;
|
||||||
$vm_mem = 0;
|
|
||||||
$disk = 0;
|
if (is_array($all_clusters_data)) {
|
||||||
$io = 0;
|
foreach ($all_clusters_data as $cluster_data) {
|
||||||
$node_mem = 0;
|
if ($cluster_count > 0 && $cluster_count % 4 == 0) {
|
||||||
$capacity = 0; $free = 0;
|
echo "</div><div class='row'>";
|
||||||
foreach ($data as $d) {
|
}
|
||||||
$vms += $d['vm_count'];
|
|
||||||
$vm_mem += $d['vm_memory'];
|
// --- Calculations ---
|
||||||
$node_mem = (int) $d['node_ram'];
|
$cluster_name = $cluster_data['cluster'];
|
||||||
foreach (explode("|", $d['csvs']) as $csv) {
|
$node_count = (int)$cluster_data['node_count'];
|
||||||
if (str_contains($csv, ';')) {
|
$total_vms = (int)$cluster_data['total_vms'];
|
||||||
$free += intval(explode(";", $csv)[1]) - intval(explode(";", $csv)[2]);
|
$total_vm_memory = (int)$cluster_data['total_vm_memory'];
|
||||||
$disk = max($disk, $free);
|
|
||||||
$capacity += (int) explode(";", $csv)[1];
|
// Memory calculation
|
||||||
|
$cluster_usable_mem = (int)$cluster_data['min_node_ram'] - 32;
|
||||||
|
if ($node_count == 4) {
|
||||||
|
$cluster_usable_mem *= 2;
|
||||||
|
}
|
||||||
|
$free_mem = $cluster_usable_mem - $total_vm_memory;
|
||||||
|
$free_mem_percentage = ($cluster_usable_mem > 0) ? round($free_mem / $cluster_usable_mem * 100) : 0;
|
||||||
|
|
||||||
|
// Storage calculation
|
||||||
|
$capacity_gb = 0;
|
||||||
|
$free_gb = 0;
|
||||||
|
if (!empty($cluster_data['all_csvs'])) {
|
||||||
|
// Explode the big string into an array of all CSV entries (with duplicates)
|
||||||
|
$all_csv_entries = explode("|", $cluster_data['all_csvs']);
|
||||||
|
// Create a new array containing only the unique CSV entries
|
||||||
|
$unique_csv_entries = array_unique($all_csv_entries);
|
||||||
|
// Loop through the UNIQUE entries to perform the calculation
|
||||||
|
foreach ($unique_csv_entries as $csv_string) {
|
||||||
|
if (str_contains($csv_string, ';')) {
|
||||||
|
$parts = explode(";", $csv_string);
|
||||||
|
if(count($parts) >= 3) {
|
||||||
|
$capacity_gb += (int)$parts[1];
|
||||||
|
// Free space is Total Capacity (parts[1]) - Used Space (parts[2])
|
||||||
|
$free_gb += (int)$parts[1] - (int)$parts[2];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$io += $d['io_disk'];
|
$free_gb = max(0, $free_gb);
|
||||||
}
|
$free_storage_percentage = ($capacity_gb > 0) ? round($free_gb / $capacity_gb * 100) : 0;
|
||||||
$node_mem = $node_mem * count($data) / 2;
|
|
||||||
$io= round($io / count($data) * 1024);
|
|
||||||
if($io == 0){$io = "?";}
|
|
||||||
$vmleft = floor(($node_mem - 24 - $vm_mem) / 16);
|
|
||||||
$storageleft = floor($disk / 110);
|
|
||||||
$vmleft = min($vmleft, $storageleft);
|
|
||||||
$totalleft += $vmleft;
|
|
||||||
if ($vmleft > 2) {
|
|
||||||
$vleft = "<span class='text-success'><b>(" . $vmleft . "</b> VMs left)";
|
|
||||||
} elseif ($vmleft == 2) {
|
|
||||||
$vleft = "<span class='text-warning'><b>(" . $vmleft . "</b> VMs left)";
|
|
||||||
} else {
|
|
||||||
$vleft = "<span class='text-danger'><b>(" . $vmleft . "</b> VM left)";
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
// IOPS Calculation
|
||||||
|
$avg_io = ($node_count > 0) ? round((float)$cluster_data['total_io_disk'] / $node_count * 1024) : 0;
|
||||||
|
$io_display = ($avg_io == 0) ? "?" : $avg_io;
|
||||||
|
|
||||||
<div class='col-3'>
|
// VMs Left Calculation
|
||||||
<a href="cluster-detail.php?cluster=<?php echo $cluster['cluster']; ?>" class="text-decoration-none" target="_blank">
|
$vms_left_by_mem = ($free_mem > 0) ? floor($free_mem / 16) : 0;
|
||||||
<div class='card border-secondary mb-3'>
|
$vms_left_by_storage = ($free_gb > 0) ? floor($free_gb / 110) : 0;
|
||||||
<div class='card-header text-white bg-dark border-secondary'>
|
$vms_left = min($vms_left_by_mem, $vms_left_by_storage);
|
||||||
<h4 class="text-center">
|
$total_vms_left += $vms_left;
|
||||||
<?php echo $cluster['cluster']; ?>
|
|
||||||
</h4>
|
// --- Display Logic ---
|
||||||
<h6 class="text-center">
|
if ($vms_left > 2) {
|
||||||
<b><?php echo $nodes; ?></b> Nodes / <b><?php echo $vms; ?></b> VMs <?php echo $vleft; ?>
|
$vleft_html = "<span class='text-success'><b>(" . $vms_left . "</b> VMs left)</span>";
|
||||||
</h6>
|
} elseif ($vms_left >= 1) { // Handles 1 and 2
|
||||||
<?php
|
$vleft_html = "<span class='text-warning'><b>(" . $vms_left . "</b> VMs left)</span>";
|
||||||
if($nodes == 2 && $vms > 0){
|
} else {
|
||||||
$Repart = Invoke_Infra("select Owner, count(owner) as nbvm from cmdb_vms where Cluster ='".$cluster['cluster']."' and decomtime is null group by Owner order by Owner");
|
$vleft_html = "<span class='text-danger'><b>(" . $vms_left . "</b> VMs left)</span>";
|
||||||
$vmCountNode1 = $vmCountNode2 = 0;
|
}
|
||||||
$node1_name = $node2_name = "";
|
?>
|
||||||
if(isset($Repart) && count($Repart) == 1 ){
|
|
||||||
$node1_name = $Repart[0]['Owner']; $vmCountNode1 = $Repart[0]['nbvm'];
|
<div class='col-3'>
|
||||||
}else{
|
<a href="cluster-detail.php?cluster=<?php echo htmlspecialchars($cluster_name); ?>" class="text-decoration-none" target="_blank">
|
||||||
$node1_name = 'DUN'; $vmCountNode1 = $Repart[0]['nbvm'];
|
<div class='card border-secondary mb-3'>
|
||||||
$node2_name = 'MDK'; $vmCountNode2 = $Repart[1]['nbvm'];
|
<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; ?>
|
||||||
|
</h6>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$vm_dist_html = "<div class='progress' style='border: 2px solid grey; height: 20px; background-Color: transparent;'><div class='progress-bar' style='width: 0; background-color: transparent;'></div></div>";
|
||||||
|
if ($total_vms > 0 && isset($vm_distribution[$cluster_name])) {
|
||||||
|
$dist_data = $vm_distribution[$cluster_name];
|
||||||
|
if ($node_count == 2 && count($dist_data) > 0) {
|
||||||
|
$owner1_name = $dist_data[0]['owner'];
|
||||||
|
$owner1_count = $dist_data[0]['vm_count'];
|
||||||
|
$owner2_name = isset($dist_data[1]) ? $dist_data[1]['owner'] : 'N/A';
|
||||||
|
$owner2_count = isset($dist_data[1]) ? $dist_data[1]['vm_count'] : 0;
|
||||||
|
|
||||||
|
$p1 = ($total_vms > 0) ? ($owner1_count / $total_vms) * 100 : 0;
|
||||||
|
$p2 = ($total_vms > 0) ? ($owner2_count / $total_vms) * 100 : 0;
|
||||||
|
|
||||||
|
$vm_dist_html = "<div class='progress' style='border: 2px solid grey; height: 20px;'>
|
||||||
|
<div class='progress-bar text-white' role='progressbar' style='width:$p1%'><b>$owner1_name: $owner1_count</b></div>
|
||||||
|
<div class='progress-bar bg-info text-dark' role='progressbar' style='width:$p2%'><b>$owner2_name: $owner2_count</b></div>
|
||||||
|
</div>";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$totalVMs = $vmCountNode1 + $vmCountNode2;
|
echo $vm_dist_html;
|
||||||
$percentageNode1 = ($totalVMs > 0) ? ($vmCountNode1 / $totalVMs) * 100 : 0;
|
?>
|
||||||
$percentageNode2 = ($totalVMs > 0) ? ($vmCountNode2 / $totalVMs) * 100 : 0;
|
</div>
|
||||||
echo "<div class='progress' style='border: 2px solid grey; height: 20px;'>
|
<div class='card-body text-white bg-dark'>
|
||||||
<div class='progress-bar text-white' role='progressbar' style='width:$percentageNode1%' aria-valuenow='$percentageNode1' aria-valuemin='0' aria-valuemax='100'>
|
<?php
|
||||||
<b>$node1_name : $vmCountNode1 VMs</b>
|
$mem_color = ($free_mem_percentage <= 5) ? 'bg-danger' : (($free_mem_percentage <= 10) ? 'bg-warning' : 'bg-success');
|
||||||
</div>
|
$mem_border = ($free_mem_percentage <= 5) ? 'red' : (($free_mem_percentage <= 10) ? 'yellow' : 'green');
|
||||||
<div class='progress-bar bg-info text-dark' role='progressbar' style='width:$percentageNode2%' aria-valuenow='$percentageNode2' aria-valuemin='0' aria-valuemax='100'>
|
$mem_used_percentage = 100 - $free_mem_percentage;
|
||||||
<b>$node2_name : $vmCountNode2 VMs</b>
|
?>
|
||||||
</div>
|
<div class='row mb-2 align-items-center'>
|
||||||
</div>";
|
<div class='col-7'><b>Free Mem:</b> <?php echo $free_mem . " / " . $cluster_usable_mem; ?> GB</div>
|
||||||
}elseif($nodes == 4){
|
<div class='col-5'>
|
||||||
$RepartD = Invoke_Infra("select count(owner) as nbvm from cmdb_vms where Cluster ='".$cluster['cluster']."' and Owner like 'DUN%' and decomtime is null");
|
<div class='progress' style='border: 2px solid <?php echo $mem_border; ?>; height: 20px;'>
|
||||||
$RepartM = Invoke_Infra("select count(owner) as nbvm from cmdb_vms where Cluster ='".$cluster['cluster']."' and Owner like 'MDK%' and decomtime is null");
|
<div class='progress-bar bg-dark progress-bar-striped' style='width: <?php echo $mem_used_percentage; ?>%;'></div>
|
||||||
$vmCountNode1 = $vmCountNode2 = 0;
|
<div class='progress-bar <?php echo $mem_color; ?>' style='width: <?php echo $free_mem_percentage; ?>%;'></div>
|
||||||
$node1_name = 'DUN'; $vmCountNode1 = $RepartD[0]['nbvm'];
|
</div>
|
||||||
$node2_name = 'MDK'; $vmCountNode2 = $RepartM[0]['nbvm'];
|
</div>
|
||||||
$totalVMs = $vmCountNode1 + $vmCountNode2;
|
</div>
|
||||||
$percentageNode1 = ($totalVMs > 0) ? ($vmCountNode1 / $totalVMs) * 100 : 0;
|
|
||||||
$percentageNode2 = ($totalVMs > 0) ? ($vmCountNode2 / $totalVMs) * 100 : 0;
|
|
||||||
echo "<div class='progress' style='border: 2px solid grey; height: 20px;'>
|
|
||||||
<div class='progress-bar text-white' role='progressbar' style='width:$percentageNode1%' aria-valuenow='$percentageNode1' aria-valuemin='0' aria-valuemax='100'>
|
|
||||||
<b>$node1_name : $vmCountNode1 VMs</b>
|
|
||||||
</div>
|
|
||||||
<div class='progress-bar bg-info text-dark' role='progressbar' style='width:$percentageNode2%' aria-valuenow='$percentageNode2' aria-valuemin='0' aria-valuemax='100'>
|
|
||||||
<b>$node2_name : $vmCountNode2 VMs</b>
|
|
||||||
</div>
|
|
||||||
</div>";
|
|
||||||
|
|
||||||
}else{
|
<?php
|
||||||
echo "<div class='progress' style='border: 2px solid grey; height: 20px; background-Color: transparent;'>
|
$disk_unit = "GB";
|
||||||
<div class='progress-bar' style='width: 0; background-color: transparent;'></div>
|
$display_capacity = $capacity_gb;
|
||||||
</div>";
|
$display_free = $free_gb;
|
||||||
}
|
if ($capacity_gb > 10000) {
|
||||||
?>
|
$disk_unit = "TB";
|
||||||
|
$display_capacity = round($capacity_gb / 1024, 1);
|
||||||
|
$display_free = round($free_gb / 1024, 1);
|
||||||
|
}
|
||||||
|
$disk_color = ($free_storage_percentage <= 5) ? 'bg-danger' : (($free_storage_percentage <= 10) ? 'bg-warning' : 'bg-success');
|
||||||
|
$disk_border = ($free_storage_percentage <= 5) ? 'red' : (($free_storage_percentage <= 10) ? 'yellow' : 'green');
|
||||||
|
$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-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>
|
||||||
|
<div class='progress-bar <?php echo $disk_color; ?>' style='width: <?php echo $free_storage_percentage; ?>%;'></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class='row'><div class='col-7'><b>CSV I/O</b> (24h):</div><div class='col-5'><b><?php echo $io_display; ?> KB/s</b></div></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class='card-body text-white bg-dark'>
|
</a>
|
||||||
<?php
|
</div>
|
||||||
//Memory
|
|
||||||
echo "<div class='row'>";
|
|
||||||
echo "<div class='col-7'>";
|
|
||||||
echo "<b>Free Mem : </b>".($clmem - $vm_mem). " / " .$clmem. " GB";
|
|
||||||
echo "</div><div class='col-5'>";
|
|
||||||
$pcent = round(($clmem - $vm_mem)/$clmem*100);
|
|
||||||
$pcent_restant = 100 - $pcent;
|
|
||||||
if($pcent <= 5){
|
|
||||||
$color = "bg-danger"; $border = "red";
|
|
||||||
}else{
|
|
||||||
if($pcent <= 10){
|
|
||||||
$color = "bg-warning"; $border = "yellow";
|
|
||||||
}else{
|
|
||||||
$color = "bg-success"; $border = "green";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
echo "
|
|
||||||
<div class='progress flex-grow-1' style='border: 2px solid $border; height: 20px;'>
|
|
||||||
<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></div>";
|
|
||||||
//DISK
|
|
||||||
echo "<div class='row'>";
|
|
||||||
echo "<div class='col-7'>";
|
|
||||||
$unit="GB";
|
|
||||||
if($capacity > 10000){
|
|
||||||
$capacity = round($capacity / 1024,1); $unit="TB";
|
|
||||||
$free = round($free / 1024,1);
|
|
||||||
}
|
|
||||||
$used = $capacity - $free;
|
|
||||||
echo "<b>Free CSV : </b>".$free. " / " .$capacity. " $unit";
|
|
||||||
echo "</div><div class='col-5'>";
|
|
||||||
$pcent = ($clmem > 0) ? round(($clmem - $vm_mem) / $clmem * 100) : 0;
|
|
||||||
$pcent_restant = 100 - $pcent;
|
|
||||||
if($pcent <= 5){
|
|
||||||
$color = "bg-danger"; $border = "red";
|
|
||||||
}else{
|
|
||||||
if($pcent <= 10){
|
|
||||||
$color = "bg-warning"; $border = "yellow";
|
|
||||||
}else{
|
|
||||||
$color = "bg-success"; $border = "green";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
echo "
|
|
||||||
<div class='progress flex-grow-1' style='border: 2px solid $border; height: 20px;'>
|
|
||||||
<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></div>";
|
|
||||||
echo "<div class='row'><div class='col-7'><b>CSV I/O</b> R/W (24h) :</div><div class='col-5'><b> $io KB/s</b></div></div>";
|
|
||||||
|
|
||||||
?>
|
<?php
|
||||||
</div>
|
$cluster_count++;
|
||||||
</div>
|
} // End foreach
|
||||||
</a>
|
} // End if is_array
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
$count++; }
|
|
||||||
?>
|
?>
|
||||||
<br><br><h3 class ="text-center">Total VM Left : <?php echo $totalleft;?> </h3>
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<br><br>
|
||||||
|
<h3 class="text-center">Total VMs Left: <?php echo $total_vms_left; ?></h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- End of main content -->
|
<!-- End of main content -->
|
||||||
</div>
|
</div>
|
||||||
@@ -226,6 +269,3 @@
|
|||||||
<script src="/js/switch.js"></script>
|
<script src="/js/switch.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
<script>
|
|
||||||
$(".GaugeMeter").gaugeMeter();
|
|
||||||
</script>
|
|
||||||
@@ -77,7 +77,7 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
<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" ; ?> <!-- Left Navbar -->
|
<?php include $_SERVER['DOCUMENT_ROOT']."/navbar.html" ; ?> <!-- Left Navbar -->
|
||||||
</div>
|
</div>
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
<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" ; ?> <!-- Left Navbar -->
|
<?php include $_SERVER['DOCUMENT_ROOT']."/navbar.html" ; ?> <!-- Left Navbar -->
|
||||||
</div>
|
</div>
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
<div class="container-fluid" id="content">
|
<div class="container-fluid" id="content">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
<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"; ?>
|
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?>
|
||||||
</div>
|
</div>
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
<div class="container-fluid" id="content">
|
<div class="container-fluid" id="content">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
<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"; ?>
|
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?>
|
||||||
</div>
|
</div>
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
<div class="container-fluid" id="content">
|
<div class="container-fluid" id="content">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
<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"; ?>
|
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?>
|
||||||
</div>
|
</div>
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
|
|||||||
@@ -135,7 +135,7 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
<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"; ?> <!-- Left Navbar -->
|
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?> <!-- Left Navbar -->
|
||||||
</div>
|
</div>
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
<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" ; ?> <!-- Left Navbar -->
|
<?php include $_SERVER['DOCUMENT_ROOT']."/navbar.html" ; ?> <!-- Left Navbar -->
|
||||||
</div>
|
</div>
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
<div class="container-fluid" id="content">
|
<div class="container-fluid" id="content">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
<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"; ?>
|
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?>
|
||||||
</div>
|
</div>
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
<div class="container-fluid" id="content">
|
<div class="container-fluid" id="content">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
<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"; ?>
|
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?>
|
||||||
</div>
|
</div>
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
<div class="container-fluid" id="content">
|
<div class="container-fluid" id="content">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
<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"; ?>
|
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?>
|
||||||
</div>
|
</div>
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
<div class="container-fluid" id="content">
|
<div class="container-fluid" id="content">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
<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"; ?>
|
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?>
|
||||||
</div>
|
</div>
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
<div class="container-fluid" id="content">
|
<div class="container-fluid" id="content">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
<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"; ?>
|
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?>
|
||||||
</div>
|
</div>
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
<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" ; ?> <!-- Left Navbar -->
|
<?php include $_SERVER['DOCUMENT_ROOT']."/navbar.html" ; ?> <!-- Left Navbar -->
|
||||||
</div>
|
</div>
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
<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" ; ?> <!-- Left Navbar -->
|
<?php include $_SERVER['DOCUMENT_ROOT']."/navbar.html" ; ?> <!-- Left Navbar -->
|
||||||
</div>
|
</div>
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
<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"; ?> <!-- Left Navbar -->
|
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?> <!-- Left Navbar -->
|
||||||
</div>
|
</div>
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
<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"; ?> <!-- Left Navbar -->
|
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?> <!-- Left Navbar -->
|
||||||
</div>
|
</div>
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
<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" ; ?> <!-- Left Navbar -->
|
<?php include $_SERVER['DOCUMENT_ROOT']."/navbar.html" ; ?> <!-- Left Navbar -->
|
||||||
</div>
|
</div>
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
<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" ; ?> <!-- Left Navbar -->
|
<?php include $_SERVER['DOCUMENT_ROOT']."/navbar.html" ; ?> <!-- Left Navbar -->
|
||||||
</div>
|
</div>
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
<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" ; ?> <!-- Left Navbar -->
|
<?php include $_SERVER['DOCUMENT_ROOT']."/navbar.html" ; ?> <!-- Left Navbar -->
|
||||||
</div>
|
</div>
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
<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" ; ?> <!-- Left Navbar -->
|
<?php include $_SERVER['DOCUMENT_ROOT']."/navbar.html" ; ?> <!-- Left Navbar -->
|
||||||
</div>
|
</div>
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
<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" ; ?> <!-- Left Navbar -->
|
<?php include $_SERVER['DOCUMENT_ROOT']."/navbar.html" ; ?> <!-- Left Navbar -->
|
||||||
</div>
|
</div>
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
<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" ; ?> <!-- Left Navbar -->
|
<?php include $_SERVER['DOCUMENT_ROOT']."/navbar.html" ; ?> <!-- Left Navbar -->
|
||||||
</div>
|
</div>
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
|
|||||||
288
include/all.php
288
include/all.php
@@ -1,7 +1,285 @@
|
|||||||
<?php
|
<?php
|
||||||
include $_SERVER['DOCUMENT_ROOT']."/include/constants.inc.php";
|
|
||||||
include $_SERVER['DOCUMENT_ROOT']."/../../include/db_connect.inc.php";
|
|
||||||
include $_SERVER['DOCUMENT_ROOT']."/include/function.inc.php";
|
|
||||||
include $_SERVER['DOCUMENT_ROOT']."/include/modal_wait.html";
|
|
||||||
|
|
||||||
|
|
||||||
|
// CONSTANTS //
|
||||||
|
$BaseUrl = "http://".$_SERVER['SERVER_NAME'];
|
||||||
|
$root = $_SERVER['DOCUMENT_ROOT'];
|
||||||
|
$bdnuss = "http://web-bdnuss-sys-dev.appliarmony.net";
|
||||||
|
|
||||||
|
// FUNCTIONS //
|
||||||
|
//tools//
|
||||||
|
function decypher(string $name): ?string {
|
||||||
|
$openssl = 'C:\Program Files\FireDaemon OpenSSL 3\bin\openssl.exe';
|
||||||
|
$cmsFile = "F:\\Include\\dat\\$name.p7m";
|
||||||
|
$certPem = "F:\\Include\\certs\\cert_only.pem";
|
||||||
|
$keyPem = "F:\\Include\\certs\\key_only.pem";
|
||||||
|
|
||||||
|
foreach ([$openssl,$cmsFile,$certPem,$keyPem] as $p) {
|
||||||
|
if (!is_file($p)) { error_log("Missing file: $p"); return null; }
|
||||||
|
}
|
||||||
|
|
||||||
|
$cmd = '"' . $openssl . '" cms -decrypt -inform PEM'
|
||||||
|
. ' -in ' . escapeshellarg($cmsFile)
|
||||||
|
. ' -recip ' . escapeshellarg($certPem)
|
||||||
|
. ' -inkey ' . escapeshellarg($keyPem)
|
||||||
|
. ' -out -';
|
||||||
|
|
||||||
|
$spec = [
|
||||||
|
0 => ['pipe','r'], // stdin (unused)
|
||||||
|
1 => ['pipe','w'], // stdout -> texte déchiffré
|
||||||
|
2 => ['pipe','w'], // stderr -> erreurs OpenSSL
|
||||||
|
];
|
||||||
|
$proc = proc_open($cmd, $spec, $pipes);
|
||||||
|
if (!is_resource($proc)) { error_log('proc_open failed'); return null; }
|
||||||
|
fclose($pipes[0]); // rien à envoyer en stdin
|
||||||
|
|
||||||
|
$stdout = stream_get_contents($pipes[1]); fclose($pipes[1]);
|
||||||
|
$stderr = stream_get_contents($pipes[2]); fclose($pipes[2]);
|
||||||
|
$code = proc_close($proc);
|
||||||
|
|
||||||
|
if ($code !== 0) {
|
||||||
|
error_log("OpenSSL failed (code $code): $stderr");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return $stdout;
|
||||||
|
}
|
||||||
|
function PostJson($url, $content){
|
||||||
|
$curl = curl_init($url);
|
||||||
|
curl_setopt($curl, CURLOPT_HEADER, false);
|
||||||
|
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
|
||||||
|
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||||
|
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-type: application/json"));
|
||||||
|
curl_setopt($curl, CURLOPT_POST, true);
|
||||||
|
curl_setopt($curl, CURLOPT_POSTFIELDS, $content);
|
||||||
|
$retour = curl_exec($curl);
|
||||||
|
curl_close($curl);
|
||||||
|
return $retour;
|
||||||
|
}
|
||||||
|
|
||||||
|
//invoke//
|
||||||
|
function Invoke_Infra($request)
|
||||||
|
{
|
||||||
|
error_reporting(E_ALL ^ E_WARNING);
|
||||||
|
$user = "INFRA_dbo";
|
||||||
|
$pwd = decypher("infra");
|
||||||
|
$server = "DUN-PRD-R1MSSQL.armony.net\PRD";
|
||||||
|
$database = "INFRA";
|
||||||
|
$conn = odbc_connect("Driver={SQL Server};Server=$server;Database=$database;", $user, $pwd);
|
||||||
|
if (!($conn)) {
|
||||||
|
echo "Pas de connexion";
|
||||||
|
}
|
||||||
|
$rs = odbc_exec($conn, $request);
|
||||||
|
if (str_contains(strtoupper($request), "SELECT")) {
|
||||||
|
while ($row = odbc_fetch_array($rs)) {
|
||||||
|
$answer[] = $row;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isset($answer)) {
|
||||||
|
return $answer;
|
||||||
|
} else {
|
||||||
|
if ($rs) {
|
||||||
|
return "OK";
|
||||||
|
} else {
|
||||||
|
error_reporting(E_ALL);
|
||||||
|
return "ERROR : " . odbc_errormsg($conn);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
function Invoke_WebSelfInfra($request)
|
||||||
|
{
|
||||||
|
$user = "Scom-Write";
|
||||||
|
$pwd = decypher("web-self-infra");
|
||||||
|
$server = "DUN-PRD-R1SCOM.armony.net\OPS";
|
||||||
|
$database = "web-self-infra";
|
||||||
|
$conn = odbc_connect("Driver={SQL Server};Server=$server;Database=$database;", $user, $pwd);
|
||||||
|
if (!($conn)) {
|
||||||
|
echo "Pas de connexion";
|
||||||
|
}
|
||||||
|
$rs = odbc_exec($conn, $request);
|
||||||
|
if (str_contains(strtoupper($request), "SELECT")) {
|
||||||
|
while ($row = odbc_fetch_array($rs)) {
|
||||||
|
$answer[] = $row;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $answer ?? null;
|
||||||
|
}
|
||||||
|
function Invoke_WebInfraReports($request)
|
||||||
|
{
|
||||||
|
$user = "admin";
|
||||||
|
$pwd = decypher("web-infra-reports");
|
||||||
|
$server = "dun-sup-s2entry.armony.net:3306";
|
||||||
|
$database = "web-infra-reports";
|
||||||
|
$conn = new mysqli($server, $user, $pwd, $database);
|
||||||
|
$rs = $conn->query($request);
|
||||||
|
while ($row = mysqli_fetch_array($rs)) {
|
||||||
|
$answer[] = $row;
|
||||||
|
}
|
||||||
|
return $answer ?? null;
|
||||||
|
|
||||||
|
}
|
||||||
|
function Invoke_SCOMInfra($request)
|
||||||
|
{
|
||||||
|
$user = "Scom-Write";
|
||||||
|
$pwd = decypher("ScomInfra");
|
||||||
|
$server = "DUN-PRD-R1SCOM.armony.net\OPS";
|
||||||
|
$database = "infra";
|
||||||
|
$conn = odbc_connect("Driver={SQL Server};Server=$server;Database=$database;", $user, $pwd);
|
||||||
|
if (!($conn)) {
|
||||||
|
echo "Pas de connexion";
|
||||||
|
}
|
||||||
|
$rs = odbc_exec($conn, $request);
|
||||||
|
if (str_contains(strtoupper($request), "SELECT")) {
|
||||||
|
while ($row = odbc_fetch_array($rs)) {
|
||||||
|
$answer[] = $row;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $answer ?? null;
|
||||||
|
}
|
||||||
|
function Invoke_Entry01($request)
|
||||||
|
{
|
||||||
|
$user = "infra";
|
||||||
|
$pwd = decypher("entry01");
|
||||||
|
$server = "dun-sup-entry01:3306";
|
||||||
|
$database = "infra";
|
||||||
|
$conn = new mysqli($server, $user, $pwd, $database);
|
||||||
|
$rs = $conn->query($request);
|
||||||
|
while ($row = mysqli_fetch_array($rs)) {
|
||||||
|
$answer[] = $row;
|
||||||
|
}
|
||||||
|
return $answer ?? null;
|
||||||
|
}
|
||||||
|
function Invoke_WebInfraTools($request)
|
||||||
|
{
|
||||||
|
$user = "admin";
|
||||||
|
$pwd = decypher("web-infra-tools");
|
||||||
|
$server = "dun-sup-s2entry.armony.net:3306";
|
||||||
|
$database = "webinfratools";
|
||||||
|
$conn = new mysqli($server, $user, $pwd, $database);
|
||||||
|
$rs = $conn->query($request);
|
||||||
|
while ($row = mysqli_fetch_array($rs)) {
|
||||||
|
$answer[] = $row;
|
||||||
|
}
|
||||||
|
return $answer ?? null;
|
||||||
|
}
|
||||||
|
function Invoke_GLPI($request)
|
||||||
|
{
|
||||||
|
$user="glpi_lect_seule";
|
||||||
|
$pwd=decypher("glpi");
|
||||||
|
$server="mys_glpi_prod.appliarmony.net";
|
||||||
|
$database="glpi";
|
||||||
|
$conn = new mysqli($server, $user, $pwd, $database);
|
||||||
|
$rs = $conn->query($request);
|
||||||
|
while ($row = mysqli_fetch_array($rs)) {
|
||||||
|
$answer[] = $row;
|
||||||
|
}
|
||||||
|
return $answer ?? null;
|
||||||
|
}
|
||||||
|
function Invoke_aixcmdb($request)
|
||||||
|
{
|
||||||
|
$conn_string = "DRIVER={IBM DB2 ODBC DRIVER - F_DB2_clidriver};" .
|
||||||
|
"DATABASE=AIXCMDB; " .
|
||||||
|
"HOSTNAME=db2_aixcmdb.appliarmony.net;" .
|
||||||
|
"PORT=50000; " .
|
||||||
|
"PROTOCOL=TCPIP; " .
|
||||||
|
"UID=aixcmdb;" .
|
||||||
|
"AUTHENTICATION=SERVER;" .
|
||||||
|
"PWD=".decypher('aixcmdb').";";
|
||||||
|
|
||||||
|
$conn = odbc_connect($conn_string, "", "");
|
||||||
|
if (!$conn) {
|
||||||
|
$error_message = "ODBC Connect Error: " . odbc_errormsg() . " (" . odbc_error() . ")";
|
||||||
|
echo "Pas de connexion : " . $error_message . "<br>";
|
||||||
|
return "ERROR: Could not connect to DB2. Check connection string and ODBC setup.";
|
||||||
|
}
|
||||||
|
$rs = odbc_exec($conn, $request);
|
||||||
|
if (str_contains(strtoupper($request), "SELECT")) {
|
||||||
|
$answer = [];
|
||||||
|
while ($row = odbc_fetch_array($rs)) {
|
||||||
|
$answer[] = $row;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isset($answer)) {
|
||||||
|
return $answer;
|
||||||
|
} else {
|
||||||
|
if ($rs) {
|
||||||
|
return "OK";
|
||||||
|
} else {
|
||||||
|
error_reporting(E_ALL);
|
||||||
|
return "ERROR : " . odbc_errormsg($conn);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//DB Conn//
|
||||||
|
function DB_SCCM(){
|
||||||
|
$user = "infra";
|
||||||
|
$pwd = decypher("SCCM");
|
||||||
|
$conn = odbc_connect("Driver={SQL Server};Server=DUN-SMS-SRV01;Database=CM_SV1;", $user, $pwd);
|
||||||
|
return $conn;
|
||||||
|
}
|
||||||
|
function DB_GLPI() {
|
||||||
|
$username="glpi_lect_seule";
|
||||||
|
$password=decypher( "glpi");
|
||||||
|
$dbserver="mys_glpi_prod.appliarmony.net";
|
||||||
|
$database="glpi";
|
||||||
|
$conn = new mysqli($dbserver,$username,$password,$database);
|
||||||
|
return $conn;
|
||||||
|
}
|
||||||
|
function DB_ENTRY01() {
|
||||||
|
$username="infra";
|
||||||
|
$password=decypher("entry01");
|
||||||
|
$dbserver="dun-sup-entry01.armony.net";
|
||||||
|
$database="infra";
|
||||||
|
$conn = new mysqli($dbserver,$username,$password,$database);
|
||||||
|
return $conn;
|
||||||
|
}
|
||||||
|
function DB_ENTRY02() {
|
||||||
|
$username="admin";
|
||||||
|
$password=decypher("web-infra-reports");
|
||||||
|
$dbserver="dun-sup-s2entry.armony.net";
|
||||||
|
$database="web-infra-reports";
|
||||||
|
$conn = new mysqli($dbserver,$username,$password,$database);
|
||||||
|
return $conn ;
|
||||||
|
}
|
||||||
|
function DB_INFRA() {
|
||||||
|
$user="INFRA_dbo";
|
||||||
|
$pwd=decypher("infra");
|
||||||
|
$server="DUN-PRD-R1MSSQL.armony.net\PRD";
|
||||||
|
$database="INFRA";
|
||||||
|
$conn = odbc_connect("Driver={SQL Server};Server=$server;Database=$database;", $user, $pwd);
|
||||||
|
return $conn ;
|
||||||
|
}
|
||||||
|
function DB_ZABBIX()
|
||||||
|
{
|
||||||
|
$host = 'aztprdzabbix52.armony.net';
|
||||||
|
$dbname = 'zabbix';
|
||||||
|
$user = 'patrick';
|
||||||
|
$pass = decypher( 'zabbix');
|
||||||
|
$pdo = new PDO("mysql:host=$host;dbname=$dbname", $user, $pass);
|
||||||
|
return $pdo;
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<!-- 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">
|
||||||
|
<span class="text-center"><i class="bi bi-hourglass-split"></i><br> Work in progress ...</span>
|
||||||
|
</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>
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
//tools//
|
//tools//
|
||||||
function decypher(string $name): ?string {
|
function decypher(string $name): ?string {
|
||||||
$openssl = 'C:\Program Files\FireDaemon OpenSSL 3\bin\openssl.exe';
|
$openssl = 'C:\Program Files\FireDaemon OpenSSL 3\bin\openssl.exe';
|
||||||
$cmsFile = "F:\\Include\\dat\\{$name}.p7m";
|
$cmsFile = "F:\\Include\\dat\\$name.p7m";
|
||||||
$certPem = "F:\\Include\\certs\\cert_only.pem";
|
$certPem = "F:\\Include\\certs\\cert_only.pem";
|
||||||
$keyPem = "F:\\Include\\certs\\key_only.pem";
|
$keyPem = "F:\\Include\\certs\\key_only.pem";
|
||||||
|
|
||||||
@@ -134,7 +134,6 @@
|
|||||||
return $answer ?? null;
|
return $answer ?? null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Invoke_Infra($request)
|
function Invoke_Infra($request)
|
||||||
{
|
{
|
||||||
error_reporting(E_ALL ^ E_WARNING);
|
error_reporting(E_ALL ^ E_WARNING);
|
||||||
@@ -203,20 +202,14 @@
|
|||||||
{
|
{
|
||||||
$user="glpi_lect_seule";
|
$user="glpi_lect_seule";
|
||||||
$pwd=decypher("glpi");
|
$pwd=decypher("glpi");
|
||||||
$server="srvv-n4glpi-aim.process.dkm";
|
|
||||||
$server="mys_glpi_prod.appliarmony.net";
|
$server="mys_glpi_prod.appliarmony.net";
|
||||||
$database="glpi";
|
$database="glpi";
|
||||||
$conn = new mysqli($server, $user, $pwd, $database);
|
$conn = new mysqli($server, $user, $pwd, $database);
|
||||||
if (!($conn)) {
|
|
||||||
echo "Pas de connexion";
|
|
||||||
}
|
|
||||||
$rs = $conn->query($request);
|
$rs = $conn->query($request);
|
||||||
while ($row = mysqli_fetch_array($rs)) {
|
while ($row = mysqli_fetch_array($rs)) {
|
||||||
$answer[] = $row;
|
$answer[] = $row;
|
||||||
}
|
}
|
||||||
if (isset($answer)) {
|
return $answer ?? null;
|
||||||
return $answer;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//DB Conn//
|
//DB Conn//
|
||||||
@@ -270,14 +263,13 @@
|
|||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
//HTML//
|
|
||||||
<!-- MODAL WAIT -->
|
<!-- 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 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-dialog modal-sm">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h4 class="modal-title mb-1 text-dark text-uppercase">
|
<h4 class="modal-title mb-1 text-dark text-uppercase">
|
||||||
<div class="text-center"><i class="bi bi-hourglass-split"></i><br> Work in progress ...</div>
|
<span class="text-center"><i class="bi bi-hourglass-split"></i><br> Work in progress ...</span>
|
||||||
</h4>
|
</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
<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" ; ?> <!-- Left Navbar -->
|
<?php include $_SERVER['DOCUMENT_ROOT']."/navbar.html" ; ?> <!-- Left Navbar -->
|
||||||
</div>
|
</div>
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
<div class="container-fluid" id="content">
|
<div class="container-fluid" id="content">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
<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"; ?>
|
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?>
|
||||||
</div>
|
</div>
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
<div class="container-fluid" id="content">
|
<div class="container-fluid" id="content">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
<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"; ?>
|
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?>
|
||||||
</div>
|
</div>
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
|
|||||||
@@ -79,7 +79,7 @@
|
|||||||
<div class="container-fluid" id="content">
|
<div class="container-fluid" id="content">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
<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"; ?>
|
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?>
|
||||||
</div>
|
</div>
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
<div class="container-fluid" id="content">
|
<div class="container-fluid" id="content">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
<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"; ?>
|
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?>
|
||||||
</div>
|
</div>
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
<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"; ?> <!-- Left Navbar -->
|
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?> <!-- Left Navbar -->
|
||||||
</div>
|
</div>
|
||||||
<!-- Display -->
|
<!-- Display -->
|
||||||
|
|||||||
Reference in New Issue
Block a user