|
@@ -3,6 +3,7 @@
|
|
|
import angular from 'angular';
|
|
import angular from 'angular';
|
|
|
import _ from 'lodash';
|
|
import _ from 'lodash';
|
|
|
import moment from 'moment';
|
|
import moment from 'moment';
|
|
|
|
|
+import kbn from 'app/core/utils/kbn';
|
|
|
import PanelMeta from 'app/features/panel/panel_meta2';
|
|
import PanelMeta from 'app/features/panel/panel_meta2';
|
|
|
import {transformDataToTable} from './transformers';
|
|
import {transformDataToTable} from './transformers';
|
|
|
|
|
|
|
@@ -23,6 +24,8 @@ export class TablePanelCtrl {
|
|
|
$scope.panelMeta.addEditorTab('Options', 'app/plugins/panel/table/options.html');
|
|
$scope.panelMeta.addEditorTab('Options', 'app/plugins/panel/table/options.html');
|
|
|
$scope.panelMeta.addEditorTab('Time range', 'app/features/panel/partials/panelTime.html');
|
|
$scope.panelMeta.addEditorTab('Time range', 'app/features/panel/partials/panelTime.html');
|
|
|
|
|
|
|
|
|
|
+ $scope.panelMeta.addExtendedMenuItem('Export CSV', '', 'exportCsv()');
|
|
|
|
|
+
|
|
|
var panelDefaults = {
|
|
var panelDefaults = {
|
|
|
targets: [{}],
|
|
targets: [{}],
|
|
|
transform: 'timeseries_to_columns',
|
|
transform: 'timeseries_to_columns',
|
|
@@ -124,6 +127,10 @@ export class TablePanelCtrl {
|
|
|
panelHelper.broadcastRender($scope, $scope.table, $scope.dataRaw);
|
|
panelHelper.broadcastRender($scope, $scope.table, $scope.dataRaw);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ $scope.exportCsv = function() {
|
|
|
|
|
+ kbn.exportTableDataToCsv($scope.table);
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
$scope.init();
|
|
$scope.init();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|