summaryrefslogtreecommitdiffstats
path: root/panes/wizardCloneVMAdvanced.html
blob: 508d2b38b8fe3463f1faf108e383e4f1990555ee (plain)
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
<!-- 

	Advanced panes for clone virtual machine wizard. Logic in vboxWizard()
	Copyright (C) 2010-2015 Ian Moore (imoore76 at yahoo dot com)
	
	$Id: wizardCloneVMAdvanced.html 595 2015-04-17 09:50:36Z imoore76 $

 -->
<!-- Step 1 -->
<div id='wizardCloneVMStep1' style='display: none'>

	<span class='vboxTableLabel translate'>New machine name</span>
	<div class='vboxOptions' style='padding: 6px; padding-top: 8px;'>
		<input type='text' class='vboxText' name='machineCloneName' style='width: 95%' />
	</div>
	
	<table class='vboxInvisible' style='border: 0px solid transparent; border-spacing: 4px;'>
		<tr style='vertical-align: top'>
			<td>
				<span class='vboxTableLabel translate'>Clone type</span>
				<div class='vboxOptions'>
					<table style='margin-top: 8px'>
						<tr style='vertical-align: bottom;'>
							<td><label><input type='radio' class='vboxRadio' name='vboxCloneType' value='Full' onclick='vboxCloneVMUpdateSteps(this.value)' /> <span class='translate'>Full Clone</span></label></td>
						</tr>
						<tr style='vertical-align: bottom;'>
							<td><label><input type='radio' class='vboxRadio' checked='checked' name='vboxCloneType' value='Linked' onclick='vboxCloneVMUpdateSteps(this.value)' /> <span class='translate'>Linked Clone</span></label></td>
						</tr>		
					</table>
				</div>
			</td>
			<td>
				<span class='vboxTableLabel translate'>Snapshots</span>
				<div class='vboxOptions'>
					<table style='margin-top: 8px' class='vboxWizardCloneVMSnapshotOpts'>
						<tr style='vertical-align: bottom;'>
							<td><label><input type='radio' class='vboxRadio' checked='checked' name='vmState' value='MachineState' /> <span class='translate'>Current machine state</span></label></td>
						</tr>
						<tr style='vertical-align: bottom; display:none;' id='vboxCloneCurrentAll'>
							<td><label><input type='radio' class='vboxRadio' name='vmState' value='MachineAndChildStates' /> <span class='translate'>Current snapshot tree branch</span></label></td>
						</tr>		
						<tr style='vertical-align: bottom;'>
							<td><label><input type='radio' class='vboxRadio' name='vmState' value='AllStates' /> <span class='translate'>Everything</span></label></td>
						</tr>	
					</table>
				</div>
			</td>
		</tr>
	</table>

	<p><label><input type='checkbox' class='vboxCheckbox' name='vboxCloneReinitNetwork' checked='checked' />
		<span class='translate'>Reinitialize the MAC address of all network cards</span></label>
	</p>
</div>


<script type='text/javascript'>

$('#wizardCloneVMStep1').on('show',function(e,wiz){

	// Already initialized?
	if($('#wizardCloneVMStep1').data('init') || !wiz.args) return;
	
	$('#wizardCloneVMStep1').data('init',1);
	
	// Hold wizard
	$('#wizardCloneVMStep1').data('wiz',wiz);
	
	// Hold wizard original steps
	$('#wizardCloneVMStep1').data('wizSteps',wiz.steps);
	
	// Hide "new snapshot" message if we're cloning a snapshot
	if(wiz.args && wiz.args.snapshot)
		$('#vboxCloneVMNewSnap').hide();
	
	
	if((wiz.args.snapshot && wiz.args.snapshot.children && wiz.args.snapshot.children.length)) {
		$('#wizardCloneVMCurrentAll').show();
		$('#vboxCloneCurrentAll').show();
	}
	
	$(document.forms['frmwizardCloneVM'].elements.machineCloneName).focus();

	document.forms['frmwizardCloneVM'].elements.machineCloneName.value = trans('%1 Clone','UIWizardCloneVMPage1').replace('%1',wiz.args.vm.name);

	var inputBox = $('#wizardCloneVMStep1').find('input.vboxText').select();
	setTimeout(inputBox.focus.bind(inputBox),10);
});


function vboxCloneVMUpdateSteps(cval) {
	
	if(cval == 'Linked') {
		$('#wizardCloneVMStep1').find('table.vboxWizardCloneVMSnapshotOpts').find('tr').addClass('disabled').find('input').prop('disabled', true);
	} else {
		$('#wizardCloneVMStep1').find('table.vboxWizardCloneVMSnapshotOpts').find('tr').removeClass('disabled').find('input').prop('disabled', false);
	}
}

</script>