Browse Source

uppercase literals

master
Alexey Velikiy 6 years ago
parent
commit
18d5ea29b5
  1. 1
      src/colors.ts
  2. 12
      src/models/analytic_unit.ts
  3. 2
      src/models/segment_array.ts
  4. 10
      src/module.ts
  5. 10
      src/partials/tab_analytics.html

1
src/colors.ts

@ -1,4 +1,3 @@
import _ from 'lodash';
import tinycolor from 'tinycolor2';
export const PALETTE_ROWS = 4;

12
src/models/analytic_unit.ts

@ -39,7 +39,7 @@ export class AnalyticUnit {
this._panelObject = {};
}
_.defaults(this._panelObject, {
name: 'AnalyticUnitName', confidence: 0.2, color: ANALYTIC_UNIT_COLORS[0], type: 'general'
name: 'AnalyticUnitName', confidence: 0.2, color: ANALYTIC_UNIT_COLORS[0], type: 'GENERAL'
});
//this._metric = new Metric(_panelObject.metric);
@ -96,10 +96,10 @@ export class AnalyticUnit {
get status() { return this._status; }
set status(value) {
if(
value !== 'ready' &&
value !== 'learning' &&
value !== 'pending' &&
value !== 'failed'
value !== 'READY' &&
value !== 'LEARNING' &&
value !== 'PENDING' &&
value !== 'FAILED'
) {
throw new Error('Unsupported status value: ' + value);
}
@ -110,7 +110,7 @@ export class AnalyticUnit {
set error(value) { this._error = value; }
get isActiveStatus() {
return this.status !== 'ready' && this.status !== 'failed';
return this.status !== 'READY' && this.status !== 'FAILED';
}
get panelObject() { return this._panelObject; }

2
src/models/segment_array.ts

@ -1,8 +1,6 @@
import { SegmentsSet } from './segment_set';
import { Segment, SegmentId } from './segment';
import _ from 'lodash';
export class SegmentArray<T extends Segment> implements SegmentsSet<T> {
private _segments: T[];

10
src/module.ts

@ -27,11 +27,11 @@ const BACKEND_VARIABLE_NAME = 'HASTIC_SERVER_URL';
class GraphCtrl extends MetricsPanelCtrl {
static template = template;
ANALYTIC_TYPES: Array<{name: string, value: string}> = [
{ name: 'General', value: 'general' },
{ name: 'Peaks', value: 'peak' },
{ name: 'Jumps', value: 'jump' },
{ name: 'Drops', value: 'drop' },
{ name: 'Custom', value: 'custom' }
{ name: 'General', value: 'GENERAL' },
{ name: 'Peaks', value: 'PEAK' },
{ name: 'Jumps', value: 'JUMP' },
{ name: 'Drops', value: 'DROP' },
{ name: 'Custom', value: 'CUSTOM' }
];
hiddenSeries: any = {};

10
src/partials/tab_analytics.html

@ -35,10 +35,10 @@
/>
</span>
<label class="gf-form-label" ng-style="analyticUnit.status === 'learning' && { 'cursor': 'not-allowed' }">
<label class="gf-form-label" ng-style="analyticUnit.status === 'LEARNING' && { 'cursor': 'not-allowed' }">
<a class="pointer" tabindex="1"
ng-click="ctrl.onToggleLabelingMode(analyticUnit.id)"
ng-disabled="analyticUnit.status === 'learning'"
ng-disabled="analyticUnit.status === 'LEARNING'"
>
<i class="fa fa-bar-chart" ng-if="!analyticUnit.saving"></i>
<i class="fa fa-spinner fa-spin" ng-if="analyticUnit.saving"></i>
@ -107,9 +107,9 @@
</label>
<label>
<i ng-if="analyticUnit.status === 'learning'" class="grafana-tip fa fa-leanpub ng-scope" bs-tooltip="'Learning'"></i>
<i ng-if="analyticUnit.status === 'pending'" class="grafana-tip fa fa-list-ul ng-scope" bs-tooltip="'Pending'"></i>
<i ng-if="analyticUnit.status === 'failed'" class="grafana-tip fa fa-exclamation-circle ng-scope" bs-tooltip="'Error: ' + analyticUnit.error"></i>
<i ng-if="analyticUnit.status === 'LEARNING'" class="grafana-tip fa fa-leanpub ng-scope" bs-tooltip="'Learning'"></i>
<i ng-if="analyticUnit.status === 'PENDING'" class="grafana-tip fa fa-list-ul ng-scope" bs-tooltip="'Pending'"></i>
<i ng-if="analyticUnit.status === 'FAILED'" class="grafana-tip fa fa-exclamation-circle ng-scope" bs-tooltip="'Error: ' + analyticUnit.error"></i>
</label>
</div>

Loading…
Cancel
Save