mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
feat(plugins): migrated cloudwatch and fixed a bunch of issues with data source edit views
This commit is contained in:
34
public/app/plugins/datasource/elasticsearch/config_ctrl.ts
Normal file
34
public/app/plugins/datasource/elasticsearch/config_ctrl.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
///<reference path="../../../headers/common.d.ts" />
|
||||
|
||||
import angular from 'angular';
|
||||
import _ from 'lodash';
|
||||
|
||||
export class ElasticConfigCtrl {
|
||||
static templateUrl = 'public/app/plugins/datasource/elasticsearch/partials/config.html';
|
||||
current: any;
|
||||
|
||||
/** @ngInject */
|
||||
constructor($scope) {
|
||||
this.current.jsonData.timeField = this.current.jsonData.timeField || '@timestamp';
|
||||
}
|
||||
|
||||
indexPatternTypes = [
|
||||
{name: 'No pattern', value: undefined},
|
||||
{name: 'Hourly', value: 'Hourly', example: '[logstash-]YYYY.MM.DD.HH'},
|
||||
{name: 'Daily', value: 'Daily', example: '[logstash-]YYYY.MM.DD'},
|
||||
{name: 'Weekly', value: 'Weekly', example: '[logstash-]GGGG.WW'},
|
||||
{name: 'Monthly', value: 'Monthly', example: '[logstash-]YYYY.MM'},
|
||||
{name: 'Yearly', value: 'Yearly', example: '[logstash-]YYYY'},
|
||||
];
|
||||
|
||||
esVersions = [
|
||||
{name: '1.x', value: 1},
|
||||
{name: '2.x', value: 2},
|
||||
];
|
||||
|
||||
indexPatternTypeChanged() {
|
||||
var def = _.findWhere(this.indexPatternTypes, {value: this.current.jsonData.interval});
|
||||
this.current.database = def.example || 'es-index-name';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user