commit b8d80f36476d48363cdcc95e875b7cf5ab242612
Author: Yoann Vandoorselaere <[email protected]>
Date: Wed Jun 3 13:24:19 2009 +0200
Implement more action on classification.reference click
Clicking on a classification reference now trigger a CSS menu which
allow to filter on the reference, and to get more information concerning
it.
========================================
prewikka/templates/AlertListing.tmpl | 13 ++++++++++---
prewikka/views/alertlisting.py | 7 +++++++
2 files changed, 17 insertions(+), 3 deletions(-)
========================================
diff --git a/prewikka/templates/AlertListing.tmpl b/prewikka/templates/AlertListing.tmpl
index 468adf6..86da711 100644
--- a/prewikka/templates/AlertListing.tmpl
+++ b/prewikka/templates/AlertListing.tmpl
@@ -797,11 +797,18 @@ function ${type}_set_filter_saved() {
<br/>
#set $sep = "("
+
#for url, name in $info.classification_references##slurp
-#if $url#$sep<a target="$prewikka.external_link_target" href="$url">$name</a>#else#$sep$name#end if##slurp
- #set $sep = ", "
-#end for##if $info.classification_references#)#end if
+$sep#if $url#<a class="popup_menu_toggle">$name.value</a>#else##filter Filter $writeInlineFilter($name)#end filter##end if##slurp
+#set $sep = ", "
+<span class="popup_menu">
+ - #filter Filter $writeInlineFilter($name, $_("Filter on this reference"))#end filter#<br />
+ - <a target="$prewikka.external_link_target" href="$url">Reference information</a>
+</span>#end for##if $info.classification_references#)#end if
+
#end for
+
+
</td>
#for $name, $direction, $hidden, $total, $expand in ($_("source"), $message.source, $message.aggregated_source_hidden, $message.aggregated_source_total, $message.aggregated_source_expand), ($_("target"), $message.target, $message.aggregated_target_hidden, $message.aggregated_target_total, $message.aggregated_target_expand)
diff --git a/prewikka/views/alertlisting.py b/prewikka/views/alertlisting.py
index 0fb535c..3bac3db 100644
--- a/prewikka/views/alertlisting.py
+++ b/prewikka/views/alertlisting.py
@@ -574,20 +574,27 @@ class ListedAlert(ListedMessage):
def _setMessageClassificationReferences(self, dataset, message):
dataset["classification_references"] = [ ]
for ref in message["alert.classification.reference"]:
+ pl = []
+ vl = []
fstr = ""
origin = ref["origin"]
if origin:
+ pl.append("alert.classification.reference.origin")
+ vl.append(origin)
fstr += origin
name = ref["name"]
if name:
+ pl.append("alert.classification.reference.name")
+ vl.append(name)
fstr += ":" + name
urlstr = "https://www.prelude-ids.com/reference_details.php?origin=%s&name=%s" % (urllib.quote(ref["origin"]), urllib.quote(ref["name"]))
if ref["origin"] in ("vendor-specific", "user-specific"):
urlstr += "&url=" + urllib.quote(ref["url"], safe="")
+ fstr = self.createInlineFilteredField(pl, vl, "classification", fstr)
dataset["classification_references"].append((urlstr, fstr))
def _setMessageClassification(self, dataset, message):
_______________________________________________
Prelude-cvslog site list
[email protected]
http://lists.prelude-ids.org/mailman/listinfo/prelude-cvslog
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.