git://git.onelab.eu
/
plewww.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9fea82d
)
fixed: handles better display of nodes,persons,slices
author
Ciro Scognamiglio
<c.scognamiglio@cslash.net>
Fri, 19 May 2017 10:57:22 +0000
(12:57 +0200)
committer
Ciro Scognamiglio
<c.scognamiglio@cslash.net>
Fri, 19 May 2017 10:57:22 +0000
(12:57 +0200)
planetlab/sites/site.php
patch
|
blob
|
history
diff --git
a/planetlab/sites/site.php
b/planetlab/sites/site.php
index
9abb737
..
1a0ffba
100644
(file)
--- a/
planetlab/sites/site.php
+++ b/
planetlab/sites/site.php
@@
-69,30
+69,44
@@
$node_ids= $site['node_ids'];
$person_ids= $site['person_ids'];
$slice_ids= $site['slice_ids'];
$person_ids= $site['person_ids'];
$slice_ids= $site['slice_ids'];
-$api->begin();
+
//
$api->begin();
// gets address info
// gets address info
-$api->GetAddresses( $address_ids );
+$a
ddresses = $a
pi->GetAddresses( $address_ids );
// gets node info
// gets node info
-$api->GetNodes( $node_ids, array( "node_id", "hostname", "boot_state", "pcu_ids", "ports" ) );
-
+if ($node_ids) {
+ $nodes = $api->GetNodes( $node_ids, array( "node_id", "hostname", "boot_state", "pcu_ids", "ports" ) );
+} else {
+ $nodes = array();
+}
// gets person info
// gets person info
-$api->GetPersons( $person_ids, array( "role_ids", "person_id", "first_name", "last_name", "email", "enabled" , "slice_ids") );
-
-$api->GetSlices ( $slice_ids, array ("slice_id", "name", "instantiation", "node_ids", "person_ids" ) );
+if ($person_ids) {
+ $persons = $api->GetPersons( $person_ids, array( "role_ids", "person_id", "first_name", "last_name", "email", "enabled" , "slice_ids") );
+} else {
+ $persons = array();
+}
+if ($slice_ids) {
+ $slices = $api->GetSlices ( $slice_ids, array ("slice_id", "name", "instantiation", "node_ids", "person_ids" ) );
+} else {
+ $slices = array();
+}
////////////////////
// PCU stuff - not too sure why, but GetPCUs is not exposed to the 'user' role
$display_pcus = (plc_is_admin() || plc_is_pi() || plc_is_tech());
////////////////////
// PCU stuff - not too sure why, but GetPCUs is not exposed to the 'user' role
$display_pcus = (plc_is_admin() || plc_is_pi() || plc_is_tech());
-if ($display_pcus)
- $api->GetPCUs ($pcu_ids, array ('hostname', 'pcu_id' ));
-
+if ($display_pcus) {
+ if ($pcu_ids) {
+ $pcus = $api->GetPCUs ($pcu_ids, array ('hostname', 'pcu_id' ));
+ } else {
+ $pcus = array();
+ }
+}
// get results
// get results
-if ($display_pcus)
- list( $addresses, $nodes, $persons, $slices, $pcus )= $api->commit();
-else
- list( $addresses, $nodes, $persons, $slices )= $api->commit();
-
+
//
if ($display_pcus)
+
//
list( $addresses, $nodes, $persons, $slices, $pcus )= $api->commit();
+
//
else
+
//
list( $addresses, $nodes, $persons, $slices )= $api->commit();
+
$techs = array();
$pis = array();
$disabled_persons = array();
$techs = array();
$pis = array();
$disabled_persons = array();