|
|
|
@ -302,9 +302,10 @@ class GraphCtrl extends MetricsPanelCtrl {
|
|
|
|
|
this.subTabIndex = 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
onInitPanelActions(actions) { |
|
|
|
|
onInitPanelActions(actions: { text: string, click: string }[]): void { |
|
|
|
|
actions.push({ text: 'Export CSV', click: 'ctrl.exportCsv()' }); |
|
|
|
|
actions.push({ text: 'Toggle legend', click: 'ctrl.toggleLegend()' }); |
|
|
|
|
actions.push({ text: 'Export analytic units', click: 'ctrl.exportAnalyticUnits()' }); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async onHasticDatasourceChange() { |
|
|
|
@ -552,6 +553,14 @@ class GraphCtrl extends MetricsPanelCtrl {
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async exportAnalyticUnits(): Promise<void> { |
|
|
|
|
const json = await this.analyticsController.exportAnalyticUnits(); |
|
|
|
|
this.publishAppEvent('show-modal', { |
|
|
|
|
src: 'public/app/partials/edit_json.html', |
|
|
|
|
model: { object: json, enableCopy: true } |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// getAnnotationsByTag(tag) {
|
|
|
|
|
// var res = [];
|
|
|
|
|
// for (var annotation of this.annotations) {
|
|
|
|
|