From cc980b8224b32832478303f446ba1200203a410e Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Mon, 6 Apr 2009 15:13:46 +0000 Subject: [PATCH] more consistency --- planetlab/css/plc_style.css | 6 ------ planetlab/includes/plc_functions.php | 8 ++++---- planetlab/persons/person.php | 19 +++++++++---------- planetlab/sites/site.php | 12 ++++++------ planetlab/sites/sites.php | 2 +- 5 files changed, 20 insertions(+), 27 deletions(-) diff --git a/planetlab/css/plc_style.css b/planetlab/css/plc_style.css index 1e4cdbd..a3a1b02 100644 --- a/planetlab/css/plc_style.css +++ b/planetlab/css/plc_style.css @@ -73,9 +73,3 @@ p.node_add { font-size: larger; } -/* some air around the list tables */ -table#sites, table#persons, table#nodes, table#slices { - margin-left: 10px; - margin-right: 10px; -} - diff --git a/planetlab/includes/plc_functions.php b/planetlab/includes/plc_functions.php index 34f9f3e..50370d6 100644 --- a/planetlab/includes/plc_functions.php +++ b/planetlab/includes/plc_functions.php @@ -129,7 +129,7 @@ function l_sites_pending() { return "/db/sites/join_request.php"; } function tab_nodes () { return array ('label'=>'All nodes','url'=>l_nodes(), 'bubble'=>'Display nodes from all peers'); } function tab_nodes_local () { return array ('label'=>'Local nodes', 'url'=>l_nodes_peer('local'), - 'bubble'=>'Display local nodes only'); } + 'bubble'=>'Display all nodes local to this peer'); } function tab_nodes_site($site_id){ return array ('label'=>'Site nodes', 'url'=>l_nodes_site($site_id), 'bubble'=>'Display nodes on that site'); } function tab_nodes_slice($slice_id){ return array ('label'=>'Slice nodes', 'url'=>l_nodes_slice($slice_id), @@ -145,7 +145,7 @@ function tab_mysite() { return array ('label'=>'My site', 'url'=>l_site(plc_my_ 'bubble'=>'Details for site ' . plc_my_site_id()); } function tab_sites () { return array ('label'=>'All sites' , 'url'=>l_sites(), 'bubble'=> 'Display all sites'); } function tab_sites_local () { return array ('label'=>'Local sites' , 'url'=>l_sites_peer('local'), - 'bubble'=> 'Display local sites'); } + 'bubble'=> 'Display all siteslocal to this peer'); } ////////// function tab_slices() { return array ('label'=>'All slices', 'url'=>l_slices(), 'bubble' => 'Display all slices'); } @@ -154,14 +154,14 @@ function tab_slices_mysite () { return array ('label'=>'My site slices', 'url'=> function tab_slices_mine () { return array ('label'=>'My site slices', 'url'=>l_slices_site(plc_my_site_id()), 'bubble'=>'Display all slices on my site'); } function tab_slices_local () { return array ('label'=>'Local slices', 'url'=>l_slices_local(), - 'bubble'=>'Display all slices on my site'); } + 'bubble'=>'Display all slices local to this peer'); } function tab_slice($slice) { return array ('label'=>'Slice '.$slice['name'], 'url'=>l_slice($slice['slice_id']), 'bubble' => 'Details for ' . $slice['name']); } ////////// function tab_persons() { return array ('label'=>'All accounts', 'url'=>l_persons(), 'bubble'=>'Display users from all peers'); } function tab_persons_local() { return array ('label'=>'Local accounts', 'url'=>l_persons_peer('local'), - 'bubble'=>'Display local users'); } + 'bubble'=>'Display all users local to this peer'); } function tab_persons_mysite() { return array ('label'=>'My accounts' , 'url'=>l_persons_site(plc_my_site_id()), 'bubble'=>'Display accounts on site ' . plc_my_site_id()); } function tab_person($person) { return array ('label'=>'Account '.$person['email'], 'url'=>l_person($person['person_id']), diff --git a/planetlab/persons/person.php b/planetlab/persons/person.php index ab6351b..dac8028 100644 --- a/planetlab/persons/person.php +++ b/planetlab/persons/person.php @@ -73,9 +73,17 @@ $is_my_account = plc_my_person_id() == $person_id; $privileges = plc_is_admin () || ( plc_in_site($site_id) && plc_is_pi()); $tabs=array(); -$tabs []= tab_persons(); // enable / disable +// become +if (plc_is_admin() && ! $is_my_account && $local_peer) + $tabs['Become'] = array('method'=>'POST', + 'url'=>l_actions(), + 'values'=>array('action'=>'become-person', + 'person_id'=>$person_id), + 'bubble'=>"Become $first_name $last_name", + 'confirm'=>"Are you sure you want to su $first_name $last_name"); + if ($local_peer && $privileges) if ($enabled) $tabs['Disable'] = array ('method'=>'POST', @@ -92,15 +100,6 @@ if ($local_peer && $privileges) 'bubble'=>"Enable $first_name $last_name", 'confirm'=>"Are you sure you want to enable $first_name $last_name"); -// become -if (plc_is_admin() && ! $is_my_account && $local_peer) - $tabs['Become'] = array('method'=>'POST', - 'url'=>l_actions(), - 'values'=>array('action'=>'become-person', - 'person_id'=>$person_id), - 'bubble'=>"Become $first_name $last_name", - 'confirm'=>"Are you sure you want to su $first_name $last_name"); - // delete if ($local_peer && $privileges && $local_peer) $tabs['Delete'] = array ('method'=>'POST', diff --git a/planetlab/sites/site.php b/planetlab/sites/site.php index ba3273c..0398f08 100644 --- a/planetlab/sites/site.php +++ b/planetlab/sites/site.php @@ -77,7 +77,7 @@ $api->GetAddresses( $address_ids ); $api->GetNodes( $node_ids, array( "node_id", "hostname", "boot_state" ) ); // gets person info -$api->GetPersons( $person_ids, array( "role_ids", "person_id", "first_name", "last_name", "email", "enabled" ) ); +$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" ) ); @@ -107,8 +107,6 @@ drupal_set_title("Details for site " . $sitename); $tabs=array(); -$tabs []= tab_sites_local(); - // available actions if ( $is_site_admin) $tabs['Expire slices'] = array('url'=>l_actions(), @@ -126,15 +124,15 @@ if ( $is_site_admin) 'confirm'=>"Are you sure you want to delete site $login_base"); if ( $is_site_pi ) - $tabs ['Add site'] = array ('url'=>l_slice_add(), + $tabs ['Add slice'] = array ('url'=>l_slice_add(), 'method'=>'post', 'bubble'=>'Create new slice in site'); -if (plc_in_site($site_id)) +if (plc_is_admin() || plc_in_site($site_id)) $tabs["Events"]=array_merge (tablook_event(), array('url'=>l_event("Site","site",$site_id), 'bubble'=>"Events for site $sitename")); -if (plc_in_site($site_id)) +if (plc_is_admin() || plc_in_site($site_id)) $tabs["Comon"]=array_merge(tablook_comon(), array('url'=>l_comon("site_id",$site_id), 'bubble'=>"Comon page for $sitename")); @@ -250,6 +248,7 @@ if ( $local_peer ) { $headers = array (); $headers["email"]='string'; + $headers["S"]='int'; $headers["PI"]='string'; $headers['User']='string'; $headers["Tech"]='string'; @@ -261,6 +260,7 @@ if ( $local_peer ) { if ($persons) foreach ($persons as $person) { $table->row_start(); $table->cell(l_person_obj($person)); + $table->cell(count($person['slice_ids'])); $table->cell( in_array ('20',$person['role_ids']) ? "yes" : "no"); $table->cell( in_array ('30',$person['role_ids']) ? "yes" : "no"); $table->cell( in_array ('40',$person['role_ids']) ? "yes" : "no"); diff --git a/planetlab/sites/sites.php b/planetlab/sites/sites.php index 3009824..3ae1e97 100644 --- a/planetlab/sites/sites.php +++ b/planetlab/sites/sites.php @@ -99,7 +99,7 @@ if (! plc_is_admin()) { } if (plc_is_admin()) - $tabs['Pending'] = array ('url'=>l_sites_pending(), + $tabs['Joining Sites'] = array ('url'=>l_sites_pending(), 'bubble'=>'Review pending join requests'); drupal_set_title($title); -- 2.43.0