From b079360bf0694879e14a37d7a5a9c5ea93484ef5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B8=D0=BA=D1=82=D0=BE=D1=80?= <78488229+viktor138irk@users.noreply.github.com> Date: Thu, 7 May 2026 07:40:36 +0900 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D1=80=D1=8F=D0=B4=D0=BE=D0=BA=20?= =?UTF-8?q?=D0=B7=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=BA=D0=B8=20=D0=B1=D1=8B?= =?UTF-8?q?=D0=BB=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B2=D0=B5=D0=B4=D1=91=D0=BD?= =?UTF-8?q?=20=D0=BD=D0=B0=20=D0=BF=D0=B5=D1=80=D0=B5=D1=82=D0=B0=D1=81?= =?UTF-8?q?=D0=BA=D0=B8=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/patch_existing_vm_iso_mount.py | 95 ++++++++++++++++++++++---- 1 file changed, 80 insertions(+), 15 deletions(-) diff --git a/scripts/patch_existing_vm_iso_mount.py b/scripts/patch_existing_vm_iso_mount.py index de0a185..e1f5701 100644 --- a/scripts/patch_existing_vm_iso_mount.py +++ b/scripts/patch_existing_vm_iso_mount.py @@ -192,20 +192,80 @@ boot_card = r'''

Порядок загрузки

- boot order + drag boot
-
- + + +
+
+ +
ISO / CD-ROMУстановщик или rescue-образ
+
+
+ +
ДискОсновной qcow2/raw диск VM
+
+
+ +
Сеть / PXEЗагрузка по сети
+
+
-

Чтобы загрузиться с ISO, выбери “Сначала ISO/CD-ROM, потом диск”. Если VM запущена, новый порядок сработает после перезапуска.

+

Перетащи нужный источник выше. Для загрузки с ISO поставь ISO / CD-ROM первым. Изменение сработает после перезапуска VM.

+
''' @@ -213,7 +273,6 @@ if template_path.exists(): tpl = template_path.read_text() original = tpl - # Normalize legacy separate cards into one two-column settings grid. legacy_boot = r'''
@@ -271,7 +330,13 @@ if template_path.exists(): ''' + iso_card + boot_card + r'''
''' - if 'vm-boot-iso-grid' not in tpl: + if 'vm-boot-iso-grid' in tpl: + start = tpl.find('
') + end = tpl.find('\n\n
', start + 1) + if start != -1 and end != -1: + tpl = tpl[:start] + settings_grid.strip('\n') + tpl[end:] + changed.append('boot order grid replaced with draggable version') + else: if legacy_boot in tpl or legacy_iso in tpl: tpl = tpl.replace(legacy_boot, '') tpl = tpl.replace(legacy_iso, '') @@ -279,13 +344,13 @@ if template_path.exists(): if marker not in tpl: raise SystemExit('vm detail grid marker not found') tpl = tpl.replace(marker, settings_grid + marker, 1) - changed.append('ISO and boot order cards moved into two-column grid') + changed.append('ISO and boot order cards moved into draggable two-column grid') elif 'action="/vm/{{ vm.name }}/iso/mount"' not in tpl: marker = '\n\n
' if marker not in tpl: raise SystemExit('vm detail grid marker not found') tpl = tpl.replace(marker, settings_grid + marker, 1) - changed.append('ISO and boot order two-column grid added') + changed.append('ISO and boot order draggable two-column grid added') if tpl != original: template_path.write_text(tpl)