vnc.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. <!DOCTYPE html>
  2. <html lang="en" class="noVNC_loading">
  3. <head>
  4. <!--
  5. noVNC example: simple example using default UI
  6. Copyright (C) 2018 The noVNC Authors
  7. noVNC is licensed under the MPL 2.0 (see LICENSE.txt)
  8. This file is licensed under the 2-Clause BSD license (see LICENSE.txt).
  9. Connect parameters are provided in query string:
  10. http://example.com/?host=HOST&port=PORT&encrypt=1
  11. or the fragment:
  12. http://example.com/#host=HOST&port=PORT&encrypt=1
  13. -->
  14. <title>noVNC</title>
  15. <meta charset="utf-8">
  16. <!-- Icons (see app/images/icons/Makefile for what the sizes are for) -->
  17. <link rel="icon" sizes="16x16" type="image/png" href="novnc/app/images/icons/novnc-16x16.png">
  18. <link rel="icon" sizes="24x24" type="image/png" href="novnc/app/images/icons/novnc-24x24.png">
  19. <link rel="icon" sizes="32x32" type="image/png" href="novnc/app/images/icons/novnc-32x32.png">
  20. <link rel="icon" sizes="48x48" type="image/png" href="novnc/app/images/icons/novnc-48x48.png">
  21. <link rel="icon" sizes="60x60" type="image/png" href="novnc/app/images/icons/novnc-60x60.png">
  22. <link rel="icon" sizes="64x64" type="image/png" href="novnc/app/images/icons/novnc-64x64.png">
  23. <link rel="icon" sizes="72x72" type="image/png" href="novnc/app/images/icons/novnc-72x72.png">
  24. <link rel="icon" sizes="76x76" type="image/png" href="novnc/app/images/icons/novnc-76x76.png">
  25. <link rel="icon" sizes="96x96" type="image/png" href="novnc/app/images/icons/novnc-96x96.png">
  26. <link rel="icon" sizes="120x120" type="image/png" href="novnc/app/images/icons/novnc-120x120.png">
  27. <link rel="icon" sizes="144x144" type="image/png" href="novnc/app/images/icons/novnc-144x144.png">
  28. <link rel="icon" sizes="152x152" type="image/png" href="novnc/app/images/icons/novnc-152x152.png">
  29. <link rel="icon" sizes="192x192" type="image/png" href="novnc/app/images/icons/novnc-192x192.png">
  30. <!-- Firefox currently mishandles SVG, see #1419039
  31. <link rel="icon" sizes="any" type="image/svg+xml" href="novnc/app/images/icons/novnc-icon.svg">
  32. -->
  33. <!-- Repeated last so that legacy handling will pick this -->
  34. <link rel="icon" sizes="16x16" type="image/png" href="novnc/app/images/icons/novnc-16x16.png">
  35. <!-- Apple iOS Safari settings -->
  36. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  37. <meta name="apple-mobile-web-app-capable" content="yes">
  38. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  39. <!-- Home Screen Icons (favourites and bookmarks use the normal icons) -->
  40. <link rel="apple-touch-icon" sizes="60x60" type="image/png" href="novnc/app/images/icons/novnc-60x60.png">
  41. <link rel="apple-touch-icon" sizes="76x76" type="image/png" href="novnc/app/images/icons/novnc-76x76.png">
  42. <link rel="apple-touch-icon" sizes="120x120" type="image/png" href="novnc/app/images/icons/novnc-120x120.png">
  43. <link rel="apple-touch-icon" sizes="152x152" type="image/png" href="novnc/app/images/icons/novnc-152x152.png">
  44. <!-- Stylesheets -->
  45. <link rel="stylesheet" href="novnc/app/styles/base.css">
  46. <!-- this is included as a normal file in order to catch script-loading errors as well -->
  47. <script src="novnc/app/error-handler.js"></script>
  48. <!-- begin scripts -->
  49. <!-- promise polyfills promises for IE11 -->
  50. <script src="novnc/vendor/promise.js"></script>
  51. <!-- ES2015/ES6 modules polyfill -->
  52. <script type="module">
  53. window._noVNC_has_module_support = true;
  54. </script>
  55. <script>
  56. window.addEventListener("load", function() {
  57. if (window._noVNC_has_module_support) return;
  58. var loader = document.createElement("script");
  59. loader.src = "novnc/vendor/browser-es-module-loader/dist/browser-es-module-loader.js";
  60. document.head.appendChild(loader);
  61. });
  62. </script>
  63. <!-- actual script modules -->
  64. <script type="module" crossorigin="anonymous" src="novnc/app/ui.js"></script>
  65. <!-- end scripts -->
  66. </head>
  67. <body>
  68. <div id="noVNC_fallback_error" class="noVNC_center">
  69. <div>
  70. <div>noVNC encountered an error:</div>
  71. <br>
  72. <div id="noVNC_fallback_errormsg"></div>
  73. </div>
  74. </div>
  75. <!-- noVNC Control Bar -->
  76. <div id="noVNC_control_bar_anchor" class="noVNC_vcenter">
  77. <div id="noVNC_control_bar">
  78. <div id="noVNC_control_bar_handle" title="Hide/Show the control bar"><div></div></div>
  79. <div class="noVNC_scroll">
  80. <h1 class="noVNC_logo" translate="no"><span>no</span><br>VNC</h1>
  81. <!-- Drag/Pan the viewport -->
  82. <input type="image" alt="viewport drag" src="novnc/app/images/drag.svg"
  83. id="noVNC_view_drag_button" class="noVNC_button noVNC_hidden"
  84. title="Move/Drag Viewport">
  85. <!--noVNC Touch Device only buttons-->
  86. <div id="noVNC_mobile_buttons">
  87. <input type="image" alt="No mousebutton" src="novnc/app/images/mouse_none.svg"
  88. id="noVNC_mouse_button0" class="noVNC_button"
  89. title="Active Mouse Button">
  90. <input type="image" alt="Left mousebutton" src="novnc/app/images/mouse_left.svg"
  91. id="noVNC_mouse_button1" class="noVNC_button"
  92. title="Active Mouse Button">
  93. <input type="image" alt="Middle mousebutton" src="novnc/app/images/mouse_middle.svg"
  94. id="noVNC_mouse_button2" class="noVNC_button"
  95. title="Active Mouse Button">
  96. <input type="image" alt="Right mousebutton" src="novnc/app/images/mouse_right.svg"
  97. id="noVNC_mouse_button4" class="noVNC_button"
  98. title="Active Mouse Button">
  99. <input type="image" alt="Keyboard" src="novnc/app/images/keyboard.svg"
  100. id="noVNC_keyboard_button" class="noVNC_button" title="Show Keyboard">
  101. </div>
  102. <!-- Extra manual keys -->
  103. <div id="noVNC_extra_keys">
  104. <input type="image" alt="Extra keys" src="novnc/app/images/toggleextrakeys.svg"
  105. id="noVNC_toggle_extra_keys_button" class="noVNC_button"
  106. title="Show Extra Keys">
  107. <div class="noVNC_vcenter">
  108. <div id="noVNC_modifiers" class="noVNC_panel">
  109. <input type="image" alt="Ctrl" src="novnc/app/images/ctrl.svg"
  110. id="noVNC_toggle_ctrl_button" class="noVNC_button"
  111. title="Toggle Ctrl">
  112. <input type="image" alt="Alt" src="novnc/app/images/alt.svg"
  113. id="noVNC_toggle_alt_button" class="noVNC_button"
  114. title="Toggle Alt">
  115. <input type="image" alt="Windows" src="novnc/app/images/windows.svg"
  116. id="noVNC_toggle_windows_button" class="noVNC_button"
  117. title="Toggle Windows">
  118. <input type="image" alt="Tab" src="novnc/app/images/tab.svg"
  119. id="noVNC_send_tab_button" class="noVNC_button"
  120. title="Send Tab">
  121. <input type="image" alt="Esc" src="novnc/app/images/esc.svg"
  122. id="noVNC_send_esc_button" class="noVNC_button"
  123. title="Send Escape">
  124. <input type="image" alt="Ctrl+Alt+Del" src="novnc/app/images/ctrlaltdel.svg"
  125. id="noVNC_send_ctrl_alt_del_button" class="noVNC_button"
  126. title="Send Ctrl-Alt-Del">
  127. </div>
  128. </div>
  129. </div>
  130. <!-- Shutdown/Reboot -->
  131. <input type="image" alt="Shutdown/Reboot" src="novnc/app/images/power.svg"
  132. id="noVNC_power_button" class="noVNC_button"
  133. title="Shutdown/Reboot...">
  134. <div class="noVNC_vcenter">
  135. <div id="noVNC_power" class="noVNC_panel">
  136. <div class="noVNC_heading">
  137. <img alt="" src="novnc/app/images/power.svg"> Power
  138. </div>
  139. <input type="button" id="noVNC_shutdown_button" value="Shutdown">
  140. <input type="button" id="noVNC_reboot_button" value="Reboot">
  141. <input type="button" id="noVNC_reset_button" value="Reset">
  142. </div>
  143. </div>
  144. <!-- Clipboard -->
  145. <input type="image" alt="Clipboard" src="novnc/app/images/clipboard.svg"
  146. id="noVNC_clipboard_button" class="noVNC_button"
  147. title="Clipboard">
  148. <div class="noVNC_vcenter">
  149. <div id="noVNC_clipboard" class="noVNC_panel">
  150. <div class="noVNC_heading">
  151. <img alt="" src="novnc/app/images/clipboard.svg"> Clipboard
  152. </div>
  153. <textarea id="noVNC_clipboard_text" rows=5></textarea>
  154. <br>
  155. <input id="noVNC_clipboard_clear_button" type="button"
  156. value="Clear" class="noVNC_submit">
  157. </div>
  158. </div>
  159. <!-- Toggle fullscreen -->
  160. <input type="image" alt="Fullscreen" src="novnc/app/images/fullscreen.svg"
  161. id="noVNC_fullscreen_button" class="noVNC_button noVNC_hidden"
  162. title="Fullscreen">
  163. <!-- Settings -->
  164. <input type="image" alt="Settings" src="novnc/app/images/settings.svg"
  165. id="noVNC_settings_button" class="noVNC_button"
  166. title="Settings">
  167. <div class="noVNC_vcenter">
  168. <div id="noVNC_settings" class="noVNC_panel">
  169. <ul>
  170. <li class="noVNC_heading">
  171. <img alt="" src="novnc/app/images/settings.svg"> Settings
  172. </li>
  173. <li>
  174. <label><input id="noVNC_setting_shared" type="checkbox"> Shared Mode</label>
  175. </li>
  176. <li>
  177. <label><input id="noVNC_setting_view_only" type="checkbox"> View Only</label>
  178. </li>
  179. <li><hr></li>
  180. <li>
  181. <label><input id="noVNC_setting_view_clip" type="checkbox"> Clip to Window</label>
  182. </li>
  183. <li>
  184. <label for="noVNC_setting_resize">Scaling Mode:</label>
  185. <select id="noVNC_setting_resize" name="vncResize">
  186. <option value="off">None</option>
  187. <option value="scale">Local Scaling</option>
  188. <option value="remote">Remote Resizing</option>
  189. </select>
  190. </li>
  191. <li><hr></li>
  192. <li>
  193. <div class="noVNC_expander">Advanced</div>
  194. <div><ul>
  195. <li>
  196. <label for="noVNC_setting_repeaterID">Repeater ID:</label>
  197. <input id="noVNC_setting_repeaterID" type="text" value="">
  198. </li>
  199. <li>
  200. <div class="noVNC_expander">WebSocket</div>
  201. <div><ul>
  202. <li>
  203. <label><input id="noVNC_setting_encrypt" type="checkbox"> Encrypt</label>
  204. </li>
  205. <li>
  206. <label for="noVNC_setting_host">Host:</label>
  207. <input id="noVNC_setting_host">
  208. </li>
  209. <li>
  210. <label for="noVNC_setting_port">Port:</label>
  211. <input id="noVNC_setting_port" type="number">
  212. </li>
  213. <li>
  214. <label for="noVNC_setting_path">Path:</label>
  215. <input id="noVNC_setting_path" type="text" value="websockify">
  216. </li>
  217. </ul></div>
  218. </li>
  219. <li><hr></li>
  220. <li>
  221. <label><input id="noVNC_setting_reconnect" type="checkbox"> Automatic Reconnect</label>
  222. </li>
  223. <li>
  224. <label for="noVNC_setting_reconnect_delay">Reconnect Delay (ms):</label>
  225. <input id="noVNC_setting_reconnect_delay" type="number">
  226. </li>
  227. <li><hr></li>
  228. <li>
  229. <label><input id="noVNC_setting_show_dot" type="checkbox" checked> Show Dot when No Cursor</label>
  230. </li>
  231. <li><hr></li>
  232. <!-- Logging selection dropdown -->
  233. <li>
  234. <label>Logging:
  235. <select id="noVNC_setting_logging" name="vncLogging">
  236. </select>
  237. </label>
  238. </li>
  239. </ul></div>
  240. </li>
  241. </ul>
  242. </div>
  243. </div>
  244. <!-- Connection Controls -->
  245. <input type="image" alt="Disconnect" src="novnc/app/images/disconnect.svg"
  246. id="noVNC_disconnect_button" class="noVNC_button"
  247. title="Disconnect">
  248. </div>
  249. </div>
  250. <div id="noVNC_control_bar_hint"></div>
  251. </div> <!-- End of noVNC_control_bar -->
  252. <!-- Status Dialog -->
  253. <div id="noVNC_status"></div>
  254. <!-- Connect button -->
  255. <div class="noVNC_center">
  256. <div id="noVNC_connect_dlg">
  257. <div class="noVNC_logo" translate="no"><span>no</span>VNC</div>
  258. <div id="noVNC_connect_button"><div>
  259. <img alt="" src="novnc/app/images/connect.svg"> Connect
  260. </div></div>
  261. </div>
  262. </div>
  263. <!-- Password Dialog -->
  264. <div class="noVNC_center noVNC_connect_layer">
  265. <div id="noVNC_password_dlg" class="noVNC_panel"><form>
  266. <ul>
  267. <li>
  268. <label>Password:</label>
  269. <input id="noVNC_password_input" type="password">
  270. </li>
  271. <li>
  272. <input id="noVNC_password_button" type="submit" value="Send Password" class="noVNC_submit">
  273. </li>
  274. </ul>
  275. </form></div>
  276. </div>
  277. <!-- Transition Screens -->
  278. <div id="noVNC_transition">
  279. <div id="noVNC_transition_text"></div>
  280. <div>
  281. <input type="button" id="noVNC_cancel_reconnect_button" value="Cancel" class="noVNC_submit">
  282. </div>
  283. <div class="noVNC_spinner"></div>
  284. </div>
  285. <!-- This is where the RFB elements will attach -->
  286. <div id="noVNC_container">
  287. <!-- Note that Google Chrome on Android doesn't respect any of these,
  288. html attributes which attempt to disable text suggestions on the
  289. on-screen keyboard. Let's hope Chrome implements the ime-mode
  290. style for example -->
  291. <textarea id="noVNC_keyboardinput" autocapitalize="off"
  292. autocomplete="off" spellcheck="false" tabindex="-1"></textarea>
  293. </div>
  294. <audio id="noVNC_bell">
  295. <source src="novnc/app/sounds/bell.oga" type="audio/ogg">
  296. <source src="novnc/app/sounds/bell.mp3" type="audio/mpeg">
  297. </audio>
  298. <script type="module">
  299. import UI from './novnc/app/ui.js';
  300. var f = function () {
  301. if (!UI.rfb) {
  302. setTimeout(f, 1000);
  303. } else {
  304. UI.rfb.addEventListener('connect', function(event) {
  305. window.parent.postMessage(JSON.stringify({from: 'novnc', state: 'connected'}), '*');
  306. // UI.rfb._display.defaultCursor();
  307. // console.log(UI.connected)
  308. // console.log(event);
  309. });
  310. UI.rfb.addEventListener('disconnect', function(event) {
  311. window.parent.postMessage(JSON.stringify({from: 'novnc', state: 'disconnected'}), '*');
  312. });
  313. // console.log(UI.rfb._rfb_connection_state);
  314. }
  315. };
  316. f();
  317. </script>
  318. </body>
  319. </html>