summaryrefslogtreecommitdiffstats
path: root/src/main/resources/META-INF/resources/designer/partials/portfolios/global_properties.html
blob: c47e90a49f07e2f986f22ef4446782afb1540aaf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<!--
  ============LICENSE_START=======================================================
  ONAP CLAMP
  ================================================================================
  Copyright (C) 2017 AT&T Intellectual Property. All rights
                              reserved.
  ================================================================================
  Licensed under the Apache License, Version 2.0 (the "License"); 
  you may not use this file except in compliance with the License. 
  You may obtain a copy of the License at
  
  http://www.apache.org/licenses/LICENSE-2.0
  
  Unless required by applicable law or agreed to in writing, software 
  distributed under the License is distributed on an "AS IS" BASIS, 
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
  See the License for the specific language governing permissions and 
  limitations under the License.
  ============LICENSE_END============================================
  ===================================================================
  
  -->


<style>
#paramsWarn {
	display: none;
}
</style>

<div id="configure-widgets">
	<div class="modal-header">
		<button type="button" class="close" ng-click="close(false)"
			aria-hidden="true" style="margin-top: -3px">&times;</button>
		<h4>Model Properties</h4>
	</div>

	<div class="modal-body" style="height: 280px">
		<i hidden id="ridinSpinners" class="fa fa-spinner fa-spin"
			style="display: none; margin-bottom: 10px; width: 100%; text-align: center; font-size: 24px; color: black;"></i>
		<form id="saveProps">
			<div class="alert alert-danger" role="alert" id='paramsWarn'>
				<strong>Ooops!</strong> Unable to load properties for <span
					id='servName'>. Would you like to</span> <a
					href="javascript:void(0);" class="btn-link" id='paramsRetry'>Retry
				</a> / <a href="javascript:void(0);" class="btn-link" id='paramsCancel'>Cancel</a>
			</div>
			<div>

				<div class="form-group clearfix">
					<label for="actionSet" class="col-sm-4 control-label">
						Action Set</label>

					<div class="col-sm-8">
						<select class="form-control" id="actionSet" name="actionSet"
							onchange="propChangeAlert(this);">
						</select>

					</div>
				</div>

				<div class="form-group clearfix">
					<label for="location" class="col-sm-4 control-label">
						Location</label>

					<div class="col-sm-8">
						<select class="form-control" id="location" name="location"
							multiple size=2>

						</select>

					</div>
				</div>
				<div class="form-group clearfix">
					<label for="deployParameters" class="col-sm-4 control-label">
						Deploy Parameters</label>

					<div class="col-sm-8">
						<textarea class="form-control" id="deployParameters"
							name="deployParameters" rows="3">
						</textarea>

					</div>
				</div>


			</div>

		</form>
		<div class="alert alert-warning propChangeWarn" style="display: none;">
			<strong>Warning!</strong> Changing these properties will reset all
			associated GUI fields.
		</div>

	</div>
	<div class="modal-footer">
		<button id="savePropsBtn" class="btn btn-primary" ng-click="submitForm()">Save</button>
		<button ng-click="close(true)" id="close_button"
			class="btn btn-primary">Cancel</button>

	</div>


	<script>
		//display message only if global was previously saved
        asDiff = false;

        function propChangeAlert(actionset) {
	        //throw warnings only if options were previously chosen
	        if (elementMap["global"]) {
		        loop1: for (var i = 0; i < elementMap["global"].length; i++) {
			        if (elementMap["global"][i]["name"] == actionset.id) {
				        //user did not change properties						
				        if (elementMap["global"][i]["value"][0] == actionset.value) {
					        if (elementMap["global"][i]["name"] == "actionSet") {
						        asDiff = false;
					        }
					        if (!asDiff) {
						        $(".propChangeWarn").hide();
					        }
					        ;
					        //user changed properties
				        } else {
					        if (elementMap["global"][i]["name"] == "actionSet") {
						        asDiff = true;
					        };
					        $(".propChangeWarn").show();
				        }
				        break loop1;
			        }
		        }
	        }
        }
	</script>
</div>