Add license to policy-engine files
[policy/engine.git] / POLICY-SDK-APP / src / main / webapp / app / policyApp / policy-models / Editor / PolicyTemplates / BasePolicyTemplate.html
1 <!--
2   ============LICENSE_START==================================================
3   ONAP Policy Engine
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
10   
11        http://www.apache.org/licenses/LICENSE-2.0
12   
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====================================================
19   -->
20 <div ng-controller="baseConfigController">
21         <form>
22                 <div class="well">
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 _." />
30                                 </div>
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." />
36                                 </div>
37                         </div>
38                         <div class="form-group row">
39                                 <div class="form-group col-sm-3">
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>
46                                 </div>
47                                 <div class="form-group col-sm-3">
48                                         <label>Config Name:<sup><b>*</b></sup></label> <input type="text"
49                                                 class="form-control" ng-disabled="temp.policy.readOnly"
50                                                 ng-model="temp.policy.configName" required pattern="\S+"
51                                                 title="Enter the Config Name without any spaces and special characters." />
52                                 </div>
53                                 <div class="form-group col-sm-3">
54                                         <label>Time to Live Date:</label> <input type="text" id="ttlDate"
55                                                 class="form-control" ng-disabled="temp.policy.readOnly" name="ttlDate"
56                                                 ng-model="temp.policy.ttlDate" 
57                                                 title="Select the date from calender onclick on the field."/>
58                                 </div>
59                         </div>
60
61                         <div class="form-group row">
62                                 <div class="form-group col-sm-3">
63                                         <label>Risk Type:<sup><b>*</b></sup></label> <select
64                                                 class="form-control" ng-disabled="temp.policy.readOnly"
65                                                 ng-model="temp.policy.riskType"
66                                                 ng-options="option for option in riskTypeDictionaryDatas track by option"
67                                                 required pattern="\S+" title="Select the dropdown value driven from RiskType (Safe Policy)Dictionary."></select>
68                                 </div>
69                                 <div class="form-group col-sm-3">
70                                         <label>Risk Level:<sup><b>*</b></sup></label> <select
71                                                 class="form-control" ng-disabled="temp.policy.readOnly"
72                                                 ng-model="temp.policy.riskLevel"
73                                                 required pattern="\S+" title="Select the dropdown Risk level value.">
74                                                 <option>1</option>
75                                                 <option>2</option>
76                                                 <option>3</option>
77                                                 <option>4</option>
78                                                 <option>5</option></select>
79                                 </div>
80                                 <div class="form-group col-sm-3">
81                                         <label>Guard:<sup><b>*</b></sup></label> <select
82                                                 class="form-control" ng-disabled="temp.policy.readOnly"
83                                                 ng-model="temp.policy.guard"
84                                                 required pattern="\S+" title="Select the dropdown Guard value.">
85                                                 <option>True</option>
86                                                 <option>False</option></select>
87                                 </div>
88                         </div>
89                 </div>
90                 <div class="well">
91                         <div class="form-group row">
92                                 <div class="form-group col-sm-1">
93                                         <label>Attributes:</label>
94                                         <button type="button" class="btn btn-default"
95                                                 ng-disabled="temp.policy.readOnly" ng-click="addNewChoice()" title="onClick Attribute row is added.">
96                                                 <i class="fa fa-plus"></i>
97                                         </button>
98                                 </div>
99                         </div>
100                         <div class="form-group row">
101                                 <div ng-repeat="choice in temp.policy.attributes">
102                                         <div class="form-group row" style="margin-left: 2%">
103                                                 <div class="form-group col-sm-3">
104                                                         <select class="form-control" required
105                                                                 ng-disabled="temp.policy.readOnly" ng-model="choice.key"
106                                                                 ng-options="option for option in attributeDictionaryDatas track by option"
107                                                                 title="Select the dropdown value driven from Attribute (common)Dictionary."></select>
108                                                 </div>
109                                                 <div class="form-group col-sm-3">
110                                                         <input type="text" class="form-control"
111                                                                 ng-disabled="temp.policy.readOnly" ng-model="choice.value"
112                                                                 placeholder="Attribute Value" required pattern="\S+"
113                                                                 title="Enter the Attribute Value without any spaces and special characters" />
114                                                 </div>
115                                                 <div class="form-group col-sm-1">
116                                                         <button type="button" class="btn btn-default"
117                                                                 ng-disabled="temp.policy.readOnly" ng-show="$last"
118                                                                 ng-click="removeChoice()" title="onClick will remove the last row">
119                                                                 <i class="fa fa-minus"></i>
120                                                         </button>
121                                                 </div>
122                                         </div>
123                                 </div>
124                         </div>
125                 </div>
126                 <div class="well">
127                         <div class="form-group row">
128                                 <div class="form-group col-sm-3">
129                                         <label>Config Type:<sup><b>*</b></sup></label> <select
130                                                 class="form-control" ng-disabled="temp.policy.readOnly"
131                                                 ng-model="temp.policy.configType" required pattern="\S+"
132                                                 title="Select the dropdown ConfigType value.">
133                                                 <option>JSON</option>
134                                                 <option>XML</option>
135                                                 <option>PROPERTIES</option>
136                                                 <option>OTHER</option>
137                                         </select>
138                                 </div>
139                                 <!--    <p><span ng-show="validateConfigType" style="color:red">Config Type Field shouldn't be Empty</span></p> -->
140                         </div>
141                         <div class="form-group row">
142                                 <div class="form-group col-sm-12">
143                                         <label>Body:<sup><b>*</b></sup></label>
144                                         <textarea class="form-control" ng-disabled="temp.policy.readOnly"
145                                                 ng-model="temp.policy.configBodyData" style="height: 400px;"
146                                                 required title="Enter the ConfigBody based on ConfigType Selection"></textarea>
147                                 </div>
148                         </div>
149                 </div>
150                 <div id="validate" style="width: 70%"></div>
151                 <br>
152                 <div class="modal-footer">
153                         <div>
154                                 <button class="btn btn-primary" ng-disabled="temp.policy.readOnly"
155                                         herf="javascript:void(0)" ng-click="validatePolicy(temp.policy);" title="Validate the data entered in the Policy fields.">Validate</button>
156                                 <button class="btn btn-success" ng-disabled="savebutton"
157                                         herf="javascript:void(0)" ng-click="savePolicy(temp);"  title="Save the Policy with validated data.">Save</button>
158                                 <button type="button" class="btn btn-default" ng-click="refresh();" title="Close the template.">Close</button>
159                         </div>
160                 </div>
161         </form>
162 </div>