annotations_query_ctrl.ts 757 B

1234567891011121314151617181920212223242526272829303132
  1. import _ from 'lodash';
  2. import './query_filter_ctrl';
  3. export class StackdriverAnnotationsQueryCtrl {
  4. static templateUrl = 'partials/annotations.editor.html';
  5. annotation: any;
  6. datasource: any;
  7. defaultDropdownValue = 'Select Metric';
  8. defaultServiceValue = 'All Services';
  9. defaults = {
  10. project: {
  11. id: 'default',
  12. name: 'loading project...',
  13. },
  14. metricType: this.defaultDropdownValue,
  15. metricService: this.defaultServiceValue,
  16. metric: '',
  17. filters: [],
  18. metricKind: '',
  19. valueType: '',
  20. };
  21. /** @ngInject */
  22. constructor() {
  23. this.annotation.target = this.annotation.target || {};
  24. this.annotation.target.refId = 'annotationQuery';
  25. _.defaultsDeep(this.annotation.target, this.defaults);
  26. }
  27. }