]>
Commit | Line | Data |
---|---|---|
d6015915 DM |
1 | package PVE::NoVncIndex; |
2 | ||
3 | use strict; | |
4 | use warnings; | |
5 | ||
6 | sub get_index { | |
7 | my ($lang, $username, $csrftoken, $console) = @_; | |
8 | ||
9 | my $page = <<_EOD; | |
10 | <!DOCTYPE html> | |
11 | <html> | |
12 | <head> | |
13 | <title>Proxmox Console</title> | |
14 | <meta charset="utf-8"> | |
15 | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
16 | <!-- Apple iOS Safari settings --> | |
17 | <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> | |
18 | <!-- Stylesheets --> | |
19 | <link rel="stylesheet" href="/novnc/include/base.css"/> | |
20 | _EOD | |
21 | ||
22 | my $langfile = "/usr/share/pve-manager/locale/pve-lang-${lang}.js"; | |
23 | if (-f $langfile) { | |
24 | $page .= "<script type='text/javascript' src='/pve2/locale/pve-lang-${lang}.js'></script>"; | |
25 | } else { | |
26 | $page .= '<script type="text/javascript">function gettext(buf) { return buf; }</script>'; | |
27 | } | |
28 | ||
29 | $page .= <<_EOD; | |
30 | <script type="text/javascript"> | |
31 | if (typeof(PVE) === 'undefined') PVE = {}; | |
32 | PVE.UserName = '$username'; | |
33 | PVE.CSRFPreventionToken = '$csrftoken'; | |
34 | INCLUDE_URI='/novnc/include/'; | |
35 | </script> | |
36 | </head> | |
37 | <body> | |
38 | <div id="noVNC-control-bar"> | |
39 | <!--noVNC Mobile Device only Buttons--> | |
40 | <div class="noVNC-buttons-left"> | |
41 | <input type="image" alt="viewport drag" src="/novnc/images/drag.png" | |
42 | id="noVNC_view_drag_button" class="noVNC_status_button" | |
43 | title="Move/Drag Viewport"> | |
44 | <div id="noVNC_mobile_buttons"> | |
45 | <input type="image" alt="No mousebutton" src="/novnc/images/mouse_none.png" | |
46 | id="noVNC_mouse_button0" class="noVNC_status_button"> | |
47 | <input type="image" alt="Left mousebutton" src="/novnc/images/mouse_left.png" | |
48 | id="noVNC_mouse_button1" class="noVNC_status_button"> | |
49 | <input type="image" alt="Middle mousebutton" src="/novnc/images/mouse_middle.png" | |
50 | id="noVNC_mouse_button2" class="noVNC_status_button"> | |
51 | <input type="image" alt="Right mousebutton" src="/novnc/images/mouse_right.png" | |
52 | id="noVNC_mouse_button4" class="noVNC_status_button"> | |
53 | <input type="image" alt="Keyboard" src="/novnc/images/keyboard.png" | |
54 | id="showKeyboard" class="noVNC_status_button" | |
55 | value="Keyboard" title="Show Keyboard"/> | |
56 | <!-- Note that Google Chrome on Android doesn't respect any of these, | |
57 | html attributes which attempt to disable text suggestions on the | |
58 | on-screen keyboard. Let's hope Chrome implements the ime-mode | |
59 | style for example --> | |
60 | <textarea id="keyboardinput" autocapitalize="off" | |
61 | autocorrect="off" autocomplete="off" spellcheck="false" | |
62 | mozactionhint="Enter" onsubmit="return false;" | |
63 | style="ime-mode: disabled;"></textarea> | |
64 | <div id="noVNC_extra_keys"> | |
65 | <input type="image" alt="Extra keys" src="/novnc/images/showextrakeys.png" | |
66 | id="showExtraKeysButton" class="noVNC_status_button"> | |
67 | <input type="image" alt="Ctrl" src="/novnc/images/ctrl.png" | |
68 | id="toggleCtrlButton" class="noVNC_status_button"> | |
69 | <input type="image" alt="Alt" src="/novnc/images/alt.png" | |
70 | id="toggleAltButton" class="noVNC_status_button"> | |
71 | <input type="image" alt="Tab" src="/novnc/images/tab.png" | |
72 | id="sendTabButton" class="noVNC_status_button"> | |
73 | <input type="image" alt="Esc" src="/novnc/images/esc.png" | |
74 | id="sendEscButton" class="noVNC_status_button"> | |
246b448b DM |
75 | <input type="image" alt="Ctrl+Alt+Del" src="/novnc/images/ctrlaltdel.png" |
76 | id="sendCtrlAltDelButton" class="noVNC_status_button"> | |
d6015915 DM |
77 | </div> |
78 | </div> | |
79 | </div> | |
80 | ||
81 | <div id="noVNC_status">Loading</div> | |
82 | ||
83 | <!--noVNC Buttons--> | |
84 | <div class="noVNC-buttons-right"> | |
246b448b DM |
85 | <input type="image" alt="Send keys" src="/novnc/images/showextrakeys.png" |
86 | id="showSendKeysButton" class="noVNC_status_button" | |
87 | title="Send keys" /> | |
d6015915 DM |
88 | <input type="image" alt="Clipboard" src="/novnc/images/clipboard.png" |
89 | id="clipboardButton" class="noVNC_status_button" | |
90 | title="Clipboard" /> | |
91 | <input type="image" alt="Commands" src="/novnc/images/power.png" | |
92 | id="pveCommandsButton" class="noVNC_status_button" | |
93 | title="Commands" /> | |
94 | </div> | |
95 | ||
96 | <div id="noVNC_description" class=""> | |
97 | </div> | |
98 | ||
99 | <!-- Popup Status Panel --> | |
100 | <div id="noVNC_popup_status_panel" class=""> | |
101 | </div> | |
102 | ||
103 | <!-- Clipboard Panel --> | |
104 | <div id="noVNC_clipboard" class="triangle-right top"> | |
105 | <textarea id="noVNC_clipboard_text" rows=5> | |
106 | </textarea> | |
107 | <br /> | |
108 | <input id="noVNC_clipboard_clear_button" type="button" | |
109 | value="Clear"> | |
110 | </div> | |
111 | ||
112 | <!-- PVE command Panel --> | |
113 | <div id="noVNC_pve_commands" class="triangle-right top"> | |
114 | <span id="noVNC_pve_command_menu"> | |
217783a4 | 115 | </span> |
d6015915 DM |
116 | </div> |
117 | ||
118 | <!-- Settings Panel --> | |
119 | <div id="noVNC_settings" class="triangle-right top"> | |
120 | <span id="noVNC_settings_menu"> | |
121 | <ul> | |
122 | <li><input id="noVNC_encrypt" type="checkbox"> Encrypt</li> | |
123 | <li><input id="noVNC_true_color" type="checkbox" checked> True Color</li> | |
124 | <li><input id="noVNC_cursor" type="checkbox"> Local Cursor</li> | |
125 | <li><input id="noVNC_clip" type="checkbox" value="true"> Clip to Window</li> | |
126 | <li><input id="noVNC_shared" type="checkbox"> Shared Mode</li> | |
127 | <li><input id="noVNC_view_only" type="checkbox"> View Only</li> | |
128 | <li><input id="noVNC_path" type="input" value="websockify"> Path</li> | |
129 | <li><input id="noVNC_repeaterID" type="input" value=""> Repeater ID</li> | |
130 | <li><input id="noVNC_stylesheet" type="input" value=""> Stylesheet</li> | |
131 | <li><input id="noVNC_logging" type="input" value=""> Logging</li> | |
132 | ||
133 | </ul> | |
134 | </span> | |
135 | </div> | |
136 | ||
246b448b DM |
137 | <!-- PVE Send Key Panel --> |
138 | <div id="noVNC_send_keys" class="triangle-right top"> | |
139 | <span id="noVNC_send_keys_panel"> | |
140 | </span> | |
141 | </div> | |
142 | ||
d6015915 DM |
143 | <!-- Connection Panel --> |
144 | <div id="noVNC_controls" class="triangle-right top"> | |
145 | <ul> | |
146 | <li><label><strong>Host: </strong><input id="noVNC_host" /></label></li> | |
147 | <li><label><strong>Port: </strong><input id="noVNC_port" /></label></li> | |
148 | <li><label><strong>Password: </strong><input id="noVNC_password" type="password" /></label></li> | |
149 | <li><input id="noVNC_connect_button" type="button" value="Connect"></li> | |
150 | </ul> | |
151 | </div> | |
152 | ||
153 | </div> <!-- End of noVNC-control-bar --> | |
154 | ||
155 | <div id="noVNC_screen"> | |
156 | <div id="noVNC_screen_pad"></div> | |
157 | ||
158 | <h1 id="noVNC_logo"><span>no</span><br />VNC</h1> | |
159 | ||
160 | <!-- HTML5 Canvas --> | |
161 | <div id="noVNC_container"> | |
b1ebe820 | 162 | <canvas id="noVNC_canvas" width="640" height="400"> |
d6015915 DM |
163 | Canvas not supported. |
164 | </canvas> | |
165 | </div> | |
166 | ||
167 | </div> | |
168 | <script src="/novnc/include/util.js"></script> | |
169 | <script src="/novnc/include/pveui.js"></script> | |
170 | </body> | |
171 | </html> | |
172 | _EOD | |
173 | ||
174 | return $page; | |
175 | } | |
176 | ||
177 | 1; |