diff --git a/checkin_notes b/checkin_notes index ad38c80120..81ac67e371 100755 --- a/checkin_notes +++ b/checkin_notes @@ -5168,3 +5168,12 @@ David June 30 2003 index.php result_summary.php util.inc + +David July 1 2003 + - further tweaks to web DB interface + + html_ops/ + db.inc + db_action.php + db_form.php + index.php diff --git a/html/ops/db.inc b/html/ops/db.inc index 220c1aef8c..cd3411c974 100644 --- a/html/ops/db.inc +++ b/html/ops/db.inc @@ -104,14 +104,14 @@ function show_app($app) { end_table(); } -function show_app_version($app_version,$show_xml_docs) { +function show_app_version($app_version, $hide_xml_docs) { start_table(); row("ID", $app_version->id); row("Created", time_str($app_version->create_time)); row("Application", "appid>" . app_name_by_id($app_version->appid) . ""); row("Version num", $app_version->version_num); row("Platform", "platformid>" . platform_name_by_id($app_version->platformid) . "" ); - if ($show_xml_docs) { + if (!$hide_xml_docs) { row("XML doc", "
".htmlspecialchars($app_version->xml_doc).""); } row("Min_core_version", $app_version->min_core_version); @@ -121,9 +121,34 @@ function show_app_version($app_version,$show_xml_docs) { end_table(); } +function host_short_header() { + echo " +
".htmlspecialchars($wu->xml_doc).""); } row("Application", "appid>" . app_name_by_id($wu->appid) . ""); @@ -260,9 +285,9 @@ function validate_state_str($s) { return "Unknown"; } -function show_result($result,$show_xml_docs,$show_stderr,$show_times) { +function show_result($result, $hide_xml_docs, $hide_stderr, $hide_times) { start_table(); - if ($show_times) { + if (!$hide_times) { row("Created", time_str($result->create_time)); row("Sent", time_str($result->sent_time)); row("Received", time_str($result->received_time)); @@ -275,11 +300,11 @@ function show_result($result,$show_xml_docs,$show_stderr,$show_times) { row("Host ID", "hostid>" . host_name_by_id($result->hostid) . ""); row("Report deadline", time_str($result->report_deadline)); row("CPU time", $result->cpu_time); - if ($show_xml_docs) { + if (!$hide_xml_docs) { row("XML doc in", "
".htmlspecialchars($result->xml_doc_in).""); row("XML doc out", "
".htmlspecialchars($result->xml_doc_out).""); } - if ($show_stderr) { + if (!$hide_stderr) { row("stderr out", "
".htmlspecialchars($result->stderr_out).""); } row("Batch", $result->batch); @@ -294,7 +319,7 @@ function show_result($result,$show_xml_docs,$show_stderr,$show_times) { function result_short_header() { echo "
Query is: $main_query
\n"; + echo "
Query: $main_query
\n"; echo "
$count database entries match the query. Displaying $start_at to $last.
@@ -112,25 +122,47 @@ function append_sql_query($original,$addition,$first) {
$urlquery = urlencode($query);
if ($last < $count) {
echo "
- Next $n
+ Next $entries_to_show
";
}
if ($detail == "high") {
echo "
- Single-line
+ | Less detail
";
}
if ($detail == "low") {
echo "
- Multi-line
+ | More detail
";
}
- echo "
Return to main admin page\n";
+ echo " | Return to main admin page\n";
+ echo "
\n"; + if ($table == "host") { + if ($show_aggregate) { + $result = mysql_query("select sum(d_total) as tot_sum, sum(d_free) as free_sum, " . "sum(m_nbytes) as tot_mem from host" . $query); + $disk_info = mysql_fetch_object($result); + $dt = $disk_info->tot_sum/(1024*1024*1024); + $df = $disk_info->free_sum/(1024*1024*1024); + $mt = $disk_info->tot_mem/(1024*1024); + echo "
\n + Sum of total disk space on these hosts: + $dt GB +
+ Sum of available disk space on these hosts: + $df GB +
+ Sum of memory on these hosts: + $mt MB +
+ "; + } + } if ($detail == "low") { start_table(); switch($table) { case "result": result_short_header(); break; + case "host": host_short_header(); break; } } $result = mysql_query($main_query); @@ -138,20 +170,24 @@ function append_sql_query($original,$addition,$first) { if ($detail == "low") { switch ($table) { case "result": show_result_short($res); break; + case "host": show_host_short($res); break; } } else { switch ($table) { case "platform": show_platform($res); break; case "app": show_app($res); break; - case "app_version": show_app_version($res,$show_xml_docs); break; + case "app_version": show_app_version($res, $hide_xml_docs); break; case "host": show_host($res); break; - case "workunit": show_workunit($res,$show_xml_docs); break; - case "result": show_result($res,$show_xml_docs,$show_stderr,$show_times); break; + case "workunit": show_workunit($res, $hide_xml_docs); break; + case "result": show_result($res, $hide_xml_docs, $hide_stderr, $hide_times); break; case "team": show_team($res); break; case "user": show_user($res); break; } } } + if ($detail == "low") { + end_table(); + } page_tail(); ?> diff --git a/html/ops/db_form.php b/html/ops/db_form.php index d5a9815a76..4460ee2e69 100644 --- a/html/ops/db_form.php +++ b/html/ops/db_form.php @@ -6,6 +6,24 @@ parse_str(getenv("QUERY_STRING")); + function print_detail_field() { + echo "
\n" - . "Sum of total disk space on these hosts: " - . $disk_info->tot_sum/(1024*1024*1024) . " GB" - . "
" - . "Sum of available disk space on these hosts: " - . $disk_info->free_sum/(1024*1024*1024) . " GB" - . "
" - . "Sum of memory on these hosts: " . $disk_info->tot_mem/(1024*1024) . " MB" - . "
" - ); - } + print_detail_field(); } else if ($table=="workunit") { - print_checkbox("Show XML fields", "show_xml_docs", $show_xml_docs); + print_checkbox("Hide XML fields", "hide_xml_docs", $hide_xml_docs); } else if ($table=="result") { echo "
-Browse database: -
-Result summary, last 24 hours -+ Browse database: +