<?php
-// $Id$
-
// Require login
require_once 'plc_login.php';
EOF;
}
+ // get settings from environment, otherwise set to defaults
+ // when to start, in hours in the future from now
+ $leases_offset=$_GET['leases_offset'];
+ if ( ! $leases_offset ) $leases_offset=0;
+ // how many timeslots to show
+ $leases_slots=$_GET['leases_slots'];
+ if ( ! $leases_slots ) $leases_slots = 36;
+ // offset in hours (in the future) from now
+ $leases_w = $_GET['leases_w'];
+ if ( ! $leases_w) $leases_w=20;
+ // number of timeslots to display
+
$grain=$api->GetLeaseGranularity();
+
+ // these elements are for passing data to the javascript layer
+ echo "<span class='hidden' id='leases_slicename'>" . $slice['name'] . "</span>";
+ echo "<span class='hidden' id='leases_sliceid'>" . $slice['slice_id']. "</span>";
+ echo "<span class='hidden' id='leases_grain'>" . $grain . "</span>";
+ echo "<span class='hidden' id='leases_offset'>" . $leases_offset . "</span>";
+ echo "<span class='hidden' id='leases_slots'>" . $leases_slots . "</span>";
+ echo "<span class='hidden' id='leases_w'>" . $leases_w . "</span>";
+
+ // cut off
if ($profiling) plc_debug_prof('6 granul',$grain);
// where to start from, expressed as an offset in hours from now
- $resa_offset=$_GET['resa_offset'];
- if ( ! $resa_offset ) $resa_offset=0;
- $rough_start=time()+$resa_offset*3600;
+ $rough_start=time()+$leases_offset*3600;
// show the next 36 grains
- $resa_slots=$_GET['resa_slots'];
- if ( ! $resa_slots ) $resa_slots = 36;
- $duration=$resa_slots*$grain;
+ $duration=$leases_slots*$grain;
$steps=$duration/$grain;
$start=intval($rough_start/$grain)*$grain;
$end=$rough_start+$duration;
$lease['nuntil']=($lease['t_until']-$start)/$grain;
$host_hash[$hostname] []= $lease;
}
- # leases_data is the name used by leases.js to locate this table
- echo "<table id='leases_data'>";
- # pass (slice_id,slicename) as the [0,0] coordinate as thead>tr>td
- echo "<thead><tr><td>" . $slice['slice_id'] . '&' . $slice['name'] . "</td>";
- # the timeslot headers read (timestamp,label)
+ // leases_data is the name used by leases.js to locate this table
+ echo "<table id='leases_data' class='hidden'>";
+ // pass (slice_id,slicename,x_grain) in the upper-left cell, as thead>tr>td
+ echo "<thead><tr><td>" . $slice['slice_id'] . '&' . $slice['name'] . '&' . $leases_w . "</td>";
+ // the timeslot headers read (timestamp,label)
$day_names=array('Su','M','Tu','W','Th','F','Sa');
for ($i=0; $i<$steps; $i++) {
$timestamp=($start+$i*$grain);
<div id='leases_area'></div>
<div id='leases_buttons'>
- <button id='leases_clear' type='submit'>Clear</button>
+ <button id='leases_refresh' type='submit'>Refresh</button>
<button id='leases_submit' type='submit'>Submit</button>
</div>
EOF;
print("<input type='hidden' id='show_configuration' value='".$show_configuration."' />");
print("<input type='hidden' id='column_configuration' value='".$slice_column_configuration."' />");
print("<br><input type='hidden' size=80 id='full_column_configuration' value='".$column_configuration."' />");
-print("<input type='hidden' id='previousConf' value='".$slice_column_configuration."'></input>");
-print("<input type='hidden' id='defaultConf' value='".$default_configuration."'></input>");
+print("<input type='hidden' id='previousConf' value='".$slice_column_configuration."' />");
+print("<input type='hidden' id='defaultConf' value='".$default_configuration."' />");
//print ("showing column message = ".$show_columns_message);
if ($show_columns_message == '0')