$slice=$slices[0];
-if ($profiling) plc_debug_prof('1: slice',count($slices));
+if ($profiling) plc_debug_prof('01: slice',count($slices));
// pull all node info to vars
$name= $slice['name'];
$expires = date( "d/m/Y", $slice['expires'] );
$peers=new Peers ($api);
$local_peer = ! $peer_id;
-if ($profiling) plc_debug_prof('2: peers',count($peers));
+if ($profiling) plc_debug_prof('02: peers',count($peers));
// gets site info
$sites= $api->GetSites( array( $site_id ) );
$site_name= $site['name'];
$max_slices = $site['max_slices'];
-if ($profiling) plc_debug_prof('3: sites',count($sites));
+if ($profiling) plc_debug_prof('03: sites',count($sites));
//////////////////////////////////////// building blocks for the renew area
// Constants
global $DAY; $DAY = 24*60*60;
$person_columns);
$count=count($persons);
-if ($profiling) plc_debug_prof('4: persons',count($persons));
+if ($profiling) plc_debug_prof('04: persons',count($persons));
$toggle=
new PlekitToggle ('my-slice-persons',"$count users",
array('bubble'=>
$potential_nodes[]=$node;
}
}
-if ($profiling) plc_debug_prof('5: nodes',count($slice_nodes));
+if ($profiling) plc_debug_prof('05: nodes',count($slice_nodes));
////////////////////
// outline the number of reservable nodes
$nodes_message=count_english($slice_nodes,"node");
$toggle_nodes->end();
}
+if ($profiling) plc_debug_prof('06: leases',0);
//////////////////// node configuration panel
if ($first_time_configuration)
print("<input type='hidden' id='previousConf' value='".$slice_column_configuration."' />");
print("<input type='hidden' id='defaultConf' value='".$default_configuration."' />");
+if ($profiling) plc_debug_prof('07: before configuration_panel',0);
$ConfigureColumns->configuration_panel_html(true);
+if ($profiling) plc_debug_prof('08: before javascript_init',0);
$ConfigureColumns->javascript_init();
$toggle_nodes->end();
+if ($profiling) plc_debug_prof('09: layout',0);
$all_sites=$api->GetSites(NULL, array('site_id','login_base'));
$site_hash=array();
foreach ($interfaces as $interface) $interface_hash[$interface['node_id']]=$interface;
-
-
+if ($profiling) plc_debug_prof('10: interfaces',count($interfaces));
//////////////////// nodes currently in
$toggle_nodes=new PlekitToggle('my-slice-nodes-current',
if ($slice_nodes) foreach ($slice_nodes as $node) {
$table->row_start();
-$table->cell($node['node_id'], array('display'=>'none'));
+ $table->cell($node['node_id'], array('display'=>'none'));
$table->cell(l_node_obj($node));
$peers->cell($table,$node['peer_id']);
$table->end();
$toggle_nodes->end();
+if ($profiling) plc_debug_prof('11: nodes in',count($slice_nodes));
+
//////////////////// nodes to add
if ($privileges) {
$new_potential_nodes = array();
if ($potential_nodes) foreach ($potential_nodes as $node) {
$table->row_start();
-$table->cell($node['node_id'], array('display'=>'none'));
+ $table->cell($node['node_id'], array('display'=>'none'));
$table->cell(l_node_obj($node));
$peers->cell($table,$node['peer_id']);
$toggle->end();
+if ($profiling) plc_debug_prof('12: nodes to add',count($potential_nodes));
+
//////////////////////////////////////// retrieve all slice tags
$tags=$api->GetSliceTags (array('slice_id'=>$slice_id));
//////////////////////////////////////////////////////////// tab:initscripts
<li> You also have the option to provide <span class='bold'> your own
code </span>, with the following conventions: <ul>
-<li> Like regular initscripts, your script must except to receive as a
+<li> Like regular initscripts, your script must expect to receive as a
first argument <span class='bold'> start </span>, <span class='bold'>
stop </span> or <span class='bold'> restart </span>. It is important
to honor this argument, as your slice may be stopped and restarted at
$shared_initscripts=$api->GetInitScripts(array('-SORT'=>'name'),array('name'));
//$shared_initscripts=$api->GetInitScripts();
-if ($profiling) plc_debug_prof('6 initscripts',count($initscripts));
+if ($profiling) plc_debug_prof('13: initscripts',count($initscripts));
// xxx expose this even on foreign slices for now
if ($local_peer) {
$initscript='';
// xxx expose this even on foreign slices for now
//if ( $local_peer ) {
- if ($profiling) plc_debug_prof('7 slice tags',count($tags));
+ if ($profiling) plc_debug_prof('14: slice tags',count($tags));
function get_tagname ($tag) { return $tag['tagname'];}
$tagnames = array_map ("get_tagname",$tags);
$nodegroup_name="n/a";
if ($tag['nodegroup_id']) {
$nodegroups=$api->GetNodeGroups(array('nodegroup_id'=>$tag['nodegroup_id']));
- if ($profiling) plc_debug_prof('8 nodegroup for slice tag',$nodegroup);
+ if ($profiling) plc_debug_prof('15: nodegroup for slice tag',$nodegroup);
if ($nodegroup) {
$nodegroup = $nodegroups[0];
$nodegroup_name = $nodegroup['groupname'];
return array("display"=>$tag['tagname'],"value"=>$tag['tag_type_id']);
}
$all_tags= $api->GetTagTypes( array ("category"=>"*slice*","-SORT"=>"+tagname"), array("tagname","tag_type_id"));
- if ($profiling) plc_debug_prof('9 tagtypes',count($all_tags));
+ if ($profiling) plc_debug_prof('16: tagtypes',count($all_tags));
$selector_tag=array_map("tag_selector",$all_tags);
function node_selector($node) {
return array("display"=>$ng["groupname"],"value"=>$ng['nodegroup_id']);
}
$all_nodegroups = $api->GetNodeGroups( array("groupname"=>"*"), array("groupname","nodegroup_id"));
- if ($profiling) plc_debug_prof('10 nodegroups',count($all_nodegroups));
+ if ($profiling) plc_debug_prof('17: nodegroups',count($all_nodegroups));
$selector_nodegroup=array_map("nodegroup_selector",$all_nodegroups);
$table->cell($form->select_html("tag_type_id",$selector_tag,array('label'=>"Choose Tag")));