/
index.html
299 lines (239 loc) · 11.8 KB
/
index.html
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
296
297
298
299
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "html-dtd/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xi="http://www.w3.org/2001/XInclude">
<head>
<!-- $Id$ -->
<!-- Copyright (C) 2011 Ian Moore (imoore76 at yahoo dot com) -->
<title>phpVirtualBox - VirtualBox Web Console</title>
<!-- Icon -->
<link rel="shortcut icon" href="images/vbox/OSE/VirtualBox_win.ico"/>
<!-- Meta fields. -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Expires" content="0"/>
<meta http-equiv="Cache-Control" content ="no-cache"/>
<meta http-equiv="Cache-Control" content ="no-store, must-revalidate, max-age=0"/>
<meta http-equiv="Cache-Control" content ="post-check=0, pre-check=0"/>
<meta http-equiv="Pragma" content="no-cache"/>
<!-- Style sheets -->
<link rel="stylesheet" type="text/css" href="css/jquery-ui.css"/>
<link rel="stylesheet" type="text/css" href="css/jquery.contextMenu.css"/>
<link rel="stylesheet" type="text/css" href="css/tipped.css" />
<link rel="stylesheet" type="text/css" href="css/jqueryFileTree.css" />
<link rel="stylesheet" type="text/css" href="css/mediumselect.css"/>
<link rel="stylesheet" type="text/css" href="css/layout.css"/>
<!-- External / vendor scripts -->
<script type="text/javascript" src="js/jquery-1.5.1-min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.9-min.js"></script>
<script type="text/javascript" src="js/jquery.contextMenu.js"></script>
<script type="text/javascript" src="js/jquery.tipped-2.1b.min.js"></script>
<script type="text/javascript" src="js/jqueryFileTree.js"></script>
<script type="text/javascript" src="js/jquery.scrollTo-min.js"></script>
<script type="text/javascript" src="js/jquery.jec-1.2.5.js"></script>
<!-- Oracle RDP Control -->
<script type="text/javascript" src="rdpweb/webclient.js"></script>
<script type="text/javascript" src="rdpweb/swfobject.js"></script>
<!-- Internal Scripts -->
<script type="text/javascript" src="js/language.php"></script>
<script type="text/javascript" src="js/jquery.vbtree.js"></script>
<script type="text/javascript" src="js/jquery.mediumselect.js"></script>
<script type="text/javascript" src="js/phpvirtualbox.js"></script>
<script type="text/javascript" src="js/utils.js"></script>
<script type="text/javascript" src="js/dialogs.js"></script>
<!-- Main Setup -->
<script type='text/javascript'>
$(document).ready(function(){
/* Check for server setting */
if(location.search) {
var query = location.search.substr(1).split('&');
for(var kv in query) {
kv = query[kv].split('=');
if(kv[0] == 'server') {
vboxSetCookie('vboxServer',unescape(kv[1]));
location = location.href.substr(0,location.href.length-location.search.length);
break;
}
}
}
// If everything loaded correctly, trans() should be defined in
// js/language.php and language data should be present.
// If not, there is a PHP error somewhere.
if(typeof trans != "function" || typeof __vboxLangData == "undefined") {
trans = function(s){return s;}
vboxAlert("An unknown PHP error occurred. This is most likely a syntax error in\
config.php in phpVirtualBox's folder. The most common errors are an unclosed\
quote or a missing\
semicolon in a configuration item that has been entered (e.g.\
location, username, or password).<p>Depending on your PHP configuration,\
navigating directly to <a href='config.php'>config.php</a> in your web\
browser may display the PHP error message.</p>\
<p>If find that this is not the case,\
or have no idea what this error message means, please raise the issue\
at <a href='http://code.google.com/p/phpvirtualbox/issues/list'\
>http://code.google.com/p/phpvirtualbox/issues/list</a></p>",{'width':'50%'});
return;
}
// Resizable
///////////////////////
$('#vboxResizeBar').draggable({cursor:(jQuery.browser.opera ? 'e-resize' : 'col-resize'),axis:'x',zIndex:99,helper:function(){
$('#vboxResizeBarTmp').remove();
var r = $('#vboxResizeBar').clone(false);
return $(r).attr({'id':'vboxResizeBarTmp'}).unbind('mouseleave').css({'background':'#cccccc'});
},scroll:false,'start':function(e,ui){
$('#vboxResizeOverlay').remove();
$('body').disableSelection().css({'cursor':(jQuery.browser.opera ? 'e-resize' : 'col-resize')});
$('#vboxIndex').append($('<div />').attr({'id':'vboxResizeOverlay','style':'width:100%;height:100%;border:0px;margin:0px;padding:0px;position:absolute;top:0px;left:0px;z-index:10;cursor:'+(jQuery.browser.opera ? 'e-resize' : 'col-resize')}));
$('#vboxResizeBar').data('vboxX',e.pageX);
},'stop':function(e){
$('#vboxResizeBarTmp').remove();
$('#vboxResizeOverlay').remove();
$('body').enableSelection().css({'cursor':'default'});
var nx = $('#vboxVMList').width() + (e.pageX - $('#vboxResizeBar').data('vboxX'));
$('#vboxVMList').css('width',(nx)+'px');
vboxSetCookie("vboxPaneX",($('#vboxVMList').width()));
$('#vboxPaneVMList').css('width',$('#vboxVMList').css('width'));
}}).css('cursor',(jQuery.browser.opera ? 'e-resize' : 'col-resize')).bind('mouseenter',function(){
$(this).css('background',"#cccccc");
}).bind('mouseleave',function(){
$(this).css('background',"");
}).parent().disableSelection();
// Resize table elements
$(window).resize(function(){
$('#vboxResizePane').children().children().css({'display':'none'});
var h = $('#vboxResize').innerHeight();
$('#vboxResizePane').children().children().css({'height':h+'px','overflow':'auto','display':''});
// special for resize bar
$('#vboxResizeBar').css({'height':(h-10)+'px'});
// special for bordered vm list
$('#vboxPaneVMList').children().css({'height':(h-4)+'px'});
});
// Refresh data when host changes
$('#vboxIndex').bind('hostChange',function(){
var l = new vboxLoader();
l.add('Config',function(d){$('#vboxIndex').data('vboxConfig',d);});
l.add('GuestOSTypes',function(d){$('#vboxIndex').data('vboxOSTypes',d);});
l.add('SystemProperties',function(d){$('#vboxIndex').data('vboxSystemProperties',d);});
l.add('Mediums',function(d){$('#vboxIndex').data('vboxMediums',d);});
l.add('HostDetails',function(d){$('#vboxIndex').data('vboxHostDetails',d);});
l.add('RecentMediums',function(d){$('#vboxIndex').data('vboxRecentMediums',d);});
l.onLoad = function(){$('#vboxIndex').trigger('hostChanged');}
l.run();
});
// Load panes and data after login
///////////////////////////////////
$('#vboxIndex').bind('login', function() {
var l = new vboxLoader();
l.add('Config',function(d){$('#vboxIndex').data('vboxConfig',d);});
l.add('GuestOSTypes',function(d){$('#vboxIndex').data('vboxOSTypes',d);});
l.add('SystemProperties',function(d){$('#vboxIndex').data('vboxSystemProperties',d);});
l.add('Mediums',function(d){$('#vboxIndex').data('vboxMediums',d);});
l.add('HostDetails',function(d){$('#vboxIndex').data('vboxHostDetails',d);});
l.add('RecentMediums',function(d){$('#vboxIndex').data('vboxRecentMediums',d);});
l.addFile('panes/topmenu.html',function(f){$('#vboxIndex').append(f);},{});
l.addFile('panes/tabs.html',function(f){$('#vboxPaneTabContent').append(f);},{})
l.addFile('panes/vmlistToolbar.html',function(f){$('#vboxIndex').append(f);},{});
l.addFile('panes/vmlist.html',function(f){$('#vboxPaneVMList').append(f);},{});
l.onLoad = function() {
// Resize to last setting
vboxParseCookies();
if($('#vboxIndex').data('vboxCookies')['vboxPaneX']) {
$('#vboxVMList').css('width',($('#vboxIndex').data('vboxCookies')['vboxPaneX'])+'px');
}
}
l.onShow = function() { $(window).trigger('resize'); }
l.hideRoot = true;
l.run();
});
// Data mediator ready for use
dataMediator = new vboxDataMediator();
// Check for valid session. Provide login box.
function vboxCheckSession(tried) {
// check session info
if($('#vboxIndex').data('vboxSession') && $('#vboxIndex').data('vboxSession').valid) {
$('#vboxIndex').trigger('login');
return;
}
// Was there an error?
if($('#vboxIndex').data('vboxSession') && !$('#vboxIndex').data('vboxSession').result) {
return;
}
// No valid session. Load login pane
$('#vboxLogin').find('input[name=password]').val('');
$('#vboxLogin').dialog('open');
// Display error if we tried to log in
if(tried) {
vboxAlert('Invalid username or password.',{'width':'auto'});
}
}
var login = new vboxLoader()
login.add('Session',function(d){$('#vboxIndex').data('vboxSession',d);});
login.addFile('panes/login.html',function(f){$('#vboxIndex').append(f);});
login.onLoad = function() {
var buttons = {};
buttons[trans('Log in')] = function() {
var u = $('#vboxLogin').find('input[name=username]').val();
var p = $('#vboxLogin').find('input[name=password]').val();
$('#vboxLogin').dialog('close');
var trylogin = new vboxLoader();
trylogin.add('login',function(d){$('#vboxIndex').data('vboxSession',d);},{'u':u,'p':p});
trylogin.onLoad = function() { vboxCheckSession(true);}
trylogin.mode = 'save';
trylogin.run();
}
// Create but do not open dialog
if($.browser.webkit) heightadd = 5;
else heightadd = 0;
$('#vboxLogin').dialog({'closeOnEscape':false,'width':300,'height':'auto','buttons':buttons,'modal':true,'autoOpen':false,'stack':true,'dialogClass':'vboxDialogContent','title':'<img src="images/vbox/OSE/about_16px.png" class="vboxDialogTitleIcon" /> phpVirtualBox :: ' + trans('Log in')});
$('#vboxLogin').find('input[name=username]').first().focus();
// Trick loader into not showing root pane again
this.hideRoot = false;
vboxCheckSession();
};
login.hideRoot = true;
login.run();
});
</script>
</head>
<body>
<div id='vboxIndex' style='height: 100%'>
<table id='vboxTableMain' cellpadding=0 cellspacing=0 style="height: 100%; width: 100%; padding: 0px; margin: 0px; border: 0px; border-spacing: 0px;">
<tr style='vertical-align: middle;'>
<td style='height:20px;border:0px;padding:0px;margin:0px;border-spacing:0px;'>
<div id='vboxMenu'>
<!--
Menu Bar will be placed here
-->
</div>
</td>
</tr>
<tr style='vertical-align: middle;'>
<td id='vboxToolbarMain' style='height: 66px; border:0px;padding:0px;margin:0px;border-spacing:0px;' class='vboxToolbarGrad'>
<!-- VMList toolbar -->
<div id='vboxPaneToolbar'></div>
<!-- Tabs / Buttons -->
<div id='vboxTabsList'></div>
</td>
</tr>
<tr style='vertical-align: top;'>
<td style='border:0px;padding:0px;margin:0px;border-spacing:0px;' id='vboxResize'>
<table style='width:100%;border:0px;padding:0px;border-spacing:0px;margin:0px' id=''>
<tr id='vboxResizePane' style='vertical-align: top;'>
<td id="vboxPaneVMList" style='padding:0px;border-spacing:0px;margin:0px'>
<!--
VM List
-->
</td>
<td id='vboxResizeTD' style='border: 0px; width: 2px; margin: 0px; padding: 0px; text-align: center;'>
<div style='z-index: 99; position: absolute; margin:0px; margin-top: 2px; padding:2px; width: 0px; height: 90%;' id='vboxResizeBar' ></div>
</td>
<td id="vboxPaneTabContent" style='width:100%;border:0px;padding:0px;border-spacing:0px;margin:0px'>
<!--
Tab content will go here
-->
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</body>
</html>