MetricsPanelCtrl: use shared queryRunner to support query execution (#16659)

* move queryRunner to panelModel

* remove isEditing from PanelChrome

* move listener to QueriesTab

* use queryRunner on MetricsPanelCtrl

* Added interval back as prop, not used yet

* QueryRunner: worked on tests

* PanelQueryRunner: Refactoring, added getQueryRunner to PanelModel

* PanelQueryRunner: interpolatel min interval

* merge master and remove grafana-live
This commit is contained in:
Ryan McKinley
2019-05-09 22:09:48 -07:00
committed by Torkel Ödegaard
parent 30bf9bf00f
commit 3c733638ee
5 changed files with 101 additions and 165 deletions

View File

@@ -1,7 +0,0 @@
{
"type": "datasource",
"name": "Grafana Live",
"id": "grafana-live",
"metrics": true
}

View File

@@ -1,34 +0,0 @@
import { liveSrv } from 'app/core/core';
class DataObservable {
target: any;
constructor(target) {
this.target = target;
}
subscribe(options) {
const observable = liveSrv.subscribe(this.target.stream);
return observable.subscribe(data => {
console.log('grafana stream ds data!', data);
});
}
}
export class GrafanaStreamDS {
subscription: any;
/** @ngInject */
constructor() {}
query(options): any {
if (options.targets.length === 0) {
return Promise.resolve({ data: [] });
}
const target = options.targets[0];
const observable = new DataObservable(target);
return Promise.resolve(observable);
}
}

View File

@@ -1,8 +0,0 @@
import { GrafanaStreamDS } from './datasource';
import { QueryCtrl } from 'app/plugins/sdk';
class GrafanaQueryCtrl extends QueryCtrl {
static templateUrl = 'partials/query.editor.html';
}
export { GrafanaStreamDS as Datasource, GrafanaQueryCtrl as QueryCtrl };

View File

@@ -1,8 +0,0 @@
<query-editor-row query-ctrl="ctrl" can-collapse="false">
<div class="gf-form-inline">
<div class="gf-form gf-form--grow">
<label class="gf-form-label width-8">Stream</label>
<input type="text" class="gf-form-input" ng-model="ctrl.target.stream" spellcheck='false' placeholder="metric">
</div>
</div>
</query-editor-row>