Browse Source

fix: Wrong tabs and tab contents #162

master
Coin de Gamma 6 years ago
parent
commit
8f2b1f0716
  1. 9
      src/panel/graph_panel/graph_ctrl.ts

9
src/panel/graph_panel/graph_ctrl.ts

@ -156,7 +156,8 @@ class GraphCtrl extends MetricsPanelCtrl {
_.defaults(this.panel.legend, this.panelDefaults.legend); _.defaults(this.panel.legend, this.panelDefaults.legend);
_.defaults(this.panel.xaxis, this.panelDefaults.xaxis); _.defaults(this.panel.xaxis, this.panelDefaults.xaxis);
// because of https://github.com/hastic/hastic-grafana-app/issues/162
this.events.on('init-edit-mode', this.onInitEditMode.bind(this));
} }
@ -241,7 +242,6 @@ class GraphCtrl extends MetricsPanelCtrl {
this.events.on('data-received', this.onDataReceived.bind(this)); this.events.on('data-received', this.onDataReceived.bind(this));
this.events.on('data-error', this.onDataError.bind(this)); this.events.on('data-error', this.onDataError.bind(this));
this.events.on('data-snapshot-load', this.onDataSnapshotLoad.bind(this)); this.events.on('data-snapshot-load', this.onDataSnapshotLoad.bind(this));
this.events.on('init-edit-mode', this.onInitEditMode.bind(this));
this.events.on('init-panel-actions', this.onInitPanelActions.bind(this)); this.events.on('init-panel-actions', this.onInitPanelActions.bind(this));
this.events.on('analytic-unit-status-change', async (analyticUnit: AnalyticUnit) => { this.events.on('analytic-unit-status-change', async (analyticUnit: AnalyticUnit) => {
@ -281,11 +281,12 @@ class GraphCtrl extends MetricsPanelCtrl {
$graphElem, this.timeSrv, this.popoverSrv, this.contextSrv, this.$scope $graphElem, this.timeSrv, this.popoverSrv, this.contextSrv, this.$scope
); );
this._graphLegend = new GraphLegend($legendElem, this.popoverSrv, this.$scope); this._graphLegend = new GraphLegend($legendElem, this.popoverSrv, this.$scope);
}
onInitEditMode() {
this._updatePanelInfo(); this._updatePanelInfo();
this.analyticsController.updateServerInfo(); this.analyticsController.updateServerInfo();
}
onInitEditMode() {
const partialPath = this.panelPath + '/partials'; const partialPath = this.panelPath + '/partials';
this.addEditorTab('Analytics', `${partialPath}/tab_analytics.html`, 2); this.addEditorTab('Analytics', `${partialPath}/tab_analytics.html`, 2);

Loading…
Cancel
Save