mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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:
committed by
Torkel Ödegaard
parent
30bf9bf00f
commit
3c733638ee
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"type": "datasource",
|
||||
"name": "Grafana Live",
|
||||
"id": "grafana-live",
|
||||
|
||||
"metrics": true
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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 };
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user