Initial OpenECOMP policy/engine commit
[policy/engine.git] / ecomp-sdk-app / src / main / webapp / app / policyApp / policy-models / Editor / PolicyTemplates / BasePolicyTemplate.html
1 <!--
2   ============LICENSE_START=======================================================
3   ECOMP Policy Engine
4   ================================================================================
5   Copyright (C) 2017 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
21 <div  ng-app ng-controller= "baseConfigController">
22 <div class="modal__content">
23 <form class="form-horizontal" role="form" name="myform">        
24         <div class="form-group">
25                 <label>Policy Name:<sup><b>*</b></sup></label>
26                 <div>
27                         <input type="text" class="form-control" ng-disabled ="temp.policy.readOnly" ng-readonly="temp.policy.editPolicy" ng-model="temp.policy.policyName" style="width:800px;" required pattern="\S+" title="Enter the Policy Name without any spaces">
28                 </div>
29         </div>
30         <div class ="form-group">
31         <label>Description:</label>
32         <div>
33                 <input type="text" class="form-control" ng-disabled ="temp.policy.readOnly" ng-model="temp.policy.policyDescription" style="width:800px;"/>
34         </div>
35     </div>
36     <div class ="form-group">
37         <label>Ecomp Name:<sup><b>*</b></sup></label>
38                 <div>
39                         <select class="form-control" style="width:800px;" ng-disabled ="temp.policy.readOnly" ng-model="temp.policy.ecompName"  ng-options="option for option in ecompNameDictionaryDatas track by option"></select>
40                 </div>
41                 <!-- <p><span ng-show="validateEcompName" style="color:red">Ecomp Name Field shouldn't be Empty</span></p> -->
42     </div>
43           <div class="fn-ebz-container" >
44                 <label>Risk Type:<sup><b>*</b></sup></label>
45                         <div>
46                                 <select class="form-field"  style="width:450px;" ng-disabled ="temp.policy.readOnly" ng-model="temp.policy.riskType"  ng-options="option for option in riskTypeDictionaryDatas track by option"></select>
47                         </div>
48                         <!-- <p><span ng-show="validateRiskType" style="color:red">Risk Type Field shouldn't be Empty</span></p> -->
49         </div> 
50          <div class="fn-ebz-container" >
51                 <label>Risk Level:<sup><b>*</b></sup></label>
52                         <div>
53                                 <select class="form-field"  style="width:450px;" ng-disabled ="temp.policy.readOnly" ng-model="temp.policy.riskLevel"  ng-options="option for option in riskLevelDatas track by option"></select>
54                         </div>
55                         <!-- <p><span ng-show="validateRiskLevel" style="color:red">Risk Level Field shouldn't be Empty</span></p> -->
56         </div> 
57          <div class="fn-ebz-container" >
58                 <label>Guard:<sup><b>*</b></sup></label>
59                         <div>
60                                 <select class="form-field"  style="width:450px;" ng-disabled ="temp.policy.readOnly" ng-model="temp.policy.guard"  ng-options="option for option in guardDatas track by option"></select>
61                         </div>
62                         <!-- <p><span ng-show="validateGuard" style="color:red">Guard Field shouldn't be Empty</span></p> -->
63                 </div> 
64         <div class ="fn-ebz-container">
65         <label>Time to Live Date:<sup><b>*</b></sup></label>
66                 <div>
67                         <input type="date" name="ttlDate" class="date"  ng-model="temp.policy.ttlDate"/>
68                 </div>                  
69         </div>    
70         <div class ="form-group">
71         <label>Config Name:<sup><b>*</b></sup></label>
72         <div>
73                 <input type="text" class="form-control" ng-disabled ="temp.policy.readOnly" ng-model="temp.policy.configName" style="width:800px;" required pattern="\S+" title="Enter the Config Name without any spaces"/>
74         </div>
75     </div>
76     <div class ="form-group">
77         <label>Attributes:</label>
78              <form  method="post" class="form-horizontal" >
79                         <div class="form-group">
80                                 <div class="col-xs-1">
81                                 <button type="button" class="btn btn-default" ng-disabled ="temp.policy.readOnly" ng-click="addNewChoice()"><i class="fa fa-plus"></i></button>
82                                 </div>
83                         </div>  
84                         <div ng-repeat="choice in temp.policy.attributes">      
85                                 <div class="fn-ebz-container">
86                                         <select  class="form-field" required ng-disabled ="temp.policy.readOnly" ng-model="choice.option" ng-options="option for option in attributeDictionaryDatas track by option" ></select>
87                                 </div>
88                                 <div class="fn-ebz-container">
89                                         <input type="text" class="form-field" ng-disabled ="temp.policy.readOnly" ng-model= "choice.number" placeholder="Attribute Value" required pattern="\S+" title="Enter the Attribute Value without any spaces"/>
90                                 </div>
91                                 <div class="fn-ebz-container">
92                                         <button type="button" class="btn btn-default" ng-disabled ="temp.policy.readOnly" ng-show="$last" ng-click="removeChoice()"><i class="fa fa-minus"></i></button>
93                                 </div>
94                         </div>
95                 </form> 
96         </div>
97     <div class ="form-group">     
98         <label>Config Type:<sup><b>*</b></sup></label>
99         <div>
100                 <select class="form-field" ng-disabled ="temp.policy.readOnly" ng-model="temp.policy.configType">
101                 <option>JSON</option>
102                 <option>XML</option>
103                 <option>PROPERTIES</option>
104                 <option>OTHER</option>
105              </select>
106         </div>
107        <!--     <p><span ng-show="validateConfigType" style="color:red">Config Type Field shouldn't be Empty</span></p> -->
108         </div>
109      <div class ="form-group">           
110           <label>Body:<sup><b>*</b></sup></label>
111           <div>
112                <textarea class="form-control" ng-disabled ="temp.policy.readOnly" ng-model="temp.policy.configBodyData" style="height :400px; width:400px;" ></textarea>
113                   <!--  <p><span ng-show="validateConfigTypeNull" style="color:red">Config Type Field shouldn't be Empty</span></p>
114                    <p><span ng-show="validateConfigTypeBody" style="color:red">{{errorMessage}}</span></p> -->
115            </div>       
116     </div>      
117     <div class="form-group">
118         <div>
119            <button class="button button--primary button--small" ng-disabled ="temp.policy.readOnly" herf="javascript:void(0)" ng-click="validatePolicy(temp.policy);">Validate</button>
120            <button class="btn btn-success" ng-disabled ="savebutton" herf="javascript:void(0)" ng-click="savePolicy(temp);">Save</button>
121            <button type="button" class="btn btn-default" data-dismiss="modal" ng-click = "close();">Close</button>
122         </div>
123     </div>
124 </form>
125 </div>
126 </div>