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 ng-show="notRawPolicy" 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 ng-show="notRawPolicy" 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+"
45 title="Select the dropdown value driven from OnapName (common)Dictionary."></select>
47 <div class="form-group col-sm-6">
48 <label>Rule Provider:<sup><b>*</b></sup></label><select
49 class="form-control" ng-disabled="temp.policy.readOnly"
50 ng-model="temp.policy.ruleProvider"
51 ng-init="providerListener(temp.policy.ruleProvider);"
52 ng-click="providerListener(temp.policy.ruleProvider);">
53 <option>Custom</option>
55 <option>Rainy_Day</option>
56 <option>GUARD_YAML</option>
57 <option>GUARD_BL_YAML</option>
63 <div ng-if="temp.policy.ruleProvider == 'Raw'">
65 <div class="form-group row">
66 <div class="form-group col-sm-12">
67 <label>Raw Policy:<sup><b>*</b></sup></label>
68 <textarea class="form-control" ng-disabled="temp.policy.readOnly"
69 ng-model="temp.policy.rawXacmlPolicy" style="height: 400px;"
70 required title="Enter the Raw XACML Policy."></textarea>
75 <div ng-if="temp.policy.ruleProvider == 'Rainy_Day'">
77 <div class="form-group row">
78 <div class="form-group row">
79 <div class="form-group col-sm-1">
80 <label>Service Type:<sup><b>*</b></sup></label>
82 <div class="form-group col-sm-2">
83 <input type="text" class="form-control"
84 ng-disabled="temp.policy.readOnly"
85 ng-model="temp.policy.rainyday.serviceType"
86 placeholder="Service Type" title="Enter Service Type value." />
88 <div class="form-group col-sm-1">
89 <label>VNF Type:<sup><b>*</b></sup></label>
91 <div class="form-group col-sm-2">
92 <input type="text" class="form-control"
93 ng-disabled="temp.policy.readOnly"
94 ng-model="temp.policy.rainyday.vnfType" placeholder="VNF Type"
95 title="Enter VNF Type value." />
97 <div class="form-group col-sm-1">
98 <label>Building Block ID:<sup><b>*</b></sup></label>
100 <div class="form-group col-sm-2">
101 <select class="form-control" ng-disabled="temp.policy.readOnly"
102 ng-model="temp.policy.rainyday.bbid"
103 ng-options="option for option in rainyDayDictionaryDatas track by option"
104 ng-change="getWorkstepValues(temp.policy.rainyday.bbid)"
105 title="Select the dropdown value driven from Rainday Allowed Treatments (Decision)Dictionary.">
106 <option value="">{{temp.policy.rainyday.bbid}}</option>
109 <div class="form-group col-sm-1">
110 <label>Work Step:<sup><b>*</b></sup></label>
112 <div class="form-group col-sm-2">
113 <select class="form-control" ng-disabled="temp.policy.readOnly"
114 ng-model="temp.policy.rainyday.workstep"
115 ng-options="option for option in workstepDictionaryDatas track by option"
116 ng-change="getTreatmentValues(temp.policy.rainyday.bbid, temp.policy.rainyday.workstep)">
117 <option value="">{{temp.policy.rainyday.workstep}}</option>
121 <div class="form-group row">
122 <div class="form-group col-sm-3">
123 <label>Desired Automated Treatments:</label>
124 <button type="button" class="btn btn-default"
125 ng-disabled="temp.policy.readOnly" ng-click="addNewTreatment()">
126 <i class="fa fa-plus"></i>
130 <div class="form-group row">
132 data-ng-repeat="treatmentTableChoice in temp.policy.rainyday.treatmentTableChoices">
133 <div class="form-group row" style="margin-left: 2%">
134 <div class="form-group col-sm-1">
135 <label>Error Code:<sup><b>*</b></sup></label>
137 <div class="form-group col-sm-3">
138 <input type="text" class="form-control"
139 ng-disabled="temp.policy.readOnly"
140 ng-model="treatmentTableChoice.errorcode"
141 placeholder="Error Code" />
143 <div class="form-group col-sm-1">
144 <label>Desired Treatment:<sup><b>*</b></sup></label>
146 <div class="form-group col-sm-3">
147 <select class="form-control" ng-disabled="temp.policy.readOnly"
148 ng-model="treatmentTableChoice.treatment"
149 ng-options="option for option in allowedTreatmentsDatas track by option">
150 <option value="">{{treatmentTableChoice.treatment}}</option>
153 <div class="form-group col-sm-1">
154 <button type="button" class="btn btn-default"
155 ng-disabled="temp.policy.readOnly"
156 ng-click="removeTreatment()">
157 <i class="fa fa-minus"></i>
166 <div ng-if="temp.policy.ruleProvider == 'GUARD_BL_YAML'">
168 <div class="form-group row">
169 <div class="form-group col-sm-1">
170 <label>Guard BlackList YAML Attributes:</label><br>
173 <div class="form-group row">
174 <div class="form-group row" style="margin-left: 2%">
175 <div class="form-group col-sm-3">
176 <label> actor: </label>
178 <div class="form-group col-sm-3">
179 <input type="text" class="form-control"
180 ng-disabled="temp.policy.readOnly"
181 ng-model="temp.policy.yamlparams.actor" placeholder="Actor" />
184 <div class="form-group row" style="margin-left: 2%">
185 <div class="form-group col-sm-3">
186 <label> recipe: </label>
188 <div class="form-group col-sm-3">
189 <input type="text" class="form-control"
190 ng-disabled="temp.policy.readOnly"
191 ng-model="temp.policy.yamlparams.recipe" placeholder="Recipe" />
194 <div class="form-group row" style="margin-left: 2%">
195 <div class="form-group col-sm-3">
196 <label> CLName: </label>
198 <div class="form-group col-sm-3">
199 <input type="text" class="form-control"
200 ng-disabled="temp.policy.readOnly"
201 ng-model="temp.policy.yamlparams.clname" placeholder="CLName" />
204 <div class="form-group row" style="margin-left: 2%">
205 <div class="form-group col-sm-3">
206 <label> guardActiveStart: </label>
208 <div class="form-group col-sm-3">
209 <input type="text" class="form-control"
210 ng-disabled="temp.policy.readOnly"
211 ng-model="temp.policy.yamlparams.guardActiveStart"
212 placeholder="00:00:00-05:00" />
215 <div class="form-group row" style="margin-left: 2%">
216 <div class="form-group col-sm-3">
217 <label> guardActiveEnd: </label>
219 <div class="form-group col-sm-3">
220 <input type="text" class="form-control"
221 ng-disabled="temp.policy.readOnly"
222 ng-model="temp.policy.yamlparams.guardActiveEnd"
223 placeholder="00:00:00-05:00" />
226 <div class="form-group row" style="margin-left: 2%">
227 <div class="form-group col-sm-3">
228 <label> BlackList Entry Type: </label>
230 <div class="form-group col-sm-3">
231 <select class="form-control"
232 ng-model="temp.policy.blackListEntryType"
233 ng-disabled="temp.policy.readOnly"
234 ng-change="initializeBlackList(temp.policy.blackListEntryType)">
235 <option>Use Manual Entry</option>
236 <option>Use File Upload</option>
240 <div class="form-group row" style="margin-left: 2%">
241 <div class="form-group col-sm-3">
242 <label>Export BlackList Entries:</label>
244 <div class="form-group col-sm-3">
245 <button type="button" class="btn btn-default"
246 ng-disabled="disableOnCreate"
247 ng-click="exportBlackListEntries()">Export BlackList</button>
250 <div ng-if="temp.policy.blackListEntryType == 'Use File Upload'"
251 class="form-group row" style="margin-left: 2%">
252 <div class="form-group col-sm-3">
253 <label>Upload BlackList: </label>
255 <div class="form-group col-sm-4">
256 <input type="file" name="file" class="form-control"
258 onchange="angular.element(this).scope().uploadBLFile(this.files)" />
260 <div class="form-group col-sm-2">
261 <button class="btn btn-primary" ng-disabled="importButton"
262 ng-click="submitUpload()">Upload</button>
265 <div ng-if="temp.policy.blackListEntryType == 'Use File Upload'"
266 class="form-group row" style="margin-left: 2%">
267 <div class="form-group col-sm-3">
268 <label>Search BlackList: </label>
270 <div class="form-group col-sm-4">
271 <input type="text" class="form-control" class="search"
272 placeholder="{{'search'}}..." ng-model="search"> <select
273 class="form-control" multiple ng-disabled="true"
274 style="height: 400px;"
275 ng-model="temp.policy.blackListSearchEntry"
276 ng-options="option for option in blackListEntries | filter:search"></select>
279 <div ng-if="temp.policy.blackListEntryType == 'Use Manual Entry'"
280 class="form-group row" style="margin-left: 2%">
281 <div class="form-group col-sm-3">
282 <label> BlackList: </label>
283 <button type="button" class="btn btn-default"
284 ng-disabled="temp.policy.readOnly" ng-click="addNewBL()">
285 <i class="fa fa-plus"></i>
288 <div class="form-group col-sm-4">
290 data-ng-repeat="choice in temp.policy.yamlparams.blackList track by $index">
291 <div class="form-group row">
292 <div class="form-group col-sm-9">
293 <input type="text" class="form-control"
294 ng-disabled="temp.policy.readOnly"
295 ng-model="temp.policy.yamlparams.blackList[$index]"
296 placeholder="BlackList" />
298 <div class="form-group col-sm-1">
299 <button type="button" class="btn btn-default"
300 ng-disabled="temp.policy.readOnly"
301 ng-click="removeBL(temp.policy.yamlparams.blackList[$index])">
302 <i class="fa fa-minus"></i>
313 <div ng-if="temp.policy.ruleProvider == 'GUARD_YAML'">
315 <div class="form-group row">
316 <div class="form-group col-sm-1">
317 <label>Guard YAML Attributes:</label><br>
320 <div class="form-group row">
321 <div class="form-group row" style="margin-left: 2%">
322 <div class="form-group col-sm-3">
323 <label> actor: </label>
325 <div class="form-group col-sm-3">
326 <input type="text" class="form-control"
327 ng-disabled="temp.policy.readOnly"
328 ng-model="temp.policy.yamlparams.actor" placeholder="Actor" />
331 <div class="form-group row" style="margin-left: 2%">
332 <div class="form-group col-sm-3">
333 <label> recipe: </label>
335 <div class="form-group col-sm-3">
336 <input type="text" class="form-control"
337 ng-disabled="temp.policy.readOnly"
338 ng-model="temp.policy.yamlparams.recipe" placeholder="Recipe" />
341 <div class="form-group row" style="margin-left: 2%">
342 <div class="form-group col-sm-3">
343 <label> CLName: </label>
345 <div class="form-group col-sm-3">
346 <input type="text" class="form-control"
347 ng-disabled="temp.policy.readOnly"
348 ng-model="temp.policy.yamlparams.clname" placeholder="CLName" />
351 <div class="form-group row" style="margin-left: 2%">
352 <div class="form-group col-sm-3">
353 <label> Targets: </label>
354 <button type="button" class="btn btn-default"
355 ng-disabled="temp.policy.readOnly" ng-click="addNewTarget()">
356 <i class="fa fa-plus"></i>
359 <div class="form-group col-sm-4">
361 data-ng-repeat="choice in temp.policy.yamlparams.targets track by $index">
362 <div class="form-group row">
363 <div class="form-group col-sm-9">
364 <input type="text" class="form-control"
365 ng-disabled="temp.policy.readOnly"
366 ng-model="temp.policy.yamlparams.targets[$index]"
367 placeholder="Target" />
369 <div class="form-group col-sm-1">
370 <button type="button" class="btn btn-default" ng-show="$last"
371 ng-disabled="temp.policy.readOnly" ng-click="removeTarget()">
372 <i class="fa fa-minus"></i>
379 <div class="form-group row" style="margin-left: 2%">
380 <div class="form-group col-sm-3">
381 <label> limit: </label>
383 <div class="form-group col-sm-3">
384 <input type="text" class="form-control"
385 ng-disabled="temp.policy.readOnly"
386 ng-model="temp.policy.yamlparams.limit" placeholder="Limit"
387 title="Enter time limit value." />
390 <div class="form-group row" style="margin-left: 2%">
391 <div class="form-group col-sm-3">
392 <label> timeWindow: </label>
394 <div class="form-group col-sm-2">
395 <input type="text" class="form-control"
396 ng-disabled="temp.policy.readOnly"
397 ng-model="temp.policy.yamlparams.timeWindow"
398 placeholder="Time Window" title="Enter time window value." />
400 <div class="form-group col-sm-1">
401 <select class="form-control" ng-disabled="temp.policy.readOnly"
402 ng-model="temp.policy.yamlparams.timeUnits"
403 title="Select the Time Units value from dropdown options.">
404 <option>minute</option>
405 <option>hour</option>
407 <option>week</option>
408 <option>month</option>
409 <option>year</option>
413 <div class="form-group row" style="margin-left: 2%">
414 <div class="form-group col-sm-3">
415 <label> guardActiveStart: </label>
417 <div class="form-group col-sm-3">
418 <input type="text" class="form-control"
419 ng-disabled="temp.policy.readOnly"
420 ng-model="temp.policy.yamlparams.guardActiveStart"
421 title="Enter Guard Active Start value in following patren '00:00:00-05:00'."
422 placeholder="00:00:00-05:00" />
425 <div class="form-group row" style="margin-left: 2%">
426 <div class="form-group col-sm-3">
427 <label> guardActiveEnd: </label>
429 <div class="form-group col-sm-3">
430 <input type="text" class="form-control"
431 ng-disabled="temp.policy.readOnly"
432 ng-model="temp.policy.yamlparams.guardActiveEnd"
433 title="Enter Guard Active End value in following patren '00:00:00-05:00'."
434 placeholder="00:00:00-05:00" />
442 <div ng-if="temp.policy.ruleProvider == 'Custom'">
444 <div class="form-group row">
445 <div class="form-group col-sm-1">
446 <label>Component Attributes:</label><br>
447 <button type="button" class="btn btn-default"
448 ng-disabled="temp.policy.readOnly" ng-click="addNewChoice()"
449 title="onClick Component Attribute row is added.">
450 <i class="fa fa-plus"></i>
454 <div class="form-group row">
455 <div data-ng-repeat="choice in temp.policy.attributes">
456 <div class="form-group row" style="margin-left: 2%">
457 <div class="form-group col-sm-3">
458 <select class="form-control" ng-disabled="temp.policy.readOnly"
459 ng-model="choice.key"
460 ng-options="option for option in attributeDictionaryDatas track by option"
461 title="Select the dropdown value driven from Attribute (common)Dictionary.">
462 <option value="">{{choice.key}}</option>
465 <div class="form-group col-sm-3">
466 <input type="text" class="form-control"
467 ng-disabled="temp.policy.readOnly" ng-model="choice.value"
468 placeholder="Attribute Value"
469 title="Enter the Attribute Value without any spaces and special characters" />
471 <div class="form-group col-sm-1">
472 <button type="button" class="btn btn-default" ng-show="$last"
473 ng-disabled="temp.policy.readOnly" ng-click="removeChoice()"
474 title="onClick will remove the last row">
475 <i class="fa fa-minus"></i>
484 <div ng-if="temp.policy.ruleProvider == 'Custom'">
486 <div class="form-group row">
487 <div class="form-group col-sm-1">
488 <label>Settings Attributes:</label><br>
489 <button type="button" class="btn btn-default"
490 ng-disabled="temp.policy.readOnly"
491 ng-click="addNewSettingsChoice()"
492 title="onClick Settings Attribute row is added.">
493 <i class="fa fa-plus"></i>
497 <div class="form-group row">
498 <div data-ng-repeat="settingschoice in temp.policy.settings">
499 <div class="form-group row" style="margin-left: 2%">
500 <div class="form-group col-sm-3">
501 <select class="form-control" ng-disabled="temp.policy.readOnly"
502 ng-model="settingschoice.key"
503 ng-options="option for option in settingsDictionaryDatas track by option"
504 title="Select the dropdown value driven from Settings (Decision)Dictionary.">
505 <option value="">{{settingschoice.key}}</option>
508 <div class="form-group col-sm-3">
509 <input type="text" class="form-control"
510 ng-disabled="temp.policy.readOnly"
511 ng-model="settingschoice.value" placeholder="Settings Value"
512 title="Enter the Settings Attribute Value without any spaces and special characters" />
514 <div class="form-group col-sm-1">
515 <button type="button" class="btn btn-default" ng-show="$last"
516 ng-disabled="temp.policy.readOnly"
517 ng-click="removeSettingsChoice()"
518 title="onClick will remove the last row">
519 <i class="fa fa-minus"></i>
528 <div ng-if="temp.policy.ruleProvider == 'Custom'">
530 <label>Decision Rule Algorithms:<sup><b></b></sup></label><br>
531 <div class="form-group row">
532 <div class="form-group col-sm-1">
533 <button type="button" class="btn btn-default"
534 ng-disabled="temp.policy.readOnly"
535 ng-click="addNewRuleAlgorithm()"
536 title="onClick Rule Algorithms row is added.">
537 <i class="fa fa-plus"></i>
541 <div class="form-group row">
543 data-ng-repeat="ruleAlgorithmschoice in temp.policy.ruleAlgorithmschoices">
544 <div class="form-group row" style="margin-left: 2%">
545 <div class="form-group col-sm-1">
547 ng-model="ruleAlgorithmschoice.dynamicRuleAlgorithmLabels"
548 name="dynamicRuleAlgorithmLabels">{{ruleAlgorithmschoice.id}}</label>
550 <div class="form-group col-sm-3">
551 <select class="form-control" id="mySelect"
552 ng-disabled="temp.policy.readOnly"
553 ng-model="ruleAlgorithmschoice.dynamicRuleAlgorithmField1"
554 ng-options="option for option in attributeDictionaryDatas track by option"
555 name="dynamicRuleAlgorithmField1"
556 title="Select the dropdown value driven from Attribute (common)Dictionary or Settings (Decision)Dictionary.">
557 <option value="">{{ruleAlgorithmschoice.dynamicRuleAlgorithmField1}}</option>
560 <div class="form-group col-sm-3">
561 <select type="text" class="form-control"
562 ng-disabled="temp.policy.readOnly"
563 ng-model="ruleAlgorithmschoice.dynamicRuleAlgorithmCombo"
564 ng-options="option for option in functionDefinitionDatas track by option"
565 name="dynamicRuleAlgorithmCombo"
566 title="Select the dropdown value driven from FunctionDataType."></select>
568 <div class="form-group col-sm-3">
569 <input type="text" class="form-control"
570 ng-disabled="temp.policy.readOnly"
571 ng-model="ruleAlgorithmschoice.dynamicRuleAlgorithmField2"
572 name="dynamicRuleAlgorithmField2"
573 title="Enter the Value without any spaces and special characters and for rule formation use A1, A2,..etc., based on above Rules." />
575 <div class="form-group col-sm-1">
576 <button type="button" class="btn btn-default"
577 ng-disabled="temp.policy.readOnly"
578 ng-click="removeRuleAlgorithm()"
579 title="onClick will remove the last row">
580 <i class="fa fa-minus"></i>
589 <div id="validate" style="width: 70%"></div>
591 <div class="modal-footer">
592 <button class="btn btn-primary" herf="javascript:void(0)"
593 ng-disabled="temp.policy.readOnly"
594 ng-click="validatePolicy(temp.policy);"
595 title="Validate the data entered in the Policy fields.">Validate</button>
596 <button class="btn btn-success" herf="javascript:void(0)"
597 ng-disabled="savebutton" ng-disabled="temp.policy.readOnly"
598 ng-click="saveDecisionPolicy(temp);"
599 title="Save the Policy with validated data.">Save</button>
600 <button type="button" class="btn btn-default" ng-click="refresh();"
601 title="Close the template.">Close</button>