| 54 |
|
|
| 55 |
|
|
| 56 |
|
# show a bar-represented value. |
| 57 |
< |
function showBar($title, $value, $max, $units, $input) { |
| 57 |
> |
function showBar($title, $value, $max, $units, $input, $arrange='normal') { |
| 58 |
|
|
| 59 |
|
include("latest_config.inc.php"); |
| 60 |
|
|
| 72 |
|
|
| 73 |
|
$width = intval($max_width * $value / $max); |
| 74 |
|
|
| 75 |
+ |
if ($arrange == 'swap') { |
| 76 |
+ |
$width = $max_width - $width; |
| 77 |
+ |
} |
| 78 |
+ |
|
| 79 |
|
?> |
| 80 |
|
<table border="0" cellpadding="0" cellspacing="0" align="center"> |
| 81 |
|
<tr> |
| 160 |
|
EOT; |
| 161 |
|
|
| 162 |
|
# Read the file. |
| 163 |
< |
#$input = "packet.attributes.machine_name=raptor.ukc.ac.uk,packet.memory.free=10,packet.memory.total=100,"; |
| 164 |
< |
$input = file("$latestDirectory/$machine/$latestData"); |
| 165 |
< |
# All we need is the first line if there is more than one line. |
| 166 |
< |
$input = $input[0]; |
| 163 |
> |
if (file_exists("$latestDirectory/$machine/$latestData")) { |
| 164 |
> |
$input = file("$latestDirectory/$machine/$latestData"); |
| 165 |
> |
# All we need is the first line if there is more than one line. |
| 166 |
> |
$input = $input[0]; |
| 167 |
> |
} |
| 168 |
|
|
| 169 |
|
if (empty($input)) { |
| 170 |
< |
echo "<br><br>There was an error reading from the latest packet received. Please notify your i-scream server administrator."; |
| 170 |
> |
echo "<br><br>There are currently no latest details about <b>$machine</b>. Please notify your i-scream server administrator if you believe this to be incorrect."; |
| 171 |
|
} |
| 172 |
|
else { |
| 173 |
|
# Display the data specified in the display include. |