summaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
authorRichard Wall <richard@aziz>2010-04-10 17:06:34 +0100
committerRichard Wall <richard@aziz>2010-04-10 17:06:34 +0100
commit887896a5019a4e5bd1fe6d1550eae3248faeb18e (patch)
tree85bcd02d06d8e1c575d4708b8576b7a74085cfa4 /index.html
parent7bda611c65b63b8f9dd1d46033dabb190984f3a9 (diff)
pass arguments where possible
Diffstat (limited to 'index.html')
-rw-r--r--index.html29
1 files changed, 18 insertions, 11 deletions
diff --git a/index.html b/index.html
index 550e4d3..0b43bb0 100644
--- a/index.html
+++ b/index.html
@@ -71,21 +71,22 @@
return c;
}
- var RrdQueryDsProxy = function(rrdQuery, dsId) {
- this.rrdQuery = rrdQuery;
- this.dsId = dsId;
- };
-
- RrdQueryDsProxy.prototype.getData = function(startTime, endTime) {
- return this.rrdQuery.getData(startTime, endTime, this.dsId);
- };
-
function loadChartFactory(template) {
var c = new jrrd.Chart(template, baseOptions);
var data = new jrrd.RrdQueryRemote('data/localhost/load/load.rrd');
var rrdDSs = ['shortterm', 'midterm', 'longterm'];
jQuery.each(rrdDSs, function(i, rrdDS) {
- c.addData(rrdDS, new RrdQueryDsProxy(data, rrdDS));
+ c.addData(rrdDS, new jrrd.RrdQueryDsProxy(data, rrdDS));
+ });
+ return c;
+ }
+
+ function nicChartFactory(template, nicname) {
+ var c = new jrrd.Chart(template, baseOptions);
+ var data = new jrrd.RrdQueryRemote('data/localhost/interface/if_octets-' + nicname + '.rrd');
+ var rrdDSs = ['tx', 'rx'];
+ jQuery.each(rrdDSs, function(i, rrdDS) {
+ c.addData(rrdDS, new jrrd.RrdQueryDsProxy(data, rrdDS));
});
return c;
}
@@ -96,6 +97,12 @@
loadChartFactory(
chartTemplate.clone().appendTo('.charts')),
+ nicChartFactory(
+ chartTemplate.clone().appendTo('.charts'), 'lo'),
+
+ nicChartFactory(
+ chartTemplate.clone().appendTo('.charts'), 'eth0'),
+
cpuChartFactory(
chartTemplate.clone().appendTo('.charts')),
@@ -105,7 +112,7 @@
jQuery.each(charts, function(i, chart) {
chart.draw(new Date('7 April 2010 09:30:00'),
- new Date('7 April 2010 15:00:00'));
+ new Date('10 April 2010 15:00:00'));
});
$('.chart').bind("plotselected", function(event, ranges) {