summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-livestats/htdocs
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2008-10-20 19:00:17 +0000
committerJo-Philipp Wich <jow@openwrt.org>2008-10-20 19:00:17 +0000
commit174e045fb42207b7c10ff8e5d6feb38873149e3a (patch)
treef0602a2f8d51a7a1fd6ec5cb82f7eed04600cbbf /applications/luci-livestats/htdocs
parentc951eeb00878768a0f03803c5eccad4e977d985e (diff)
* luci/app/livestats: fix load diagram, improvements for diagram layout, fix menu order
Diffstat (limited to 'applications/luci-livestats/htdocs')
-rw-r--r--applications/luci-livestats/htdocs/luci-static/resources/livestats/GraphRPC.js24
1 files changed, 10 insertions, 14 deletions
diff --git a/applications/luci-livestats/htdocs/luci-static/resources/livestats/GraphRPC.js b/applications/luci-livestats/htdocs/luci-static/resources/livestats/GraphRPC.js
index 9ac291fd0..a7a89ffd2 100644
--- a/applications/luci-livestats/htdocs/luci-static/resources/livestats/GraphRPC.js
+++ b/applications/luci-livestats/htdocs/luci-static/resources/livestats/GraphRPC.js
@@ -25,7 +25,6 @@ function Graph(container, id, options, transform) {
}
Graph.prototype.addDataset = function(name, ds) {
- if( window.console ) console.debug("AddDataset: " + name);
if( !this.layout ) {
this.layout = new PlotKit.Layout( this.type, this.options );
}
@@ -41,7 +40,6 @@ Graph.prototype.addDataset = function(name, ds) {
}
Graph.prototype.updateDataset = function(name, value) {
- if( window.console ) console.debug("UpdateDataset: " + name + " " + value);
if( this.dataset[name] ) {
var ds = this.dataset[name];
@@ -140,39 +138,37 @@ GraphRPC.prototype.dispatchResponse = function(response) {
this.graphs[gid].updateDataset(
name, instance
? response[instance][this.ds[i]]
- : response[parseInt(this.ds[i])]
+ : response[this.ds[i]]
);
this.graphs[gid].redraw();
}
}
}
else {
- if( !this.graphs[instance] ) {
- this.graphs[instance] = new Graph(
- this.container, instance, this.options, this.transform
+ var gid = instance || 'livegraph';
+ if( !this.graphs[gid] ) {
+ this.graphs[gid] = new Graph(
+ this.container, gid, this.options, this.transform
);
- if( window.console ) console.debug("NG: " + instance);
for( var i = 0; i < this.ds.length; i += 2 ) {
var name = this.ds[i+1] || this.ds[i];
- if( window.console ) console.debug("ADS: " + name);
- this.graphs[instance].addDataset(name);
+ this.graphs[gid].addDataset(name);
}
- this.graphs[instance].draw();
+ this.graphs[gid].draw();
}
else {
for( var i = 0; i < this.ds.length; i += 2 ) {
var name = this.ds[i+1] || this.ds[i];
- if( window.console ) console.debug("UDS: " + name + " " + response[instance][this.ds[i]]);
- this.graphs[instance].updateDataset(
+ this.graphs[gid].updateDataset(
name, instance
? response[instance][this.ds[i]]
- : response[parseInt(this.ds[i])]
+ : response[this.ds[i]]
);
}
- this.graphs[instance].redraw();
+ this.graphs[gid].redraw();
}
}
}