|
|
@ -1,148 +1,160 @@ |
|
|
|
<h5> Analytic Units </h5> |
|
|
|
<div class="gf-form-button-row" ng-if="ctrl.analyticsController.serverStatus === false"> |
|
|
|
<div class="editor-row"> |
|
|
|
<h5>Hastic server at "{{ctrl.backendURL}}" is not available</h5> |
|
|
|
<div class="gf-form" ng-repeat="analyticUnit in ctrl.analyticsController.analyticUnits"> |
|
|
|
<button class="btn btn-inverse" ng-click="ctrl.runBackendConnectivityCheck()"> |
|
|
|
|
|
|
|
<i class="fa fa-plug"></i> |
|
|
|
<label class="gf-form-label width-4"> Name </label> |
|
|
|
Reconnect to Hastic server |
|
|
|
<input |
|
|
|
</button> |
|
|
|
type="text" class="gf-form-input max-width-15" |
|
|
|
</div> |
|
|
|
ng-model="analyticUnit.name" |
|
|
|
|
|
|
|
ng-disabled="true" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<label class="gf-form-label width-8"> Type </label> |
|
|
|
|
|
|
|
<div class="gf-form-select-wrapper"> |
|
|
|
|
|
|
|
<select class="gf-form-input width-12" |
|
|
|
|
|
|
|
ng-model="analyticUnit.type" |
|
|
|
|
|
|
|
ng-options="type.value as type.name for type in ctrl.panel.analyticUnitTypes" |
|
|
|
|
|
|
|
ng-disabled="true" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- |
|
|
|
<div ng-if="ctrl.analyticsController.serverStatus === true"> |
|
|
|
<label class="gf-form-label width-6"> Confidence </label> |
|
|
|
<h5> Analytic Units </h5> |
|
|
|
<input |
|
|
|
<div class="editor-row"> |
|
|
|
type="number" class="gf-form-input width-5 ng-valid ng-scope ng-empty ng-dirty ng-valid-number ng-touched" |
|
|
|
<div class="gf-form" ng-repeat="analyticUnit in ctrl.analyticsController.analyticUnits"> |
|
|
|
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="" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
--> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<label class="gf-form-label width-6"> Color </label> |
|
|
|
|
|
|
|
<span class="gf-form-label"> |
|
|
|
|
|
|
|
<color-picker |
|
|
|
|
|
|
|
color="analyticUnit.color" |
|
|
|
|
|
|
|
onChange="ctrl.onColorChange.bind(ctrl, analyticUnit.id)" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</span> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<label class="gf-form-label" ng-style="analyticUnit.status === 'LEARNING' && { 'cursor': 'not-allowed' }"> |
|
|
|
<label class="gf-form-label width-4"> Name </label> |
|
|
|
<a class="pointer" tabindex="1" |
|
|
|
<input |
|
|
|
ng-click="ctrl.onToggleLabelingMode(analyticUnit.id)" |
|
|
|
type="text" class="gf-form-input max-width-15" |
|
|
|
ng-disabled="analyticUnit.status === 'LEARNING'" |
|
|
|
ng-model="analyticUnit.name" |
|
|
|
> |
|
|
|
ng-disabled="true" |
|
|
|
<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.selected && !analyticUnit.deleteMode && !analyticUnit.saving"> labeling </b> |
|
|
|
|
|
|
|
<b ng-if="analyticUnit.selected && analyticUnit.deleteMode && !analyticUnit.saving"> deleting </b> |
|
|
|
|
|
|
|
<b ng-if="analyticUnit.saving" ng-disabled="true"> saving... </b> |
|
|
|
|
|
|
|
</a> |
|
|
|
|
|
|
|
</label> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <label class="gf-form-label"> Alerts: </label> |
|
|
|
|
|
|
|
<label |
|
|
|
|
|
|
|
class="gf-form-label text-center" |
|
|
|
|
|
|
|
style="width: 4rem" |
|
|
|
|
|
|
|
ng-if="analyticUnit.alertEnabled === undefined" |
|
|
|
|
|
|
|
bs-tooltip="'Alarting status isn`t available. Wait please.'" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<i class="fa fa-spinner fa-spin"></i> |
|
|
|
|
|
|
|
</label> --> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<gf-form-switch |
|
|
|
|
|
|
|
ng-if="analyticUnit.alertEnabled !== undefined" |
|
|
|
|
|
|
|
on-change="ctrl.onAnomalyAlertChange(analyticUnit)" |
|
|
|
|
|
|
|
checked="analyticUnit.alertEnabled" |
|
|
|
|
|
|
|
style="height: 36px;" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<label class="gf-form-label"> |
|
|
|
|
|
|
|
<a |
|
|
|
|
|
|
|
ng-if="analyticUnit.visible" |
|
|
|
|
|
|
|
ng-disabled="analyticUnit.selected" |
|
|
|
|
|
|
|
bs-tooltip="'Hide. It`s visible now.'" |
|
|
|
|
|
|
|
ng-click="ctrl.onToggleVisibility(analyticUnit.id)" |
|
|
|
|
|
|
|
class="pointer" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<i class="fa fa-eye"></i> |
|
|
|
|
|
|
|
</a> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a |
|
|
|
|
|
|
|
ng-if="!analyticUnit.visible" |
|
|
|
|
|
|
|
ng-disabled="analyticUnit.selected" |
|
|
|
|
|
|
|
bs-tooltip="'Show. It`s hidden now.'" |
|
|
|
|
|
|
|
ng-click="ctrl.onToggleVisibility(analyticUnit.id)" |
|
|
|
|
|
|
|
class="pointer" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<i class="fa fa-eye-slash"></i> |
|
|
|
|
|
|
|
</a> |
|
|
|
|
|
|
|
</label> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<label class="gf-form-label"> |
|
|
|
|
|
|
|
<a |
|
|
|
|
|
|
|
ng-if="!analyticUnit.selected" |
|
|
|
|
|
|
|
ng-click="ctrl.onRemove(analyticUnit.id)" |
|
|
|
|
|
|
|
class="pointer" |
|
|
|
|
|
|
|
> |
|
|
|
> |
|
|
|
<i class="fa fa-trash"></i> |
|
|
|
|
|
|
|
</a> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a |
|
|
|
<label class="gf-form-label width-8"> Type </label> |
|
|
|
ng-if="analyticUnit.selected" |
|
|
|
<div class="gf-form-select-wrapper"> |
|
|
|
ng-click="ctrl.onCancelLabeling(analyticUnit.id)" |
|
|
|
<select class="gf-form-input width-12" |
|
|
|
class="pointer" |
|
|
|
ng-model="analyticUnit.type" |
|
|
|
|
|
|
|
ng-options="type.value as type.name for type in ctrl.panel.analyticUnitTypes" |
|
|
|
|
|
|
|
ng-disabled="true" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</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="" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
--> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<label class="gf-form-label width-6"> Color </label> |
|
|
|
|
|
|
|
<span class="gf-form-label"> |
|
|
|
|
|
|
|
<color-picker |
|
|
|
|
|
|
|
color="analyticUnit.color" |
|
|
|
|
|
|
|
onChange="ctrl.onColorChange.bind(ctrl, analyticUnit.id)" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</span> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<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'" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<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.selected && !analyticUnit.deleteMode && !analyticUnit.saving"> labeling </b> |
|
|
|
|
|
|
|
<b ng-if="analyticUnit.selected && analyticUnit.deleteMode && !analyticUnit.saving"> deleting </b> |
|
|
|
|
|
|
|
<b ng-if="analyticUnit.saving" ng-disabled="true"> saving... </b> |
|
|
|
|
|
|
|
</a> |
|
|
|
|
|
|
|
</label> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <label class="gf-form-label"> Alerts: </label> |
|
|
|
|
|
|
|
<label |
|
|
|
|
|
|
|
class="gf-form-label text-center" |
|
|
|
|
|
|
|
style="width: 4rem" |
|
|
|
|
|
|
|
ng-if="analyticUnit.alertEnabled === undefined" |
|
|
|
|
|
|
|
bs-tooltip="'Alarting status isn`t available. Wait please.'" |
|
|
|
> |
|
|
|
> |
|
|
|
<i class="fa fa-ban"></i> |
|
|
|
<i class="fa fa-spinner fa-spin"></i> |
|
|
|
</a> |
|
|
|
</label> --> |
|
|
|
</label> |
|
|
|
|
|
|
|
|
|
|
|
<gf-form-switch |
|
|
|
|
|
|
|
ng-if="analyticUnit.alertEnabled !== undefined" |
|
|
|
|
|
|
|
on-change="ctrl.onAnomalyAlertChange(analyticUnit)" |
|
|
|
|
|
|
|
checked="analyticUnit.alertEnabled" |
|
|
|
|
|
|
|
style="height: 36px;" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
<label> |
|
|
|
<label class="gf-form-label"> |
|
|
|
<i ng-if="analyticUnit.status === 'LEARNING'" class="grafana-tip fa fa-leanpub ng-scope" bs-tooltip="'Learning'"></i> |
|
|
|
<a |
|
|
|
<i ng-if="analyticUnit.status === 'PENDING'" class="grafana-tip fa fa-list-ul ng-scope" bs-tooltip="'Pending'"></i> |
|
|
|
ng-if="analyticUnit.visible" |
|
|
|
<i ng-if="analyticUnit.status === 'FAILED'" class="grafana-tip fa fa-exclamation-circle ng-scope" bs-tooltip="'Error: ' + analyticUnit.error"></i> |
|
|
|
ng-disabled="analyticUnit.selected" |
|
|
|
</label> |
|
|
|
bs-tooltip="'Hide. It`s visible now.'" |
|
|
|
|
|
|
|
ng-click="ctrl.onToggleVisibility(analyticUnit.id)" |
|
|
|
|
|
|
|
class="pointer" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<i class="fa fa-eye"></i> |
|
|
|
|
|
|
|
</a> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a |
|
|
|
|
|
|
|
ng-if="!analyticUnit.visible" |
|
|
|
|
|
|
|
ng-disabled="analyticUnit.selected" |
|
|
|
|
|
|
|
bs-tooltip="'Show. It`s hidden now.'" |
|
|
|
|
|
|
|
ng-click="ctrl.onToggleVisibility(analyticUnit.id)" |
|
|
|
|
|
|
|
class="pointer" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<i class="fa fa-eye-slash"></i> |
|
|
|
|
|
|
|
</a> |
|
|
|
|
|
|
|
</label> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<label class="gf-form-label"> |
|
|
|
|
|
|
|
<a |
|
|
|
|
|
|
|
ng-if="!analyticUnit.selected" |
|
|
|
|
|
|
|
ng-click="ctrl.onRemove(analyticUnit.id)" |
|
|
|
|
|
|
|
class="pointer" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<i class="fa fa-trash"></i> |
|
|
|
|
|
|
|
</a> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<a |
|
|
|
|
|
|
|
ng-if="analyticUnit.selected" |
|
|
|
|
|
|
|
ng-click="ctrl.onCancelLabeling(analyticUnit.id)" |
|
|
|
|
|
|
|
class="pointer" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<i class="fa fa-ban"></i> |
|
|
|
|
|
|
|
</a> |
|
|
|
|
|
|
|
</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> |
|
|
|
|
|
|
|
</label> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="editor-row" ng-if="ctrl.analyticsController.creatingNew"> |
|
|
|
<div class="editor-row" ng-if="ctrl.analyticsController.creatingNew"> |
|
|
|
<div class="gf-form"> |
|
|
|
<div class="gf-form"> |
|
|
|
<label class="gf-form-label width-4"> Name </label> |
|
|
|
<label class="gf-form-label width-4"> Name </label> |
|
|
|
<input |
|
|
|
<input |
|
|
|
type="text" class="gf-form-input max-width-15" |
|
|
|
type="text" class="gf-form-input max-width-15" |
|
|
|
ng-model="ctrl.analyticsController.newAnalyticUnit.name" |
|
|
|
ng-model="ctrl.analyticsController.newAnalyticUnit.name" |
|
|
|
> |
|
|
|
> |
|
|
|
|
|
|
|
|
|
|
|
<label class="gf-form-label width-8"> Type </label> |
|
|
|
<label class="gf-form-label width-8"> Type </label> |
|
|
|
<div class="gf-form-select-wrapper"> |
|
|
|
<div class="gf-form-select-wrapper"> |
|
|
|
<select class="gf-form-input width-12" |
|
|
|
<select class="gf-form-input width-12" |
|
|
|
ng-model="ctrl.analyticsController.newAnalyticUnit.type" |
|
|
|
ng-model="ctrl.analyticsController.newAnalyticUnit.type" |
|
|
|
ng-options="type.value as type.name for type in ctrl.panel.analyticUnitTypes" |
|
|
|
ng-options="type.value as type.name for type in ctrl.panel.analyticUnitTypes" |
|
|
|
/> |
|
|
|
/> |
|
|
|
|
|
|
|
</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> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="gf-form-button-row" ng-if="!ctrl.analyticsController.creatingAnalyticUnit"> |
|
|
|
|
|
|
|
<button class="btn btn-inverse" ng-click="ctrl.createNew()"> |
|
|
|
|
|
|
|
<i class="fa fa-plus"></i> |
|
|
|
|
|
|
|
Add Analytic Unit |
|
|
|
|
|
|
|
</button> |
|
|
|
|
|
|
|
|
|
|
|
<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> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="gf-form-button-row" ng-if="!ctrl.analyticsController.creatingAnalyticUnit"> |
|
|
|
|
|
|
|
<button class="btn btn-inverse" ng-click="ctrl.createNew()"> |
|
|
|
|
|
|
|
<i class="fa fa-plus"></i> |
|
|
|
|
|
|
|
Add Analytic Unit |
|
|
|
|
|
|
|
</button> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|