From b3dfd26ce97cd1817f728667a586bf29eace752f Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Thu, 30 Dec 2010 17:21:31 +0000 Subject: display a list of ds names found in the rrd url --- jarmon/jarmon.js | 91 ++++++++++++++++++++++++++++++++++++++++----------- jarmon/jarmon.test.js | 2 +- 2 files changed, 73 insertions(+), 20 deletions(-) (limited to 'jarmon') diff --git a/jarmon/jarmon.js b/jarmon/jarmon.js index 6e1d1f8..c25210d 100644 --- a/jarmon/jarmon.js +++ b/jarmon/jarmon.js @@ -256,6 +256,18 @@ jarmon.RrdQuery.prototype.getData = function(startTimeJs, endTimeJs, dsId, cfNam 'lastUpdated': lastUpdated*1000.0}; }; + +jarmon.RrdQuery.prototype.getDSNames = function() { + /** + * Return a list of RRD Data Source names + * + * @method getDSNames + * @return {Array} An array of DS names. + **/ + return this.rrd.getDSNames(); +}; + + /** * A wrapper around RrdQuery which provides asynchronous access to the data in a * remote RRD file. @@ -332,6 +344,18 @@ jarmon.RrdQueryRemote.prototype.getData = function(startTime, endTime, dsId, cfN return this._callRemote('getData', [startTime, endTime, dsId, cfName]); }; + +jarmon.RrdQueryRemote.prototype.getDSNames = function() { + /** + * Return a list of RRD Data Source names + * + * @method getDSNames + * @return {Object} A Deferred which calls back with an array of DS names. + **/ + return this._callRemote('getDSNames'); +}; + + /** * Wraps RrdQueryRemote to provide access to a different RRD DSs within a * single RrdDataSource. @@ -668,31 +692,60 @@ jarmon.Chart.fromRecipe = function(recipes, templateFactory, downloader) { **/ jarmon.ChartConfig = function($tpl) { this.$tpl = $tpl; + this.rrdUrl = ''; + this.dsNames = []; + this.errors = []; }; jarmon.ChartConfig.prototype.draw = function() { - $('
').append( - $('
').append( - $('