prewikka/master: Improve link generation for multiline charts

[email protected] Fri, 12 Feb 2010 15:14:40 +0100 (CET)
Newsgroups gmane.comp.security.ids.prelude.cvs
Message-ID <[email protected]>
commit e046d774d3a14f726d0e1fcf69d7b6e099137d76
Author: Yoann Vandoorselaere <[email protected]>
Date:   Thu Feb 11 12:56:52 2010 +0100

    Improve link generation for multiline charts
    
    The old implementation generated links for each point which directed
    the user to the alert listing, applying the selected point time criteria,
    but ignoring other specific criteria (like the severity, or the
    classification) used to generate the selected line.


========================================

 prewikka/views/stats.py |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

========================================

diff --git a/prewikka/views/stats.py b/prewikka/views/stats.py
index f9298e5..fd73ca4 100644
--- a/prewikka/views/stats.py
+++ b/prewikka/views/stats.py
@@ -262,7 +262,7 @@ class DistributionStats(view.View):
 
 
 class GenericTimelineStats(DistributionStats):
-    def _getAlertCount(self, criteria, link):
+    def _getAlertCount(self, criteria, link, zoom_view):
         d = {}
 
         results = self.env.idmef_db.getValues(self._getSelection(), criteria)
@@ -270,6 +270,9 @@ class GenericTimelineStats(DistributionStats):
             return d
 
         for name, count in results:
+            if zoom_view == "alert_listing":
+                link += "&amp;" + self.genPathValueURI(self._path, name)
+
             d[self._getNameFromMap(name or _(u"n/a"), self._names_and_colors)] = (count, link)
 
         return d
@@ -388,7 +391,7 @@ class GenericTimelineStats(DistributionStats):
                 self._setTimelineZoom(base_parameters, start, start + step)
 
             link = utils.create_link(zoom_view, base_parameters)
-            count = self._getAlertCount(c, link)
+            count = self._getAlertCount(c, link, zoom_view)
             label = start.strftime(format)
 
             start += step
_______________________________________________
Prelude-cvslog site list
[email protected]
http://lists.prelude-technologies.com/mailman/listinfo/prelude-cvslog