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

@ -6475,3 +6475,11 @@ David 11 Sept 2010
client/ client/
boinc_cmd.cpp 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; $o = $info->offset;
$sn = $info->show_names; $sn = $info->show_names;
$st = $info->state; $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) { 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>"; 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>"; echo "</center><br>";
} }

View File

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