Browse Source

small refactoring

master
Coin de Gamma 6 years ago
parent
commit
6ba3c4cbe0
  1. 1
      src/panel/graph_panel/data_processor.ts
  2. 3
      src/panel/graph_panel/graph_ctrl.ts
  3. 5
      src/panel/graph_panel/graph_legend.ts

1
src/panel/graph_panel/data_processor.ts

@ -2,6 +2,7 @@ import _ from 'lodash';
import TimeSeries from './vendor/grafana/time_series2'; import TimeSeries from './vendor/grafana/time_series2';
import colors from './vendor/grafana/colors'; import colors from './vendor/grafana/colors';
export class DataProcessor { export class DataProcessor {
constructor(private panel) {} constructor(private panel) {}

3
src/panel/graph_panel/graph_ctrl.ts

@ -18,11 +18,8 @@ import { MetricsPanelCtrl } from 'grafana/app/plugins/sdk';
import { appEvents } from 'grafana/app/core/core' import { appEvents } from 'grafana/app/core/core'
import { BackendSrv } from 'grafana/app/core/services/backend_srv'; import { BackendSrv } from 'grafana/app/core/services/backend_srv';
import _ from 'lodash'; import _ from 'lodash';
const BACKEND_VARIABLE_NAME = 'HASTIC_SERVER_URL';
class GraphCtrl extends MetricsPanelCtrl { class GraphCtrl extends MetricsPanelCtrl {
static template = template; static template = template;

5
src/panel/graph_panel/graph_legend.ts

@ -1,6 +1,5 @@
import PerfectScrollbar from 'perfect-scrollbar'; import PerfectScrollbar from 'perfect-scrollbar';
import _ from 'lodash'; import _ from 'lodash';
import 'jquery';
export class GraphLegend { export class GraphLegend {
@ -34,7 +33,7 @@ export class GraphLegend {
var el = $(e.currentTarget).find('.fa-minus'); var el = $(e.currentTarget).find('.fa-minus');
var index = this.getSeriesIndexForElement(el); var index = this.getSeriesIndexForElement(el);
var series = this.seriesList[index]; var series = this.seriesList[index];
this.popoverSrv.show({ this.popoverSrv.show({
element: el[0], element: el[0],
position: 'bottom left', position: 'bottom left',
@ -52,7 +51,7 @@ export class GraphLegend {
}, },
}, },
}); });
} }
toggleSeries(e) { toggleSeries(e) {

Loading…
Cancel
Save