define graph for EasyGateWay
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 10 Jul 2011 21:55:56 +0000 (23:55 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 10 Jul 2011 21:55:56 +0000 (23:55 +0200)
public/user.html

index 1a87ab0..67a6eb5 100644 (file)
 
        self.gnuplot_draw = function(h_cols) {
                $log.info( 'gnuplot_draw', h_cols );
-               if (h_cols) self.gnuplot.cols = h_cols;
+               if (h_cols.length) {
+                       self.gnuplot.cols = h_cols;
+               } else {
+                       $log.warn("no columns for gnuplot");
+                       return;
+               }
                var cols = [ 'timestamp' ];
                for ( var i = 0; i < h_cols.length; i++ ) {
                        cols.push( 'h->\'' + h_cols[i] + '\' as "' + h_cols[i] + '"' );
@@ -123,8 +128,7 @@ console.debug( cols );
 
        this.cpe_hash = {
                'Davolink': [ 'Max_down', 'Max_up' ],
-//             'Davolink': [ 'select timestamp,h->\'Max_down\' as Max_down,h->\'Max_up\' as Max_up from cpe_Davolink where username = \'', '\' order by timestamp desc limit 100' ],
-//             'EasyGateway':
+               'EasyGateway': [ 'upstreamCurrRate', 'upstreamMaxRate', 'upstreamNoiseMargin' ],
        };
 
       this.keys = function(h) {