return;
}
- self.message.gnuplot = 'redrawing '+h_cols.join(' ');
-
var cols = [ 'timestamp' ];
for ( var i = 0; i < h_cols.length; i++ ) {
cols.push( 'h->\'' + h_cols[i] + '\' as "' + h_cols[i] + '"' );
}
-console.debug( cols );
self.gnuplot.sql = 'select ' + cols.join(',') + ' from cpe_' + self.cpe.parser + ' where username = \'' + self.username + '\' order by timestamp desc limit 100';
-
- $log.info( 'gnuplot', self.gnuplot );
- self.gnuplot.img = '/gnuplot?hide=1;with=points;sql=' + self.gnuplot.sql;
-
+ $log.info( 'gnuplot', cols, self.gnuplot );
};
+ self.$watch('gnuplot.sql', function() {
+ if ( ! self.gnuplot ) return;
+ self.message.gnuplot = self.gnuplot.cols.join(' ');
+ self.gnuplot.img = '/gnuplot?hide=1;with=points;sql=' + self.gnuplot.sql;
+ });
self.r.table = $resource('/table/:table');
self.table_update = function () {