[Reconnoiter-devel] [reconnoiter commit] r778 - trunk/ui/web/htdocs

svn-commit at lists.omniti.com svn-commit at lists.omniti.com
Mon Jul 6 18:42:34 EDT 2009


Author: umar
Date: 2009-07-06 18:42:34 -0400 (Mon, 06 Jul 2009)
New Revision: 778

Modified:
   trunk/ui/web/htdocs/graph_panel.inc
Log:
notify user of error when adding duplicate datasets to a graph, fixes #85

Modified: trunk/ui/web/htdocs/graph_panel.inc
===================================================================
--- trunk/ui/web/htdocs/graph_panel.inc	2009-07-06 16:05:02 UTC (rev 777)
+++ trunk/ui/web/htdocs/graph_panel.inc	2009-07-06 22:42:34 UTC (rev 778)
@@ -161,6 +161,13 @@
 
 function graph_add_datapoint(d) {
   if(!graph_locked("Click 'Edit Graph' to unlock.")){
+
+   for(i=0; i<graphinfo.datapoints.length; i++){
+       if( (graphinfo.datapoints[i].sid==d.sid) && (graphinfo.datapoints[i].metric_name == d.metric_name) ) {
+              modal_warning("Error", "Graphs cannot have duplicate datasets!");
+	      return;
+       }
+    }
     if(d.axis == undefined) { d.axis = 'l'; }
     if(d.name == undefined) { d.name = d.target + '`' + d.metric_name; }
     graphinfo.datapoints.push(d);



More information about the Reconnoiter-devel mailing list