2003-06-18 23:41:31 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
function result_server_state_string($s) {
|
|
|
|
switch($s) {
|
|
|
|
case 1: return "Inactive";
|
|
|
|
case 2: return "Unsent";
|
|
|
|
case 4: return "In Progress";
|
|
|
|
case 5: return "Over";
|
|
|
|
}
|
|
|
|
return "unknown";
|
|
|
|
}
|
|
|
|
|
|
|
|
function result_outcome_string($s) {
|
|
|
|
switch($s) {
|
|
|
|
case 1: return "Success";
|
|
|
|
case 2: return "Couldn't send";
|
|
|
|
case 3: return "Client error";
|
|
|
|
case 4: return "No reply";
|
|
|
|
case 5: return "Didn't need";
|
|
|
|
}
|
|
|
|
return "unknown";
|
|
|
|
}
|
|
|
|
|
|
|
|
function result_client_state_string($s) {
|
|
|
|
switch($s) {
|
|
|
|
case 0: return "New";
|
|
|
|
case 1: return "Downloading";
|
|
|
|
case 2: return "Downloaded";
|
|
|
|
case 3: return "Computing";
|
|
|
|
case 4: return "Uploading";
|
|
|
|
case 5: return "Done";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function validate_state_str($s) {
|
|
|
|
switch($s) {
|
|
|
|
case 0: return "Initial";
|
|
|
|
case 1: return "Valid";
|
|
|
|
case 2: return "Invalid";
|
|
|
|
}
|
|
|
|
return "unknown";
|
|
|
|
}
|
|
|
|
|
2003-08-07 21:40:17 +00:00
|
|
|
function result_table_start($show_wu_link, $show_host_link) {
|
2003-06-18 23:41:31 +00:00
|
|
|
start_table();
|
|
|
|
echo "
|
|
|
|
<tr>
|
2003-08-07 21:40:17 +00:00
|
|
|
";
|
|
|
|
if ($show_wu_link) {
|
|
|
|
echo "<th>Work unit</th>\n";
|
|
|
|
}
|
|
|
|
if ($show_host_link) {
|
|
|
|
echo "<th>Host</th>\n";
|
|
|
|
}
|
|
|
|
echo "
|
2003-06-18 23:41:31 +00:00
|
|
|
<th>Sent</th>
|
|
|
|
<th>Received</th>
|
2003-08-07 21:40:17 +00:00
|
|
|
<th>Server state
|
|
|
|
<br><font size=2><a href=explain_state.php?field=result_server_state>Explain</a>
|
|
|
|
</th>
|
|
|
|
<th>Outcome
|
|
|
|
<br><font size=2><a href=explain_state.php?field=result_outcome>Explain</a>
|
|
|
|
</th>
|
|
|
|
<th>Client state
|
|
|
|
<br><font size=2><a href=explain_state.php?field=result_client_state>Explain</a>
|
|
|
|
</th>
|
|
|
|
<th>CPU time (sec)</th>
|
2003-06-18 23:41:31 +00:00
|
|
|
<th>claimed credit</th>
|
|
|
|
<th>granted credit</th>
|
|
|
|
</tr>
|
|
|
|
";
|
|
|
|
}
|
|
|
|
|
2003-08-07 21:40:17 +00:00
|
|
|
function show_result_row($result, $show_wu_link, $show_host_link) {
|
2003-06-18 23:41:31 +00:00
|
|
|
$s = time_str($result->sent_time);
|
|
|
|
$r = time_str($result->received_time);
|
|
|
|
$ss = result_server_state_string($result->server_state);
|
|
|
|
$out = result_outcome_string($result->outcome);
|
|
|
|
$cl = result_client_state_string($result->client_state);
|
|
|
|
echo "
|
|
|
|
<tr>
|
2003-08-07 21:40:17 +00:00
|
|
|
";
|
|
|
|
if ($show_wu_link) {
|
|
|
|
echo "<td><a href=workunit.php?wuid=$result->workunitid>$result->workunitid</a></td>\n";
|
|
|
|
}
|
|
|
|
if ($show_host_link) {
|
|
|
|
echo "<td><a href=host.php?hostid=$result->hostid>$result->hostid</a></td>\n";
|
|
|
|
}
|
|
|
|
echo "
|
2003-06-18 23:41:31 +00:00
|
|
|
<td>$s</td>
|
|
|
|
<td>$r</td>
|
|
|
|
<td>$ss</td>
|
|
|
|
<td>$out</td>
|
|
|
|
<td>$cl</td>
|
|
|
|
<td>$result->cpu_time</td>
|
|
|
|
<td>$result->claimed_credit</td>
|
|
|
|
<td>$result->granted_credit</td>
|
|
|
|
</tr>
|
|
|
|
";
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|