@xen-orchestra/web-core 0.41.0 → 0.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/assets/css/_themes.pcss +788 -0
- package/lib/components/banner/VtsBanner.vue +50 -0
- package/lib/components/copy-button/VtsCopyButton.vue +9 -2
- package/lib/components/donut-chart-with-legend/VtsDonutChartWithLegend.vue +1 -1
- package/lib/components/input-wrapper/VtsInputWrapper.vue +1 -0
- package/lib/components/legend-group/VtsLegendGroup.vue +1 -5
- package/lib/components/modal/VtsActionModal.vue +3 -4
- package/lib/components/modal/VtsBlockedModal.vue +96 -0
- package/lib/components/modal/VtsDeleteModal.vue +43 -0
- package/lib/components/state-hero/VtsStateHero.vue +1 -1
- package/lib/components/table/VtsTable.vue +2 -1
- package/lib/components/ui/alert/UiAlert.vue +5 -5
- package/lib/components/ui/card-numbers/UiCardNumbers.vue +1 -1
- package/lib/components/ui/checkbox/UiCheckbox.vue +1 -1
- package/lib/components/ui/donut-chart/UiDonutChart.vue +1 -1
- package/lib/components/ui/head-bar/UiHeadBar.vue +1 -0
- package/lib/components/ui/legend/UiLegend.vue +1 -1
- package/lib/components/ui/radio-button/UiRadioButton.vue +1 -1
- package/lib/components/ui/radio-button-group/UiRadioButtonGroup.vue +16 -3
- package/lib/components/ui/rich-radio-button/UiRichRadioButton.vue +247 -0
- package/lib/icons/action-icons.ts +1 -1
- package/lib/icons/fa-icons.ts +2 -0
- package/lib/layouts/CoreLayout.vue +26 -0
- package/lib/locales/cs.json +26 -13
- package/lib/locales/da.json +32 -8
- package/lib/locales/de.json +197 -17
- package/lib/locales/en.json +71 -15
- package/lib/locales/es.json +8 -14
- package/lib/locales/fa.json +6 -11
- package/lib/locales/fi.json +5 -4
- package/lib/locales/fr.json +72 -16
- package/lib/locales/it.json +6 -9
- package/lib/locales/ja.json +7 -0
- package/lib/locales/ko.json +6 -1
- package/lib/locales/nb-NO.json +6 -9
- package/lib/locales/nl.json +5 -12
- package/lib/locales/pl.json +6 -1
- package/lib/locales/pt-BR.json +7 -5
- package/lib/locales/ru.json +6 -10
- package/lib/locales/sv.json +7 -13
- package/lib/locales/uk.json +6 -8
- package/lib/packages/modal/create-modal-opener.ts +3 -2
- package/lib/packages/remote-resource/define-remote-resource.ts +11 -9
- package/lib/packages/remote-resource/sse.store.ts +31 -3
- package/lib/tables/column-sets/backup-issue-columns.ts +6 -4
- package/lib/types/object.type.ts +10 -0
- package/package.json +1 -1
package/lib/locales/pt-BR.json
CHANGED
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"admin-login": "Login do administrador",
|
|
52
52
|
"admin-password": "Senha do administrador",
|
|
53
53
|
"admin-password-confirm": "Confirmar senha do administrador",
|
|
54
|
-
"affinity-host": "
|
|
54
|
+
"affinity-host": "Afinidade do Host",
|
|
55
55
|
"alarm-type:cpu_usage": "O uso da CPU excede @:n-percent",
|
|
56
56
|
"alarm-type:disk_usage": "O uso do disco excede @:n-percent",
|
|
57
57
|
"alarm-type:fs_usage": "O uso de FS excede @:n-percent",
|
|
@@ -94,10 +94,7 @@
|
|
|
94
94
|
"backup:rolling-snapshot": "Snapshot contínuo",
|
|
95
95
|
"backup:xo-config": "Configuração XO",
|
|
96
96
|
"backups": "Backups",
|
|
97
|
-
"backups:jobs:at-least-one-skipped": "Pelo menos um ignorado",
|
|
98
|
-
"backups:jobs:based-on-last-three": "Com base nas últimas três execuções",
|
|
99
97
|
"backups:jobs:disabled": "Desativado",
|
|
100
|
-
"backups:jobs:looks-like-issue": "Parece que há um problema",
|
|
101
98
|
"backups:jobs:running-good": "Está funcionando bem",
|
|
102
99
|
"backups:vms-protection": "Proteção de máquinas virtuais",
|
|
103
100
|
"backups:vms-protection:no-job": "Sem tarefa",
|
|
@@ -214,7 +211,6 @@
|
|
|
214
211
|
"other-settings": "Outras configurações",
|
|
215
212
|
"page-not-found": "Esta página não foi encontrada…",
|
|
216
213
|
"pending": "Pendente",
|
|
217
|
-
"pool:status:unknown:tooltip": "Servidores atualmente em conexão ou em estado desconhecido",
|
|
218
214
|
"pool:status:unreachable:tooltip": "Servidores configurados que não podem ser alcançados",
|
|
219
215
|
"progress": "Progresso",
|
|
220
216
|
"properties": "Propriedades",
|
|
@@ -237,6 +233,10 @@
|
|
|
237
233
|
"task": "Tarefa",
|
|
238
234
|
"tasks:overview": "Visão geral das tarefas",
|
|
239
235
|
"template-has-bios-strings": "O template já contém BIOS strings",
|
|
236
|
+
"theme-dracula": "Dracula",
|
|
237
|
+
"theme-monokai": "Monokai",
|
|
238
|
+
"theme-nord": "Nord",
|
|
239
|
+
"theme-solarized": "Solarized",
|
|
240
240
|
"third-parties": "Aplicativos de terceiros",
|
|
241
241
|
"timezone": "Fuso horário",
|
|
242
242
|
"topology": "Topologia",
|
|
@@ -252,6 +252,7 @@
|
|
|
252
252
|
"viridian": "Viridian",
|
|
253
253
|
"vlan": "VLAN",
|
|
254
254
|
"vm-off": "Esta máquina virtual está desligada.",
|
|
255
|
+
"vtpm": "VTPM",
|
|
255
256
|
"warning": "Aviso",
|
|
256
257
|
"warnings": "Avisos",
|
|
257
258
|
"weblate": "Weblate",
|
|
@@ -259,6 +260,7 @@
|
|
|
259
260
|
"xen-orchestra": "Xen Orchestra",
|
|
260
261
|
"xo": "XO",
|
|
261
262
|
"xo-5": "XO-5",
|
|
263
|
+
"xo-lite": "XO lite",
|
|
262
264
|
"xoa": "XOA",
|
|
263
265
|
"xoa-deploy-failed!": "Desculpe, a implantação falhou!",
|
|
264
266
|
"xoa-deploy-successful!": "Implantação do XOA concluída com sucesso!"
|
package/lib/locales/ru.json
CHANGED
|
@@ -131,17 +131,13 @@
|
|
|
131
131
|
"backup:rolling-snapshot": "Скользящий снимок",
|
|
132
132
|
"backup:xo-config": "Конфигурация XO",
|
|
133
133
|
"backups": "Резервные копии",
|
|
134
|
-
"backups:jobs:at-least-one-skipped": "Как минимум один пропущенный",
|
|
135
|
-
"backups:jobs:based-on-last-three": "На основе трех последних работ",
|
|
136
134
|
"backups:jobs:disabled": "Отключен(о)а",
|
|
137
|
-
"backups:jobs:looks-like-issue": "Похоже, есть какая-то проблема",
|
|
138
135
|
"backups:jobs:running-good": "Работает хорошо",
|
|
139
136
|
"backups:vms-protection": "Защита ВМ",
|
|
140
137
|
"backups:vms-protection:no-job": "Ни на какой работе",
|
|
141
138
|
"backups:vms-protection:protected": "По крайней мере на 1 работе и защищен",
|
|
142
139
|
"backups:vms-protection:tooltip": "VM защищена, если резервное копирование по расписанию, и предыдущий запуск прошел успешно",
|
|
143
140
|
"backups:vms-protection:unprotected": "По крайней мере в 1 задании, но без защиты",
|
|
144
|
-
"best-effort": "лучшее усилие",
|
|
145
141
|
"bios-default": "bios (по умолчанию)",
|
|
146
142
|
"bios-info": "Информация о BIOS",
|
|
147
143
|
"bond": "Bond",
|
|
@@ -297,18 +293,15 @@
|
|
|
297
293
|
"host-internal-networks": "Внутренние сети узла",
|
|
298
294
|
"host-not-running": "Хост не запущен",
|
|
299
295
|
"host-off": "Хост выключен",
|
|
300
|
-
"host-unknown": "Узел неизвестен",
|
|
301
296
|
"host:status:active": "активен",
|
|
302
297
|
"host:status:halted": "@:status:halted",
|
|
303
298
|
"host:status:inactive": "неактивен",
|
|
304
299
|
"host:status:running": "работает",
|
|
305
300
|
"host:status:unknown": "неизвестен",
|
|
306
|
-
"host:status:unknown:tooltip": "Метрики узла недоступны",
|
|
307
301
|
"hosts": "Узлы",
|
|
308
302
|
"hosts-status": "Статус узла",
|
|
309
303
|
"hyper-threading": "Многопоточность (SMT)",
|
|
310
304
|
"id": "ID",
|
|
311
|
-
"in-last-three-jobs": "На своих последних трех работах",
|
|
312
305
|
"in-progress": "В процессе",
|
|
313
306
|
"info": "Информация",
|
|
314
307
|
"infos": "Информация",
|
|
@@ -449,14 +442,13 @@
|
|
|
449
442
|
"offline": "Не в сети",
|
|
450
443
|
"ok": "OK",
|
|
451
444
|
"or": "Или",
|
|
452
|
-
"pagination:all": "
|
|
445
|
+
"pagination:all": "@:all",
|
|
453
446
|
"password": "Пароль",
|
|
454
447
|
"password-invalid": "Неверный пароль",
|
|
455
448
|
"pif": "PIF",
|
|
456
449
|
"pif-status": "Статус PIF",
|
|
457
450
|
"pifs": "PIFs",
|
|
458
451
|
"pifs-status": "PIFs статус",
|
|
459
|
-
"please-confirm": "Пожалуйста подтвердите",
|
|
460
452
|
"proxy": "Proxy",
|
|
461
453
|
"pxe": "PXE",
|
|
462
454
|
"query-search-bar:label": "поисковый движок",
|
|
@@ -481,6 +473,10 @@
|
|
|
481
473
|
"status:running": "Запущен",
|
|
482
474
|
"status:unknown": "Неизвестно",
|
|
483
475
|
"template-has-bios-strings": "Шаблон уже содержит настройки BIOS",
|
|
476
|
+
"theme-dracula": "Dracula",
|
|
477
|
+
"theme-monokai": "Monokai",
|
|
478
|
+
"theme-nord": "Nord",
|
|
479
|
+
"theme-solarized": "Solarized",
|
|
484
480
|
"uuid": "UUID",
|
|
485
481
|
"vcpu": "vCPU",
|
|
486
482
|
"vcpus": "vCPUs",
|
|
@@ -498,7 +494,6 @@
|
|
|
498
494
|
"vm:status:paused": "Пауза",
|
|
499
495
|
"vm:status:running": "Запущенный",
|
|
500
496
|
"vm:status:suspended": "Приостановлен",
|
|
501
|
-
"vm:status:unknown": "Неизвестный",
|
|
502
497
|
"weblate": "Weblate",
|
|
503
498
|
"write": "Писать",
|
|
504
499
|
"xcp-ng": "XCP-ng",
|
|
@@ -506,6 +501,7 @@
|
|
|
506
501
|
"xo": "XO",
|
|
507
502
|
"xo-5": "XO-5",
|
|
508
503
|
"xo-backups": "резервные копии XO",
|
|
504
|
+
"xo-lite": "XO lite",
|
|
509
505
|
"xo-lite-under-construction": "XOLite находится в разработке",
|
|
510
506
|
"xo-replications": "Репликации XO",
|
|
511
507
|
"xoa": "XOA",
|
package/lib/locales/sv.json
CHANGED
|
@@ -118,17 +118,13 @@
|
|
|
118
118
|
"backup:rolling-snapshot": "Rullande ögonblicksbild",
|
|
119
119
|
"backup:xo-config": "XO-konfig",
|
|
120
120
|
"backups": "Säkerhetskopieringar",
|
|
121
|
-
"backups:jobs:at-least-one-skipped": "Minst en hoppades över",
|
|
122
|
-
"backups:jobs:based-on-last-three": "Baserat på de senaste tre jobben",
|
|
123
121
|
"backups:jobs:disabled": "Inaktiverad",
|
|
124
|
-
"backups:jobs:looks-like-issue": "Det ser ut som att vi har ett problem",
|
|
125
122
|
"backups:jobs:running-good": "Fungerar",
|
|
126
123
|
"backups:vms-protection": "VM-skydd",
|
|
127
124
|
"backups:vms-protection:no-job": "Ej i något jobb",
|
|
128
125
|
"backups:vms-protection:protected": "I minst ett jobb och skyddad",
|
|
129
126
|
"backups:vms-protection:tooltip": "En VM är skyddad om den är med i ett säkerhetskopieringsjobb, med ett aktivt schema och den senaste körningen lyckades",
|
|
130
127
|
"backups:vms-protection:unprotected": "Med i minst 1 jobb men oskyddad",
|
|
131
|
-
"best-effort": "bästa möjliga insats",
|
|
132
128
|
"bios-default": "bios (standardinställt)",
|
|
133
129
|
"bios-info": "BIOS-info",
|
|
134
130
|
"bond": "Bindning",
|
|
@@ -273,17 +269,14 @@
|
|
|
273
269
|
"host-internal-networks": "Host-interna nätverk",
|
|
274
270
|
"host-not-running": "Host:en kör inte",
|
|
275
271
|
"host-off": "Hosten är avstängd",
|
|
276
|
-
"host-unknown": "Host okänd",
|
|
277
272
|
"host:status:active": "@:status:active",
|
|
278
273
|
"host:status:halted": "@:status:halted",
|
|
279
274
|
"host:status:inactive": "@:status:inactive",
|
|
280
275
|
"host:status:running": "@:status:running",
|
|
281
|
-
"host:status:unknown:tooltip": "Host-data är otillgängligt",
|
|
282
276
|
"hosts": "Hostar",
|
|
283
277
|
"hosts-status": "Host-status",
|
|
284
278
|
"hyper-threading": "Multitrådning (SMT)",
|
|
285
279
|
"id": "ID",
|
|
286
|
-
"in-last-three-jobs": "I de senaste tre jobben",
|
|
287
280
|
"in-progress": "Pågående",
|
|
288
281
|
"install-settings": "Installationsinställningar",
|
|
289
282
|
"installed": "Installerad",
|
|
@@ -395,7 +388,7 @@
|
|
|
395
388
|
"n-missing": "{n} saknas",
|
|
396
389
|
"n-percent": "{n}%",
|
|
397
390
|
"n-selected-of": "{count} markerade av {total} objekt",
|
|
398
|
-
"n-subtasks": "
|
|
391
|
+
"n-subtasks": "1 underuppgift | {n} underuppgifter",
|
|
399
392
|
"n-vms": "1 VM | {n} VM:ar",
|
|
400
393
|
"name": "Namn",
|
|
401
394
|
"nested-virtualization": "Nästlad virtualisering",
|
|
@@ -461,13 +454,10 @@
|
|
|
461
454
|
"pif-status": "PIF-status",
|
|
462
455
|
"pifs": "PIFar",
|
|
463
456
|
"pifs-status": "PIF status",
|
|
464
|
-
"please-confirm": "Vänligen bekräfta",
|
|
465
457
|
"pool": "Pool",
|
|
466
458
|
"pool-cpu-usage": "Användning av CPU-pool",
|
|
467
459
|
"pool-ram-usage": "Användning av RAM-pool",
|
|
468
460
|
"pool:status:connected": "@:status:connected",
|
|
469
|
-
"pool:status:unknown": "@:status:unknown",
|
|
470
|
-
"pool:status:unknown:tooltip": "Servrarna ansluter just nu eller är i ett okänt stadie",
|
|
471
461
|
"pool:status:unreachable": "Onåbar",
|
|
472
462
|
"pool:status:unreachable:tooltip": "Konfigurerade servrar som inte kan nås",
|
|
473
463
|
"pools": "Pooler",
|
|
@@ -573,7 +563,11 @@
|
|
|
573
563
|
"template-has-bios-strings": "Den här mallen innehåller redan BIOS-strängar",
|
|
574
564
|
"theme-auto": "Auto",
|
|
575
565
|
"theme-dark": "Mörkt",
|
|
566
|
+
"theme-dracula": "Dracula",
|
|
576
567
|
"theme-light": "Ljust",
|
|
568
|
+
"theme-monokai": "Monokai",
|
|
569
|
+
"theme-nord": "Nord",
|
|
570
|
+
"theme-solarized": "Solarized",
|
|
577
571
|
"third-parties": "Tredjepartsappar",
|
|
578
572
|
"this-host": "Den här hosten",
|
|
579
573
|
"this-vm-cant-be-migrated": "Denna VM kan inte migreras",
|
|
@@ -632,11 +626,10 @@
|
|
|
632
626
|
"vm:status:paused": "Pausad",
|
|
633
627
|
"vm:status:running": "@:status:running",
|
|
634
628
|
"vm:status:suspended": "Suspenderad",
|
|
635
|
-
"vm:status:unknown": "@:status:unknown",
|
|
636
|
-
"vm:status:unknown:tooltip": "Där XO har förlorat kontakten med poolen",
|
|
637
629
|
"vms": "VMar",
|
|
638
630
|
"vms-status": "VM-status",
|
|
639
631
|
"vms-treeview": "VM-trädvy",
|
|
632
|
+
"vtpm": "VTPM",
|
|
640
633
|
"warning": "Varning",
|
|
641
634
|
"warnings": "Varningar",
|
|
642
635
|
"weblate": "Weblate",
|
|
@@ -647,6 +640,7 @@
|
|
|
647
640
|
"xo": "XO",
|
|
648
641
|
"xo-5": "XO-5",
|
|
649
642
|
"xo-backups": "XO-backuper",
|
|
643
|
+
"xo-lite": "XO lite",
|
|
650
644
|
"xo-lite-under-construction": "XOLite är under uppbyggnad",
|
|
651
645
|
"xo-replications": "XO-replikeringar",
|
|
652
646
|
"xoa": "XOA",
|
package/lib/locales/uk.json
CHANGED
|
@@ -94,17 +94,13 @@
|
|
|
94
94
|
"backup:rolling-snapshot": "Ковзний знімок",
|
|
95
95
|
"backup:xo-config": "Конфігурація XO",
|
|
96
96
|
"backups": "Резервні копії",
|
|
97
|
-
"backups:jobs:at-least-one-skipped": "Як мінімум один пропущений",
|
|
98
|
-
"backups:jobs:based-on-last-three": "На основі трьох останніх робіт",
|
|
99
97
|
"backups:jobs:disabled": "Вимкнено",
|
|
100
|
-
"backups:jobs:looks-like-issue": "Схоже, є якась проблема",
|
|
101
98
|
"backups:jobs:running-good": "Працює добре",
|
|
102
99
|
"backups:vms-protection": "Захист ВМ",
|
|
103
100
|
"backups:vms-protection:no-job": "На жодній роботі",
|
|
104
101
|
"backups:vms-protection:protected": "Принаймні на 1 роботі і захищений",
|
|
105
102
|
"backups:vms-protection:tooltip": "ВМ захищена, якщо резервне копіювання за розкладом, і попередній запуск пройшов успішно",
|
|
106
103
|
"backups:vms-protection:unprotected": "Принаймні на 1 роботі, але без захисту",
|
|
107
|
-
"best-effort": "найкращі зусилля",
|
|
108
104
|
"bios-default": "bios (за замовчуванням)",
|
|
109
105
|
"bios-info": "Інформація про BIOS",
|
|
110
106
|
"bond": "Bond",
|
|
@@ -228,12 +224,10 @@
|
|
|
228
224
|
"high-availability": "Висока доступність (HA)",
|
|
229
225
|
"host": "Вузол",
|
|
230
226
|
"host-internal-networks": "Внутрішні мережі вузла",
|
|
231
|
-
"host-unknown": "Вузол невідомий",
|
|
232
227
|
"host:status:active": "Активний",
|
|
233
228
|
"host:status:halted": "@:status:halted",
|
|
234
229
|
"host:status:inactive": "Неактивний",
|
|
235
230
|
"host:status:running": "@:status:running",
|
|
236
|
-
"host:status:unknown:tooltip": "Метрики вузла недоступні",
|
|
237
231
|
"hosts": "Вузли",
|
|
238
232
|
"hosts-status": "Статус вузла",
|
|
239
233
|
"hyper-threading": "Багатопотоковість (SMT)",
|
|
@@ -276,7 +270,6 @@
|
|
|
276
270
|
"pif-status": "Статус PIF",
|
|
277
271
|
"pifs": "PIFs",
|
|
278
272
|
"pifs-status": "Статус PIF",
|
|
279
|
-
"please-confirm": "Будь ласка, підтвердіть",
|
|
280
273
|
"proxy": "Proxy",
|
|
281
274
|
"pxe": "PXE",
|
|
282
275
|
"query-search-bar:label": "пошуковий движок",
|
|
@@ -301,6 +294,10 @@
|
|
|
301
294
|
"status:running": "Запущений",
|
|
302
295
|
"status:unknown": "Невідомо",
|
|
303
296
|
"template-has-bios-strings": "Шаблон вже містить налаштування BIOS",
|
|
297
|
+
"theme-dracula": "Dracula",
|
|
298
|
+
"theme-monokai": "Monokai",
|
|
299
|
+
"theme-nord": "Nord",
|
|
300
|
+
"theme-solarized": "Solarized",
|
|
304
301
|
"uuid": "UUID",
|
|
305
302
|
"vcpu": "vCPU",
|
|
306
303
|
"vcpus": "vCPUs",
|
|
@@ -318,7 +315,7 @@
|
|
|
318
315
|
"vm:status:paused": "Пауза",
|
|
319
316
|
"vm:status:running": "@:status:running",
|
|
320
317
|
"vm:status:suspended": "Призупинено",
|
|
321
|
-
"
|
|
318
|
+
"vtpm": "VTPM",
|
|
322
319
|
"weblate": "Weblate",
|
|
323
320
|
"write": "Писати",
|
|
324
321
|
"xcp-ng": "XCP-ng",
|
|
@@ -326,6 +323,7 @@
|
|
|
326
323
|
"xo": "XO",
|
|
327
324
|
"xo-5": "XO-5",
|
|
328
325
|
"xo-backups": "резервні копії XO",
|
|
326
|
+
"xo-lite": "XO lite",
|
|
329
327
|
"xo-lite-under-construction": "XOLite знаходиться в розробці",
|
|
330
328
|
"xo-replications": "Реплікації XO",
|
|
331
329
|
"xoa": "XOA",
|
|
@@ -55,6 +55,9 @@ export function createModalOpener() {
|
|
|
55
55
|
try {
|
|
56
56
|
isBusy.value = true
|
|
57
57
|
|
|
58
|
+
// TODO carefully about the order of close, if any issue, put it after resolve
|
|
59
|
+
close()
|
|
60
|
+
|
|
58
61
|
const result = config.onConfirm ? await config.onConfirm(...args) : (undefined as TConfirmPayload)
|
|
59
62
|
|
|
60
63
|
if (result === ABORT_MODAL || result instanceof ModalCancelResponse) {
|
|
@@ -66,8 +69,6 @@ export function createModalOpener() {
|
|
|
66
69
|
} else {
|
|
67
70
|
resolve(new ModalConfirmResponse(result))
|
|
68
71
|
}
|
|
69
|
-
|
|
70
|
-
close()
|
|
71
72
|
} finally {
|
|
72
73
|
isBusy.value = false
|
|
73
74
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
useSseStore,
|
|
3
2
|
type THandleDelete,
|
|
4
3
|
type THandlePost,
|
|
5
4
|
type THandleWatching,
|
|
5
|
+
useSseStore,
|
|
6
6
|
} from '@core/packages/remote-resource/sse.store'
|
|
7
7
|
import type { ResourceContext, UseRemoteResource } from '@core/packages/remote-resource/types.ts'
|
|
8
8
|
import type { VoidFunction } from '@core/types/utility.type.ts'
|
|
@@ -63,7 +63,7 @@ export function defineRemoteResource<
|
|
|
63
63
|
onDataReceived?: (data: Ref<NoInfer<TData>>, receivedData: any) => void
|
|
64
64
|
onDataRemoved?: (data: Ref<NoInfer<TData>>, receivedData: any) => void
|
|
65
65
|
stream?: boolean
|
|
66
|
-
|
|
66
|
+
initWatchCollection: () => {
|
|
67
67
|
collectionId: string
|
|
68
68
|
resource: string // reactivity only on XAPI XO record for now
|
|
69
69
|
getIdentifier: (obj: unknown) => string
|
|
@@ -87,7 +87,7 @@ export function defineRemoteResource<
|
|
|
87
87
|
cacheExpirationMs?: number | false
|
|
88
88
|
pollingIntervalMs?: number | false
|
|
89
89
|
stream?: boolean
|
|
90
|
-
|
|
90
|
+
initWatchCollection?: () => {
|
|
91
91
|
collectionId: string
|
|
92
92
|
resource: string // reactivity only on XAPI XO record for now
|
|
93
93
|
getIdentifier: (obj: unknown) => string
|
|
@@ -121,8 +121,10 @@ export function defineRemoteResource<
|
|
|
121
121
|
|
|
122
122
|
const pollingInterval = config.pollingIntervalMs ?? DEFAULT_POLLING_INTERVAL_MS
|
|
123
123
|
|
|
124
|
+
const watchCollection = config.initWatchCollection?.()
|
|
125
|
+
|
|
124
126
|
const removeData = (data: TData[], dataToRemove: any) => {
|
|
125
|
-
const getIdentifier =
|
|
127
|
+
const getIdentifier = watchCollection?.getIdentifier ?? JSON.stringify
|
|
126
128
|
|
|
127
129
|
remove(data, item => {
|
|
128
130
|
if (typeof item === 'object') {
|
|
@@ -156,14 +158,14 @@ export function defineRemoteResource<
|
|
|
156
158
|
config.onDataReceived ??
|
|
157
159
|
((data: Ref<TData>, receivedData: any, context?: ResourceContext<TArgs>) => {
|
|
158
160
|
// allow to ignore some update (like for sub collection. E.g. vms/:id/vdis)
|
|
159
|
-
if (
|
|
161
|
+
if (watchCollection?.predicate?.(receivedData, context) === false) {
|
|
160
162
|
return
|
|
161
163
|
}
|
|
162
164
|
|
|
163
165
|
if (data.value === undefined || (Array.isArray(data.value) && Array.isArray(receivedData))) {
|
|
164
166
|
data.value = receivedData
|
|
165
167
|
|
|
166
|
-
if (
|
|
168
|
+
if (watchCollection !== undefined && Array.isArray(data.value)) {
|
|
167
169
|
handleBuffer(data as Ref<TData[]>)
|
|
168
170
|
isBufferEventsProcessed = true
|
|
169
171
|
}
|
|
@@ -187,7 +189,7 @@ export function defineRemoteResource<
|
|
|
187
189
|
config.onDataRemoved ??
|
|
188
190
|
((data: Ref<TData>, receivedData: any, context?: ResourceContext<TArgs>) => {
|
|
189
191
|
// allow to ignore some update (like for sub collection. E.g. vms/:id/vdis)
|
|
190
|
-
if (
|
|
192
|
+
if (watchCollection?.predicate?.(receivedData, context) === false) {
|
|
191
193
|
return
|
|
192
194
|
}
|
|
193
195
|
|
|
@@ -289,8 +291,8 @@ export function defineRemoteResource<
|
|
|
289
291
|
let pause: VoidFunction = noop
|
|
290
292
|
let resume: VoidFunction = execute
|
|
291
293
|
|
|
292
|
-
if (
|
|
293
|
-
const { collectionId, resource, handleDelete, handlePost, handleWatching } =
|
|
294
|
+
if (watchCollection !== undefined) {
|
|
295
|
+
const { collectionId, resource, handleDelete, handlePost, handleWatching } = watchCollection
|
|
294
296
|
const { watch, unwatch } = useSseStore()
|
|
295
297
|
|
|
296
298
|
pause = () => unwatch({ collectionId, resource, handleDelete })
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { useNow } from '@vueuse/core'
|
|
1
2
|
import { defineStore } from 'pinia'
|
|
2
|
-
import { ref, watch as watchVue } from 'vue'
|
|
3
|
+
import { computed, ref, watch as watchVue } from 'vue'
|
|
3
4
|
|
|
4
5
|
type EventFn = (object: unknown) => void
|
|
5
6
|
export type THandlePost = (sseId: string) => Promise<string>
|
|
@@ -22,7 +23,10 @@ export type THandleWatching = (
|
|
|
22
23
|
) => void
|
|
23
24
|
|
|
24
25
|
export const useSseStore = defineStore('sse', () => {
|
|
25
|
-
const sse = ref<{ id?: string; isWatching: boolean }>({
|
|
26
|
+
const sse = ref<{ id?: string; isWatching: boolean; lastPing?: number; errorSse?: unknown | null }>({
|
|
27
|
+
isWatching: false,
|
|
28
|
+
errorSse: null,
|
|
29
|
+
})
|
|
26
30
|
const configsByResource: Map<
|
|
27
31
|
string,
|
|
28
32
|
{
|
|
@@ -38,10 +42,30 @@ export const useSseStore = defineStore('sse', () => {
|
|
|
38
42
|
}
|
|
39
43
|
> = new Map()
|
|
40
44
|
|
|
45
|
+
const now = useNow({ interval: 1000 })
|
|
46
|
+
|
|
47
|
+
const isError = computed(() => {
|
|
48
|
+
if (!sse.value.lastPing) {
|
|
49
|
+
return false
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return now.value.getTime() - sse.value.lastPing > 32_000
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
const hasErrorSse = computed(() => isError.value || sse.value.errorSse !== null)
|
|
56
|
+
|
|
57
|
+
function setErrorSse(error: unknown | null) {
|
|
58
|
+
sse.value.errorSse = error
|
|
59
|
+
}
|
|
60
|
+
|
|
41
61
|
function updateSseId(id: string) {
|
|
42
62
|
sse.value.id = id
|
|
43
63
|
}
|
|
44
64
|
|
|
65
|
+
function setPing(timestamp: number) {
|
|
66
|
+
sse.value.lastPing = timestamp
|
|
67
|
+
}
|
|
68
|
+
|
|
45
69
|
function getConfigsByResource(resource: string) {
|
|
46
70
|
return configsByResource.get(resource)
|
|
47
71
|
}
|
|
@@ -135,6 +159,10 @@ export const useSseStore = defineStore('sse', () => {
|
|
|
135
159
|
})
|
|
136
160
|
}
|
|
137
161
|
}
|
|
162
|
+
// TODO need to be improve
|
|
163
|
+
function retry() {
|
|
164
|
+
window.location.reload()
|
|
165
|
+
}
|
|
138
166
|
|
|
139
|
-
return { watch, unwatch }
|
|
167
|
+
return { watch, unwatch, retry, hasErrorSse, setErrorSse, setPing }
|
|
140
168
|
})
|
|
@@ -7,9 +7,11 @@ export const useBackupIssueColumns = defineColumns(() => {
|
|
|
7
7
|
const { t } = useI18n()
|
|
8
8
|
|
|
9
9
|
return {
|
|
10
|
-
job: useLinkColumn({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
job: useLinkColumn({ headerLabel: t('backup-job') }),
|
|
11
|
+
lastRuns: useStatusColumn({
|
|
12
|
+
headerLabel: t('last-n-runs', { n: 3 }),
|
|
13
|
+
iconOnly: true,
|
|
14
|
+
progressiveSize: true,
|
|
15
|
+
}),
|
|
14
16
|
}
|
|
15
17
|
})
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type ObjectType = 'vm'
|
|
2
|
+
export type VmActions = 'reboot' | 'shutdown' | 'force-reboot' | 'force-shutdown'
|
|
3
|
+
export type VmBlockedOperations =
|
|
4
|
+
| 'clean_shutdown'
|
|
5
|
+
| 'hard_shutdown'
|
|
6
|
+
| 'pause'
|
|
7
|
+
| 'clean_reboot'
|
|
8
|
+
| 'hard_reboot'
|
|
9
|
+
| 'suspend'
|
|
10
|
+
| 'destroy'
|