[CLAMP-1] Initial ONAP CLAMP seed code commit
[clamp.git] / src / main / resources / META-INF / resources / designer / partials / portfolios / global_template_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
24 <style>
25 .fileUpload {
26         position: relative;
27         overflow: hidden;
28         margin: 10px;
29 }
30
31 .fileUpload input.upload {
32         position: absolute;
33         top: 0;
34         right: 0;
35         margin: 0;
36         padding: 0;
37         font-size: 20px;
38         cursor: pointer;
39         opacity: 0;
40         filter: alpha(opacity = 0);
41         float: left;
42 }
43
44 .fileDisplay {
45         display: inline-block;
46         overflow: hidden;
47         float: right;
48         margin-left: 0px;
49         z-index: initial;
50         text-align: center;
51         margin-top: 17px;
52 }
53 </style>
54
55 <script type="text/javascript">
56         function disablefile() {
57
58                 document.getElementById("fileUpload").disabled = true;
59
60         }
61
62         function disableSVN() {
63
64                 document.getElementById("schemaLocation").disabled = true;
65                 document.getElementById("userID").disabled = true;
66                 document.getElementById("password").disabled = true;
67
68         }
69 </script>
70
71
72 <div attribute-test="globaltemplateproperties" id="configure-widgets">
73         <div class="modal-header">
74                 <button type="button" class="close" ng-click="close(false)"
75                         aria-hidden="true" style="margin-top: -3px">&times;</button>
76                 <h4>Template Properties</h4>
77         </div>
78         <div class="modal-body" style="height: 280px">
79                 <div style="height: 10px"></div>
80                 <form id="saveProps" >
81                                 <div>
82                                         <div class="form-group">
83                                                 <label for="service" class="col-sm-4 control-label"> YAML</label>
84
85                                                 <div class="col-sm-8">
86                                                         <textarea  class="form-control" id="service"
87                                                                 name="service"></textarea>
88
89                                                 </div>
90                                         </div>                                  
91                                 </div>
92
93                 </form>
94         
95
96         </div>
97         <div class="modal-footer">
98                 <!--<button ng-click="reset()" class="btn btn-primary" style="float:left">Reset</button>-->
99                 <button id="savePropsBtn" class="btn btn-primary">Close</button>
100                 <button ng-click="close(true)" id="close_button"
101                         class="btn btn-primary">Cancel</button>
102
103         </div>
104
105
106         <!-- <select id="vUSP_vfc" disabled hidden></select>
107         <select id="vUSP_location" disabled hidden></select>
108         <select id="vUSP_recipe" disabled hidden></select>
109         <select id="vUSP_vf" disabled hidden></select>
110         
111         <select id="Trinity_vfc" disabled hidden></select>
112         <select id="Trinity_location" disabled hidden></select>
113         <select id="Trinity_recipe" disabled hidden></select>
114         <select id="Trinity_vf" disabled hidden></select>
115         
116         
117         <select id="vSCP_vfc" disabled hidden></select>
118         <select id="vSCP_location" disabled hidden></select>
119         <select id="vSCP_recipe" disabled hidden></select>
120         <select id="vSCP_vf" disabled hidden></select>
121         
122         <select id="vProbes_vfc" disabled hidden></select>
123         <select id="vProbes_location" disabled hidden></select>
124         <select id="vProbes_recipe" disabled hidden></select>   
125         <select id="vProbes_vf" disabled hidden></select>
126  -->
127
128                 
129         <script>
130                 loadPropertyWindow("global")
131                 var el = elementMap["global"];
132                 if (el !== undefined) {
133                         for (var i = 0; i < el.length; i++) {
134                                 
135                                 $("#" + el[i].name).val(el[i].value);
136                         }
137                 }
138                 function noRepeats(form){
139                         var select={};
140                         for(var i=0;i<form.length;i++){
141                                 if(select[form[i].name]===undefined)
142                                         select[form[i].name]=[]
143                                 select[form[i].name].push(form[i].value);
144                         }
145                         var arr=[]
146                         for(s in select){
147                                 var f={}
148                                 f.name=s
149                                 f.value=select[s]
150                                 arr.push(f)
151                         }
152                         return arr
153                 }
154                 $("#saveProps").on('submit', function(event) {
155                         saveGlobalProperties(noRepeats($(this).serializeArray()))
156                         event.preventDefault();
157                         
158                         $("#close_button").click();
159
160                 })
161                 $("#savePropsBtn").click(function(event) {
162                         //alert($("#CProp_Target").val())
163                         $("#saveProps").submit();
164                 })
165         </script>
166 </div>
167