config_ctrl.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. ///<reference path="../../../headers/common.d.ts" />
  2. import angular from 'angular';
  3. import _ from 'lodash';
  4. export class CloudWatchConfigCtrl {
  5. static templateUrl = 'partials/config.html';
  6. current: any;
  7. accessKeyExist: boolean = false;
  8. secretKeyExist: boolean = false;
  9. /** @ngInject */
  10. constructor($scope) {
  11. this.current.jsonData.timeField = this.current.jsonData.timeField || '@timestamp';
  12. this.current.jsonData.authType = this.current.jsonData.authType || 'credentials';
  13. this.accessKeyExist = this.current.secureJsonFields.accessKey;
  14. this.secretKeyExist = this.current.secureJsonFields.secretKey;
  15. }
  16. resetAccessKey() {
  17. this.accessKeyExist = false;
  18. }
  19. resetSecretKey() {
  20. this.secretKeyExist = false;
  21. }
  22. authTypes = [
  23. {name: 'Access & secret key', value: 'keys'},
  24. {name: 'Credentials file', value: 'credentials'},
  25. {name: 'ARN', value: 'arn'},
  26. ];
  27. indexPatternTypes = [
  28. {name: 'No pattern', value: undefined},
  29. {name: 'Hourly', value: 'Hourly', example: '[logstash-]YYYY.MM.DD.HH'},
  30. {name: 'Daily', value: 'Daily', example: '[logstash-]YYYY.MM.DD'},
  31. {name: 'Weekly', value: 'Weekly', example: '[logstash-]GGGG.WW'},
  32. {name: 'Monthly', value: 'Monthly', example: '[logstash-]YYYY.MM'},
  33. {name: 'Yearly', value: 'Yearly', example: '[logstash-]YYYY'},
  34. ];
  35. }