mirror of
https://github.com/ThomasGsp/HyperProxmox.git
synced 2025-03-09 15:40:18 +00:00
Fix multiples errors on functions args
This commit is contained in:
parent
ef85e04c3d
commit
25a7ae6699
1 changed files with 27 additions and 15 deletions
|
@ -28,16 +28,28 @@ class API_GET_INFO
|
||||||
return $cluster_conf;
|
return $cluster_conf;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function GET_qemu($date, $cluster=null, $node=null, $vmid= null)
|
public function GET_qemu($date, $cluster=null, $node=null, $vmid=null)
|
||||||
{
|
{
|
||||||
|
if (!empty($vmid))
|
||||||
|
$qemu = curl("api/v1/static/instances/".$date."/".$cluster."/".$node."/".$vmid);
|
||||||
|
else if (!empty($node))
|
||||||
|
$qemu = curl("api/v1/static/instances/".$date."/".$cluster."/".$node."/");
|
||||||
|
else if (!empty($cluster))
|
||||||
|
$qemu = curl("api/v1/static/instances/".$date."/".$cluster."/");
|
||||||
|
else
|
||||||
$qemu = curl("api/v1/static/instances/".$date."/");
|
$qemu = curl("api/v1/static/instances/".$date."/");
|
||||||
return $qemu;
|
return $qemu;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function GET_hyp($date, $cluster=null, $node=null)
|
public function GET_hyp($date, $cluster=null, $node=null)
|
||||||
{
|
{
|
||||||
|
if (!empty($node))
|
||||||
|
$nodes = curl("api/v1/static/nodes/".$date."/".$cluster."/".$node);
|
||||||
|
else if (!empty($cluster))
|
||||||
|
$nodes = curl("api/v1/static/nodes/".$date."/".$cluster."/");
|
||||||
|
else
|
||||||
$nodes = curl("api/v1/static/nodes/".$date."/");
|
$nodes = curl("api/v1/static/nodes/".$date."/");
|
||||||
|
|
||||||
return $nodes;
|
return $nodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,11 +179,11 @@ class API_Gen_HTML
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function List_VMs($date, $node=null)
|
public function List_VMs($date, $cluster=null, $node=null)
|
||||||
{
|
{
|
||||||
$html = '';
|
$html = '';
|
||||||
$d = new API_GET_INFO;
|
$d = new API_GET_INFO;
|
||||||
$vms_list = json_decode($d->GET_qemu($date), true)['value'];
|
$vms_list = json_decode($d->GET_qemu($date, $cluster, $node), true)['value'];
|
||||||
$last_clust = "";
|
$last_clust = "";
|
||||||
$last_disk = "";
|
$last_disk = "";
|
||||||
|
|
||||||
|
@ -240,7 +252,7 @@ class API_Gen_HTML
|
||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function List_HYPs($date, $cluster = null)
|
public function List_HYPs($date, $cluster=null, $node=null)
|
||||||
{
|
{
|
||||||
require(dirname(__DIR__).'/requires/configs.php');
|
require(dirname(__DIR__).'/requires/configs.php');
|
||||||
//$m = new REQUESTS_MYSQL;
|
//$m = new REQUESTS_MYSQL;
|
||||||
|
@ -248,11 +260,9 @@ class API_Gen_HTML
|
||||||
|
|
||||||
|
|
||||||
$q = new API_GET_INFO;
|
$q = new API_GET_INFO;
|
||||||
$nodes = json_decode($q->GET_hyp($date, $cluster), true)['value'];
|
$nodes = json_decode($q->GET_hyp($date, $cluster, $node), true)['value'];
|
||||||
|
|
||||||
|
|
||||||
arsort($nodes);
|
arsort($nodes);
|
||||||
|
|
||||||
$row_non_grata = [];
|
$row_non_grata = [];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -264,6 +274,8 @@ class API_Gen_HTML
|
||||||
$html = '';
|
$html = '';
|
||||||
$last_sto = "";
|
$last_sto = "";
|
||||||
$last_clust = "";
|
$last_clust = "";
|
||||||
|
|
||||||
|
|
||||||
foreach ($nodes as $node)
|
foreach ($nodes as $node)
|
||||||
{
|
{
|
||||||
$node = (object) $node;
|
$node = (object) $node;
|
||||||
|
@ -357,11 +369,11 @@ class API_Gen_HTML
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function List_STO($date, $node=null, $sto=null)
|
public function List_STO($date, $cluster=null, $node=null, $sto=null)
|
||||||
{
|
{
|
||||||
|
|
||||||
$q = new API_GET_INFO;
|
$q = new API_GET_INFO;
|
||||||
$stos_list = json_decode($q->GET_sto($date), true)['value'];
|
$stos_list = json_decode($q->GET_sto($date, $cluster, $node, $sto), true)['value'];
|
||||||
$html = '';
|
$html = '';
|
||||||
$last_clust = "";
|
$last_clust = "";
|
||||||
$last_disk = "";
|
$last_disk = "";
|
||||||
|
@ -422,7 +434,7 @@ class API_Gen_HTML
|
||||||
<td></td>
|
<td></td>
|
||||||
<td>
|
<td>
|
||||||
<a href="node.php?id='.$sto->_id["\$oid"].'&type=sto&date='.$date.'"> '.$sto->node.'</a>
|
<a href="node.php?id='.$sto->_id["\$oid"].'&type=sto&date='.$date.'"> '.$sto->node.'</a>
|
||||||
<a data-toggle="tooltip" title="External Link: https://'.$clusters_info->url.':'.$clusters_info->port.'/#v1:0:=node%2F'.$node->node.':4:5:::::" href="https://'.$clusters_info->url.':'.$clusters_info->port.'/#v1:0:=storage%2F'.$sto->node.'%2F'.$sto->storage.':4::::::" target="_blank">
|
<a data-toggle="tooltip" title="External Link: https://'.$clusters_info->url.':'.$clusters_info->port.'/#v1:0:=node%2F'.$sto->node.':4:5:::::" href="https://'.$clusters_info->url.':'.$clusters_info->port.'/#v1:0:=storage%2F'.$sto->node.'%2F'.$sto->storage.':4::::::" target="_blank">
|
||||||
<img src="images/fb-lien-420.png" alt="ExternalProxmoxLink" style="width:20px;height:20px;"></a> </td>
|
<img src="images/fb-lien-420.png" alt="ExternalProxmoxLink" style="width:20px;height:20px;"></a> </td>
|
||||||
<td> '.$sto->storage.'</td>
|
<td> '.$sto->storage.'</td>
|
||||||
<td data-order="'.$sto->total.'"> '.formatBytes($sto->total).'</td>
|
<td data-order="'.$sto->total.'"> '.formatBytes($sto->total).'</td>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue