forked from phpvirtualbox/phpvirtualbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchooser.html
96 lines (79 loc) · 2.24 KB
/
chooser.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
<!--
Virtual Machine List
Copyright (C) 2010-2015 Ian Moore (imoore76 at yahoo dot com)
$Id: chooser.html 595 2015-04-17 09:50:36Z imoore76 $
@see js/chooser.js
-->
<div id='vboxChooserDiv'></div>
<script type='text/javascript'>
/*
*
*
* Startup for VM List
*
*/
vboxChooser.setAnchorId('vboxChooserDiv');
// Stop actions
var sChildren = [];
for(var i = 0; i < vboxVMActions.stop_actions.length; i++) {
sChildren[sChildren.length] = $.extend(true,{},vboxVMActions[vboxVMActions.stop_actions[i]],{'iconStringDisabled':'_disabled'});
}
// VM List Group context menu
vboxChooser.setContextMenu('group', [
vboxVMGroupActions['newmachine'],
vboxVMGroupActions['addmachine'],
$.extend({}, vboxVMGroupActions['rename'], {separator: true}),
vboxVMGroupActions['ungroup'],
$.extend({}, vboxVMActions['start'], {'separator' : true}),
vboxVMActions['pause'],
vboxVMActions['reset'],
$.extend({},vboxVMActions['stop'], {'children':sChildren}),
$.extend({},vboxVMActions['discard'], {separator: true}),
vboxVMActions['refresh'],
$.extend({}, vboxVMGroupActions['sort'], {separator:true}),
]);
/*
* VM Context menu setup (menu per VM in list)
*/
vboxChooser.setContextMenu('vm',[
vboxVMActions['settings'],
vboxVMActions['clone'],
vboxVMActions['remove'],
vboxVMActions['group'],
$.extend({},vboxVMActions['start'], {'separator' : true}),
vboxVMActions['pause'],
vboxVMActions['reset'],
$.extend({},vboxVMActions['stop'], {'children': sChildren}),
$.extend({},vboxVMActions['discard'], {'separator' : true}),
vboxVMActions['logs'],
vboxVMActions['refresh']
]);
// Don't need thse anymore
sChildren = null;
/*
* VM list context menu setup
*/
vboxChooser.setContextMenu('anchor', [
vboxVMActions['new'],
vboxVMActions['add'],
{
'name':'fileImport',
'label':'Import Appliance...',
'icon':'import',
'click':function(){
new vboxWizardImportApplianceDialog().run();
},
'separator': true
},
{
'name':'fileExport',
'label':'Export Appliance...',
'icon':'export',
'click':function(){new vboxWizardExportApplianceDialog().run(); }
},
$.extend({},vboxVMGroupActions['sort'],{'separator':true,click:function(){
vboxChooser.sortSelectedGroup(true);
}})
]);
vboxChooser.start();
</script>