Changeset f8f9b3df4b347d30dc3cdbe22ba4250cb072e15c

Show
Ignore:
Timestamp:
07/06/09 22:42:34 (5 years ago)
Author:
Umar Farooq <umar@omniti.com>
git-committer:
Umar Farooq <umar@omniti.com> 1246920154 +0000
git-parent:

[17f1624295aa07da22c051506eae0ff2e6836e6f]

git-author:
Umar Farooq <umar@omniti.com> 1246920154 +0000
Message:

notify user of error when adding duplicate datasets to a graph, fixes #85

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • ui/web/htdocs/graph_panel.inc

    r44c7512 rf8f9b3d  
    162162function graph_add_datapoint(d) { 
    163163  if(!graph_locked("Click 'Edit Graph' to unlock.")){ 
     164 
     165   for(i=0; i<graphinfo.datapoints.length; i++){ 
     166       if( (graphinfo.datapoints[i].sid==d.sid) && (graphinfo.datapoints[i].metric_name == d.metric_name) ) { 
     167              modal_warning("Error", "Graphs cannot have duplicate datasets!"); 
     168              return; 
     169       } 
     170    } 
    164171    if(d.axis == undefined) { d.axis = 'l'; } 
    165172    if(d.name == undefined) { d.name = d.target + '`' + d.metric_name; }