rozetko
4 years ago
committed by
GitHub
9 changed files with 291 additions and 14 deletions
@ -0,0 +1,148 @@
|
||||
<div class="section gf-form-group"> |
||||
<div class="gf-form"> |
||||
<label class="gf-form-label query-keyword"> |
||||
Name |
||||
</label> |
||||
<input |
||||
type="text" class="gf-form-input" |
||||
ng-model="analyticUnit.name" |
||||
ng-blur="ctrl.onAnalyticUnitChange(analyticUnit)" |
||||
> |
||||
</div> |
||||
<div class="gf-form"> |
||||
<label class="gf-form-label query-keyword"> Type </label> |
||||
<div class="gf-form-select-wrapper"> |
||||
<select class="gf-form-input" |
||||
ng-model="analyticUnit.type" |
||||
ng-options="type.value as type.name for type in ctrl.analyticUnitTypes[analyticUnit.detectorType]" |
||||
ng-disabled="true" |
||||
/> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="section gf-form-group"> |
||||
<div class="gf-form"> |
||||
<label class="gf-form-label query-keyword"> Positive Color </label> |
||||
<label class="gf-form-label"> |
||||
<color-picker |
||||
color="analyticUnit.labeledColor" |
||||
onChange="ctrl.onColorChange.bind(ctrl, analyticUnit.id, false)" |
||||
/> |
||||
</label> |
||||
</div> |
||||
|
||||
<div class="gf-form" |
||||
ng-if="analyticUnit.detectorType === 'pattern' || analyticUnit.detectorType === 'anomaly'" |
||||
> |
||||
<label class="gf-form-label query-keyword"> Negative Color </label> |
||||
<label class="gf-form-label"> |
||||
<color-picker |
||||
color="analyticUnit.deletedColor" |
||||
onChange="ctrl.onColorChange.bind(ctrl, analyticUnit.id, true)" |
||||
/> |
||||
</label> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="section gf-form-group" ng-if="analyticUnit.detectorType === 'threshold'"> |
||||
<!-- TODO: move analytic-unit-specific fields rendering to class --> |
||||
<div class="gf-form"> |
||||
<label class="gf-form-label query-keyword"> 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" |
||||
ng-if="analyticUnit.condition !== 'NO_DATA'" |
||||
type="number" |
||||
ng-model="analyticUnit.value" |
||||
ng-blur="ctrl.onAnalyticUnitChange(analyticUnit)" |
||||
/> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="section gf-form-group" ng-if="analyticUnit.detectorType === 'anomaly'"> |
||||
<div class="gf-form"> |
||||
<label class="gf-form-label query-keyword"> |
||||
Alpha |
||||
|
||||
<i class="fa fa-info" bs-tooltip="'Takes value from 0 to 1. Less Alpha means smoother bounds'"></i> |
||||
</label> |
||||
<input class="gf-form-input" |
||||
min="0" |
||||
max="1" |
||||
type="number" |
||||
ng-model="analyticUnit.alpha" |
||||
ng-blur="ctrl.onAnalyticUnitChange(analyticUnit)" |
||||
/> |
||||
</div> |
||||
|
||||
<div class="gf-form"> |
||||
<label class="gf-form-label query-keyword"> |
||||
Сonfidence |
||||
|
||||
<i class="fa fa-info" bs-tooltip="'Bounds for the metric'"></i> |
||||
</label> |
||||
<input class="gf-form-input" |
||||
min="0" |
||||
type="number" |
||||
ng-model="analyticUnit.confidence" |
||||
ng-blur="ctrl.onAnalyticUnitChange(analyticUnit)" |
||||
/> |
||||
</div> |
||||
|
||||
</div> |
||||
|
||||
<div class="section gf-form-group" ng-if="analyticUnit.detectorType === 'anomaly'"> |
||||
<div class="gf-form"> |
||||
<gf-form-switch |
||||
class="gf-form" |
||||
label="Seasonality" |
||||
label-class="query-keyword" |
||||
on-change="ctrl.onAnalyticUnitChange(analyticUnit)" |
||||
checked="analyticUnit.hasSeasonality" |
||||
/> |
||||
</div> |
||||
|
||||
<div class="gf-form" ng-if="analyticUnit.hasSeasonality"> |
||||
<label class="gf-form-label query-keyword"> Seasonality Period </label> |
||||
<input |
||||
type="number" class="gf-form-input" |
||||
ng-init="seasonalityValue = analyticUnit.seasonalityPeriod.value" |
||||
ng-model="seasonalityValue" |
||||
ng-blur="ctrl.onSeasonalityChange(analyticUnit.id, seasonalityValue)" |
||||
min="0" |
||||
> |
||||
</div> |
||||
|
||||
<div class="gf-form" ng-if="analyticUnit.hasSeasonality"> |
||||
<div class="gf-form-select-wrapper"> |
||||
<!-- TODO: move periods from ng-options --> |
||||
<select class="gf-form-input" |
||||
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="section gf-form-group" ng-if="analyticUnit.detectorType === 'anomaly'"> |
||||
<div class="gf-form"> |
||||
<label class="gf-form-label query-keyword"> Enabled bounds </label> |
||||
<div class="gf-form-select-wrapper"> |
||||
<select class="gf-form-input" |
||||
ng-model="analyticUnit.enableBounds" |
||||
ng-change="ctrl.onAnalyticUnitChange(analyticUnit)" |
||||
ng-options="bound.value as bound.name for bound in ctrl.boundTypes" |
||||
/> |
||||
</div> |
||||
</div> |
||||
</div> |
@ -0,0 +1,106 @@
|
||||
<div class="query-editor-row" ng-repeat="analyticUnit in ctrl.analyticsController.analyticUnits"> |
||||
<div class="query-editor-row__header"> |
||||
<div class="query-editor-row__ref-id" ng-click="ctrl.onToggleCollapsed(analyticUnit.id)"> |
||||
<i class="fa fa-fw fa-caret-down" ng-hide="analyticUnit.collapsed"></i> |
||||
<i class="fa fa-fw fa-caret-right" ng-show="analyticUnit.collapsed"></i> |
||||
<span>{{analyticUnit.name}}</span> |
||||
<em class="query-editor-row__context-info">({{analyticUnit.id}})</em> |
||||
</div> |
||||
<div |
||||
class="query-editor-row__collapsed-text" |
||||
style="line-height: 0px;" |
||||
> |
||||
|
||||
<i ng-if="analyticUnit.status === 'READY'" |
||||
class="fa fa-fw fa-check-circle" |
||||
bs-tooltip="'Ready'" |
||||
></i> |
||||
<i ng-if="analyticUnit.status === 'SUCCESS'" |
||||
class="fa fa-fw fa-check" |
||||
bs-tooltip="'Learning succeeded'" |
||||
></i> |
||||
<i ng-if="analyticUnit.status === 'LEARNING'" |
||||
class="fa fa-fw fa-leanpub" |
||||
bs-tooltip="'Learning'" |
||||
></i> |
||||
<i ng-if="analyticUnit.status === 'DETECTION'" |
||||
class="fa fa-fw fa-search" |
||||
bs-tooltip="'Detection'" |
||||
></i> |
||||
<i ng-if="analyticUnit.status === 'PENDING'" |
||||
class="fa fa-fw fa-list-ul" |
||||
bs-tooltip="'Pending'" |
||||
></i> |
||||
<i ng-if="analyticUnit.status === 'FAILED'" |
||||
class="fa fa-fw fa-exclamation-circle" |
||||
bs-tooltip="'Error: ' + analyticUnit.error" |
||||
></i> |
||||
</div> |
||||
</div> |
||||
|
||||
<div |
||||
class="gf-form-query" |
||||
ng-class="analyticUnit.collapsed && 'query-editor-row__body--collapsed'" |
||||
> |
||||
<div class="query-editor-row__header"> |
||||
<button class="query-editor-row__action" ng-click=ctrl.onToggleVisibility(analyticUnit.id)> |
||||
<a ng-if="analyticUnit.visible" bs-tooltip="'Hide. It`s visible now.'" class="pointer"> |
||||
<i class="fa fa-fw fa-eye"></i> |
||||
</a> |
||||
<a ng-if="!analyticUnit.visible" bs-tooltip="'Show. It`s hidden now.'" class="pointer"> |
||||
<i class="fa fa-fw fa-eye-slash"></i> |
||||
</a> |
||||
</button> |
||||
|
||||
<button class="query-editor-row__action" ng-click="ctrl.onToggleInspect(analyticUnit.id)" bs-tooltip="'Inspect Mode'"> |
||||
<a class="pointer"> |
||||
<!--use ctrl.pluginPath--> |
||||
<img src="public/plugins/corpglory-hastic-app/img/inspect_enabled.svg" class="fa fa-fw" |
||||
ng-if="analyticUnit.inspect"></img> |
||||
<img src="public/plugins/corpglory-hastic-app/img/inspect_disabled.svg" class="fa fa-fw" |
||||
ng-if="!analyticUnit.inspect"></img> |
||||
</a> |
||||
</button> |
||||
|
||||
<button class="query-editor-row__action" ng-click="ctrl.onRemove(analyticUnit.id)" bs-tooltip="'Delete'"> |
||||
<a class="pointer"> |
||||
<i class="fa fa-fw fa-trash"></i> |
||||
</a> |
||||
</button> |
||||
|
||||
<button class="query-editor-row__action" ng-if=" |
||||
(analyticUnit.detectorType === 'pattern' || |
||||
(analyticUnit.detectorType === 'anomaly' && analyticUnit.hasSeasonality)) && |
||||
!analyticUnit.selected" bs-tooltip="'Label'"> |
||||
<a class="pointer" ng-style="analyticUnit.status === 'LEARNING' && { 'cursor': 'not-allowed' }" |
||||
ng-click="ctrl.onToggleLabelingMode(analyticUnit.id)" ng-disabled="analyticUnit.status === 'LEARNING'"> |
||||
<i class="fa fa-fw fa-bar-chart" ng-if="!analyticUnit.saving"></i> |
||||
<i class="fa fa-fw fa-spinner fa-spin" ng-if="analyticUnit.saving"></i> |
||||
Label |
||||
</a> |
||||
</button> |
||||
|
||||
<select class="gf-form-input width-11" 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'" /> |
||||
|
||||
<button class="query-editor-row__action" ng-if="analyticUnit.selected && !analyticUnit.saving" |
||||
bs-tooltip="'Cancel labeling'"> |
||||
<a class="pointer" ng-click="ctrl.onCancelLabeling(analyticUnit.id)"> |
||||
<i class="fa fa-fw fa-ban"></i> |
||||
</a> |
||||
</button> |
||||
|
||||
<button class="query-editor-row__action" ng-click="ctrl.runDetectInCurrentRange(analyticUnit)" |
||||
ng-disabled="analyticUnit.saving" bs-tooltip="'Learn & Detect'"> |
||||
<a class="pointer"> |
||||
Apply |
||||
</a> |
||||
</button> |
||||
</div> |
||||
<div class="query-editor-row__body"> |
||||
<ng-include src="ctrl.partialsPath + '/analytic_unit_7.x.html'"></ng-include> |
||||
</div> |
||||
</div> |
||||
</div> |
@ -0,0 +1,14 @@
|
||||
<div class="query-editor-row"> |
||||
<div class="query-editor-row__header"> |
||||
<div class="query-editor-row__ref-id width-25" style="cursor: default;"> |
||||
<span>New analytic unit</span> |
||||
</div> |
||||
|
||||
<div class="query-editor-row__collapsed-text"> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="query-editor-row__body gf-form-query"> |
||||
<ng-include src="ctrl.partialsPath + '/new_analytic_unit.html'"></ng-include> |
||||
</div> |
||||
</div> |
Loading…
Reference in new issue