1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-02 08:56:07 +00:00

fix(vmbackups): clearer backup pages; a deletion stays on its page

Deleting a backup took the user to the generic job page, which named
neither the backup nor a way back. The deletion now stays on the page it
was asked from, says which backup is being deleted, shows the row as
being deleted and reads the page again until it is gone. The confirm
dialog is 'Delete backup' and names the target and that it cannot be
undone; the job's label names the VM and the backup's time.

The lists keep a VM's and a target's name and a row's actions on one
line, link a backup's job only when it is being made (Progress) or failed
(Why?), and say 'While shut off' for an offline backup. The schedule form
puts the full-backup setting on a row of its own and the schedule list
shows it; the restore form starts on the VM's host.
This commit is contained in:
catborise 2026-11-17 20:14:12 +03:00
parent 43d25a2759
commit fc87a3034e
18 changed files with 276 additions and 182 deletions

Binary file not shown.

View file

@ -11,7 +11,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-11-17 16:40+0000\n"
"POT-Creation-Date: 2026-11-17 17:12+0000\n"
"PO-Revision-Date: 2020-11-04 12:00+0000\n"
"Last-Translator: catborise <muhammetalisag@gmail.com>, 2020\n"
"Language-Team: Turkish (https://www.transifex.com/catborise/teams/110663/tr/)\n"
@ -76,7 +76,7 @@ msgstr "Geçersiz anahtar"
#: networks/templates/network.html:373 nwfilters/templates/nwfilters.html:29
#: storages/templates/storage.html:123 virtsecrets/forms.py:34
#: virtsecrets/forms.py:36 vmbackups/forms.py:23 vmbackups/forms.py:36
#: vmbackups/forms.py:77 vmbackups/templates/vmbackups/policies.html:16
#: vmbackups/forms.py:79 vmbackups/templates/vmbackups/policies.html:16
#: vmbackups/templates/vmbackups/targets.html:17
msgid "Name"
msgstr "Ad"
@ -477,7 +477,6 @@ msgstr "%(name)s API anahtarı için işlemler"
#: templates/common/confirm_delete.html:5
#: templates/common/confirm_delete.html:9
#: templates/common/confirm_delete.html:26
#: vmbackups/templates/vmbackups/delete_form.html:11
msgid "Delete"
msgstr "Sil"
@ -811,14 +810,14 @@ msgstr "Bellek"
#: admin/forms.py:213 instances/models.py:240
#: instances/templates/create_instance_w2.html:118
#: instances/templates/instances/settings_tab.html:25
#: instances/templates/instances/stats_tab.html:53 vmbackups/forms.py:55
#: instances/templates/instances/stats_tab.html:53 vmbackups/forms.py:57
#: vmbackups/templates/vmbackups/restore_over.html:18
msgid "Disk"
msgstr "Disk"
#: admin/forms.py:214 instances/templates/instance.html:112
#: templates/navbar.html:21 vmbackups/templates/vmbackups/index.html:6
#: vmbackups/templates/vmbackups/index.html:8
#: templates/navbar.html:21 vmbackups/templates/vmbackups/index.html:7
#: vmbackups/templates/vmbackups/index.html:9
#: vmbackups/templates/vmbackups/policies.html:9
#: vmbackups/templates/vmbackups/restore.html:9
#: vmbackups/templates/vmbackups/restore_disk.html:9
@ -1015,7 +1014,7 @@ msgstr "Tamamlandı"
#: admin/templates/admin/logs.html:56 admin/views.py:395 logs/views.py:18
#: operations/templates/operations/job.html:107
#: vmbackups/templates/vmbackups/index.html:32
#: vmbackups/templates/vmbackups/index.html:33
#: vmbackups/templates/vmbackups/policy.html:38
#: vmbackups/templates/vmbackups/state.html:1
msgid "Failed"
@ -2495,7 +2494,7 @@ msgstr "hiçbiri"
#: networks/templates/network.html:337 networks/templates/network.html:379
#: networks/templates/network.html:406 networks/templates/network.html:445
#: nwfilters/templates/nwfilter.html:157 templates/common/form.html:28
#: vmbackups/templates/vmbackups/policy_form.html:19
#: vmbackups/templates/vmbackups/policy_form.html:21
msgid "Save"
msgstr "Kaydet"
@ -3986,7 +3985,7 @@ msgstr "Sunucunun bir havuzunda zaten bulunan bir birim."
#: instances/templates/create_instance_w2.html:165
#: instances/templates/instances/move_disk.html:16
#: instances/templates/instances/settings_tab.html:223 vmbackups/forms.py:14
#: vmbackups/forms.py:57
#: vmbackups/forms.py:59
msgid "Storage pool"
msgstr "Depolama havuzu"
@ -3998,8 +3997,8 @@ msgstr "Harf, rakam, nokta, tire ve alt çizgi."
#: instances/templates/add_instance_volume.html:44
#: instances/templates/instances/settings_tab.html:851
#: vmbackups/templates/vmbackups/index.html:47
#: vmbackups/templates/vmbackups/vm_tab.html:41
#: vmbackups/templates/vmbackups/index.html:48
#: vmbackups/templates/vmbackups/vm_tab.html:42
msgid "Size"
msgstr "Boyut"
@ -4158,8 +4157,8 @@ msgstr "Adres"
#: instances/templates/allinstances.html:105 instances/views.py:240
#: interfaces/templates/interface.html:153 networks/templates/network.html:202
#: vmbackups/templates/vmbackups/index.html:16
#: vmbackups/templates/vmbackups/index.html:46
#: vmbackups/templates/vmbackups/index.html:17
#: vmbackups/templates/vmbackups/index.html:47
#: vmbackups/templates/vmbackups/policy.html:29
msgid "VM"
msgstr "VM"
@ -6651,10 +6650,10 @@ msgstr "Çok fazla arama hâlâ çalışıyor; birazdan yeniden deneyin."
#: operations/templates/operations/jobs.html:38
#: operations/templates/operations/jobs.html:62
#: storages/templates/storage.html:91
#: vmbackups/templates/vmbackups/index.html:27
#: vmbackups/templates/vmbackups/index.html:47
#: vmbackups/templates/vmbackups/index.html:28
#: vmbackups/templates/vmbackups/index.html:48
#: vmbackups/templates/vmbackups/policies.html:17
#: vmbackups/templates/vmbackups/vm_tab.html:41
#: vmbackups/templates/vmbackups/vm_tab.html:42
msgid "State"
msgstr "Durum"
@ -8318,8 +8317,8 @@ msgstr "Filtre oluştur"
#: nwfilters/templates/nwfilter.html:15 nwfilters/templates/nwfilter.html:54
#: operations/templates/operations/jobs.html:46
#: vmbackups/templates/vmbackups/index.html:14
#: vmbackups/templates/vmbackups/index.html:38
#: vmbackups/templates/vmbackups/index.html:15
#: vmbackups/templates/vmbackups/index.html:39
msgid "Filter"
msgstr "Filtre"
@ -8357,7 +8356,7 @@ msgid "Parameters"
msgstr "Parametreler"
#: nwfilters/templates/nwfilter.html:64
#: vmbackups/templates/vmbackups/index.html:34
#: vmbackups/templates/vmbackups/index.html:35
#: vmbackups/templates/vmbackups/state.html:1
msgid "Missing"
msgstr "Eksik"
@ -8586,6 +8585,7 @@ msgstr "İş iptal formu"
#: operations/templates/operations/job.html:44
#: operations/templates/operations/jobs.html:82
#: vmbackups/templates/vmbackups/state.html:1
msgid "Progress"
msgstr "İlerleme"
@ -8665,7 +8665,7 @@ msgid "All kinds"
msgstr "Tüm türler"
#: operations/templates/operations/jobs.html:39
#: vmbackups/templates/vmbackups/index.html:29
#: vmbackups/templates/vmbackups/index.html:30
msgid "All states"
msgstr "Tüm durumlar"
@ -8678,7 +8678,6 @@ msgid "No jobs"
msgstr "İş yok"
#: operations/templates/operations/jobs.html:59
#: vmbackups/templates/vmbackups/state.html:1
msgid "Job"
msgstr "İş"
@ -9759,7 +9758,7 @@ msgstr ""
"Eski değerin yerini hemen alır; bir parolanın şifrelediği veriler yeniden "
"şifrelenmez."
#: vmbackups/forms.py:13 vmbackups/forms.py:37 vmbackups/forms.py:56
#: vmbackups/forms.py:13 vmbackups/forms.py:37 vmbackups/forms.py:58
msgid "Compute"
msgstr "Sunucu"
@ -9787,43 +9786,43 @@ msgstr ""
msgid "Start after restore"
msgstr "Geri yüklendikten sonra başlat"
#: vmbackups/forms.py:58
#: vmbackups/forms.py:60
msgid "Volume name"
msgstr "Birim adı"
#: vmbackups/forms.py:77 vmbackups/templates/vmbackups/vm_tab.html:13
#: vmbackups/forms.py:79 vmbackups/templates/vmbackups/vm_tab.html:14
msgid "Backup target"
msgstr "Yedek hedefi"
#: vmbackups/forms.py:77
#: vmbackups/forms.py:79
msgid "Every VM of a compute"
msgstr "Bir sunucunun bütün sanal makineleri"
#: vmbackups/forms.py:78
#: vmbackups/forms.py:80
msgid "Or these VMs"
msgstr "Ya da bu sanal makineler"
#: vmbackups/forms.py:78 vmbackups/templates/vmbackups/policies.html:16
#: vmbackups/forms.py:80 vmbackups/templates/vmbackups/policies.html:16
msgid "Daily at"
msgstr "Her gün saat"
#: vmbackups/forms.py:78
msgid "Backups to keep of each VM"
msgstr "Her sanal makineden tutulacak yedek sayısı"
#: vmbackups/forms.py:80
msgid "Backups kept per VM"
msgstr "VM başına tutulan yedek"
#: vmbackups/forms.py:79
#: vmbackups/forms.py:81
msgid "A full backup every N backups"
msgstr "Her N yedekte bir tam yedek"
#: vmbackups/forms.py:80 vmbackups/templates/vmbackups/vm_tab.html:21
#: vmbackups/forms.py:82 vmbackups/templates/vmbackups/vm_tab.html:22
msgid "Require frozen file systems"
msgstr "Dosya sistemlerinin dondurulmasını zorunlu kıl"
#: vmbackups/forms.py:80 vmbackups/templates/vmbackups/policies.html:27
#: vmbackups/forms.py:82 vmbackups/templates/vmbackups/policies.html:28
msgid "Enabled"
msgstr "Etkin"
#: vmbackups/forms.py:92
#: vmbackups/forms.py:94
msgid ""
"1: every backup is full. Above 1, the backups between copy only what changed "
"(running VMs with qcow2 disks)."
@ -9831,16 +9830,16 @@ msgstr ""
"1: her yedek tamdır. 1'den büyükse aradaki yedekler yalnızca değişenleri "
"kopyalar (qcow2 diskli, çalışan VM'ler)."
#: vmbackups/forms.py:99
#: vmbackups/forms.py:101
msgid "Choose a compute or VMs, not both"
msgstr "Bir sunucu ya da sanal makineler seçin, ikisini birden değil"
#: vmbackups/forms.py:104 vmbackups/jobs.py:106
#: vmbackups/forms.py:106 vmbackups/jobs.py:106
#, python-format
msgid "Backup target %(target)s has no storage pool on %(compute)s"
msgstr "%(target)s yedek hedefinin %(compute)s üzerinde depolama havuzu yok"
#: vmbackups/forms.py:111
#: vmbackups/forms.py:113
msgid "Keep one backup at least"
msgstr "En az bir yedek tutun"
@ -9960,7 +9959,7 @@ msgid "No compute of backup target %(target)s reaches its storage pool"
msgstr ""
"%(target)s yedek hedefinin hiçbir sunucusu depolama havuzuna erişemiyor"
#: vmbackups/jobs.py:601
#: vmbackups/jobs.py:601 vmbackups/templates/vmbackups/delete_form.html:11
msgid "Delete backup"
msgstr "Yedeği sil"
@ -10193,8 +10192,8 @@ msgid "The schedule's owner is no longer an active superuser"
msgstr "Zamanlamanın sahibi artık etkin bir süper kullanıcı değil"
#: vmbackups/templates/vmbackups/consistency.html:1
msgid "Shut off"
msgstr "Kapalı"
msgid "While shut off"
msgstr "Kapalıyken"
#: vmbackups/templates/vmbackups/consistency.html:1
msgid "Frozen"
@ -10234,19 +10233,19 @@ msgstr "Tek disk"
#: vmbackups/templates/vmbackups/delete_form.html:12
#, python-format
msgid ""
"Delete the backup of %(vm)s taken %(time)s? Its files are removed from the "
"target."
"Delete the backup of %(vm)s taken %(time)s? Its files are removed from "
"%(target)s; this cannot be undone."
msgstr ""
"%(vm)s sanal makinesinin %(time)s tarihli yedeği silinsin mi? Dosyaları "
"hedeften kaldırılır."
"%(vm)s VM'inin %(time)s tarihli yedeği silinsin mi? Dosyaları %(target)s "
"hedefinden kaldırılır; bu geri alınamaz."
#: vmbackups/templates/vmbackups/index.html:10
#: vmbackups/templates/vmbackups/index.html:11
#: vmbackups/templates/vmbackups/policies.html:9
#: vmbackups/templates/vmbackups/policy.html:9
msgid "Schedules"
msgstr "Zamanlamalar"
#: vmbackups/templates/vmbackups/index.html:11
#: vmbackups/templates/vmbackups/index.html:12
#: vmbackups/templates/vmbackups/target.html:7
#: vmbackups/templates/vmbackups/target.html:9
#: vmbackups/templates/vmbackups/targets.html:6
@ -10254,63 +10253,63 @@ msgstr "Zamanlamalar"
msgid "Backup targets"
msgstr "Yedek hedefleri"
#: vmbackups/templates/vmbackups/index.html:17
#: vmbackups/templates/vmbackups/index.html:18
msgid "VM name"
msgstr "Sanal makine adı"
#: vmbackups/templates/vmbackups/index.html:20
#: vmbackups/templates/vmbackups/index.html:46
#: vmbackups/templates/vmbackups/index.html:21
#: vmbackups/templates/vmbackups/index.html:47
#: vmbackups/templates/vmbackups/policies.html:16
#: vmbackups/templates/vmbackups/vm_tab.html:41
#: vmbackups/templates/vmbackups/vm_tab.html:42
msgid "Target"
msgstr "Hedef"
#: vmbackups/templates/vmbackups/index.html:22
#: vmbackups/templates/vmbackups/index.html:23
msgid "All targets"
msgstr "Tüm hedefler"
#: vmbackups/templates/vmbackups/index.html:30
#: vmbackups/templates/vmbackups/index.html:31
#: vmbackups/templates/vmbackups/state.html:1
msgid "Ready"
msgstr "Hazır"
#: vmbackups/templates/vmbackups/index.html:31
#: vmbackups/templates/vmbackups/index.html:32
#: vmbackups/templates/vmbackups/state.html:1
msgid "Creating"
msgstr "Oluşturuluyor"
#: vmbackups/templates/vmbackups/index.html:33
#: vmbackups/templates/vmbackups/index.html:34
#: vmbackups/templates/vmbackups/state.html:1
msgid "Deleting"
msgstr "Siliniyor"
#: vmbackups/templates/vmbackups/index.html:46
#: vmbackups/templates/vmbackups/vm_tab.html:41
#: vmbackups/templates/vmbackups/index.html:47
#: vmbackups/templates/vmbackups/vm_tab.html:42
msgid "Time"
msgstr "Zaman"
#: vmbackups/templates/vmbackups/index.html:46
#: vmbackups/templates/vmbackups/vm_tab.html:41
#: vmbackups/templates/vmbackups/index.html:47
#: vmbackups/templates/vmbackups/vm_tab.html:42
msgid "Consistency"
msgstr "Tutarlılık"
#: vmbackups/templates/vmbackups/index.html:46
#: vmbackups/templates/vmbackups/index.html:47
msgid "Schedule"
msgstr "Zamanlama"
#: vmbackups/templates/vmbackups/index.html:55
#: vmbackups/templates/vmbackups/index.html:56
msgid "removed"
msgstr "kaldırıldı"
#: vmbackups/templates/vmbackups/index.html:60
#: vmbackups/templates/vmbackups/index.html:61
msgid "By hand"
msgstr "Elle"
#: vmbackups/templates/vmbackups/index.html:70
#: vmbackups/templates/vmbackups/index.html:71
msgid "No backup matches the filter."
msgstr "Süzgece uyan yedek yok."
#: vmbackups/templates/vmbackups/index.html:72
#: vmbackups/templates/vmbackups/index.html:73
msgid "No backup yet. Back a VM up from its Backups tab."
msgstr "Henüz yedek yok. Bir sanal makineyi Yedekler sekmesinden yedekleyin."
@ -10323,21 +10322,34 @@ msgstr "Yedekleme zamanlamaları"
msgid "Backups kept"
msgstr "Tutulan yedek"
#: vmbackups/templates/vmbackups/policies.html:17
msgid "Full backup"
msgstr "Tam yedek"
#: vmbackups/templates/vmbackups/policies.html:23
#, python-format
msgid "Every VM of %(compute)s"
msgstr "%(compute)s üzerindeki bütün sanal makineler"
#: vmbackups/templates/vmbackups/policies.html:27
#: vmbackups/templates/vmbackups/vm_tab.html:34
msgid "Every backup"
msgstr "Her yedek"
#: vmbackups/templates/vmbackups/policies.html:27
#, python-format
msgid "Every %(n)s backups"
msgstr "Her %(n)s yedekte bir"
#: vmbackups/templates/vmbackups/policies.html:28
#: vmbackups/templates/vmbackups/vm_tab.html:35
msgid "Disabled"
msgstr "Devre dışı"
#: vmbackups/templates/vmbackups/policies.html:34
#: vmbackups/templates/vmbackups/policies.html:35
msgid "No backup schedule yet."
msgstr "Henüz yedekleme zamanlaması yok."
#: vmbackups/templates/vmbackups/policies.html:38
#: vmbackups/templates/vmbackups/policies.html:39
msgid "Add a backup schedule"
msgstr "Yedekleme zamanlaması ekle"
@ -10379,7 +10391,7 @@ msgstr "Henüz çalışma yok."
msgid "Time zone: %(time_zone)s"
msgstr "Saat dilimi: %(time_zone)s"
#: vmbackups/templates/vmbackups/policy_form.html:18
#: vmbackups/templates/vmbackups/policy_form.html:20
msgid ""
"Each VM is backed up once a day, starting at the time; a VM that has not "
"started within 6 hours waits for the next day. Older backups of each VM "
@ -10475,6 +10487,10 @@ msgstr ""
msgid "Files of the backup are missing from the target"
msgstr "Yedeğin dosyaları hedefte yok"
#: vmbackups/templates/vmbackups/state.html:1
msgid "Why?"
msgstr "Neden?"
#: vmbackups/templates/vmbackups/target.html:13
#, python-format
msgid "%(counter)s backup."
@ -10564,12 +10580,12 @@ msgstr "Henüz yedek hedefi yok."
msgid "Add a backup target"
msgstr "Yedek hedefi ekle"
#: vmbackups/templates/vmbackups/vm_tab.html:10
#: vmbackups/templates/vmbackups/vm_tab.html:25
#: vmbackups/templates/vmbackups/vm_tab.html:11
#: vmbackups/templates/vmbackups/vm_tab.html:26
msgid "Back up now"
msgstr "Şimdi yedekle"
#: vmbackups/templates/vmbackups/vm_tab.html:28
#: vmbackups/templates/vmbackups/vm_tab.html:29
msgid ""
"A running VM keeps running: its disks are copied from one instant, its file "
"systems frozen for that instant when the guest agent answers, otherwise the "
@ -10579,11 +10595,11 @@ msgstr ""
" konuk ajanı yanıt verirse dosya sistemleri o an için dondurulur, vermezse "
"yedek çökme tutarlıdır. Bellek saklanmaz."
#: vmbackups/templates/vmbackups/vm_tab.html:33
#: vmbackups/templates/vmbackups/vm_tab.html:34
msgid "Schedules:"
msgstr "Zamanlamalar:"
#: vmbackups/templates/vmbackups/vm_tab.html:58
#: vmbackups/templates/vmbackups/vm_tab.html:59
msgid "No backup of this VM yet."
msgstr "Bu sanal makinenin henüz yedeği yok."
@ -10603,29 +10619,29 @@ msgid ""
msgstr ""
"%(pool)s depolama havuzu %(target)s yedek hedefidir; önce hedeften çıkarın"
#: vmbackups/utils.py:56
#: vmbackups/utils.py:65
msgid ""
"No backup target open to VM owners has a storage pool on this VM's host."
msgstr ""
"VM sahiplerine açık hiçbir yedek hedefinin bu VM'in sunucusunda depolama "
"havuzu yok."
#: vmbackups/utils.py:57
#: vmbackups/utils.py:66
msgid "No backup target has a storage pool on this VM's host."
msgstr ""
"Hiçbir yedek hedefinin bu sanal makinenin sunucusunda depolama havuzu yok."
#: vmbackups/views.py:82 vmbackups/views.py:108
#: vmbackups/views.py:83 vmbackups/views.py:109
#, python-format
msgid "Backup target %(target)s has backups; delete them first"
msgstr "%(target)s yedek hedefinde yedekler var; önce onları silin"
#: vmbackups/views.py:85
#: vmbackups/views.py:86
#, python-format
msgid "Backup target %(target)s has schedules; delete them first"
msgstr "%(target)s yedek hedefinin zamanlamaları var; önce onları silin"
#: vmbackups/views.py:125
#: vmbackups/views.py:126
#, python-format
msgid ""
"Storage pool %(pool)s of %(compute)s is not the same directory as storage "
@ -10634,10 +10650,15 @@ msgstr ""
"%(compute)s sunucusunun %(pool)s depolama havuzu, %(other_compute)s "
"sunucusunun %(other)s depolama havuzuyla aynı dizin değil"
#: vmbackups/views.py:161
#: vmbackups/views.py:162
msgid "Choose a backup target"
msgstr "Bir yedek hedefi seçin"
#: vmbackups/views.py:198
#, python-format
msgid "The backup of %(vm)s taken %(time)s is being deleted."
msgstr "%(vm)s VM'inin %(time)s tarihli yedeği siliniyor."
#: vrtManager/backup.py:35
#, python-format
msgid ""

Binary file not shown.

View file

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-11-17 16:40+0000\n"
"POT-Creation-Date: 2026-11-17 17:12+0000\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -73,7 +73,7 @@ msgstr "无效的密钥"
#: networks/templates/network.html:373 nwfilters/templates/nwfilters.html:29
#: storages/templates/storage.html:123 virtsecrets/forms.py:34
#: virtsecrets/forms.py:36 vmbackups/forms.py:23 vmbackups/forms.py:36
#: vmbackups/forms.py:77 vmbackups/templates/vmbackups/policies.html:16
#: vmbackups/forms.py:79 vmbackups/templates/vmbackups/policies.html:16
#: vmbackups/templates/vmbackups/targets.html:17
msgid "Name"
msgstr "名称"
@ -470,7 +470,6 @@ msgstr "API 令牌 %(name)s 的操作"
#: templates/common/confirm_delete.html:5
#: templates/common/confirm_delete.html:9
#: templates/common/confirm_delete.html:26
#: vmbackups/templates/vmbackups/delete_form.html:11
msgid "Delete"
msgstr "删除"
@ -785,14 +784,14 @@ msgstr "内存"
#: admin/forms.py:213 instances/models.py:240
#: instances/templates/create_instance_w2.html:118
#: instances/templates/instances/settings_tab.html:25
#: instances/templates/instances/stats_tab.html:53 vmbackups/forms.py:55
#: instances/templates/instances/stats_tab.html:53 vmbackups/forms.py:57
#: vmbackups/templates/vmbackups/restore_over.html:18
msgid "Disk"
msgstr "磁盘"
#: admin/forms.py:214 instances/templates/instance.html:112
#: templates/navbar.html:21 vmbackups/templates/vmbackups/index.html:6
#: vmbackups/templates/vmbackups/index.html:8
#: templates/navbar.html:21 vmbackups/templates/vmbackups/index.html:7
#: vmbackups/templates/vmbackups/index.html:9
#: vmbackups/templates/vmbackups/policies.html:9
#: vmbackups/templates/vmbackups/restore.html:9
#: vmbackups/templates/vmbackups/restore_disk.html:9
@ -987,7 +986,7 @@ msgstr "完成"
#: admin/templates/admin/logs.html:56 admin/views.py:395 logs/views.py:18
#: operations/templates/operations/job.html:107
#: vmbackups/templates/vmbackups/index.html:32
#: vmbackups/templates/vmbackups/index.html:33
#: vmbackups/templates/vmbackups/policy.html:38
#: vmbackups/templates/vmbackups/state.html:1
msgid "Failed"
@ -2384,7 +2383,7 @@ msgstr "无"
#: networks/templates/network.html:337 networks/templates/network.html:379
#: networks/templates/network.html:406 networks/templates/network.html:445
#: nwfilters/templates/nwfilter.html:157 templates/common/form.html:28
#: vmbackups/templates/vmbackups/policy_form.html:19
#: vmbackups/templates/vmbackups/policy_form.html:21
msgid "Save"
msgstr "保存"
@ -3784,7 +3783,7 @@ msgstr "主机存储池中已有的卷。"
#: instances/templates/create_instance_w2.html:165
#: instances/templates/instances/move_disk.html:16
#: instances/templates/instances/settings_tab.html:223 vmbackups/forms.py:14
#: vmbackups/forms.py:57
#: vmbackups/forms.py:59
msgid "Storage pool"
msgstr "存储池"
@ -3796,8 +3795,8 @@ msgstr "字母、数字、点、短横线和下划线。"
#: instances/templates/add_instance_volume.html:44
#: instances/templates/instances/settings_tab.html:851
#: vmbackups/templates/vmbackups/index.html:47
#: vmbackups/templates/vmbackups/vm_tab.html:41
#: vmbackups/templates/vmbackups/index.html:48
#: vmbackups/templates/vmbackups/vm_tab.html:42
msgid "Size"
msgstr "大小"
@ -3951,8 +3950,8 @@ msgstr "地址"
#: instances/templates/allinstances.html:105 instances/views.py:240
#: interfaces/templates/interface.html:153 networks/templates/network.html:202
#: vmbackups/templates/vmbackups/index.html:16
#: vmbackups/templates/vmbackups/index.html:46
#: vmbackups/templates/vmbackups/index.html:17
#: vmbackups/templates/vmbackups/index.html:47
#: vmbackups/templates/vmbackups/policy.html:29
msgid "VM"
msgstr "虚拟机"
@ -6267,10 +6266,10 @@ msgstr "仍在运行的搜索过多;请稍后再试。"
#: operations/templates/operations/jobs.html:38
#: operations/templates/operations/jobs.html:62
#: storages/templates/storage.html:91
#: vmbackups/templates/vmbackups/index.html:27
#: vmbackups/templates/vmbackups/index.html:47
#: vmbackups/templates/vmbackups/index.html:28
#: vmbackups/templates/vmbackups/index.html:48
#: vmbackups/templates/vmbackups/policies.html:17
#: vmbackups/templates/vmbackups/vm_tab.html:41
#: vmbackups/templates/vmbackups/vm_tab.html:42
msgid "State"
msgstr "状态"
@ -7829,8 +7828,8 @@ msgstr "创建过滤器"
#: nwfilters/templates/nwfilter.html:15 nwfilters/templates/nwfilter.html:54
#: operations/templates/operations/jobs.html:46
#: vmbackups/templates/vmbackups/index.html:14
#: vmbackups/templates/vmbackups/index.html:38
#: vmbackups/templates/vmbackups/index.html:15
#: vmbackups/templates/vmbackups/index.html:39
msgid "Filter"
msgstr "过滤器"
@ -7868,7 +7867,7 @@ msgid "Parameters"
msgstr "参数"
#: nwfilters/templates/nwfilter.html:64
#: vmbackups/templates/vmbackups/index.html:34
#: vmbackups/templates/vmbackups/index.html:35
#: vmbackups/templates/vmbackups/state.html:1
msgid "Missing"
msgstr "缺失"
@ -8087,6 +8086,7 @@ msgstr "取消任务表单"
#: operations/templates/operations/job.html:44
#: operations/templates/operations/jobs.html:82
#: vmbackups/templates/vmbackups/state.html:1
msgid "Progress"
msgstr "进度"
@ -8164,7 +8164,7 @@ msgid "All kinds"
msgstr "所有类型"
#: operations/templates/operations/jobs.html:39
#: vmbackups/templates/vmbackups/index.html:29
#: vmbackups/templates/vmbackups/index.html:30
msgid "All states"
msgstr "所有状态"
@ -8177,7 +8177,6 @@ msgid "No jobs"
msgstr "没有任务"
#: operations/templates/operations/jobs.html:59
#: vmbackups/templates/vmbackups/state.html:1
msgid "Job"
msgstr "任务"
@ -9201,7 +9200,7 @@ msgid ""
"encrypted anew."
msgstr "新值会立即替换旧值;之前用口令加密的内容不会重新加密。"
#: vmbackups/forms.py:13 vmbackups/forms.py:37 vmbackups/forms.py:56
#: vmbackups/forms.py:13 vmbackups/forms.py:37 vmbackups/forms.py:58
msgid "Compute"
msgstr "计算节点"
@ -9227,58 +9226,58 @@ msgstr "恢复的客户机保留虚拟机的地址和主机名:与原虚拟机
msgid "Start after restore"
msgstr "恢复后启动"
#: vmbackups/forms.py:58
#: vmbackups/forms.py:60
msgid "Volume name"
msgstr "卷名"
#: vmbackups/forms.py:77 vmbackups/templates/vmbackups/vm_tab.html:13
#: vmbackups/forms.py:79 vmbackups/templates/vmbackups/vm_tab.html:14
msgid "Backup target"
msgstr "备份目标"
#: vmbackups/forms.py:77
#: vmbackups/forms.py:79
msgid "Every VM of a compute"
msgstr "某计算节点的所有虚拟机"
#: vmbackups/forms.py:78
#: vmbackups/forms.py:80
msgid "Or these VMs"
msgstr "或这些虚拟机"
#: vmbackups/forms.py:78 vmbackups/templates/vmbackups/policies.html:16
#: vmbackups/forms.py:80 vmbackups/templates/vmbackups/policies.html:16
msgid "Daily at"
msgstr "每天时间"
#: vmbackups/forms.py:78
msgid "Backups to keep of each VM"
#: vmbackups/forms.py:80
msgid "Backups kept per VM"
msgstr "每台虚拟机保留的备份数"
#: vmbackups/forms.py:79
#: vmbackups/forms.py:81
msgid "A full backup every N backups"
msgstr "每 N 次备份进行一次完整备份"
#: vmbackups/forms.py:80 vmbackups/templates/vmbackups/vm_tab.html:21
#: vmbackups/forms.py:82 vmbackups/templates/vmbackups/vm_tab.html:22
msgid "Require frozen file systems"
msgstr "要求冻结文件系统"
#: vmbackups/forms.py:80 vmbackups/templates/vmbackups/policies.html:27
#: vmbackups/forms.py:82 vmbackups/templates/vmbackups/policies.html:28
msgid "Enabled"
msgstr "已启用"
#: vmbackups/forms.py:92
#: vmbackups/forms.py:94
msgid ""
"1: every backup is full. Above 1, the backups between copy only what changed "
"(running VMs with qcow2 disks)."
msgstr "1:每次备份都是完整备份。大于 1 时,中间的备份只复制变化的部分(适用于使用 qcow2 磁盘的运行中虚拟机)。"
#: vmbackups/forms.py:99
#: vmbackups/forms.py:101
msgid "Choose a compute or VMs, not both"
msgstr "请选择一个计算节点或若干虚拟机,不能同时选择"
#: vmbackups/forms.py:104 vmbackups/jobs.py:106
#: vmbackups/forms.py:106 vmbackups/jobs.py:106
#, python-format
msgid "Backup target %(target)s has no storage pool on %(compute)s"
msgstr "备份目标 %(target)s 在 %(compute)s 上没有存储池"
#: vmbackups/forms.py:111
#: vmbackups/forms.py:113
msgid "Keep one backup at least"
msgstr "至少保留一个备份"
@ -9381,7 +9380,7 @@ msgstr "无法写入备份文件:%(error)s"
msgid "No compute of backup target %(target)s reaches its storage pool"
msgstr "备份目标 %(target)s 的计算节点都无法访问其存储池"
#: vmbackups/jobs.py:601
#: vmbackups/jobs.py:601 vmbackups/templates/vmbackups/delete_form.html:11
msgid "Delete backup"
msgstr "删除备份"
@ -9595,8 +9594,8 @@ msgid "The schedule's owner is no longer an active superuser"
msgstr "该计划的所有者已不再是活动的超级用户"
#: vmbackups/templates/vmbackups/consistency.html:1
msgid "Shut off"
msgstr "已关闭"
msgid "While shut off"
msgstr "关机时"
#: vmbackups/templates/vmbackups/consistency.html:1
msgid "Frozen"
@ -9636,17 +9635,17 @@ msgstr "单个磁盘"
#: vmbackups/templates/vmbackups/delete_form.html:12
#, python-format
msgid ""
"Delete the backup of %(vm)s taken %(time)s? Its files are removed from the "
"target."
msgstr "要删除 %(vm)s 在 %(time)s 的备份吗?其文件将从目标中移除。"
"Delete the backup of %(vm)s taken %(time)s? Its files are removed from "
"%(target)s; this cannot be undone."
msgstr "删除 %(vm)s 于 %(time)s 的备份?其文件将从 %(target)s 中移除;此操作无法撤销。"
#: vmbackups/templates/vmbackups/index.html:10
#: vmbackups/templates/vmbackups/index.html:11
#: vmbackups/templates/vmbackups/policies.html:9
#: vmbackups/templates/vmbackups/policy.html:9
msgid "Schedules"
msgstr "计划"
#: vmbackups/templates/vmbackups/index.html:11
#: vmbackups/templates/vmbackups/index.html:12
#: vmbackups/templates/vmbackups/target.html:7
#: vmbackups/templates/vmbackups/target.html:9
#: vmbackups/templates/vmbackups/targets.html:6
@ -9654,63 +9653,63 @@ msgstr "计划"
msgid "Backup targets"
msgstr "备份目标"
#: vmbackups/templates/vmbackups/index.html:17
#: vmbackups/templates/vmbackups/index.html:18
msgid "VM name"
msgstr "虚拟机名称"
#: vmbackups/templates/vmbackups/index.html:20
#: vmbackups/templates/vmbackups/index.html:46
#: vmbackups/templates/vmbackups/index.html:21
#: vmbackups/templates/vmbackups/index.html:47
#: vmbackups/templates/vmbackups/policies.html:16
#: vmbackups/templates/vmbackups/vm_tab.html:41
#: vmbackups/templates/vmbackups/vm_tab.html:42
msgid "Target"
msgstr "目标"
#: vmbackups/templates/vmbackups/index.html:22
#: vmbackups/templates/vmbackups/index.html:23
msgid "All targets"
msgstr "所有目标"
#: vmbackups/templates/vmbackups/index.html:30
#: vmbackups/templates/vmbackups/index.html:31
#: vmbackups/templates/vmbackups/state.html:1
msgid "Ready"
msgstr "就绪"
#: vmbackups/templates/vmbackups/index.html:31
#: vmbackups/templates/vmbackups/index.html:32
#: vmbackups/templates/vmbackups/state.html:1
msgid "Creating"
msgstr "正在创建"
#: vmbackups/templates/vmbackups/index.html:33
#: vmbackups/templates/vmbackups/index.html:34
#: vmbackups/templates/vmbackups/state.html:1
msgid "Deleting"
msgstr "正在删除"
#: vmbackups/templates/vmbackups/index.html:46
#: vmbackups/templates/vmbackups/vm_tab.html:41
#: vmbackups/templates/vmbackups/index.html:47
#: vmbackups/templates/vmbackups/vm_tab.html:42
msgid "Time"
msgstr "时间"
#: vmbackups/templates/vmbackups/index.html:46
#: vmbackups/templates/vmbackups/vm_tab.html:41
#: vmbackups/templates/vmbackups/index.html:47
#: vmbackups/templates/vmbackups/vm_tab.html:42
msgid "Consistency"
msgstr "一致性"
#: vmbackups/templates/vmbackups/index.html:46
#: vmbackups/templates/vmbackups/index.html:47
msgid "Schedule"
msgstr "计划"
#: vmbackups/templates/vmbackups/index.html:55
#: vmbackups/templates/vmbackups/index.html:56
msgid "removed"
msgstr "已移除"
#: vmbackups/templates/vmbackups/index.html:60
#: vmbackups/templates/vmbackups/index.html:61
msgid "By hand"
msgstr "手动"
#: vmbackups/templates/vmbackups/index.html:70
#: vmbackups/templates/vmbackups/index.html:71
msgid "No backup matches the filter."
msgstr "没有符合筛选条件的备份。"
#: vmbackups/templates/vmbackups/index.html:72
#: vmbackups/templates/vmbackups/index.html:73
msgid "No backup yet. Back a VM up from its Backups tab."
msgstr "还没有备份。请在虚拟机的备份选项卡中备份虚拟机。"
@ -9723,21 +9722,34 @@ msgstr "备份计划"
msgid "Backups kept"
msgstr "保留的备份数"
#: vmbackups/templates/vmbackups/policies.html:17
msgid "Full backup"
msgstr "完整备份"
#: vmbackups/templates/vmbackups/policies.html:23
#, python-format
msgid "Every VM of %(compute)s"
msgstr "%(compute)s 的所有虚拟机"
#: vmbackups/templates/vmbackups/policies.html:27
#: vmbackups/templates/vmbackups/vm_tab.html:34
msgid "Every backup"
msgstr "每次备份"
#: vmbackups/templates/vmbackups/policies.html:27
#, python-format
msgid "Every %(n)s backups"
msgstr "每 %(n)s 次备份一次"
#: vmbackups/templates/vmbackups/policies.html:28
#: vmbackups/templates/vmbackups/vm_tab.html:35
msgid "Disabled"
msgstr "已禁用"
#: vmbackups/templates/vmbackups/policies.html:34
#: vmbackups/templates/vmbackups/policies.html:35
msgid "No backup schedule yet."
msgstr "还没有备份计划。"
#: vmbackups/templates/vmbackups/policies.html:38
#: vmbackups/templates/vmbackups/policies.html:39
msgid "Add a backup schedule"
msgstr "添加备份计划"
@ -9779,7 +9791,7 @@ msgstr "还没有运行记录。"
msgid "Time zone: %(time_zone)s"
msgstr "时区:%(time_zone)s"
#: vmbackups/templates/vmbackups/policy_form.html:18
#: vmbackups/templates/vmbackups/policy_form.html:20
msgid ""
"Each VM is backed up once a day, starting at the time; a VM that has not "
"started within 6 hours waits for the next day. Older backups of each VM "
@ -9864,6 +9876,10 @@ msgstr "将备份恢复到 %(vm)s 上?备份之后虚拟机写入的内容将
msgid "Files of the backup are missing from the target"
msgstr "备份的文件在目标中缺失"
#: vmbackups/templates/vmbackups/state.html:1
msgid "Why?"
msgstr "原因?"
#: vmbackups/templates/vmbackups/target.html:13
#, python-format
msgid "%(counter)s backup."
@ -9942,23 +9958,23 @@ msgstr "还没有备份目标。"
msgid "Add a backup target"
msgstr "添加备份目标"
#: vmbackups/templates/vmbackups/vm_tab.html:10
#: vmbackups/templates/vmbackups/vm_tab.html:25
#: vmbackups/templates/vmbackups/vm_tab.html:11
#: vmbackups/templates/vmbackups/vm_tab.html:26
msgid "Back up now"
msgstr "立即备份"
#: vmbackups/templates/vmbackups/vm_tab.html:28
#: vmbackups/templates/vmbackups/vm_tab.html:29
msgid ""
"A running VM keeps running: its disks are copied from one instant, its file "
"systems frozen for that instant when the guest agent answers, otherwise the "
"backup is crash-consistent. Memory is not kept."
msgstr "运行中的虚拟机会继续运行:其磁盘从同一时刻复制;客户机代理响应时,文件系统在该时刻被冻结,否则备份为崩溃一致。不保存内存。"
#: vmbackups/templates/vmbackups/vm_tab.html:33
#: vmbackups/templates/vmbackups/vm_tab.html:34
msgid "Schedules:"
msgstr "计划:"
#: vmbackups/templates/vmbackups/vm_tab.html:58
#: vmbackups/templates/vmbackups/vm_tab.html:59
msgid "No backup of this VM yet."
msgstr "此虚拟机还没有备份。"
@ -9976,36 +9992,41 @@ msgid ""
"first"
msgstr "存储池 %(pool)s 是备份目标 %(target)s;请先将其从目标中移除"
#: vmbackups/utils.py:56
#: vmbackups/utils.py:65
msgid ""
"No backup target open to VM owners has a storage pool on this VM's host."
msgstr "没有向虚拟机所有者开放的备份目标在此虚拟机的主机上有存储池。"
#: vmbackups/utils.py:57
#: vmbackups/utils.py:66
msgid "No backup target has a storage pool on this VM's host."
msgstr "没有备份目标在此虚拟机的主机上有存储池。"
#: vmbackups/views.py:82 vmbackups/views.py:108
#: vmbackups/views.py:83 vmbackups/views.py:109
#, python-format
msgid "Backup target %(target)s has backups; delete them first"
msgstr "备份目标 %(target)s 中有备份;请先删除它们"
#: vmbackups/views.py:85
#: vmbackups/views.py:86
#, python-format
msgid "Backup target %(target)s has schedules; delete them first"
msgstr "备份目标 %(target)s 有计划;请先删除它们"
#: vmbackups/views.py:125
#: vmbackups/views.py:126
#, python-format
msgid ""
"Storage pool %(pool)s of %(compute)s is not the same directory as storage "
"pool %(other)s of %(other_compute)s"
msgstr "%(compute)s 的存储池 %(pool)s 与 %(other_compute)s 的存储池 %(other)s 不是同一目录"
#: vmbackups/views.py:161
#: vmbackups/views.py:162
msgid "Choose a backup target"
msgstr "请选择备份目标"
#: vmbackups/views.py:198
#, python-format
msgid "The backup of %(vm)s taken %(time)s is being deleted."
msgstr "正在删除 %(vm)s 于 %(time)s 的备份。"
#: vrtManager/backup.py:35
#, python-format
msgid ""

View file

@ -45,6 +45,8 @@ class RestoreForm(forms.Form):
super().__init__(*args, **kwargs)
self.fields["compute"].queryset = Compute.objects.filter(backuptargetpool__target=backup.target).order_by("name")
self.fields["name"].initial = f"{backup.vm_name}-restored"
if backup.instance_id: # the VM's host, when it has the target's pool
self.fields["compute"].initial = self.fields["compute"].queryset.filter(instance=backup.instance_id).first()
if place: # a VM owner's: the VM's compute and pool, shown on the page
del self.fields["compute"], self.fields["pool"]
@ -75,7 +77,7 @@ class PolicyForm(forms.ModelForm):
model = BackupPolicy
fields = ["name", "target", "compute", "instances", "time", "keep", "full_every", "frozen", "enabled"]
labels = {"name": _("Name"), "target": _("Backup target"), "compute": _("Every VM of a compute"),
"instances": _("Or these VMs"), "time": _("Daily at"), "keep": _("Backups to keep of each VM"),
"instances": _("Or these VMs"), "time": _("Daily at"), "keep": _("Backups kept per VM"),
"full_every": _("A full backup every N backups"),
"frozen": _("Require frozen file systems"), "enabled": _("Enabled")}
widgets = {"time": forms.TimeInput(attrs={"type": "time"}, format="%H:%M"),

View file

@ -624,7 +624,7 @@ class DeleteBackup(Kind):
return Plan(
claims={claims.backup_key(backup.uuid): Claim.EXCLUSIVE, **_target_claims(backup.target)},
resource=claims.backup_key(backup.uuid),
label=f"{backup.target.name}/{backup.vm_name}",
label=f"{backup.vm_name} {timezone.localtime(backup.created_at):%Y-%m-%d %H:%M}",
intent={"compute": backup.compute_name, "vm": backup.vm_name, "uuid": backup.vm_uuid,
"time": timezone.localtime(backup.created_at).strftime("%Y-%m-%d %H:%M")},
)

View file

@ -0,0 +1,17 @@
// A backup being made or deleted: the page reads it again until it is done,
// while the backups are in view (the VM page's Backups tab, the Backups page)
// and nothing is open on them (a menu, a dialog).
(function () {
if (!document.querySelector("[data-backup-pending]")) return;
var check = function () {
var pane = document.getElementById("backups");
var hidden = pane && pane.classList.contains("tab-pane") && !pane.classList.contains("active");
var busy = document.querySelector(".dropdown-menu.show, .modal.show");
if (hidden || busy || document.hidden) {
setTimeout(check, 4000);
} else {
location.reload();
}
};
setTimeout(check, 4000);
})();

View file

@ -1 +1 @@
{% load i18n %}{% if backup.consistency == "offline" %}{% trans "Shut off" %}{% elif backup.consistency == "frozen" %}{% trans "Frozen" %}{% elif backup.consistency == "crash" %}{% trans "Crash-consistent" %}{% else %}–{% endif %}{% if backup.parent_id %} <span class="badge text-bg-light border" title="{% trans 'Copies only what changed since the backup it builds on' %}">{% trans "Incremental" %}</span>{% endif %}
{% load i18n %}{% if backup.consistency == "offline" %}{% trans "While shut off" %}{% elif backup.consistency == "frozen" %}{% trans "Frozen" %}{% elif backup.consistency == "crash" %}{% trans "Crash-consistent" %}{% else %}–{% endif %}{% if backup.parent_id %} <span class="badge text-bg-light border" title="{% trans 'Copies only what changed since the backup it builds on' %}">{% trans "Incremental" %}</span>{% endif %}

View file

@ -1,4 +1,4 @@
{% load i18n %}{% load operations %}{% load bootstrap_icons %}{% if backup.state == "ready" %}<div class="btn-group me-1">
{% load i18n %}{% load operations %}{% load bootstrap_icons %}{% if backup.state != "deleting" and backup.uuid|stringformat:"s" not in pending_deletes %}<div class="d-inline-flex gap-1 justify-content-end">{% if backup.state == "ready" %}<div class="btn-group">
{# fixed: the menu would be cut off by the table's scrolling box #}
<button class="btn btn-sm btn-outline-primary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false"
data-bs-popper-config='{"strategy": "fixed"}'>{% trans "Restore" %}</button>
@ -8,5 +8,5 @@
{% if user.is_superuser %}<li><a class="dropdown-item" href="{% url 'vmbackups:restore_disk' backup.uuid %}">{% trans "One disk" %}</a></li>{% endif %}
</ul>
</div>{% endif %}{% if backup.state != "creating" %}{% if user.is_superuser or backup.taken_by_id == user.id and not backup.policy_id %}<form method="post" action="{% url 'vmbackups:delete' backup.uuid %}" class="d-inline">{% csrf_token %}{% submission_key %}
<button type="submit" class="btn btn-sm btn-outline-danger" aria-label="{% trans "Delete" %}" title="{% trans "Delete" %}"
data-confirm="{% blocktrans with time=backup.created_at|date:"Y-m-d H:i" vm=backup.vm_name %}Delete the backup of {{ vm }} taken {{ time }}? Its files are removed from the target.{% endblocktrans %}">{% bs_icon 'trash' %}</button></form>{% endif %}{% endif %}
<button type="submit" class="btn btn-sm btn-outline-danger" aria-label="{% trans "Delete backup" %}" title="{% trans "Delete backup" %}"
data-confirm="{% blocktrans with time=backup.created_at|date:"Y-m-d H:i" vm=backup.vm_name target=backup.target.name %}Delete the backup of {{ vm }} taken {{ time }}? Its files are removed from {{ target }}; this cannot be undone.{% endblocktrans %}">{% bs_icon 'trash' %}</button></form>{% endif %}{% endif %}</div>{% endif %}

View file

@ -1,5 +1,6 @@
{% extends "base.html" %}
{% load i18n %}
{% load static %}
{% load bootstrap_icons %}
{% load operations %}
@ -50,17 +51,17 @@
{% for backup in rows %}
<tr>
<td class="text-nowrap">{{ backup.created_at|date:"Y-m-d H:i" }}</td>
<td>
<td class="text-nowrap">
{% if backup.instance %}<a href="{% url 'instances:instance' backup.instance.id %}">{{ backup.vm_name }}</a>
{% else %}{{ backup.vm_name }} <span class="badge text-bg-secondary">{% trans "removed" %}</span>{% endif %}
<div class="small text-body-secondary">{{ backup.compute_name }}</div>
</td>
<td>{{ backup.target.name }}</td>
<td class="text-nowrap">{{ backup.target.name }}</td>
<td>{% include "vmbackups/consistency.html" %}</td>
<td>{% if backup.policy %}<a href="{% url 'vmbackups:policy' backup.policy_id %}">{{ backup.policy.name }}</a>{% else %}<span class="text-body-secondary">{% trans "By hand" %}</span>{% endif %}</td>
<td class="text-end text-nowrap">{% if backup.size %}{{ backup.size|filesizeformat }}{% else %}–{% endif %}</td>
<td>{% include "vmbackups/state.html" %}</td>
<td class="text-end">{% include "vmbackups/delete_form.html" %}</td>
<td class="text-end text-nowrap">{% include "vmbackups/delete_form.html" %}</td>
</tr>
{% endfor %}
</tbody>
@ -72,3 +73,5 @@
<div class="alert alert-info">{% trans "No backup yet. Back a VM up from its Backups tab." %}</div>
{% endif %}
{% endblock %}
{% block script %}<script src="{% static 'vmbackups/pending.js' %}"></script>{% endblock %}

View file

@ -14,7 +14,7 @@
<table class="table table-hover align-middle">
<thead>
<tr><th>{% trans "Name" %}</th><th>{% trans "VMs" %}</th><th>{% trans "Target" %}</th><th>{% trans "Daily at" %}</th>
<th class="text-end">{% trans "Backups kept" %}</th><th>{% trans "State" %}</th></tr>
<th class="text-end">{% trans "Backups kept" %}</th><th>{% trans "Full backup" %}</th><th>{% trans "State" %}</th></tr>
</thead>
<tbody>
{% for policy in policies %}
@ -24,6 +24,7 @@
<td>{{ policy.target.name }}</td>
<td>{{ policy.time|time:"H:i" }}</td>
<td class="text-end">{{ policy.keep }}</td>
<td>{% if policy.full_every == 1 %}{% trans "Every backup" %}{% else %}{% blocktrans with n=policy.full_every %}Every {{ n }} backups{% endblocktrans %}{% endif %}</td>
<td>{% if policy.enabled %}<span class="badge text-bg-success">{% trans "Enabled" %}</span>{% else %}<span class="badge text-bg-secondary">{% trans "Disabled" %}</span>{% endif %}</td>
</tr>
{% endfor %}

View file

@ -9,9 +9,11 @@
<div class="col-md-7">{% bootstrap_field form.instances %}</div>
</div>
<div class="row g-2">
<div class="col-md-4">{% blocktrans asvar zone_help %}Time zone: {{ time_zone }}{% endblocktrans %}{% bootstrap_field form.time help_text=zone_help %}</div>
<div class="col-md-4">{% bootstrap_field form.keep %}</div>
<div class="col-md-4">{% bootstrap_field form.full_every %}</div>
<div class="col-sm-6">{% blocktrans asvar zone_help %}Time zone: {{ time_zone }}{% endblocktrans %}{% bootstrap_field form.time help_text=zone_help %}</div>
<div class="col-sm-6">{% bootstrap_field form.keep %}</div>
</div>
<div class="row g-2">
<div class="col-sm-6">{% bootstrap_field form.full_every %}</div>
</div>
{% bootstrap_field form.frozen %}
{% bootstrap_field form.enabled %}

View file

@ -1 +1 @@
{% load i18n %}{% if backup.state == "ready" %}<span class="badge text-bg-success">{% trans "Ready" %}</span>{% elif backup.state == "creating" %}<span class="badge text-bg-info">{% trans "Creating" %}</span>{% elif backup.state == "deleting" %}<span class="badge text-bg-warning">{% trans "Deleting" %}</span>{% elif backup.state == "missing" %}<span class="badge text-bg-danger" title="{% trans "Files of the backup are missing from the target" %}">{% trans "Missing" %}</span>{% else %}<span class="badge text-bg-danger">{% trans "Failed" %}</span>{% endif %}{% if backup.operation_id %} <a class="small" href="{% url 'operations:job' backup.operation_id %}">{% trans "Job" %}</a>{% endif %}
{% load i18n %}{% if backup.state == "deleting" or backup.uuid|stringformat:"s" in pending_deletes %}<span class="badge text-bg-warning" data-backup-pending>{% trans "Deleting" %}</span>{% elif backup.state == "ready" %}<span class="badge text-bg-success">{% trans "Ready" %}</span>{% elif backup.state == "creating" %}<span class="badge text-bg-info" data-backup-pending>{% trans "Creating" %}</span>{% if backup.operation_id %} <a class="small" href="{% url 'operations:job' backup.operation_id %}">{% trans "Progress" %}</a>{% endif %}{% elif backup.state == "missing" %}<span class="badge text-bg-danger" title="{% trans "Files of the backup are missing from the target" %}">{% trans "Missing" %}</span>{% else %}<span class="badge text-bg-danger">{% trans "Failed" %}</span>{% if backup.operation_id %} <a class="small" href="{% url 'operations:job' backup.operation_id %}">{% trans "Why?" %}</a>{% endif %}{% endif %}

View file

@ -1,6 +1,7 @@
{% load i18n %}
{% load operations %}
{% load bootstrap_icons %}
{% load static %}
<div class="tab-pane" id="backups" role="tabpanel">
<div class="card">
<div class="card-body">
@ -47,8 +48,8 @@
<td>{{ backup.target.name }}</td>
<td>{% include "vmbackups/consistency.html" %}</td>
<td class="text-end text-nowrap">{% if backup.size %}{{ backup.size|filesizeformat }}{% else %}–{% endif %}</td>
<td>{% include "vmbackups/state.html" %}</td>
<td class="text-end">{% include "vmbackups/delete_form.html" %}</td>
<td>{% include "vmbackups/state.html" with pending_deletes=backups.pending_deletes %}</td>
<td class="text-end text-nowrap">{% include "vmbackups/delete_form.html" with pending_deletes=backups.pending_deletes %}</td>
</tr>
{% endfor %}
</tbody>
@ -60,3 +61,4 @@
</div>
</div>
</div>
<script src="{% static 'vmbackups/pending.js' %}"></script>

View file

@ -133,11 +133,16 @@ class DeleteBackupTests(TransactionTestCase):
def test_the_page_deletes_and_goes_back(self):
self.client.force_login(self.admin)
url = reverse("vmbackups:delete", args=[self.backup.uuid])
response = self.client.post(url, {"submission_key": "key-page-del1"}, HTTP_REFERER="http://testserver/backups/")
op = Operation.objects.get()
self.assertEqual(op.kind, "backup.delete")
# the job's own page: neither the Backups page nor the VM page shows a backup's job
self.assertRedirects(response, reverse("operations:job", args=[op.pk]), fetch_redirect_response=False)
response = self.client.post(url, {"submission_key": "key-page-del1"}, HTTP_REFERER="http://testserver/backups/",
follow=True)
self.assertEqual(Operation.objects.get().kind, "backup.delete")
# the page it was asked from, saying which backup goes, and the row as being deleted
self.assertEqual(response.redirect_chain[0][0], "http://testserver/backups/")
self.assertContains(response, f"The backup of vm1 taken {self.backup.created_at:%Y-%m-%d} ")
page = lxml_html.fromstring(response.content)
row = page.xpath("//table[@id='backups']/tbody/tr")[0]
self.assertTrue(row.xpath(".//*[@data-backup-pending]"))
self.assertFalse(row.xpath(".//button[@data-confirm]")) # nothing more to ask of it
class IndexTests(TransactionTestCase):

View file

@ -283,6 +283,14 @@ class RestoreTests(TransactionTestCase):
with self.assertRaisesMessage(OperationError, "builds on a backup that is gone"):
self.run_job(self.submit())
def test_the_restore_form_starts_on_the_vms_host(self):
from vmbackups.forms import RestoreForm
vm = Instance.objects.create(compute=self.compute, name="vm1", uuid=self.backup.vm_uuid)
Backup.objects.filter(pk=self.backup.pk).update(instance=vm)
self.backup.refresh_from_db()
self.assertEqual(RestoreForm(backup=self.backup).fields["compute"].initial, self.compute)
def test_the_nvram_file_is_qemus(self):
self.run_job(self.submit())
self.assertEqual(self.conn.upload_volume.call_args.kwargs, {"owner": _owner(), "mode": "0600"})

View file

@ -41,6 +41,15 @@ def refuse_target_pool(compute, pool):
)
def pending_deletes():
"""The UUIDs of the backups a deletion job was asked for and has not
finished: shown as being deleted before the job marks them."""
from operations.models import Operation
ops = Operation.objects.filter(kind="backup.delete", state__in=Operation.ACTIVE).values_list("params", flat=True)
return {params["backup"] for params in ops}
def vm_tab(instance, user):
"""The VM page's Backups tab: the VM's backups, the targets of its host,
and why it cannot be backed up, if it cannot. A VM owner sees only
@ -63,4 +72,5 @@ def vm_tab(instance, user):
problem = str(err)
schedules = [] if owner else BackupPolicy.objects.filter(
Q(instances=instance) | Q(compute=instance.compute_id)).distinct().order_by("name")
return {"rows": rows, "targets": targets, "problem": problem, "schedules": schedules}
return {"rows": rows, "targets": targets, "problem": problem, "schedules": schedules,
"pending_deletes": pending_deletes()}

View file

@ -6,6 +6,7 @@ from django.conf import settings
from django.db.models import Count
from django.shortcuts import get_object_or_404, redirect, render
from django.urls import reverse
from django.utils import timezone
from django.views.decorators.http import require_POST
from django.utils.translation import gettext_lazy as _
from django.utils.translation import gettext_noop
@ -25,7 +26,7 @@ from vrtManager.util import OperationError
from .forms import PolicyForm, RestoreDiskForm, RestoreForm, TargetForm, TargetPoolForm
from .jobs import _over_plan, _proxy, _vm_pool
from .models import Backup, BackupPolicy, BackupTarget
from .utils import inside_vm_pool
from .utils import inside_vm_pool, pending_deletes
def _may_restore(user, backup):
@ -177,24 +178,25 @@ def index(request):
rows = rows.filter(state=state)
return render(request, "vmbackups/index.html", {
"rows": rows, "targets": BackupTarget.objects.order_by("name"),
"vm": vm, "target": target, "state": state,
"vm": vm, "target": target, "state": state, "pending_deletes": pending_deletes(),
})
@require_POST
@login_required
def delete(request, uuid):
"""Delete a backup: a backup.delete job. The page it was asked from shows
the backup as being deleted until it is gone."""
backup = get_object_or_404(Backup, uuid=uuid)
try:
op = jobs.submit("backup.delete", request.user, {"backup": str(backup.uuid)},
request.POST.get("submission_key", ""))
jobs.submit("backup.delete", request.user, {"backup": str(backup.uuid)}, request.POST.get("submission_key", ""))
except claims.Busy as busy:
messages.error(request, busy_message(busy, request.user))
except (jobs.SubmissionConflict, libvirtError) as err:
messages.error(request, error_text(request, err))
else:
# the job's page follows it: the pages listing backups show no backup's job
return redirect("operations:job", op.pk)
messages.success(request, _("The backup of %(vm)s taken %(time)s is being deleted.") % {
"vm": backup.vm_name, "time": timezone.localtime(backup.created_at).strftime("%Y-%m-%d %H:%M")})
return redirect(same_origin_referer(request, reverse("vmbackups:index")))