Update Holmes related feature
[clamp.git] / src / main / resources / META-INF / resources / designer / partials / portfolios / holmes_properties.html
1 <!--
2   ============LICENSE_START=======================================================
3   ONAP CLAMP
4   ================================================================================
5   Copyright (C) 2017 AT&T Intellectual Property. All rights
6                               reserved.
7   ================================================================================
8   Licensed under the Apache License, Version 2.0 (the "License");
9   you may not use this file except in compliance with the License.
10   You may obtain a copy of the License at
11
12   http://www.apache.org/licenses/LICENSE-2.0
13
14   Unless required by applicable law or agreed to in writing, software
15   distributed under the License is distributed on an "AS IS" BASIS,
16   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17   See the License for the specific language governing permissions and
18   limitations under the License.
19   ============LICENSE_END============================================
20   ===================================================================
21   ECOMP is a trademark and service mark of AT&T Intellectual Property.
22   -->
23 <style>
24 </style>
25
26
27 <div id="holmes-configuration">
28   <!-- form header -->
29   <div class="modal-header">
30     <button type="button" class="close" ng-click="close(false)" aria-hidden="true" style="margin-top: -3px">&times;</button>
31     <h4>Holmes Microservice Configuration</h4>
32   </div>
33
34   <!-- Form center-->
35   <div class="modal-body" style="height: 280px">
36
37     <form id="saveProps" class="form-horizontal">
38       <div class="form-group">
39         <div>
40           <label for="correlationalLogic" class="col-sm-4 control-label">Correlational logic</label>
41         </div>
42         <div class="col-sm-8">
43           <textarea class="form-control" focus="true" name="correlationalLogic"  id="correlationalLogic" />
44         </div>
45         <div>
46           <label for="configPolicyName" class="col-sm-4 control-label">Configuration Policy Name</label>
47         </div>
48         <div class="col-sm-8">
49           <textarea class="form-control" focus="true" name="configPolicyName"  id="configPolicyName" />
50         </div>
51       </div>
52     </form>
53
54   </div>
55
56   <!-- footer -->
57   <div class="modal-footer">
58     <button id="savePropsBtn" class="btn btn-primary">Save</button>
59     <button id="close_button" class="btn btn-primary" ng-click="close(true)">Cancel</button>
60   </div>
61 </div>
62
63 <script language="javascript">
64
65 // load window
66 loadPropertyWindow('holmes')
67
68 // fill policy combo box (allPolicies from ImporSchemaCtrl.js
69 if (typeof allPolicies !== "undefined"){
70           $.each(Object.keys(allPolicies), function(val, text) {
71               $('#operationalPolicy').append($('<option></option>').val(text).html(text));
72           });  
73 } else if (typeof elementMap !== "undefined"){
74                 for (key in elementMap){
75                                 if (key.indexOf("Policy")>-1){
76                                           $.each(Object.keys(elementMap[key]), function(val, text){
77                                                     $('#operationalPolicy').append(
78                                                               $('<option></option>').val(text).html(text)
79                                                     );
80                                           });
81                                 }
82                 }
83 }
84
85 // load property values
86 var el=elementMap[lastElementSelected];
87 if(el!==undefined){
88     for(var i=0;i<el.length;i++){
89         $("#"+el[i].name).val(el[i].value);
90     }
91 }
92
93 $("#saveProps").on('submit', function (event) {
94     saveProperties($(this).serializeArray())
95     event.preventDefault();
96     $("#close_button").click();
97 });
98
99 $("#savePropsBtn").click(function (event) {
100     $("#saveProps").submit();
101 });
102
103
104
105
106
107 </script>