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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
|
<html>
<head>
<title>Spice-XPI test page</title>
<style type="text/css">
caption {
text-align: left;
font-weight: bold;
}
th {
text-align: left;
}
</style>
</head>
<body onload='bodyLoad()' onunload='bodyUnload()'>
<center>
<h1>SPICE xpi test page</h1>
</center>
SPICE xpi test page. Disabled (greyed out) values are passed to SPICE xpi as empty variables, asterisk-marked ones are passed when you press button marked in the same fashion.
<br />
<center>
<embed type="application/x-spice" width="0" height="0" id="spice-xpi" /><br />
<script type="text/javascript">
var embed = document.getElementById("spice-xpi");
function bodyLoad()
{
log("BodyLoad");
}
function bodyUnload()
{
log("BodyUnload");
}
function connect()
{
setConnectVars();
log("connect: host '" + embed.hostIP + "', port '" + embed.port + "', secure port '" + embed.SecurePort + "', USB port '" + embed.UsbListenPort + "'");
embed.connect();
}
function disconnect()
{
embed.disconnect();
log("disconnected by page");
}
/* FIXME
function OnDisconnected(msg)
{
log(msg);
}
*/
function log(message)
{
var log = document.getElementById("log");
var ts = new Date().toString() + ": ";
var newRow = document.createElement("tr");
var tsCell = document.createElement("td");
var msgCell = document.createElement("td");
tsCell.innerHTML = ts;
msgCell.innerHTML = message;
newRow.appendChild(tsCell);
newRow.appendChild(msgCell);
log.appendChild(newRow);
}
function setLanguageStrings()
{
section = document.getElementById("LanguageStringsSectionToggled").checked == true ? document.getElementById("LanguageStringsSection").value : "";
lang = document.getElementById("LanguageStringsLangToggled").checked == true ? document.getElementById("LanguageStringsLang").value : "";
embed.SetLanguageStrings(section, lang)
log("Language Strings were set to '" + section + "' '" + lang + "'");
}
function setUsbFilter()
{
filter = document.getElementById("UsbFilterToggled").checked == true ? document.getElementById("UsbFilter").value : "";
embed.SetUsbFilter(filter);
log("USB Filter String was set to: '" + filter + "'");
}
function setConnectVars()
{
if(document.getElementById("hostIPToggled").checked == true) { embed.hostIP = document.getElementById("hostIP").value; } else { embed.hostIP = ""; }
if(document.getElementById("portToggled").checked == true) { embed.port = document.getElementById("port").value; } else { embed.port = ""; }
if(document.getElementById("SecurePortToggled").checked == true) { embed.SecurePort = document.getElementById("SecurePort").value; } else { embed.SecurePort = ""; }
if(document.getElementById("PasswordToggled").checked == true) { embed.Password = document.getElementById("Password").value; } else { embed.Password = ""; }
if(document.getElementById("CipherSuiteToggled").checked == true) { embed.CipherSuite = document.getElementById("CipherSuite").value; } else { embed.CipherSuite = ""; }
if(document.getElementById("SSLChannelsToggled").checked == true) { embed.SSLChannels = document.getElementById("SSLChannels").value; } else { embed.SSLChannels = ""; }
if(document.getElementById("TrustStoreToggled").checked == true) { embed.TrustStore = document.getElementById("TrustStore").value; } else { embed.TrustStore = ""; }
if(document.getElementById("HostSubjectToggled").checked == true) { embed.HostSubject = document.getElementById("HostSubject").value; } else { embed.HostSubject = ""; }
if(document.getElementById("fullScreenToggled").checked == true) { embed.fullScreen = document.getElementById("fullScreen").checked; } else { embed.fullScreen = ""; }
if(document.getElementById("AdminConsoleToggled").checked == true) { embed.AdminConsole = document.getElementById("AdminConsole").checked; } else { embed.AdminConsole = ""; }
if(document.getElementById("TitleToggled").checked == true) { embed.Title = document.getElementById("Title").value; } else { embed.Title = ""; }
if(document.getElementById("dynamicMenuToggled").checked == true) { embed.dynamicMenu = document.getElementById("dynamicMenu").value; } else { embed.dynamicMenu = ""; }
if(document.getElementById("NumberOfMonitorsToggled").checked == true) { embed.NumberOfMonitors = document.getElementById("NumberOfMonitors").value; } else { embed.NumberOfMonitors = ""; }
if(document.getElementById("GuestHostNameToggled").checked == true) { embed.GuestHostName = document.getElementById("GuestHostName").value; } else { embed.GuestHostName = ""; }
if(document.getElementById("HotKeyToggled").checked == true) { embed.HotKey = document.getElementById("HotKey").value; } else { embed.HotKey = ""; }
if(document.getElementById("NoTaskMgrExecutionToggled").checked == true) { embed.NoTaskMgrExecution = document.getElementById("NoTaskMgrExecution").checked; } else { embed.NoTaskMgrExecution = ""; }
if(document.getElementById("SendCtrlAltdeleteToggled").checked == true) { embed.SendCtrlAltdelete = document.getElementById("SendCtrlAltdelete").checked; } else { embed.SendCtrlAltDelete = ""; }
if(document.getElementById("UsbListenPortToggled").checked == true) { embed.UsbListenPort = parseInt( document.getElementById("UsbListenPort").value ); } else { embed.UsbListenPort = ""; }
if(document.getElementById("UsbAutoShareToggled").checked == true) { embed.UsbAutoShare = document.getElementById("UsbAutoShare").checked; } else { embed.UsbAutoShare = ""; }
if(document.getElementById("SmartcardToggled").checked == true) { embed.Smartcard = document.getElementById("Smartcard").checked; } else { embed.Smartcard = ""; }
}
function show()
{
embed.show();
log("Show was called");
}
function status()
{
var status = embed.ConnectedStatus();
log("ConnectedStatus = " + status);
}
function toggle(checkboxID)
{
var checkbox = document.getElementById(checkboxID);
for (var i = 1; i < arguments.length; i++)
{
var toggle = document.getElementById(arguments[i]);
var updateToggle = checkbox.checked ? toggle.disabled = false : toggle.disabled = true;
}
}
</script>
<table id="values">
<tr>
<td>
<table>
<tr>
<td><input type="checkbox" id="hostIPToggled" onclick="toggle('hostIPToggled', 'hostIP')" checked /></td>
<td>Host:</td>
<td> <input id="hostIP" type="text" size="30" /></td>
</tr>
<tr>
<td><input type="checkbox" id="portToggled" onclick="toggle('portToggled', 'port')" checked /></td>
<td>Port:</td>
<td> <input id="port" type="text" size="30" /> </td>
</tr>
<tr>
<td><input type="checkbox" id="SecurePortToggled" onclick="toggle('SecurePortToggled', 'SecurePort')" /></td>
<td>SecurePort:</td>
<td> <input id="SecurePort" type="text" size="30" disabled /> </td>
</tr>
<tr>
<td><input type="checkbox" id="PasswordToggled" onclick="toggle('PasswordToggled', 'Password')" /></td>
<td>Password:</td>
<td> <input id="Password" type="text" size="30" disabled /><br />
</tr>
<tr>
<td><input type="checkbox" id="CipherSuiteToggled" onclick="toggle('CipherSuiteToggled', 'CipherSuite')" /></td>
<td>Cipher Suite:</td>
<td> <input id="CipherSuite" type="text" size="30" disabled /></td>
</tr>
<tr>
<td><input type="checkbox" id="SSLChannelsToggled" onclick="toggle('SSLChannelsToggled', 'SSLChannels')" /></td>
<td>Secure Channels:</td>
<td> <input id="SSLChannels" type="text" size="30" disabled /></td>
</tr>
<tr>
<td><input type="checkbox" id="HostSubjectToggled" onclick="toggle('HostSubjectToggled', 'HostSubject')" /></td>
<td>Host Subject:</td>
<td> <input id="HostSubject" type="text" size="30" disabled /></td>
</tr>
<tr>
<td><input type="checkbox" id="fullScreenToggled" onclick="toggle('fullScreenToggled', 'fullScreen')" /></td>
<td>Full Screen:</td>
<td> <input id="fullScreen" type="checkbox" disabled /> </td>
</tr>
<tr>
<td><input type="checkbox" id="AdminConsoleToggled" onclick="toggle('AdminConsoleToggled', 'AdminConsole')" checked /></td>
<td>AdminConsole:</td>
<td> <input id="AdminConsole" type="checkbox" checked /></td>
</tr>
<tr>
<td><input type="checkbox" id="TitleToggled" onclick="toggle('TitleToggled', 'Title')" /></td>
<td>Title:</td>
<td> <input id="Title" type="text" size="30" disabled /></td>
</tr>
<tr>
<td><input type="checkbox" id="dynamicMenuToggled" onclick="toggle('dynamicMenuToggled', 'dynamicMenu')" /></td>
<td>Dynamic Menu:</td>
<td> <input id="dynamicMenu" type="text" size="30" disabled /></td>
</tr>
<tr>
<td><input type="checkbox" id="NumberOfMonitorsToggled" onclick="toggle('NumberOfMonitorsToggled', 'NumberOfMonitors')" /></td>
<td>Number of Monitors:</td>
<td> <input id="NumberOfMonitors" type="text" size="30" disabled /></td>
</tr>
<tr>
<td><input type="checkbox" id="GuestHostNameToggled" onclick="toggle('GuestHostNameToggled', 'GuestHostName')" /></td>
<td>GuestHostName:</td>
<td> <input id="GuestHostName" type="text" size="30" disabled /></td>
</tr>
<tr>
<td><input type="checkbox" id="HotKeyToggled" onclick="toggle('HotKeyToggled', 'HotKey')" checked /></td>
<td>Hot Key:</td>
<td> <input id="HotKey" type="text" size="30" value="toggle-fullscreen=shift+f11,release-cursor=shift+f12,smartcard-insert=shift+f8,smartcard-remove=shift+f9" /></td>
</tr>
<tr>
<td><input type="checkbox" id="NoTaskMgrExecutionToggled" onclick="toggle('NoTaskMgrExecutionToggled', 'NoTaskMgrExecution')" /></td>
<td title="Suppress launching of task manager when Ctrl+Alt+Del is pressed">NoTaskMgrExecution:</td>
<td> <input id="NoTaskMgrExecution" type="checkbox" disabled /></td>
</tr>
<tr>
<td><input type="checkbox" id="SendCtrlAltdeleteToggled" onclick="toggle('SendCtrlAltdeleteToggled', 'SendCtrlAltdelete')" /></td>
<td>Send Ctrl+Alt+Delete:</td>
<td> <input id="SendCtrlAltdelete" type="checkbox" disabled /></td>
</tr>
<tr>
<td><input type="checkbox" id="UsbListenPortToggled" onclick="toggle('UsbListenPortToggled', 'UsbListenPort')" /></td>
<td>USB listen port:</td>
<td> <input id="UsbListenPort" type="text" size="30" value="32023" disabled /></td>
</tr>
<tr>
<td><input type="checkbox" id="UsbAutoShareToggled" onclick="toggle('UsbAutoShareToggled', 'UsbAutoShare')" /></td>
<td>USB Auto Share:</td>
<td> <input id="UsbAutoShare" type="checkbox" disabled /></td>
</tr>
<tr>
<td><input type="checkbox" id="SmartcardToggled" onclick="toggle('SmartcardToggled', 'Smartcard')" checked /></td>
<td>Smartcard:</td>
<td> <input id="Smartcard" type="checkbox" /></td>
</tr>
<tr>
<td><input type="checkbox" id="LanguageStringsSectionToggled" onclick="toggle('LanguageStringsSectionToggled', 'LanguageStringsSection')" checked /></td>
<td>*Language Strings - section:</td>
<td> <input id="LanguageStringsSection" type="input" size="30" /></td>
</tr>
<tr>
<td><input type="checkbox" id="LanguageStringsLangToggled" onclick="toggle('LanguageStringsLangToggled', 'LanguageStringsLang')" checked /></td>
<td>*Language Strings - lang:</td>
<td> <input id="LanguageStringsLang" type="input" size="30" /></td>
</tr>
<tr>
<td><input type="checkbox" id="UsbFilterToggled" onclick="toggle('UsbFilterToggled', 'UsbFilter')" checked /></td>
<td>**Set USB Filter:</td>
<td><input id="UsbFilter" type="text" size="30" /></td>
</tr>
</table>
</td>
<td rowspan="21" width="25px" > </td>
<td>
<table>
<td>
<tr>
<td><input type="checkbox" id="TrustStoreToggled" onclick="toggle('TrustStoreToggled', 'TrustStore')" /></td>
<td title="CA Certificate in plain text. For RHEV-M, it can be found in 'http://rhev-m.example.com/ca.crt'">Trust Store:</td>
</tr>
<tr><td colspan="2"><textarea id="TrustStore" cols="66" rows="33" disabled ></textarea></td></tr>
</table>
</td>
</tr>
</table>
<input type="button" value="Connect" onclick='connect()' />
<input type="button" value="Check Status" onclick='status()' />
<input type="button" value="Show" onclick='show()' />
<input type="button" value="*Set Language Strings" onclick='setLanguageStrings()' id="LanguageStringsButton" />
<input type="button" value="**Set Usb Filter" onclick='setUsbFilter()' id="UsbFilterButton" />
<input type="button" value="Disconnect" onclick='disconnect()' />
</center>
<hr />
<table style="border: 1px; border-color: black; " >
<caption >log:</caption>
<thead><tr><th style="width: 22em; ">timestamp</th><th>message</th></tr></thead>
<tbody style="font-family: monospace; " id="log">
</tbody>
</table>
</body>
</html>
|