-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathovfcommand.html
More file actions
238 lines (183 loc) · 6.21 KB
/
Copy pathovfcommand.html
File metadata and controls
238 lines (183 loc) · 6.21 KB
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>OVF command</title>
<style type="text/css" media="screen">
body {font-family:verdana, sans-serif; color:#666; background:#fafafa; padding:20px; text-align:center;}
#page {text-align:left; max-width:600px; margin:0 auto;}
h1 {font-size:16px; font-weight:normal; text-align:center;}
label {font-size:16px;}
label i {font-style:normal; display:inline-block; text-align:right; width:100px;}
label textarea {vertical-align:top;}
button {margin-left:105px; padding:5px; margin-top:5px; font-size:16px;}
input, textarea {width:400px; font-size:16px; font-family: courier, "courier new", monospace; margin:0 0 5px 0; padding:5px; border:1px solid #eee;}
select {margin:0 0 5px 0;}
@media (min-width:300px) and (max-width: 768px)
{
input, textarea {width:100%;}
label i {display:block; width:auto; text-align:left;}
button {display:block; margin:0;}
}
</style>
<script type="text/javascript">
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth()+1;
var yyyy = today.getFullYear();
if(dd<10) {
dd='0'+dd
}
if(mm<10) {
mm='0'+mm
}
today = yyyy+'-'+mm+'-'+dd;
function saveFormAsTextFile()
{
var textToSave = 'ovftool --noSSLVerify --acceptAllEulas --skipManifestCheck --X:injectOvfEnv --powerOn "--net:' + document.getElementById('source_network').value +
'=' + document.getElementById('destination_network').value +
'" --datastore=' + document.getElementById('datastore').value +
' --diskMode=' + document.getElementById('disk_mode').value +
' --name=' + document.getElementById('vm_name').value +
'--prop:proxy_name=' + document.getElementById('proxy_name').value +
' --prop:gateway=' + document.getElementById('gateway').value +
' --prop:ipaddress=' + document.getElementById('ipaddress').value +
' --prop:netmask=' + document.getElementById('netmask').value +
' --prop:domain=' + document.getElementById('domain').value +
' --prop:dns1=' + document.getElementById('primary_dns').value +
' --prop:dns2=' + document.getElementById('secondary_dns').value +
' --prop:global_proxy=' + document.getElementById('global_proxy').value +
' --prop:client_network="' + document.getElementById('client_network').value + '"'
' --prop:global_smtp_relay=' + document.getElementById('global_smtp_relay').value +
' D:\RP\ITEC-REVERSEPROXY.ovf "vi://' + document.getElementById('username').value +
'@' + document.getElementById('ip_host').value +
':443/' + document.getElementById('datacenter').value +
'/host' + document.getElementById('cluster_name').value + '"';
var textToSaveAsBlob = new Blob([textToSave], {type:"text/plain"});
var textToSaveAsURL = window.URL.createObjectURL(textToSaveAsBlob);
var fileNameToSaveAs = document.getElementById("filename").value;
var downloadLink = document.createElement("a");
downloadLink.download = fileNameToSaveAs;
downloadLink.innerHTML = "Download file";
downloadLink.href = textToSaveAsURL;
downloadLink.onclick = destroyClickedElement;
downloadLink.style.display = "none";
document.body.appendChild(downloadLink);
downloadLink.click();
}
function destroyClickedElement(event)
{
document.body.removeChild(event.target);
}
</script>
</head>
<body>
<div id="page">
<h1>OVF command</h1>
<label for="source_network">
<i>Source newtork</i>
<input id="source_network" size="40">
</label>
<br>
<label for="destination_network">
<i>Destination network</i>
<input id="destination_network" size="40">
</label>
<br>
<label for="datastore">
<i>Datastore</i>
<input id="datastore" size="40">
</label>
<br>
<label for="disk_mode">
<i>Disk mode</i>
<input id="disk_mode" size="40">
</label>
<br>
<label for="vm_name">
<i>VM name</i>
<input id="vm_name" size="40">
</label>
<br>
<label for="proxy_name">
<i>Hostname</i>
<input id="proxy_name" size="40">
</label>
<br>
<label for="gateway">
<i>Gateway</i>
<input id="gateway" size="40">
</label>
<label for="ipaddress">
<i>IP</i>
<input id="ipaddress" size="40">
</label>
<br>
<label for="netmask">
<i>Netmask</i>
<input id="netmask" size="40">
</label>
<br>
<label for="domain">
<i>Domain</i>
<input id="domain" size="40">
</label>
<br>
<label for="primary_dns">
<i>Primary DNS</i>
<input id="primary_dns" size="40">
</label>
<br>
<label for="secondary_dns">
<i>Secondary DNS</i>
<input id="secondary_dns" size="40">
</label>
<br>
<label for="global_proxy">
<i>Global Proxy</i>
<input id="global_proxy" size="40">
</label>
<br>
<label for="client_network">
<i>Client network</i>
<input id="client_network" size="40">
</label>
<br>
<label for="global_smtp_relay">
<i>Global SMTP</i>
<input id="global_smtp_relay" size="40">
</label>
<br>
<label for="username">
<i>Username</i>
<input id="username" size="40">
</label>
<br>
<label for="ip_host">
<i>IP host</i>
<input id="ip_host" size="40">
</label>
<br>
<label for="datacenter">
<i>Datacenter</i>
<input id="datacenter" size="40">
</label>
<br>
<label for="cluster_name">
<i>Cluster name</i>
<input id="cluster_name" size="40">
</label>
<br>
<label for="filename">
<i>Filename</i>
<input id="filename" value="" size="40" placeholder="File name">
</label>
<button onclick="saveFormAsTextFile()">
Download configuration
</button>
<!-- Pfff ! Je pensais que t’étais beaucoup plus fort que ça Batman ! -->
</div>
</body>
</html>