[Openvas-commits] r11627 - in trunk/gsa: . src src/html
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Fri Sep 16 18:32:38 CEST 2011
Author: mattm
Date: 2011-09-16 18:32:38 +0200 (Fri, 16 Sep 2011)
New Revision: 11627
Modified:
trunk/gsa/ChangeLog
trunk/gsa/src/gsad_omp.c
trunk/gsa/src/html/omp.xsl
Log:
Add multi-host prognosis report.
* src/gsad_omp.c (get_report_omp): Add host levels to
GET_PROGNOSTIC_REPORT.
* src/html/omp.xsl (assets): Add overall prognostic report button.
(html-report-details): Get back link levels from host levels. Remove
result hosts only button.
Modified: trunk/gsa/ChangeLog
===================================================================
--- trunk/gsa/ChangeLog 2011-09-16 16:23:01 UTC (rev 11626)
+++ trunk/gsa/ChangeLog 2011-09-16 16:32:38 UTC (rev 11627)
@@ -1,5 +1,16 @@
2011-09-16 Matthew Mundell <matthew.mundell at greenbone.net>
+ Add multi-host prognosis report.
+
+ * src/gsad_omp.c (get_report_omp): Add host levels to
+ GET_PROGNOSTIC_REPORT.
+
+ * src/html/omp.xsl (assets): Add overall prognostic report button.
+ (html-report-details): Get back link levels from host levels. Remove
+ result hosts only button.
+
+2011-09-16 Matthew Mundell <matthew.mundell at greenbone.net>
+
* src/html/omp.xsl (html-report-details): Pass host filtering params
through on result filtering form too.
Modified: trunk/gsa/src/gsad_omp.c
===================================================================
--- trunk/gsa/src/gsad_omp.c 2011-09-16 16:23:01 UTC (rev 11626)
+++ trunk/gsa/src/gsad_omp.c 2011-09-16 16:32:38 UTC (rev 11627)
@@ -7735,8 +7735,8 @@
{
if (type && (strcmp (type, "prognostic") == 0))
{
- const char *host_search_phrase, *host_first_result;
- const char *host_max_results;
+ const char *host_search_phrase, *host_levels;
+ const char *host_first_result, *host_max_results;
xml = g_string_new ("<get_prognostic_report>");
@@ -7745,6 +7745,11 @@
params_given (params, "host_search_phrase")
|| (host_search_phrase = "");
+ host_levels = params_value (params, "host_levels");
+ if (host_levels == NULL)
+ params_given (params, "host_levels")
+ || (host_levels = "");
+
host_first_result = params_value (params, "host_first_result");
if (host_first_result == NULL
|| sscanf (host_first_result, "%u", &first) != 1)
@@ -7769,8 +7774,10 @@
"<host_search_phrase>"
"%s"
"</host_search_phrase>"
+ "<host_levels>%s</host_levels>"
"<results start=\"%s\" max=\"%s\"/>",
host_search_phrase,
+ host_levels,
host_first_result,
host_max_results);
}
Modified: trunk/gsa/src/html/omp.xsl
===================================================================
--- trunk/gsa/src/html/omp.xsl 2011-09-16 16:23:01 UTC (rev 11626)
+++ trunk/gsa/src/html/omp.xsl 2011-09-16 16:32:38 UTC (rev 11627)
@@ -780,6 +780,10 @@
<a style="margin-left: 7px" href="/help/assets.html?token={/envelope/token}" title="Help: Assets">
<img src="/img/help.png" border="0"/>
</a>
+ <a href="/omp?cmd=get_report&type=prognostic&pos=1&host_search_phrase={report/filters/phrase}&host_levels={gsa:build-levels(report/filters)}&host_first_result={hosts/@start}&host_max_results={hosts/@max}&token={/envelope/token}"
+ title="Prognostic Report" style="margin-left:3px;">
+ <img src="/img/new.png" border="0" alt="Prognostic Report"/>
+ </a>
</div>
<div class="gb_window_part_content">
<xsl:apply-templates select="report" mode="assets"/>
@@ -873,7 +877,7 @@
<xsl:choose>
<xsl:when test="@type='prognostic'">
<div class="float_right">
- <a href="?cmd=get_report&type=assets&levels={report/filters/text()}&search_phrase={../../host_search_phrase}&first_result={../../results/@start}&max_results={../../results/@max}&token={/envelope/token}">Back to Assets</a>
+ <a href="?cmd=get_report&type=assets&levels={../host_levels}&search_phrase={../../host_search_phrase}&first_result={../../results/@start}&max_results={../../results/@max}&token={/envelope/token}">Back to Assets</a>
</div>
</xsl:when>
<xsl:otherwise>
@@ -886,12 +890,18 @@
<a name="summary"/>
<table border="0" cellspacing="0" cellpadding="3">
<xsl:choose>
- <xsl:when test="@type='prognostic'">
+ <xsl:when test="@type='prognostic' and string-length (report/filters/host) > 0">
<tr>
<td><b>Host:</b></td>
<td><b><xsl:value-of select="report/filters/host"/></b></td>
</tr>
</xsl:when>
+ <xsl:when test="@type='prognostic'">
+ <tr>
+ <td><b>Multiple hosts</b></td>
+ <td></td>
+ </tr>
+ </xsl:when>
<xsl:otherwise>
<tr>
<td><b>Result of Task:</b></td>
@@ -1585,6 +1595,7 @@
<input type="hidden" name="type" value="prognostic"/>
<input type="hidden" name="host" value="{report/filters/host}"/>
<input type="hidden" name="host_search_phrase" value="{../../host_search_phrase}"/>
+ <input type="hidden" name="host_levels" value="{../../host_levels}"/>
<input type="hidden" name="host_first_result" value="{../../results/@start}"/>
<input type="hidden" name="host_max_results" value="{../../results/@max}"/>
</xsl:when>
@@ -1679,17 +1690,17 @@
<div style="padding: 2px;">
<xsl:choose>
- <xsl:when test="@type='prognostic' and string-length (report/filters/host/ip) > 0">
- <input type="checkbox" name="result_hosts_only" value="1" disabled="1"/>
+ <xsl:when test="@type='prognostic'">
</xsl:when>
<xsl:when test="report/filters/result_hosts_only = 0">
<input type="checkbox" name="result_hosts_only" value="1"/>
+ Only show hosts that have results
</xsl:when>
<xsl:otherwise>
<input type="checkbox" name="result_hosts_only" value="1" checked="1"/>
+ Only show hosts that have results
</xsl:otherwise>
</xsl:choose>
- Only show hosts that have results
</div>
<div style="padding: 2px;">
<xsl:choose>
More information about the Openvas-commits
mailing list