2 ============LICENSE_START==================================================
4 ===========================================================================
5 Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
6 ===========================================================================
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
11 http://www.apache.org/licenses/LICENSE-2.0
13 Unless required by applicable law or agreed to in writing, software
14 distributed under the License is distributed on an "AS IS" BASIS,
15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 See the License for the specific language governing permissions and
17 limitations under the License.
18 ============LICENSE_END====================================================
20 <div ng-controller="decisionPolicyController">
23 <div class="form-group row">
24 <div class="form-group col-sm-6">
25 <label>Policy Name:<sup><b>*</b></sup></label> <input type="text"
26 class="form-control" ng-disabled="temp.policy.readOnly"
27 ng-readonly="temp.policy.editPolicy"
28 ng-model="temp.policy.policyName" required pattern="\S+"
29 title="Enter Policy Name without any spaces and special characters and will accept _." />
31 <div class="form-group col-sm-6">
32 <label>Description:</label> <input type="text" class="form-control"
33 ng-disabled="temp.policy.readOnly"
34 ng-model="temp.policy.policyDescription"
35 title="Description field will accept any type of data."/>
38 <div class="form-group row">
39 <div class="form-group col-sm-6">
40 <label>Onap Name:<sup><b>*</b></sup></label> <select
41 class="form-control" ng-disabled="temp.policy.readOnly"
42 ng-model="temp.policy.onapName"
43 ng-options="option for option in onapNameDictionaryDatas track by option"
44 required pattern="\S+" title="Select the dropdown value driven from OnapName (common)Dictionary."></select>
46 <div class="form-group col-sm-6">
47 <label>Rule Provider:<sup><b>*</b></sup></label><select
48 class="form-control" ng-disabled="temp.policy.readOnly"
49 ng-model="temp.policy.ruleProvider"
50 ng-init="providerListener(temp.policy.ruleProvider);"
51 ng-click="providerListener(temp.policy.ruleProvider);">
52 <option>Custom</option>
54 <option>Rainy_Day</option>
55 <option>GUARD_YAML</option>
56 <option>GUARD_BL_YAML<option>
61 <div ng-if="temp.policy.ruleProvider == 'Rainy_Day'">
63 <div class="form-group row">
64 <div class="form-group row">
65 <div class="form-group col-sm-1">
66 <label>Service Type:<sup><b>*</b></sup></label>
68 <div class="form-group col-sm-2">
69 <input type="text" class="form-control"
70 ng-disabled="temp.policy.readOnly" ng-model="temp.policy.rainyday.serviceType"
71 placeholder="Service Type" title="Enter Service Type value."/>
73 <div class="form-group col-sm-1">
74 <label>VNF Type:<sup><b>*</b></sup></label>
76 <div class="form-group col-sm-2">
77 <input type="text" class="form-control"
78 ng-disabled="temp.policy.readOnly" ng-model="temp.policy.rainyday.vnfType"
79 placeholder="VNF Type" title="Enter VNF Type value."/>
81 <div class="form-group col-sm-1">
82 <label>Building Block ID:<sup><b>*</b></sup></label>
84 <div class="form-group col-sm-2">
86 class="form-control" ng-disabled="temp.policy.readOnly"
87 ng-model="temp.policy.rainyday.bbid"
88 ng-options="option for option in rainyDayDictionaryDatas track by option"
89 ng-change="getWorkstepValues(temp.policy.rainyday.bbid)" title="Select the dropdown value driven from Rainday Allowed Treatments (Decision)Dictionary.">
90 <option value="">{{temp.policy.rainyday.bbid}}</option>
93 <div class="form-group col-sm-1">
94 <label>Work Step:<sup><b>*</b></sup></label>
96 <div class="form-group col-sm-2">
98 class="form-control" ng-disabled="temp.policy.readOnly"
99 ng-model="temp.policy.rainyday.workstep"
100 ng-options="option for option in workstepDictionaryDatas track by option"
101 ng-change="getTreatmentValues(temp.policy.rainyday.bbid, temp.policy.rainyday.workstep)">
102 <option value="">{{temp.policy.rainyday.workstep}}</option>
106 <div class="form-group row">
107 <div class="form-group col-sm-3">
108 <label>Desired Automated Treatments:</label>
109 <button type="button" class="btn btn-default"
110 ng-disabled="temp.policy.readOnly"
111 ng-click="addNewTreatment()">
112 <i class="fa fa-plus"></i>
116 <div class="form-group row">
117 <div data-ng-repeat="treatmentTableChoice in temp.policy.rainyday.treatmentTableChoices">
118 <div class="form-group row" style="margin-left: 2%">
119 <div class="form-group col-sm-1">
120 <label>Error Code:<sup><b>*</b></sup></label>
122 <div class="form-group col-sm-3">
123 <input type="text" class="form-control"
124 ng-disabled="temp.policy.readOnly"
125 ng-model="treatmentTableChoice.errorcode"
126 placeholder="Error Code" />
128 <div class="form-group col-sm-1">
129 <label>Desired Treatment:<sup><b>*</b></sup></label>
131 <div class="form-group col-sm-3">
134 ng-disabled="temp.policy.readOnly"
135 ng-model="treatmentTableChoice.treatment"
136 ng-options="option for option in allowedTreatmentsDatas track by option">
137 <option value="">{{treatmentTableChoice.treatment}}</option>
140 <div class="form-group col-sm-1">
141 <button type="button" class="btn btn-default"
142 ng-disabled="temp.policy.readOnly"
143 ng-click="removeTreatment()">
144 <i class="fa fa-minus"></i>
153 <div ng-if="temp.policy.ruleProvider == 'GUARD_BL_YAML'">
155 <div class="form-group row">
156 <div class="form-group col-sm-1">
157 <label>Guard BlackList YAML Attributes:</label><br>
160 <div class="form-group row">
161 <div class="form-group row" style="margin-left: 2%">
162 <div class="form-group col-sm-3">
163 <label> actor: </label>
165 <div class="form-group col-sm-3">
166 <input type="text" class="form-control"
167 ng-disabled="temp.policy.readOnly" ng-model="temp.policy.yamlparams.actor"
168 placeholder="Actor" />
171 <div class="form-group row" style="margin-left: 2%">
172 <div class="form-group col-sm-3">
173 <label> recipe: </label>
175 <div class="form-group col-sm-3">
176 <input type="text" class="form-control"
177 ng-disabled="temp.policy.readOnly" ng-model="temp.policy.yamlparams.recipe"
178 placeholder="Recipe" />
181 <div class="form-group row" style="margin-left: 2%">
182 <div class="form-group col-sm-3">
183 <label> CLName: </label>
185 <div class="form-group col-sm-3">
186 <input type="text" class="form-control"
187 ng-disabled="temp.policy.readOnly" ng-model="temp.policy.yamlparams.clname"
188 placeholder="CLName" />
191 <div class="form-group row" style="margin-left: 2%">
192 <div class="form-group col-sm-3">
193 <label> guardActiveStart: </label>
195 <div class="form-group col-sm-3">
196 <input type="text" class="form-control"
197 ng-disabled="temp.policy.readOnly" ng-model="temp.policy.yamlparams.guardActiveStart"
198 placeholder="00:00:00-05:00" />
201 <div class="form-group row" style="margin-left: 2%">
202 <div class="form-group col-sm-3">
203 <label> guardActiveEnd: </label>
205 <div class="form-group col-sm-3">
206 <input type="text" class="form-control"
207 ng-disabled="temp.policy.readOnly" ng-model="temp.policy.yamlparams.guardActiveEnd"
208 placeholder="00:00:00-05:00" />
211 <div class="form-group row" style="margin-left: 2%">
212 <div class="form-group col-sm-3">
213 <label> BlackList: </label>
214 <button type="button" class="btn btn-default"
215 ng-disabled="temp.policy.readOnly" ng-click="addNewBL()">
216 <i class="fa fa-plus"></i>
219 <div class="form-group col-sm-4">
220 <div data-ng-repeat="choice in temp.policy.yamlparams.blackList track by $index">
221 <div class="form-group row">
222 <div class="form-group col-sm-9">
223 <input type="text" class="form-control"
224 ng-disabled="temp.policy.readOnly"
225 ng-model="temp.policy.yamlparams.blackList[$index]" placeholder="BlackList" />
227 <div class="form-group col-sm-1">
228 <button type="button" class="btn btn-default" ng-show="$last"
229 ng-disabled="temp.policy.readOnly" ng-click="removeBL()">
230 <i class="fa fa-minus"></i>
241 <div ng-if="temp.policy.ruleProvider == 'GUARD_YAML'">
243 <div class="form-group row">
244 <div class="form-group col-sm-1">
245 <label>Guard YAML Attributes:</label><br>
248 <div class="form-group row">
249 <div class="form-group row" style="margin-left: 2%">
250 <div class="form-group col-sm-3">
251 <label> actor: </label>
253 <div class="form-group col-sm-3">
254 <input type="text" class="form-control"
255 ng-disabled="temp.policy.readOnly" ng-model="temp.policy.yamlparams.actor"
256 placeholder="Actor" />
259 <div class="form-group row" style="margin-left: 2%">
260 <div class="form-group col-sm-3">
261 <label> recipe: </label>
263 <div class="form-group col-sm-3">
264 <input type="text" class="form-control"
265 ng-disabled="temp.policy.readOnly" ng-model="temp.policy.yamlparams.recipe"
266 placeholder="Recipe" />
269 <div class="form-group row" style="margin-left: 2%">
270 <div class="form-group col-sm-3">
271 <label> CLName: </label>
273 <div class="form-group col-sm-3">
274 <input type="text" class="form-control"
275 ng-disabled="temp.policy.readOnly" ng-model="temp.policy.yamlparams.clname"
276 placeholder="CLName" />
279 <div class="form-group row" style="margin-left: 2%">
280 <div class="form-group col-sm-3">
281 <label> Targets: </label>
282 <button type="button" class="btn btn-default"
283 ng-disabled="temp.policy.readOnly" ng-click="addNewTarget()">
284 <i class="fa fa-plus"></i>
287 <div class="form-group col-sm-4">
288 <div data-ng-repeat="choice in temp.policy.yamlparams.targets track by $index">
289 <div class="form-group row">
290 <div class="form-group col-sm-9">
291 <input type="text" class="form-control"
292 ng-disabled="temp.policy.readOnly"
293 ng-model="temp.policy.yamlparams.targets[$index]" placeholder="Target" />
295 <div class="form-group col-sm-1">
296 <button type="button" class="btn btn-default" ng-show="$last"
297 ng-disabled="temp.policy.readOnly" ng-click="removeTarget()">
298 <i class="fa fa-minus"></i>
305 <div class="form-group row" style="margin-left: 2%">
306 <div class="form-group col-sm-3">
307 <label> limit: </label>
309 <div class="form-group col-sm-3">
310 <input type="text" class="form-control"
311 ng-disabled="temp.policy.readOnly" ng-model="temp.policy.yamlparams.limit"
312 placeholder="Limit" title="Enter time limit value."/>
315 <div class="form-group row" style="margin-left: 2%">
316 <div class="form-group col-sm-3">
317 <label> timeWindow: </label>
319 <div class="form-group col-sm-2">
320 <input type="text" class="form-control"
321 ng-disabled="temp.policy.readOnly" ng-model="temp.policy.yamlparams.timeWindow"
322 placeholder="Time Window" title="Enter time window value."/>
324 <div class="form-group col-sm-1">
325 <select class="form-control" ng-disabled="temp.policy.readOnly"
326 ng-model="temp.policy.yamlparams.timeUnits" title="Select the Time Units value from dropdown options.">
327 <option>minute</option>
328 <option>hour</option>
330 <option>week</option>
331 <option>month</option>
332 <option>year</option>
336 <div class="form-group row" style="margin-left: 2%">
337 <div class="form-group col-sm-3">
338 <label> guardActiveStart: </label>
340 <div class="form-group col-sm-3">
341 <input type="text" class="form-control"
342 ng-disabled="temp.policy.readOnly" ng-model="temp.policy.yamlparams.guardActiveStart" title="Enter Guard Active Start value in following patren '00:00:00-05:00'."
343 placeholder="00:00:00-05:00" />
346 <div class="form-group row" style="margin-left: 2%">
347 <div class="form-group col-sm-3">
348 <label> guardActiveEnd: </label>
350 <div class="form-group col-sm-3">
351 <input type="text" class="form-control"
352 ng-disabled="temp.policy.readOnly" ng-model="temp.policy.yamlparams.guardActiveEnd" title="Enter Guard Active End value in following patren '00:00:00-05:00'."
353 placeholder="00:00:00-05:00" />
361 <div ng-if="temp.policy.ruleProvider == 'Custom'">
363 <div class="form-group row">
364 <div class="form-group col-sm-1">
365 <label>Component Attributes:</label><br>
366 <button type="button" class="btn btn-default"
367 ng-disabled="temp.policy.readOnly" ng-click="addNewChoice()" title="onClick Component Attribute row is added.">
368 <i class="fa fa-plus"></i>
372 <div class="form-group row">
373 <div data-ng-repeat="choice in temp.policy.attributes">
374 <div class="form-group row" style="margin-left: 2%">
375 <div class="form-group col-sm-3">
376 <select class="form-control" ng-disabled="temp.policy.readOnly"
377 ng-model="choice.key"
378 ng-options="option for option in attributeDictionaryDatas track by option" title="Select the dropdown value driven from Attribute (common)Dictionary.">
379 <option value="">{{choice.key}}</option>
382 <div class="form-group col-sm-3">
383 <input type="text" class="form-control"
384 ng-disabled="temp.policy.readOnly" ng-model="choice.value"
385 placeholder="Attribute Value" title="Enter the Attribute Value without any spaces and special characters"/>
387 <div class="form-group col-sm-1">
388 <button type="button" class="btn btn-default" ng-show="$last"
389 ng-disabled="temp.policy.readOnly" ng-click="removeChoice()" title="onClick will remove the last row">
390 <i class="fa fa-minus"></i>
399 <div ng-if="temp.policy.ruleProvider == 'Custom'">
401 <div class="form-group row">
402 <div class="form-group col-sm-1">
403 <label>Settings Attributes:</label><br>
404 <button type="button" class="btn btn-default"
405 ng-disabled="temp.policy.readOnly"
406 ng-click="addNewSettingsChoice()" title="onClick Settings Attribute row is added.">
407 <i class="fa fa-plus"></i>
411 <div class="form-group row">
412 <div data-ng-repeat="settingschoice in temp.policy.settings">
413 <div class="form-group row" style="margin-left: 2%">
414 <div class="form-group col-sm-3">
415 <select class="form-control" ng-disabled="temp.policy.readOnly"
416 ng-model="settingschoice.key"
417 ng-options="option for option in settingsDictionaryDatas track by option" title="Select the dropdown value driven from Settings (Decision)Dictionary.">
418 <option value="">{{settingschoice.key}}</option>
421 <div class="form-group col-sm-3">
422 <input type="text" class="form-control"
423 ng-disabled="temp.policy.readOnly"
424 ng-model="settingschoice.value" placeholder="Settings Value" title="Enter the Settings Attribute Value without any spaces and special characters"/>
426 <div class="form-group col-sm-1">
427 <button type="button" class="btn btn-default" ng-show="$last"
428 ng-disabled="temp.policy.readOnly"
429 ng-click="removeSettingsChoice()" title="onClick will remove the last row">
430 <i class="fa fa-minus"></i>
439 <div ng-if="temp.policy.ruleProvider == 'Custom'">
441 <label>Decision Rule Algorithms:<sup><b></b></sup></label><br>
442 <div class="form-group row">
443 <div class="form-group col-sm-1">
444 <button type="button" class="btn btn-default"
445 ng-disabled="temp.policy.readOnly"
446 ng-click="addNewRuleAlgorithm()" title="onClick Rule Algorithms row is added.">
447 <i class="fa fa-plus"></i>
451 <div class="form-group row">
453 data-ng-repeat="ruleAlgorithmschoice in temp.policy.ruleAlgorithmschoices">
454 <div class="form-group row" style="margin-left: 2%">
455 <div class="form-group col-sm-1">
457 ng-model="ruleAlgorithmschoice.dynamicRuleAlgorithmLabels"
458 name="dynamicRuleAlgorithmLabels">{{ruleAlgorithmschoice.id}}</label>
460 <div class="form-group col-sm-3">
461 <select class="form-control" id="mySelect"
462 ng-disabled="temp.policy.readOnly"
463 ng-model="ruleAlgorithmschoice.dynamicRuleAlgorithmField1"
464 ng-options="option for option in attributeDictionaryDatas track by option"
465 name="dynamicRuleAlgorithmField1" title="Select the dropdown value driven from Attribute (common)Dictionary or Settings (Decision)Dictionary.">
466 <option value="">{{ruleAlgorithmschoice.dynamicRuleAlgorithmField1}}</option>
469 <div class="form-group col-sm-3">
470 <select type="text" class="form-control"
471 ng-disabled="temp.policy.readOnly"
472 ng-model="ruleAlgorithmschoice.dynamicRuleAlgorithmCombo"
473 ng-options="option for option in functionDefinitionDatas track by option"
474 name="dynamicRuleAlgorithmCombo" title="Select the dropdown value driven from FunctionDataType."></select>
476 <div class="form-group col-sm-3">
477 <input type="text" class="form-control"
478 ng-disabled="temp.policy.readOnly"
479 ng-model="ruleAlgorithmschoice.dynamicRuleAlgorithmField2"
480 name="dynamicRuleAlgorithmField2" title="Enter the Value without any spaces and special characters and for rule formation use A1, A2,..etc., based on above Rules."/>
482 <div class="form-group col-sm-1">
483 <button type="button" class="btn btn-default"
484 ng-disabled="temp.policy.readOnly"
485 ng-click="removeRuleAlgorithm()" title="onClick will remove the last row">
486 <i class="fa fa-minus"></i>
495 <div id="validate" style="width: 70%"></div>
497 <div class="modal-footer">
498 <button class="btn btn-primary" herf="javascript:void(0)"
499 ng-disabled="temp.policy.readOnly"
500 ng-click="validatePolicy(temp.policy);" title="Validate the data entered in the Policy fields.">Validate</button>
501 <button class="btn btn-success" herf="javascript:void(0)"
502 ng-disabled="savebutton" ng-disabled="temp.policy.readOnly"
503 ng-click="saveDecisionPolicy(temp);" title="Save the Policy with validated data.">Save</button>
504 <button type="button" class="btn btn-default" ng-click="refresh();" title="Close the template.">Close</button>