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 |
|
|
70 |
|
return; |
71 |
|
} |
72 |
|
|
73 |
+ |
if ($arrange == 'swap') { |
74 |
+ |
$value = $max - $value; |
75 |
+ |
} |
76 |
+ |
|
77 |
|
$width = intval($max_width * $value / $max); |
78 |
|
|
79 |
|
?> |
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. |