From a5fa21f6dcb665b800930662d48e488d33e8c635 Mon Sep 17 00:00:00 2001 From: Bruce Allen Date: Mon, 16 Jan 2006 17:34:54 +0000 Subject: [PATCH] user web pages: in list of hosts, add link to show results if project is configured to show results. svn path=/trunk/boinc/; revision=9247 --- checkin_notes | 4 +-- html/inc/host.inc | 69 ++++++++++++++++++++++++++++++----------------- 2 files changed, 47 insertions(+), 26 deletions(-) diff --git a/checkin_notes b/checkin_notes index f37f002e36..a37ac693a8 100755 --- a/checkin_notes +++ b/checkin_notes @@ -499,11 +499,11 @@ Bruce 16 Jan 2006 AND external IP (only for owner of host machine). - user web pages: if can't delete host because there are still results, give clearer error message and link to list of results. + - user web pages: in list of hosts, add link to show results + if project is configured to show results. html/ inc/ db_ops.inc host.inc user/ host_delete.php - - diff --git a/html/inc/host.inc b/html/inc/host.inc index 301d24be20..af6937d99f 100644 --- a/html/inc/host.inc +++ b/html/inc/host.inc @@ -2,6 +2,15 @@ require_once("../inc/credit.inc"); +function link_to_results($host) { + if (!$host) return "No host"; + $config = get_config(); + if (!parse_bool($config, "show_results")) return "Unavailable"; + $nresults = host_nresults($host); + if (!$nresults) return "0"; + return "id>$nresults"; +} + function sched_log_name($x) { if ($x == 0) return "NO_SUCH_LOG"; return gmdate('Y-m-d_H/Y-m-d_H:i', $x) . ".txt"; @@ -160,9 +169,10 @@ function user_host_table_start($private) { Total credit CPU type Operating system - Last contact - "; + $config = get_config(); + if (parse_bool($config, "show_results")) echo "Results"; + echo "Last contact"; } // the following is used for list of top hosts @@ -220,28 +230,39 @@ function show_host_row($host, $i, $private, $show_owner) { } } } - if (!$show_owner) - printf(" - %s - %s - %s
%s - %s
%s - %s", - format_credit($host->expavg_credit), format_credit($host->total_credit), - $host->p_vendor, $host->p_model, - $host->os_name, $host->os_version, sched_log_link($host->rpc_time) - ); - else - printf(" - %s - %s - %s
%s - %s
%s", - format_credit($host->expavg_credit), format_credit($host->total_credit), - $host->p_vendor, $host->p_model, - $host->os_name, $host->os_version - ); - + if ($show_owner) { + // This is used in the TOP COMPUTERS display + // + printf(" + %s + %s + %s
%s + %s
%s", + format_credit($host->expavg_credit), format_credit($host->total_credit), + $host->p_vendor, $host->p_model, + $host->os_name, $host->os_version + ); + } else { + // This is used in constructing list of COMPUTERS for a given user + // + $config = get_config(); + if (parse_bool($config, "show_results")) { + $ltr="".link_to_results($host).""; + } else { + $ltr=""; + } + printf(" + %s + %s + %s
%s + %s
%s + %s + %s", + format_credit($host->expavg_credit), format_credit($host->total_credit), + $host->p_vendor, $host->p_model, + $host->os_name, $host->os_version, $ltr, sched_log_link($host->rpc_time) + ); + } //$nresults = host_nresults($host); //echo "id>$nresults";