user web: filter results by application.

svn path=/trunk/boinc/; revision=22339
This commit is contained in:
Rytis Slatkevičius 2010-09-12 09:43:20 +00:00
parent 6df96d612a
commit 4c1dfc6701
3 changed files with 40 additions and 1 deletions

View File

@ -6474,4 +6474,12 @@ David 11 Sept 2010
client/
boinc_cmd.cpp
Rytis 12 Sept 2010
- user web: filter results by application.
html/
inc/
result.inc
user/
results.php

View File

@ -250,7 +250,8 @@ function result_page_url($info) {
$o = $info->offset;
$sn = $info->show_names;
$st = $info->state;
return "results.php?$c&offset=$o&show_names=$sn&state=$st";
$appid = $info->appid;
return "results.php?$c&offset=$o&show_names=$sn&state=$st&appid=$appid";
}
function result_table_start($show_wu_link, $show_host_link, $info) {
@ -429,6 +430,31 @@ function show_result_navigation($info) {
echo "<a href=$url>".$state_name[$i]."</a>";
}
}
$apps = BoincApp::enum('deprecated=0 ORDER BY user_friendly_name');
if (count($apps) > 1) {
$i2 = clone $info;
echo '<br />';
if ($info->appid) {
$i2->appid = 0;
$url = result_page_url($i2);
echo '<a href="'.$url.'">All</a>';
} else {
echo 'All';
}
foreach ($apps as $app) {
$i2->appid = $app->id;
$url = result_page_url($i2);
echo ' | ';
if ($info->appid == $app->id) {
echo $app->user_friendly_name;
} else {
echo '<a href="'.$url.'">'.$app->user_friendly_name.'</a>';
}
}
}
echo "</center><br>";
}

View File

@ -34,6 +34,7 @@ $results_per_page = 20;
$hostid = get_int("hostid", true);
$userid = get_int("userid", true);
$offset = get_int("offset", true);
$appid = get_int("appid", true);
if (!$offset) $offset=0;
$state = get_int("state", true);
if (!$state) $state=0;
@ -60,6 +61,9 @@ if ($hostid) {
}
$clause2 = $clause. $state_clause[$state];
if ($appid) {
$clause2 .= ' AND appid='.$appid;
}
$query = "$clause2 order by id desc limit $offset,".($results_per_page+1);
$results = BoincResult::enum($query);
@ -71,6 +75,7 @@ $info->results_per_page = $results_per_page;
$info->offset = $offset;
$info->show_names = $show_names;
$info->state = $state;
$info->appid = $appid;
if (count($results)) {
echo show_result_navigation($info);