|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
<div class="gf-form-group"> |
|
|
|
|
<div class="gf-form"> |
|
|
|
|
<label class="gf-form-label">Select Hastic datasource</label> |
|
|
|
|
<select class="gf-form-input max-width-15" |
|
|
|
|
<select class="gf-form-input width-15" |
|
|
|
|
ng-model="ctrl.panel.hasticDatasource" |
|
|
|
|
ng-options="ds.id as ds.name for ds in ctrl.hasticDatasources" |
|
|
|
|
ng-change="ctrl.onHasticDatasourceChange()" |
|
|
|
@ -12,7 +12,7 @@
|
|
|
|
|
<div class="gf-form"> |
|
|
|
|
<div class="gf-form-button-row" ng-if="ctrl.analyticsController.serverStatus === false"> |
|
|
|
|
<h5>Hastic server at "{{ctrl.hasticDatasource.url}}" is not available</h5> |
|
|
|
|
<button class="btn btn-inverse" ng-click="ctrl.runDatasourceConnectivityCheck()"> |
|
|
|
|
<button class="btn btn-inverse" ng-click="ctrl.onHasticDatasourceChange()"> |
|
|
|
|
<i class="fa fa-plug"></i> |
|
|
|
|
Reconnect to Hastic server |
|
|
|
|
</button> |
|
|
|
@ -20,213 +20,299 @@
|
|
|
|
|
|
|
|
|
|
<div ng-if="ctrl.analyticsController.serverStatus === true && !ctrl.analyticsController.loading"> |
|
|
|
|
<h5> Analytic Units </h5> |
|
|
|
|
<div class="editor-row"> |
|
|
|
|
<div class="gf-form" ng-repeat="analyticUnit in ctrl.analyticsController.analyticUnits"> |
|
|
|
|
|
|
|
|
|
<label class="gf-form-label width-5"> |
|
|
|
|
<i class="fa fa-info" bs-tooltip="'Analytic unit id: ' + analyticUnit.id"></i> |
|
|
|
|
Name |
|
|
|
|
</label> |
|
|
|
|
<input |
|
|
|
|
type="text" class="gf-form-input max-width-15" |
|
|
|
|
ng-model="analyticUnit.name" |
|
|
|
|
ng-blur="ctrl.onAnalyticUnitChange(analyticUnit)" |
|
|
|
|
> |
|
|
|
|
|
|
|
|
|
<label class="gf-form-label width-4"> Type </label> |
|
|
|
|
<div class="gf-form-select-wrapper"> |
|
|
|
|
<select class="gf-form-input width-10" |
|
|
|
|
ng-model="analyticUnit.type" |
|
|
|
|
ng-options="type.value as type.name for type in ctrl.analyticUnitTypes[analyticUnit.detectorType]" |
|
|
|
|
ng-disabled="true" |
|
|
|
|
/> |
|
|
|
|
<div ng-repeat="analyticUnit in ctrl.analyticsController.analyticUnits"> |
|
|
|
|
<div class="gf-form-inline"> |
|
|
|
|
<div class="gf-form"> |
|
|
|
|
<label class="gf-form-label width-5"> |
|
|
|
|
<i class="fa fa-info" bs-tooltip="'Analytic unit id: ' + analyticUnit.id"></i> |
|
|
|
|
Name |
|
|
|
|
</label> |
|
|
|
|
<input |
|
|
|
|
type="text" class="gf-form-input width-15" |
|
|
|
|
ng-model="analyticUnit.name" |
|
|
|
|
ng-blur="ctrl.onAnalyticUnitChange(analyticUnit)" |
|
|
|
|
> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<!-- |
|
|
|
|
<label class="gf-form-label width-6"> Confidence </label> |
|
|
|
|
<input |
|
|
|
|
type="number" class="gf-form-input width-5 ng-valid ng-scope ng-empty ng-dirty ng-valid-number ng-touched" |
|
|
|
|
placeholder="auto" bs-tooltip="'Override automatic decimal precision for legend and tooltips'" |
|
|
|
|
data-placement="right" ng-model="ctrl.panel.decimals" ng-change="ctrl.render()" ng-model-onblur="" data-original-title="" title="" |
|
|
|
|
/> |
|
|
|
|
--> |
|
|
|
|
<div class="gf-form"> |
|
|
|
|
<label class="gf-form-label width-5"> Type </label> |
|
|
|
|
<div class="gf-form-select-wrapper"> |
|
|
|
|
<select class="gf-form-input width-9" |
|
|
|
|
ng-model="analyticUnit.type" |
|
|
|
|
ng-options="type.value as type.name for type in ctrl.analyticUnitTypes[analyticUnit.detectorType]" |
|
|
|
|
ng-disabled="true" |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<label class="gf-form-label width-8"> Positive Color </label> |
|
|
|
|
<span class="gf-form-label"> |
|
|
|
|
<color-picker |
|
|
|
|
color="analyticUnit.labeledColor" |
|
|
|
|
onChange="ctrl.onColorChange.bind(ctrl, analyticUnit.id, false)" |
|
|
|
|
/> |
|
|
|
|
</span> |
|
|
|
|
<div class="gf-form"> |
|
|
|
|
<label class="gf-form-label width-8"> Positive Color </label> |
|
|
|
|
<span class="gf-form-label"> |
|
|
|
|
<color-picker |
|
|
|
|
color="analyticUnit.labeledColor" |
|
|
|
|
onChange="ctrl.onColorChange.bind(ctrl, analyticUnit.id, false)" |
|
|
|
|
/> |
|
|
|
|
</span> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<!-- Hack to avoid Grafana's .gf-form-label + .gf-form-label css. Fix for https://github.com/hastic/hastic-grafana-app/issues/192 --> |
|
|
|
|
<div ng-if="analyticUnit.detectorType === 'pattern'"></div> |
|
|
|
|
<div class="gf-form" |
|
|
|
|
ng-if="analyticUnit.detectorType === 'pattern' || analyticUnit.detectorType === 'anomaly'" |
|
|
|
|
> |
|
|
|
|
<label class="gf-form-label width-8"> Negative Color </label> |
|
|
|
|
<span class="gf-form-label"> |
|
|
|
|
<color-picker |
|
|
|
|
color="analyticUnit.deletedColor" |
|
|
|
|
onChange="ctrl.onColorChange.bind(ctrl, analyticUnit.id, true)" |
|
|
|
|
/> |
|
|
|
|
</span> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<label ng-if="analyticUnit.detectorType === 'pattern'" class="gf-form-label width-8"> Negative Color </label> |
|
|
|
|
<span ng-if="analyticUnit.detectorType === 'pattern'" class="gf-form-label"> |
|
|
|
|
<color-picker |
|
|
|
|
color="analyticUnit.deletedColor" |
|
|
|
|
onChange="ctrl.onColorChange.bind(ctrl, analyticUnit.id, true)" |
|
|
|
|
<div class="gf-form" ng-if="analyticUnit.visible"> |
|
|
|
|
<!-- TODO: Remove hack with "margin-bottom: 0" --> |
|
|
|
|
<gf-form-switch |
|
|
|
|
class="gf-form" |
|
|
|
|
style="margin-bottom: 0" |
|
|
|
|
label="Inspect" |
|
|
|
|
label-class="width-5" |
|
|
|
|
on-change="ctrl.onToggleInspect(analyticUnit.id)" |
|
|
|
|
checked="analyticUnit.inspect" |
|
|
|
|
/> |
|
|
|
|
</span> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<!-- TODO: move analytic-unit-specific fields rendering to class --> |
|
|
|
|
<select class="gf-form-input width-9" |
|
|
|
|
ng-if="analyticUnit.detectorType === 'threshold'" |
|
|
|
|
ng-model="analyticUnit.condition" |
|
|
|
|
ng-options="type for type in ctrl.analyticsController.conditions" |
|
|
|
|
ng-change="ctrl.onAnalyticUnitChange(analyticUnit)" |
|
|
|
|
/> |
|
|
|
|
<input class="gf-form-input width-5" |
|
|
|
|
<div |
|
|
|
|
class="gf-form" |
|
|
|
|
ng-if=" |
|
|
|
|
analyticUnit.detectorType === 'threshold' && |
|
|
|
|
analyticUnit.condition !== 'NO_DATA' |
|
|
|
|
analyticUnit.detectorType === 'pattern' || |
|
|
|
|
(analyticUnit.detectorType === 'anomaly' && analyticUnit.hasSeasonality) |
|
|
|
|
" |
|
|
|
|
type="number" |
|
|
|
|
ng-model="analyticUnit.value" |
|
|
|
|
ng-blur="ctrl.onAnalyticUnitChange(analyticUnit)" |
|
|
|
|
/> |
|
|
|
|
> |
|
|
|
|
<label |
|
|
|
|
class="gf-form-label pointer" |
|
|
|
|
ng-if="!analyticUnit.selected" |
|
|
|
|
ng-style="analyticUnit.status === 'LEARNING' && { 'cursor': 'not-allowed' }" |
|
|
|
|
ng-click="ctrl.onToggleLabelingMode(analyticUnit.id)" |
|
|
|
|
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> |
|
|
|
|
Label |
|
|
|
|
</label> |
|
|
|
|
<select class="gf-form-input width-12" |
|
|
|
|
ng-if="analyticUnit.selected && !analyticUnit.saving" |
|
|
|
|
ng-model="ctrl.analyticsController.labelingMode" |
|
|
|
|
ng-options="type.value as type.name for type in analyticUnit.labelingModes" |
|
|
|
|
ng-disabled="analyticUnit.status === 'LEARNING'" |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<label class="gf-form-label width-6" ng-if="analyticUnit.detectorType === 'anomaly'"> Alpha </label> |
|
|
|
|
<input class="gf-form-input width-5" |
|
|
|
|
ng-if="analyticUnit.detectorType === 'anomaly'" |
|
|
|
|
min="0" |
|
|
|
|
max="1" |
|
|
|
|
type="number" |
|
|
|
|
ng-model="analyticUnit.alpha" |
|
|
|
|
ng-blur="ctrl.onAnalyticUnitChange(analyticUnit)" |
|
|
|
|
/> |
|
|
|
|
<div class="gf-form" ng-if="!analyticUnit.selected"> |
|
|
|
|
<label class="gf-form-label"> |
|
|
|
|
<a |
|
|
|
|
ng-if="analyticUnit.visible" |
|
|
|
|
bs-tooltip="'Hide. It`s visible now.'" |
|
|
|
|
ng-click="ctrl.onToggleVisibility(analyticUnit.id)" |
|
|
|
|
class="pointer" |
|
|
|
|
> |
|
|
|
|
<i class="fa fa-eye"></i> |
|
|
|
|
</a> |
|
|
|
|
|
|
|
|
|
<label class="gf-form-label width-6" ng-if="analyticUnit.detectorType === 'anomaly'"> Confidence </label> |
|
|
|
|
<input class="gf-form-input width-5" |
|
|
|
|
ng-if="analyticUnit.detectorType === 'anomaly'" |
|
|
|
|
min="0" |
|
|
|
|
type="number" |
|
|
|
|
ng-model="analyticUnit.confidence" |
|
|
|
|
ng-blur="ctrl.onAnalyticUnitChange(analyticUnit)" |
|
|
|
|
/> |
|
|
|
|
<a |
|
|
|
|
ng-if="!analyticUnit.visible" |
|
|
|
|
bs-tooltip="'Show. It`s hidden now.'" |
|
|
|
|
ng-click="ctrl.onToggleVisibility(analyticUnit.id)" |
|
|
|
|
class="pointer" |
|
|
|
|
> |
|
|
|
|
<i class="fa fa-eye-slash"></i> |
|
|
|
|
</a> |
|
|
|
|
</label> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<label class="gf-form-label" ng-if="analyticUnit.status === 'READY' && analyticUnit.visible"> |
|
|
|
|
Inspect |
|
|
|
|
</label> |
|
|
|
|
<div class="gf-form" ng-if="!analyticUnit.selected"> |
|
|
|
|
<a |
|
|
|
|
class="btn btn-danger" |
|
|
|
|
ng-click="ctrl.onRemove(analyticUnit.id)" |
|
|
|
|
> |
|
|
|
|
<i class="fa fa-trash"></i> |
|
|
|
|
</a> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<gf-form-switch ng-if="analyticUnit.status === 'READY' && analyticUnit.visible" |
|
|
|
|
on-change="ctrl.onToggleInspect(analyticUnit.id)" |
|
|
|
|
checked="analyticUnit.inspect" |
|
|
|
|
/> |
|
|
|
|
<div class="gf-form" ng-if="analyticUnit.selected"> |
|
|
|
|
<div class="gf-form-label"> |
|
|
|
|
<a |
|
|
|
|
class="pointer" |
|
|
|
|
ng-click="ctrl.onCancelLabeling(analyticUnit.id)" |
|
|
|
|
> |
|
|
|
|
Cancel |
|
|
|
|
</a> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<label class="gf-form-label" ng-if="analyticUnit.visible"> |
|
|
|
|
HSR |
|
|
|
|
</label> |
|
|
|
|
<div class="gf-form"> |
|
|
|
|
<label> |
|
|
|
|
<i ng-if="analyticUnit.status === 'READY'" class="grafana-tip fa fa-check-circle ng-scope" bs-tooltip="'Ready'"></i> |
|
|
|
|
<i ng-if="analyticUnit.status === 'SUCCESS'" class="grafana-tip fa fa-check ng-scope" bs-tooltip="'Learning succeeded'"></i> |
|
|
|
|
<i ng-if="analyticUnit.status === 'LEARNING'" class="grafana-tip fa fa-leanpub ng-scope" bs-tooltip="'Learning'"></i> |
|
|
|
|
<i ng-if="analyticUnit.status === 'DETECTION'" class="grafana-tip fa fa-search ng-scope" bs-tooltip="'Detection'"></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> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<gf-form-switch ng-if="analyticUnit.visible" |
|
|
|
|
on-change="ctrl.onToggleHSR(analyticUnit.id)" |
|
|
|
|
checked="analyticUnit.showHSR" |
|
|
|
|
/> |
|
|
|
|
<div class="gf-form-inline"> |
|
|
|
|
<div class="gf-form width-20"/> |
|
|
|
|
<!-- TODO: move analytic-unit-specific fields rendering to class --> |
|
|
|
|
<div class="gf-form" ng-if="analyticUnit.detectorType === 'threshold'"> |
|
|
|
|
<label class="gf-form-label width-5"> Condition </label> |
|
|
|
|
<select class="gf-form-input" |
|
|
|
|
ng-class="{ |
|
|
|
|
'width-5': analyticUnit.condition !== 'NO_DATA', |
|
|
|
|
'width-9': analyticUnit.condition === 'NO_DATA' |
|
|
|
|
}" |
|
|
|
|
ng-model="analyticUnit.condition" |
|
|
|
|
ng-options="type for type in ctrl.analyticsController.conditions" |
|
|
|
|
ng-change="ctrl.onAnalyticUnitChange(analyticUnit)" |
|
|
|
|
/> |
|
|
|
|
<input class="gf-form-input width-4" |
|
|
|
|
ng-if="analyticUnit.condition !== 'NO_DATA'" |
|
|
|
|
type="number" |
|
|
|
|
ng-model="analyticUnit.value" |
|
|
|
|
ng-blur="ctrl.onAnalyticUnitChange(analyticUnit)" |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<label class="gf-form-label" ng-hide="analyticUnit.selected"> |
|
|
|
|
<a |
|
|
|
|
ng-if="analyticUnit.visible" |
|
|
|
|
bs-tooltip="'Hide. It`s visible now.'" |
|
|
|
|
ng-click="ctrl.onToggleVisibility(analyticUnit.id)" |
|
|
|
|
class="pointer" |
|
|
|
|
> |
|
|
|
|
<i class="fa fa-eye"></i> |
|
|
|
|
</a> |
|
|
|
|
<div class="gf-form" ng-if="analyticUnit.detectorType === 'anomaly'"> |
|
|
|
|
<label class="gf-form-label width-5"> Alpha </label> |
|
|
|
|
<input class="gf-form-input width-9" |
|
|
|
|
min="0" |
|
|
|
|
max="1" |
|
|
|
|
type="number" |
|
|
|
|
ng-model="analyticUnit.alpha" |
|
|
|
|
ng-blur="ctrl.onAnalyticUnitChange(analyticUnit)" |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<a |
|
|
|
|
ng-if="!analyticUnit.visible" |
|
|
|
|
bs-tooltip="'Show. It`s hidden now.'" |
|
|
|
|
ng-click="ctrl.onToggleVisibility(analyticUnit.id)" |
|
|
|
|
class="pointer" |
|
|
|
|
> |
|
|
|
|
<i class="fa fa-eye-slash"></i> |
|
|
|
|
</a> |
|
|
|
|
</label> |
|
|
|
|
<div class="gf-form" ng-if="analyticUnit.detectorType === 'anomaly'"> |
|
|
|
|
<label class="gf-form-label width-6"> Confidence </label> |
|
|
|
|
<input class="gf-form-input width-5" |
|
|
|
|
min="0" |
|
|
|
|
type="number" |
|
|
|
|
ng-model="analyticUnit.confidence" |
|
|
|
|
ng-blur="ctrl.onAnalyticUnitChange(analyticUnit)" |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div class="gf-form" ng-if="analyticUnit.detectorType === 'anomaly'"> |
|
|
|
|
<!-- TODO: Remove hack with "margin-bottom: 0" --> |
|
|
|
|
<gf-form-switch |
|
|
|
|
class="gf-form" |
|
|
|
|
style="margin-bottom: 0" |
|
|
|
|
label="Seasonality" |
|
|
|
|
label-class="width-7" |
|
|
|
|
on-change="ctrl.onAnalyticUnitChange(analyticUnit)" |
|
|
|
|
checked="analyticUnit.hasSeasonality" |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<label class="gf-form-label" |
|
|
|
|
ng-if="analyticUnit.detectorType === 'threshold' || analyticUnit.detectorType === 'anomaly'" |
|
|
|
|
<div |
|
|
|
|
class="gf-form" |
|
|
|
|
ng-if="analyticUnit.detectorType === 'anomaly' && analyticUnit.hasSeasonality" |
|
|
|
|
> |
|
|
|
|
<a class="pointer" ng-click="ctrl.runDetect(analyticUnit.id)"> |
|
|
|
|
<i class="fa fa-spinner fa-spin" ng-if="analyticUnit.saving"></i> |
|
|
|
|
<b ng-if="!analyticUnit.saving"> Detect </b> |
|
|
|
|
<b ng-if="analyticUnit.saving" ng-disabled="true"> saving... </b> |
|
|
|
|
</a> |
|
|
|
|
</label> |
|
|
|
|
<label class="gf-form-label width-9"> Seasonality Period </label> |
|
|
|
|
<input |
|
|
|
|
type="number" class="gf-form-input width-5" |
|
|
|
|
ng-init="seasonalityValue = analyticUnit.seasonalityPeriod.value" |
|
|
|
|
ng-model="seasonalityValue" |
|
|
|
|
ng-blur="ctrl.onSeasonalityChange(analyticUnit.id, seasonalityValue)" |
|
|
|
|
min="0" |
|
|
|
|
> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<label |
|
|
|
|
class="gf-form-label" |
|
|
|
|
ng-if="analyticUnit.detectorType === 'pattern'" |
|
|
|
|
ng-style="analyticUnit.status === 'LEARNING' && { 'cursor': 'not-allowed' }" |
|
|
|
|
<div class="gf-form" |
|
|
|
|
ng-if=" |
|
|
|
|
analyticUnit.detectorType === 'anomaly' && |
|
|
|
|
analyticUnit.hasSeasonality |
|
|
|
|
" |
|
|
|
|
> |
|
|
|
|
<a class="pointer" tabindex="1" |
|
|
|
|
ng-click="ctrl.onToggleLabelingMode(analyticUnit.id)" |
|
|
|
|
ng-disabled="analyticUnit.status === 'LEARNING'" |
|
|
|
|
<div class="gf-form-select-wrapper"> |
|
|
|
|
<!-- TODO: move periods from ng-options --> |
|
|
|
|
<select class="gf-form-input width-8" |
|
|
|
|
ng-model="analyticUnit.seasonalityPeriod.unit" |
|
|
|
|
ng-change="ctrl.onSeasonalityChange(analyticUnit.id)" |
|
|
|
|
ng-options="type for type in ['seconds', 'minutes', 'hours', 'days', 'years']" |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div class="gf-form-inline"> |
|
|
|
|
<div class="gf-form width-20"/> |
|
|
|
|
<div class="gf-form"> |
|
|
|
|
<button class="btn btn-secondary" |
|
|
|
|
ng-click="ctrl.onAnalyticUnitSave(analyticUnit)" |
|
|
|
|
ng-disabled="!analyticUnit.changed" |
|
|
|
|
> |
|
|
|
|
<i class="fa fa-bar-chart" ng-if="!analyticUnit.saving"></i> |
|
|
|
|
<i class="fa fa-spinner fa-spin" ng-if="analyticUnit.saving"></i> |
|
|
|
|
<b ng-if="!analyticUnit.saving"> Save </b> |
|
|
|
|
<b ng-if="analyticUnit.saving" ng-disabled="true"> saving... </b> |
|
|
|
|
</a> |
|
|
|
|
</label> |
|
|
|
|
|
|
|
|
|
<select class="gf-form-input width-12" |
|
|
|
|
ng-model="ctrl.analyticsController.labelingMode" |
|
|
|
|
ng-options="type.value as type.name for type in [ |
|
|
|
|
{ name:'Label Positive', value: 'LABELING' }, |
|
|
|
|
{ name:'Label Negative', value: 'DELETING' }, |
|
|
|
|
{ name:'Unlabel', value: 'UNLABELING' } |
|
|
|
|
]" |
|
|
|
|
ng-if="analyticUnit.selected && !analyticUnit.saving" |
|
|
|
|
ng-disabled="analyticUnit.status === 'LEARNING'" |
|
|
|
|
/> |
|
|
|
|
</button> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<label class="gf-form-label"> |
|
|
|
|
<a |
|
|
|
|
ng-if="!analyticUnit.selected" |
|
|
|
|
ng-click="ctrl.onRemove(analyticUnit.id)" |
|
|
|
|
class="pointer" |
|
|
|
|
<!-- TODO: Leave one Detect button instead of 2 --> |
|
|
|
|
<div class="gf-form" |
|
|
|
|
ng-if=" |
|
|
|
|
analyticUnit.detectorType === 'pattern' || |
|
|
|
|
(analyticUnit.detectorType === 'anomaly' && analyticUnit.hasSeasonality) |
|
|
|
|
" |
|
|
|
|
> |
|
|
|
|
<button class="btn btn-secondary" |
|
|
|
|
ng-click="ctrl.onToggleLabelingMode(analyticUnit.id)" |
|
|
|
|
ng-disabled="analyticUnit.status === 'LEARNING' || analyticUnit.saving || analyticUnit.changed || !analyticUnit.selected" |
|
|
|
|
> |
|
|
|
|
<i class="fa fa-trash"></i> |
|
|
|
|
</a> |
|
|
|
|
<b> Detect </b> |
|
|
|
|
</button> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<a |
|
|
|
|
ng-if="analyticUnit.selected" |
|
|
|
|
ng-click="ctrl.onCancelLabeling(analyticUnit.id)" |
|
|
|
|
class="pointer" |
|
|
|
|
<div class="gf-form" |
|
|
|
|
ng-if=" |
|
|
|
|
analyticUnit.detectorType === 'threshold' || |
|
|
|
|
(analyticUnit.detectorType === 'anomaly' && !analyticUnit.hasSeasonality) |
|
|
|
|
" |
|
|
|
|
> |
|
|
|
|
<button class="btn btn-secondary" |
|
|
|
|
ng-click="ctrl.runDetectInCurrentRange(analyticUnit.id)" |
|
|
|
|
ng-disabled="analyticUnit.status === 'LEARNING' || analyticUnit.saving || analyticUnit.changed" |
|
|
|
|
> |
|
|
|
|
<i class="fa fa-ban"></i> |
|
|
|
|
</a> |
|
|
|
|
</label> |
|
|
|
|
|
|
|
|
|
<label> |
|
|
|
|
<i ng-if="analyticUnit.status === 'READY'" class="grafana-tip fa fa-check-circle ng-scope" bs-tooltip="'Ready'"></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> |
|
|
|
|
<b> Detect </b> |
|
|
|
|
</button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div class="editor-row" ng-if="ctrl.analyticsController.creatingNew"> |
|
|
|
|
<div class="gf-form-inline" ng-if="ctrl.analyticsController.creatingNew"> |
|
|
|
|
<div class="gf-form"> |
|
|
|
|
<label class="gf-form-label width-4"> Name </label> |
|
|
|
|
<label class="gf-form-label width-5"> Name </label> |
|
|
|
|
<input |
|
|
|
|
type="text" class="gf-form-input max-width-15" |
|
|
|
|
type="text" class="gf-form-input width-15" |
|
|
|
|
ng-model="ctrl.analyticsController.newAnalyticUnit.name" |
|
|
|
|
> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div class="gf-form"> |
|
|
|
|
<label class="gf-form-label width-8"> Detector Type </label> |
|
|
|
|
<div class="gf-form-select-wrapper"> |
|
|
|
|
<select class="gf-form-input width-10" |
|
|
|
|
<select class="gf-form-input width-8" |
|
|
|
|
ng-model="ctrl.analyticsController.newAnalyticUnit.detectorType" |
|
|
|
|
ng-options="analyticUnitDetectorType for analyticUnitDetectorType in ctrl.analyticUnitDetectorTypes" |
|
|
|
|
ng-change="ctrl.analyticsController.onAnalyticUnitDetectorChange(ctrl.analyticUnitTypes);" |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<label class="gf-form-label width-8"> Type </label> |
|
|
|
|
<div class="gf-form"> |
|
|
|
|
<label class="gf-form-label width-5"> Type </label> |
|
|
|
|
<div class="gf-form-select-wrapper"> |
|
|
|
|
<select class="gf-form-input width-10" |
|
|
|
|
<select class="gf-form-input width-9" |
|
|
|
|
ng-model="ctrl.analyticsController.newAnalyticUnit.type" |
|
|
|
|
ng-options=" |
|
|
|
|
type.value as type.name |
|
|
|
@ -234,23 +320,33 @@
|
|
|
|
|
" |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<label class="gf-form-label"> |
|
|
|
|
<a class="pointer" tabindex="1" ng-click="ctrl.saveNew()"> |
|
|
|
|
<b ng-if="!ctrl.analyticsController.saving"> create </b> |
|
|
|
|
<b ng-if="ctrl.analyticsController.saving" ng-disabled="true"> saving... </b> |
|
|
|
|
</a> |
|
|
|
|
</label> |
|
|
|
|
<div class="gf-form"> |
|
|
|
|
<a class="btn btn-danger" ng-click="ctrl.cancelCreation()"> |
|
|
|
|
<b> Cancel </b> |
|
|
|
|
</a> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div class="gf-form"> |
|
|
|
|
<a class="btn btn-secondary" ng-click="ctrl.saveNew()"> |
|
|
|
|
<b ng-if="!ctrl.analyticsController.saving"> Create </b> |
|
|
|
|
<b ng-if="ctrl.analyticsController.saving" ng-disabled="true"> Saving... </b> |
|
|
|
|
</a> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div class="gf-form-button-row" ng-if="!ctrl.analyticsController.creatingAnalyticUnit"> |
|
|
|
|
<button class="btn btn-inverse width-12" ng-click="ctrl.createNew()"> |
|
|
|
|
<div class="gf-form-button-row"> |
|
|
|
|
<button |
|
|
|
|
class="btn btn-secondary width-12" |
|
|
|
|
ng-click="ctrl.createNew()" |
|
|
|
|
ng-disabled="ctrl.analyticsController.creatingNew" |
|
|
|
|
> |
|
|
|
|
<i class="fa fa-plus"></i> |
|
|
|
|
Add Analytic Unit |
|
|
|
|
</button> |
|
|
|
|
</div> |
|
|
|
|
<div class="gf-form-button-row"> |
|
|
|
|
<div class="gf-form-button-row" ng-if="ctrl.analyticsController.analyticUnits.length > 0"> |
|
|
|
|
<button class="gf-form-label width-12 pointer" ng-click="ctrl.redetectAll()"> |
|
|
|
|
Re-detect all analytic units |
|
|
|
|
</button> |
|
|
|
|