blob: 59ed6080c48be2cce9414c9ca3d92a84882500ab [file] [log] [blame]
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<div class="container-fluid">
<div class="row">
<h5 class="over-title margin-bottom-15">Create DQ Model</h5>
</div><!--//row-->
<div class="row">
<form name="Form" id="form" novalidate>
<div id="wizard" class="swMain" >
<ul>
<li ng-click="form.goTo(Form, 1)">
<a href="" ng-class="{'selected' : currentStep >= 1, 'done' : currentStep > 1}" class="selected" style="">
<div class="stepNumber">
1
</div>
<span class="stepDesc text-small"> Choose Target </span>
</a>
</li>
<li ng-click="form.goTo(Form, 2)">
<a href="" ng-class="{'selected' : currentStep >= 2, 'done' : currentStep > 2}" class="" style="">
<div class="stepNumber">
2
</div>
<span class="stepDesc text-small"> Select Models </span>
</a>
</li>
<li ng-click="form.goTo(Form, 3)">
<a href="" ng-class="{'selected' : currentStep >= 3, 'done' : currentStep > 3}" class="" style="">
<div class="stepNumber">
3
</div>
<span class="stepDesc text-small"> Configuration </span>
</a>
</li>
</ul>
<div id="step-1" ng-show="currentStep == 1" class="formStep" >
<label class="stepDesc">This step let you choose the target for data quality model, Apollo datasets are enabled, other platofrms are coming soon. </label>
<div class="container-fluid">
<!-- select db tree -->
<div class="col-md-4 col-lg-4 col-sm-4">
<fieldset>
<legend>Please select schema</legend>
<div class="add-dataset" style="color:#b2c831">
<a class="bark-link" href="#/createdataasset">Cannot find your DataAsset? Click here to add</a>
</div>
<div angular-treeview="true"
tree-model="dbList"
node-id="id"
node-label="name"
node-children="children"
l1-icon="fa fa-database"
l2-icon="fa fa-table"
l3-icon="fa fa-file-text-o"
class="y-scrollable">
</div>
</fieldset>
</div>
<!-- schema definition list -->
<div class="col-md-8 col-lg-8 col-sm-8">
<fieldset>
<legend>
<!-- Select one attribute -->
Schema definition
</legend>
<div class="y-scrollable">
<div>
<label>View schema:</label> <i ng-show="currentNode.parent" style="color:#fff;font-weight: bold;">{{currentNode.parent.name}}.{{currentNode.name}}</i>
</div>
<!-- <div>
<label>Selected Column:</label> <i style="color:#fff;font-weight: bold;">{{form.selection}}</i>
</div> -->
<div>
<table st-table="schemaCollection" class="table table-striped">
<thead>
<tr style="background-color:#7D95CC">
<!-- <th></th> -->
<th>Column Name</th>
<th>Description</th>
<th>Data Type</th>
<th>Sample Data</th>
</tr>
</thead>
<tbody>
<tr ng-if="!schemaCollection || schemaCollection.length == 0">
<td colspan="5" style="text-align:center" ><span class="highlight">Please select a schema from the left tree first</span></td>
</tr>
<tr ng-repeat="row in schemaCollection">
<!-- <td><input type="radio"
name="selAttr"
value="{{row.name}}"
ng-model="form.selection"
/>
</td> -->
<td>{{row.name}}</td>
<td>{{row.desc}}</td>
<td>{{row.type}}</td>
<td class="highlight">{{row.sample}}</td>
</tr>
</tbody>
</table>
</div>
<div style="color:#b2c831">
<p ng-show="currentNode.parent">
<i class="fa fa-info-circle"></i> Total Count of this schema will be applied to the machine learning algorithm
</p>
</div>
</div>
</fieldset>
</div>
<div class="form-group btn-container">
<button class="btn btn-primary btn-o next-step btn-wide pull-right" ng-click="form.next(Form)">
Next <i class="fa fa-arrow-circle-right"></i>
</button>
</div>
</div>
</div>
<div id="step-2" ng-show="currentStep == 2" class="formStep" >
<label class="stepDesc">Please choose one of the statistical techniques provided below for automatically detecting anomalies:</label>
<div class="container-fluid">
<div class="col-md-12 col-lg-12 col-sm-12">
<fieldset>
<!-- <legend>
Map the fields
</legend> -->
<div class="y-scrollable">
<div class="container col-md-12 col-lg-12 col-sm-12">
<div class="row">
<div class="col-md-6 col-lg-6 col-sm-6">
<h5>
<input name="anType" type="radio" ng-model="form.anType" value="1" ng-init="form.anType=1" style="width:1em;height:1em;"/>
<span>History Trend Detection</span>
</h5>
<label style="color:#fff;">This is a method of evaluating two or more measured events to comparison the results at one time period with those from another time period (or series of time periods), on an yearly, monthly, weekly, daily or hourly basis. Currently weekly comparision is supported.</label>
</div>
<div class="col-md-6 col-lg-6 col-sm-6">
<div class="container-fluid">
<!-- <p>Here's an example for Year over Year difference calculation</p> -->
<img src="/img/yoy.png" style="max-height: 200px;width:100%"/>
</div>
</div>
</div>
<br/>
<div class="row">
<div class="col-md-6 col-lg-6 col-sm-6">
<h5>
<input name="anType" type="radio" ng-model="form.anType" value="3" style="width:1em;height:1em;"/>
<span>Deviation Detection(Based on MAD)</span>
</h5>
<label style="color:#fff;">Deviation detection algorithm usually look at a given time window of a metric time series and establish an upper and lower band for accepted deviations and assume any data point out of those band as a deviation.
<a href="https://en.wikipedia.org/wiki/Median_absolute_deviation" target="_blank">MAD(Median absolute deviation)</a> is a robust measure of the variability of a univariate sample of quantitative data
</label>
</div>
<div class="col-md-6 col-lg-6 col-sm-6">
<div class="container-fluid">
<!-- <p>Here's an example for Year over Year difference calculation</p> -->
<img src="/img/mad.png" style="max-height: 200px;width:100%"/>
</div>
</div>
</div>
<br/>
<div class="row">
<div class="col-md-6 col-lg-6 col-sm-6">
<h5>
<input name="anType" type="radio" ng-model="form.anType" value="2" style="width:1em;height:1em;"/>
Bollinger Bands Detection
</h5>
<label style="color:#fff">
<a href="https://en.wikipedia.org/wiki/Bollinger_Bands" target="_blank">Bollinger Bands</a> are volatility bands placed above and below a moving average. Volatility is based on the standard deviation, which changes as volatility increases and decreases. The bands automatically widen when volatility increases and narrow when volatility decreases.
</label>
</div>
<div class="col-md-6 col-lg-6 col-sm-6">
<div class="container-fluid">
<!-- <p>Here's an example for Bollinger Bands</p> -->
<img src="/img/bollinger.png" style="max-height: 200px;width:100%"/>
</div>
</div>
</div>
</div>
</div>
</fieldset>
</div>
<div class="form-group btn-container" >
<button class="btn btn-primary btn-o back-step btn-wide pull-left" ng-click="form.prev(Form)">
<i class="fa fa-arrow-circle-left"></i> Back
</button>
<button class="btn btn-primary btn-o next-step btn-wide pull-right" ng-click="form.next(Form)">
Next <i class="fa fa-arrow-circle-right"></i>
</button>
</div>
</div>
</div>
<div id="step-3" ng-show="currentStep == 3" class="formStep" >
<label class="stepDesc">Please setup the model required information</label>
<div class="container-fluid">
<!-- schema definition list -->
<div class="col-md-12 col-lg-12 col-sm-12">
<fieldset>
<legend>
Required Information
</legend>
<div class="y-scrollable">
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="form-group" ng-class="{'has-error':Form.ruleName.$dirty&&Form.ruleName.$invalid, 'has-success':Form.ruleName.$valid}">
<label class="col-md-2 col-lg-2 col-sm-2 control-label">
Model Name<span class="symbol required"></span>:
</label>
<div class="col-md-10 col-lg-10 col-sm-10 ">
<input type="text" class="form-control" ng-model="form.basic.name" name="ruleName" placeholder="Please input the measure name" required ng-pattern="'([0-9a-zA-Z\\_\\-])+'">
<span class="error text-small block " ng-if="Form.ruleName.$dirty && Form.ruleName.$error.required">Model Name is required</span>
<span class="error text-small block " ng-if="Form.ruleName.$dirty && Form.ruleName.$error.pattern">Only letter, number, "-" and "_" are allowed</span>
</div>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="form-group">
<label class="col-md-2 col-lg-2 col-sm-2 control-label">
Model Definition:
</label>
<div class="col-md-10 col-lg-10 col-sm-10 ">
<input type="text" class="form-control" ng-model="form.basic.desc" placeholder="Please input detail description of your model">
</div>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="form-group">
<label for="typeSelector" class="col-md-2 col-lg-2 col-sm-2 control-label">
Model Type:
</label>
<div class="col-md-10 col-lg-10 col-sm-10 ">
<select id="typeSelector" class="form-control" ng-model="form.basic.type" ng-init="form.basic.type='2'" disabled required>
<option ng-repeat="row in ruleTypes" value="{{$index}}" >{{row}}</option>
</select>
</div>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="form-group">
<label for="systemSelector" class="col-md-2 col-lg-2 col-sm-2 control-label">
Organization:
</label>
<div class="col-md-10 col-lg-10 col-sm-10 ">
<select id="systemSelector" class="form-control" ng-model="form.basic.system" required disabled>
<option ng-repeat="row in ruleSystems" value="{{$index}}" >{{row}}</option>
</select>
</div>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="form-group">
<label class="col-md-2 col-lg-2 col-sm-2 control-label">
DataAsset:
</label>
<div class="col-md-10 col-lg-10 col-sm-10">
<input type="text" class="form-control" ng-model="currentNode.name" disabled>
</div>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="form-group" ng-class="{'has-error':Form.threshold.$invalid}">
<label class="col-md-2 col-lg-2 col-sm-2 control-label">
Threshold:
</label>
<div class="col-md-10 col-lg-10 col-sm-10">
<input type="number" class="form-control" ng-model="form.basic.threshold" name="threshold">
<span class="error text-small block" ng-if="Form.threshold.$error.number">Only number is allowed</span>
</div>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="form-group">
<label class="col-md-2 col-lg-2 col-sm-2 control-label">
Schedule Type:
</label>
<div class="col-md-10 col-lg-10 col-sm-10 ">
<select class="form-control" ng-init="form.basic.scheduleType='1'" ng-model="form.basic.scheduleType" ng-init="form.basic.scheduleType='0'">
<option ng-repeat="row in scheduleTypes" value="{{$index}}" >{{row}}</option>
</select>
</div>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="form-group" ng-class="{'has-error':Form.email.$dirty&&Form.email.$invalid, 'has-success':Form.email.$valid}">
<label class="col-md-2 col-lg-2 col-sm-2 control-label">
Notification email<span class="symbol required"></span>:
</label>
<div class="col-md-10 col-lg-10 col-sm-10">
<input type="email" class="form-control" ng-model="form.basic.email" name="email" ng-required="currentStep==3" placeholder="Please input valid email address" ng-pattern="'^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$'">
<span class="error text-small block" ng-if="Form.email.$dirty&&Form.email.$invalid">Please, enter a valid email address.</span>
</div>
</div>
</div>
<div class="col-md-12 col-lg-12 col-sm-12">
<div class="form-group">
<label class="col-md-2 col-lg-2 col-sm-2 control-label">
Owner:
</label>
<div class="col-md-10 col-lg-10 col-sm-10">
<input type="text" class="form-control" ng-model="form.basic.owner" ng-init="form.basic.owner=ntAccount" disabled>
</div>
</div>
</div>
</div>
<!-- <div style="color:#fff">
<label style="color:#b2c831">Tips: </label>After submitted, please go to "Rule Repository" to check the rule status
</div> -->
<div style="color:#b2c831">
<p>
<i class="fa fa-info-circle"></i> After submitted, please go to "<a class="bark-link" href="#/measures">Models</a>" to check the model status
</p>
</div>
</fieldset>
</div>
<div class="form-group btn-container" >
<button class="btn btn-primary btn-o back-step btn-wide pull-left" ng-click="form.prev(Form)">
<i class="fa fa-arrow-circle-left"></i> Back
</button>
<button class="btn btn-primary btn-o next-step btn-wide pull-right" ng-click="form.submit(Form)">
<!-- <button class="btn btn-primary btn-o next-step btn-wide pull-right" data-toggle="modal" data-target="#confirm"> -->
Submit
</button>
</div>
</div>
</div>
<div class="modal fade" id="confirm-an" role="dialog">
<div class="modal-dialog modal-xg modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title">Save the model with the below information?</h4>
</div>
<div class="modal-body">
<ng-include src="'/pages/measures/confirmation-an.html'"/>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary" ng-click="form.save()">Save</button>
</div>
</div>
</div>
</div>
</form>
</div><!--//row-->
</div>