- Backend: None = keep current size (no auto-shrink); only resize when value explicitly provided - Frontend: Target Disk Size field shows detected size, disabled (not submitted) - Checkbox 'Enable disk resize' unlocks the field for editing
129 lines
5.3 KiB
HTML
129 lines
5.3 KiB
HTML
{# Fragment — no <script> tags (injected via innerHTML) #}
|
|
|
|
{% if error %}
|
|
<div class="pve-panel" id="analysis-result">
|
|
<div class="pve-panel-header">
|
|
<span class="pve-panel-title">Analysis Failed</span>
|
|
</div>
|
|
<div class="pve-panel-body">
|
|
<div class="pve-alert pve-alert-error">{{ error }}</div>
|
|
<a href="/" class="pve-btn" style="margin-top:0.75rem;">Try Again</a>
|
|
</div>
|
|
</div>
|
|
{% else %}
|
|
<div class="pve-panel" id="step2">
|
|
<div class="pve-panel-header">
|
|
<span class="pve-panel-title">Analysis Result</span>
|
|
</div>
|
|
<div class="pve-panel-body">
|
|
|
|
<table class="pve-table">
|
|
<tr><td>File</td><td>{{ analysis.filename }}</td></tr>
|
|
<tr><td>Disk Format</td><td>{{ analysis.disk_format }}</td></tr>
|
|
<tr><td>Disk Size</td><td>{{ analysis.disk_size_gb }} GB</td></tr>
|
|
<tr><td>Operating System</td><td>{{ analysis.os_type or 'Unknown' }}</td></tr>
|
|
<tr><td>EFI Bootable</td><td>{{ 'Yes' if analysis.efi_detectable else 'Unknown' }}</td></tr>
|
|
</table>
|
|
|
|
{% if analysis.all_disks and analysis.all_disks|length > 1 %}
|
|
<div style="margin-top:1rem;">
|
|
<label style="font-size:0.75rem;color:var(--pve-muted);font-weight:600;margin-bottom:0.3rem;display:block;">Disks Found — select boot disk</label>
|
|
<table class="pve-table">
|
|
{% for d in analysis.all_disks %}
|
|
<tr>
|
|
<td style="width:auto;padding-right:0.5rem;">
|
|
<input type="radio" name="boot_disk_index" value="{{ loop.index0 }}" {% if loop.first %}checked{% endif %}>
|
|
</td>
|
|
<td>{{ d.filename }}</td>
|
|
<td>{{ d.format }}</td>
|
|
<td>{{ d.size_gb }} GB</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<p class="pve-dim" style="margin:0.75rem 0;">Is this correct? Configure the VM below and submit the conversion job.</p>
|
|
|
|
<form id="confirm-form" data-vmid="{{ vmid }}" data-source-filename="{{ source_filename }}">
|
|
<input type="hidden" name="vmid" value="{{ vmid }}">
|
|
<input type="hidden" name="source_filename" value="{{ source_filename }}">
|
|
<input type="hidden" name="disk_format" value="{{ analysis.disk_format }}">
|
|
<input type="hidden" name="session_id" value="{{ session_id or '' }}">
|
|
{% if analysis.all_disks and analysis.all_disks|length > 1 %}
|
|
<input type="hidden" name="has_multiple_disks" value="1">
|
|
{% for d in analysis.all_disks %}
|
|
<input type="hidden" name="disk_{{ loop.index0 }}_file" value="{{ d.filename }}">
|
|
<input type="hidden" name="disk_{{ loop.index0 }}_fmt" value="{{ d.format }}">
|
|
{% endfor %}
|
|
{% endif %}
|
|
|
|
<div class="pve-row">
|
|
<div class="pve-form-group">
|
|
<label>VM Name *</label>
|
|
<input type="text" name="vm_name" required class="pve-input" value="{{ vm_name or '' }}"
|
|
placeholder="my-converted-vm">
|
|
</div>
|
|
<div class="pve-form-group">
|
|
<label>Target Disk Size (GB)</label>
|
|
<input type="number" name="target_disk_size_gb" id="target-disk-size" class="pve-input"
|
|
value="{{ analysis.disk_size_gb }}" disabled>
|
|
<label style="margin-top:0.3rem;font-size:0.72rem;display:flex;align-items:center;gap:0.3rem;cursor:pointer;">
|
|
<input type="checkbox" id="enable-resize" onchange="toggleDiskResize()">
|
|
Enable disk resize (shrink or expand)
|
|
</label>
|
|
<span class="pve-hint" id="resize-hint">
|
|
Default: {{ analysis.disk_size_gb }} GB (no resize). Check the box above to change.
|
|
<strong>Warning:</strong> shrinking can break complex layouts (LVM, encryption).
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<div class="pve-row">
|
|
<div class="pve-form-group">
|
|
<label>CPU Cores</label>
|
|
<input type="number" name="cpu_cores" class="pve-input" value="2" min="1">
|
|
</div>
|
|
<div class="pve-form-group">
|
|
<label>RAM (MB)</label>
|
|
<input type="number" name="ram_mb" class="pve-input" value="4096" min="512">
|
|
</div>
|
|
</div>
|
|
<div class="pve-row">
|
|
<div class="pve-form-group">
|
|
<label>Storage Pool</label>
|
|
{% if storage_pools %}
|
|
<select name="target_storage" class="pve-select" id="storage-select">
|
|
{% for pool in storage_pools %}
|
|
<option value="{{ pool.name }}">{{ pool.name }} ({{ pool.type }})</option>
|
|
{% endfor %}
|
|
<option value="__custom__">Custom...</option>
|
|
</select>
|
|
<input type="text" class="pve-input pve-hidden" id="storage-custom"
|
|
placeholder="Enter pool name" style="margin-top:0.3rem;">
|
|
{% else %}
|
|
<input type="text" name="target_storage" class="pve-input" value="local-lvm">
|
|
{% endif %}
|
|
</div>
|
|
<div class="pve-form-group">
|
|
<label>Boot Detection</label>
|
|
<select name="auto_detect_boot" class="pve-select">
|
|
<option value="true" selected>Auto-detect (recommended)</option>
|
|
<option value="false">Manual</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="pve-form-group" id="boot-type-group" style="display:none;">
|
|
<label>Boot Type</label>
|
|
<select name="boot_type" class="pve-select">
|
|
<option value="uefi">UEFI</option>
|
|
<option value="legacy">Legacy BIOS</option>
|
|
</select>
|
|
</div>
|
|
|
|
<button type="submit" id="submit-btn" class="pve-btn pve-btn-primary">Start Conversion</button>
|
|
</form>
|
|
|
|
<div id="submit-status" class="pve-hidden" style="margin-top:1rem;"></div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|