diff --git a/code/web/www/pages/requires/functions.php b/code/web/www/pages/requires/functions.php index efe431d..08bafa0 100755 --- a/code/web/www/pages/requires/functions.php +++ b/code/web/www/pages/requires/functions.php @@ -24,7 +24,10 @@ class API_GET_INFO public function GET_clusters_conf($cluster=null) { - $cluster_conf = curl("api/v1/administration/cluster/".$cluster); + if (!empty($cluster)) + $cluster_conf = curl("api/v1/administration/cluster/".$cluster); + else + $cluster_conf = curl("api/v1/administration/cluster/"); return $cluster_conf; } @@ -67,13 +70,9 @@ class API_GET_INFO return $storages; } - public function GET_Groups($date, $group = null) + public function GET_Groups() { - if (!empty($group)) - $groups = curl($date."/groups/".$group); - else - $groups = curl($date."/groups/"); - + $groups = curl("api/v1/administration/cluster/"); return $groups; } @@ -118,39 +117,41 @@ class API_Gen_HTML } - public function List_Groups($timestamp = "") + public function List_Groups($date) { $d = new API_GET_INFO; - $groups = $d->GET_Groups($timestamp); $html = ''; - $arr_groups = json_decode($groups, true); - - - foreach ($arr_groups as $group) + $clusters = json_decode($d->GET_Groups(), true)['value']; + + + $group_arr = array(); + foreach ($clusters as $cluster) { - $clusters = $d->GET_Groups($timestamp, $group); - - $arr_clusters = json_decode($clusters, true); - sort($arr_clusters); - - reset($arr_clusters); - if (!empty($group)) + $cluster = (object) $cluster; + foreach ($cluster->groups as $group) { - $html = $html.'
  • '.$group.''; - $html = $html.'
  • '; - } - else { - $html = $html.'
  • '.$group.''; - $html = $html.'
  • '; } } + + foreach ($group_arr as $keygroup => $group) + { + $html = $html.'
  • '.$keygroup.''; + $html = $html.'
  • '; + } + $html = $html.''; return $html;