[Groonga-commit] groonga/grafana-datasource-plugin-groonga at 3b2c59f [master] Set table name in query controller

Back to archive index

Masafumi Yokoyama null+****@clear*****
Sat Feb 13 11:01:25 JST 2016


Masafumi Yokoyama	2016-02-13 11:01:25 +0900 (Sat, 13 Feb 2016)

  New Revision: 3b2c59f7033ea444a3c19088cd3e0fba89f6cada
  https://github.com/groonga/grafana-datasource-plugin-groonga/commit/3b2c59f7033ea444a3c19088cd3e0fba89f6cada

  Message:
    Set table name in query controller

  Modified files:
    datasource.js
    query_ctrl.js

  Modified: datasource.js (+2 -1)
===================================================================
--- datasource.js    2016-02-08 23:53:49 +0900 (8816894)
+++ datasource.js    2016-02-13 11:01:25 +0900 (862b672)
@@ -33,8 +33,9 @@ function (angular) {
     };
 
     GroongaDatasource.prototype.query = function(options) {
+      var target = options.targets[0];
       var selectOptions = {
-        table: 'Logs',
+        table: target.table,
         filter: 'between(timestamp, ' +
                          options.range.from.unix() + ', "include", ' +
                          options.range.to.unix() + ', "include")',

  Modified: query_ctrl.js (+4 -0)
===================================================================
--- query_ctrl.js    2016-02-08 23:53:49 +0900 (d556571)
+++ query_ctrl.js    2016-02-13 11:01:25 +0900 (175b50f)
@@ -9,7 +9,11 @@ function (angular) {
   module.controller('GroongaQueryCtrl', function ($scope) {
 
     $scope.init = function () {
+      console.log('init');
+      $scope.target.table = 'Logs';
     };
 
+    $scope.init();
+
   });
 });
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index