浏览代码

mysql: minor improvement for table panel

Torkel Ödegaard 8 年之前
父节点
当前提交
f976e465c4
共有 1 个文件被更改,包括 8 次插入1 次删除
  1. 8 1
      public/app/plugins/datasource/mysql/query_ctrl.ts

+ 8 - 1
public/app/plugins/datasource/mysql/query_ctrl.ts

@@ -48,7 +48,14 @@ export class MysqlQueryCtrl extends QueryCtrl {
     ];
 
     if (!this.target.rawSql) {
-      this.target.rawSql = defaulQuery;
+
+      // special handling when in table panel
+      if (this.panelCtrl.panel.type === 'table') {
+        this.target.format = 'table';
+        this.target.rawSql = "SELECT 1";
+      } else {
+        this.target.rawSql = defaulQuery;
+      }
     }
 
     this.panelCtrl.events.on('data-received', this.onDataReceived.bind(this), $scope);