| 37 |
|
} |
| 38 |
|
} |
| 39 |
|
|
| 40 |
+ |
function printLine($title) { |
| 41 |
+ |
echo "<hr color=\"#9999ff\">"; |
| 42 |
+ |
echo "<b>$title</b>"; |
| 43 |
+ |
} |
| 44 |
|
|
| 45 |
+ |
|
| 46 |
|
function showStat($title, $value, $input) { |
| 47 |
< |
preg_match("/$value=([^\,]*)\,/", $input, $matches); |
| 47 |
> |
preg_match("/$value=([^\,]*)[\,\}]/", $input, $matches); |
| 48 |
|
$value = $matches[1]; |
| 49 |
|
if (empty($value)) { |
| 50 |
< |
$value = "<i>unknown</i>"; |
| 50 |
> |
$value = "<i><font color=\"#999999\">not sent</font></i>"; |
| 51 |
|
} |
| 52 |
|
?> |
| 53 |
|
<table border="0" width="100%"> |
| 54 |
|
<tr> |
| 55 |
< |
<td width="50%" align="right"><b><?=$title?></b></td> |
| 56 |
< |
<td width="50%" align="left"><?=$value?></td> |
| 55 |
> |
<td width="50%" align="right" valign="top"><b><font size="2"><?=$title?>:</font></b></td> |
| 56 |
> |
<td width="50%" align="left" valign="top"><font size="2"><?=$value?></font></td> |
| 57 |
|
</tr> |
| 58 |
|
</table> |
| 59 |
|
<? |
| 78 |
|
$width = intval($max_width * $value / $max); |
| 79 |
|
|
| 80 |
|
?> |
| 81 |
< |
<table border="0" cellpadding="0" cellspacing="0"> |
| 81 |
> |
<table border="0" cellpadding="0" cellspacing="0" align="center"> |
| 82 |
|
<tr> |
| 83 |
|
<td colspan="2"><b><?=$title?></b></td> |
| 84 |
|
</tr> |
| 101 |
|
|
| 102 |
|
<? include($titleHTML); ?> |
| 103 |
|
|
| 104 |
< |
<hr weight="1" color="<? echo $lineColor ?>"> |
| 104 |
> |
<? printLine("Display the latest information received from a host."); ?> |
| 105 |
|
|
| 101 |
– |
<b>Display the latest information received from a host</b> |
| 106 |
|
<form method="<? echo $formMethod ?>" action="<? echo $thisPage ?>"> |
| 107 |
|
<? |
| 108 |
|
|
| 109 |
< |
$file_array = getdirArray($latestDirectory,'rsort'); |
| 109 |
> |
$file_array = getdirArray($latestDirectory,'asort'); |
| 110 |
|
print "<select size=\"1\" name=\"machine\">"; |
| 111 |
|
if ($machine) { ?> |
| 112 |
|
<option selected value="<? echo $machine ?>"><? echo $machine ?></option> |
| 113 |
|
<option value="">----------------</option> |
| 114 |
|
<? } |
| 115 |
|
foreach($file_array as $file_name) { |
| 116 |
< |
if (is_dir($file_name)) { |
| 113 |
< |
$i++; |
| 116 |
> |
#if (is_dir($file_name)) { |
| 117 |
|
print "<option value=\"$file_name\">$file_name</option>"; |
| 118 |
< |
} |
| 118 |
> |
#} |
| 119 |
|
} |
| 120 |
|
print "</select>"; |
| 121 |
|
|
| 123 |
|
<input type="submit" name="submit" value="Display"> |
| 124 |
|
</form> |
| 125 |
|
|
| 123 |
– |
<hr weight="1" color="<? echo $lineColor ?>"> |
| 124 |
– |
|
| 126 |
|
<? if ($machine) { |
| 127 |
|
|
| 128 |
|
# Read the file. |
| 129 |
|
#$input = "packet.attributes.machine_name=raptor.ukc.ac.uk,packet.memory.free=10,packet.memory.total=100,"; |
| 130 |
< |
$input = file("$latestDirectory/$machine/latest_data"); |
| 130 |
> |
$input = file("$latestDirectory/$machine/$latestData"); |
| 131 |
|
# All we need is the first line if there is more than one line. |
| 132 |
|
$input = $input[0]; |
| 133 |
|
|
| 139 |
|
include("latest_display.inc.php"); |
| 140 |
|
} |
| 141 |
|
} |
| 142 |
< |
|
| 142 |
> |
printLine(""); |
| 143 |
|
?> |
| 144 |
|
|
| 145 |
|
|