diff --git a/pkg/harvester/components/DiskTags.vue b/pkg/harvester/components/DiskTags.vue new file mode 100644 index 00000000..d50e8214 --- /dev/null +++ b/pkg/harvester/components/DiskTags.vue @@ -0,0 +1,212 @@ + + + + + diff --git a/pkg/harvester/components/FilterBySriov.vue b/pkg/harvester/components/FilterBySriov.vue new file mode 100644 index 00000000..4e1eade5 --- /dev/null +++ b/pkg/harvester/components/FilterBySriov.vue @@ -0,0 +1,134 @@ + + + + + diff --git a/pkg/harvester/components/FilterLabel.vue b/pkg/harvester/components/FilterLabel.vue new file mode 100644 index 00000000..7675b69b --- /dev/null +++ b/pkg/harvester/components/FilterLabel.vue @@ -0,0 +1,247 @@ + + + + + diff --git a/pkg/harvester/components/HarvesterUpgrade.vue b/pkg/harvester/components/HarvesterUpgrade.vue index 1eb775c1..e70b0131 100644 --- a/pkg/harvester/components/HarvesterUpgrade.vue +++ b/pkg/harvester/components/HarvesterUpgrade.vue @@ -1,11 +1,11 @@ + + + + diff --git a/pkg/harvester/components/SettingList.vue b/pkg/harvester/components/SettingList.vue new file mode 100644 index 00000000..b2bba63e --- /dev/null +++ b/pkg/harvester/components/SettingList.vue @@ -0,0 +1,203 @@ + + + + + diff --git a/pkg/harvester/components/VMConsoleBar.vue b/pkg/harvester/components/VMConsoleBar.vue new file mode 100644 index 00000000..2b6621f8 --- /dev/null +++ b/pkg/harvester/components/VMConsoleBar.vue @@ -0,0 +1,95 @@ + + + + + diff --git a/pkg/harvester/components/novnc/NovncConsole.vue b/pkg/harvester/components/novnc/NovncConsole.vue new file mode 100644 index 00000000..38533898 --- /dev/null +++ b/pkg/harvester/components/novnc/NovncConsole.vue @@ -0,0 +1,149 @@ + + + + + diff --git a/pkg/harvester/components/novnc/NovncConsoleCustomKeys.vue b/pkg/harvester/components/novnc/NovncConsoleCustomKeys.vue new file mode 100644 index 00000000..ae393537 --- /dev/null +++ b/pkg/harvester/components/novnc/NovncConsoleCustomKeys.vue @@ -0,0 +1,245 @@ + + + + + diff --git a/pkg/harvester/components/novnc/NovncConsoleItem.vue b/pkg/harvester/components/novnc/NovncConsoleItem.vue new file mode 100644 index 00000000..c3aee1aa --- /dev/null +++ b/pkg/harvester/components/novnc/NovncConsoleItem.vue @@ -0,0 +1,89 @@ + + + + + diff --git a/pkg/harvester/components/novnc/NovncConsoleWrapper.vue b/pkg/harvester/components/novnc/NovncConsoleWrapper.vue new file mode 100644 index 00000000..668a07f6 --- /dev/null +++ b/pkg/harvester/components/novnc/NovncConsoleWrapper.vue @@ -0,0 +1,348 @@ + + + + + diff --git a/pkg/harvester/components/settings/additional-ca.vue b/pkg/harvester/components/settings/additional-ca.vue new file mode 100644 index 00000000..af1123ac --- /dev/null +++ b/pkg/harvester/components/settings/additional-ca.vue @@ -0,0 +1,36 @@ + + + diff --git a/pkg/harvester/components/settings/auto-rotate-rke2-certs.vue b/pkg/harvester/components/settings/auto-rotate-rke2-certs.vue new file mode 100644 index 00000000..8bce9dba --- /dev/null +++ b/pkg/harvester/components/settings/auto-rotate-rke2-certs.vue @@ -0,0 +1,85 @@ + + + + + diff --git a/pkg/harvester/components/settings/backup-target.vue b/pkg/harvester/components/settings/backup-target.vue new file mode 100644 index 00000000..d43da9b1 --- /dev/null +++ b/pkg/harvester/components/settings/backup-target.vue @@ -0,0 +1,199 @@ + + + + + diff --git a/pkg/harvester/components/settings/containerd-registry.vue b/pkg/harvester/components/settings/containerd-registry.vue new file mode 100644 index 00000000..b8413ee3 --- /dev/null +++ b/pkg/harvester/components/settings/containerd-registry.vue @@ -0,0 +1,377 @@ + + + + + diff --git a/pkg/harvester/components/settings/csi-driver-config.vue b/pkg/harvester/components/settings/csi-driver-config.vue new file mode 100644 index 00000000..02638fdd --- /dev/null +++ b/pkg/harvester/components/settings/csi-driver-config.vue @@ -0,0 +1,249 @@ + + + + + diff --git a/pkg/harvester/components/settings/default-vm-termination-grace-period-seconds.vue b/pkg/harvester/components/settings/default-vm-termination-grace-period-seconds.vue new file mode 100644 index 00000000..22812ca9 --- /dev/null +++ b/pkg/harvester/components/settings/default-vm-termination-grace-period-seconds.vue @@ -0,0 +1,43 @@ + + + diff --git a/pkg/harvester/components/settings/http-proxy.vue b/pkg/harvester/components/settings/http-proxy.vue new file mode 100644 index 00000000..f3b91262 --- /dev/null +++ b/pkg/harvester/components/settings/http-proxy.vue @@ -0,0 +1,87 @@ + + + diff --git a/pkg/harvester/components/settings/ntp-servers.vue b/pkg/harvester/components/settings/ntp-servers.vue new file mode 100644 index 00000000..9dbde7c4 --- /dev/null +++ b/pkg/harvester/components/settings/ntp-servers.vue @@ -0,0 +1,73 @@ + + + diff --git a/pkg/harvester/components/settings/overcommit-config.vue b/pkg/harvester/components/settings/overcommit-config.vue new file mode 100644 index 00000000..8028e398 --- /dev/null +++ b/pkg/harvester/components/settings/overcommit-config.vue @@ -0,0 +1,94 @@ + + + diff --git a/pkg/harvester/components/settings/ssl-certificates.vue b/pkg/harvester/components/settings/ssl-certificates.vue new file mode 100644 index 00000000..d55c123c --- /dev/null +++ b/pkg/harvester/components/settings/ssl-certificates.vue @@ -0,0 +1,117 @@ + + + + + diff --git a/pkg/harvester/components/settings/ssl-parameters.vue b/pkg/harvester/components/settings/ssl-parameters.vue new file mode 100644 index 00000000..659ac702 --- /dev/null +++ b/pkg/harvester/components/settings/ssl-parameters.vue @@ -0,0 +1,161 @@ + + + diff --git a/pkg/harvester/components/settings/storage-network.vue b/pkg/harvester/components/settings/storage-network.vue new file mode 100644 index 00000000..81af5136 --- /dev/null +++ b/pkg/harvester/components/settings/storage-network.vue @@ -0,0 +1,240 @@ + + + diff --git a/pkg/harvester/components/settings/support-bundle-image.vue b/pkg/harvester/components/settings/support-bundle-image.vue new file mode 100644 index 00000000..70cb4216 --- /dev/null +++ b/pkg/harvester/components/settings/support-bundle-image.vue @@ -0,0 +1,134 @@ + + + diff --git a/pkg/harvester/components/settings/support-bundle-namespaces.vue b/pkg/harvester/components/settings/support-bundle-namespaces.vue new file mode 100644 index 00000000..a42da9ba --- /dev/null +++ b/pkg/harvester/components/settings/support-bundle-namespaces.vue @@ -0,0 +1,73 @@ + + + diff --git a/pkg/harvester/components/settings/vm-force-reset-policy.vue b/pkg/harvester/components/settings/vm-force-reset-policy.vue new file mode 100644 index 00000000..adefb315 --- /dev/null +++ b/pkg/harvester/components/settings/vm-force-reset-policy.vue @@ -0,0 +1,81 @@ + + + + + diff --git a/pkg/harvester/config/types.js b/pkg/harvester/config/types.js new file mode 100644 index 00000000..1a8c4973 --- /dev/null +++ b/pkg/harvester/config/types.js @@ -0,0 +1,4 @@ +export const BACKUP_TYPE = { + BACKUP: 'backup', + SNAPSHOT: 'snapshot' +}; diff --git a/pkg/harvester/detail/harvesterhci.io.host/HarvesterHostBasic.vue b/pkg/harvester/detail/harvesterhci.io.host/HarvesterHostBasic.vue new file mode 100644 index 00000000..3f7e86c6 --- /dev/null +++ b/pkg/harvester/detail/harvesterhci.io.host/HarvesterHostBasic.vue @@ -0,0 +1,331 @@ + + + + + diff --git a/pkg/harvester/detail/harvesterhci.io.host/HarvesterHostDisk.vue b/pkg/harvester/detail/harvesterhci.io.host/HarvesterHostDisk.vue new file mode 100644 index 00000000..5692c856 --- /dev/null +++ b/pkg/harvester/detail/harvesterhci.io.host/HarvesterHostDisk.vue @@ -0,0 +1,214 @@ + + + + + diff --git a/pkg/harvester/detail/harvesterhci.io.host/HarvesterKsmtuned.vue b/pkg/harvester/detail/harvesterhci.io.host/HarvesterKsmtuned.vue new file mode 100644 index 00000000..328b23ea --- /dev/null +++ b/pkg/harvester/detail/harvesterhci.io.host/HarvesterKsmtuned.vue @@ -0,0 +1,171 @@ + + + diff --git a/pkg/harvester/detail/harvesterhci.io.host/HarvesterSeeder.vue b/pkg/harvester/detail/harvesterhci.io.host/HarvesterSeeder.vue new file mode 100644 index 00000000..8267a66b --- /dev/null +++ b/pkg/harvester/detail/harvesterhci.io.host/HarvesterSeeder.vue @@ -0,0 +1,131 @@ + + + diff --git a/pkg/harvester/detail/harvesterhci.io.host/VirtualMachineInstance.vue b/pkg/harvester/detail/harvesterhci.io.host/VirtualMachineInstance.vue new file mode 100644 index 00000000..f82c5b63 --- /dev/null +++ b/pkg/harvester/detail/harvesterhci.io.host/VirtualMachineInstance.vue @@ -0,0 +1,131 @@ + + + + + diff --git a/pkg/harvester/detail/harvesterhci.io.host/VlanStatus/LinkStatus.vue b/pkg/harvester/detail/harvesterhci.io.host/VlanStatus/LinkStatus.vue new file mode 100644 index 00000000..34ecd722 --- /dev/null +++ b/pkg/harvester/detail/harvesterhci.io.host/VlanStatus/LinkStatus.vue @@ -0,0 +1,71 @@ + + + diff --git a/pkg/harvester/detail/harvesterhci.io.host/VlanStatus/index.vue b/pkg/harvester/detail/harvesterhci.io.host/VlanStatus/index.vue new file mode 100644 index 00000000..2fb8512b --- /dev/null +++ b/pkg/harvester/detail/harvesterhci.io.host/VlanStatus/index.vue @@ -0,0 +1,104 @@ + + + diff --git a/pkg/harvester/detail/harvesterhci.io.host/index.vue b/pkg/harvester/detail/harvesterhci.io.host/index.vue new file mode 100644 index 00000000..a3c7e445 --- /dev/null +++ b/pkg/harvester/detail/harvesterhci.io.host/index.vue @@ -0,0 +1,488 @@ + + + diff --git a/pkg/harvester/detail/harvesterhci.io.secret.vue b/pkg/harvester/detail/harvesterhci.io.secret.vue new file mode 100644 index 00000000..cc4187ee --- /dev/null +++ b/pkg/harvester/detail/harvesterhci.io.secret.vue @@ -0,0 +1,287 @@ + + + + + diff --git a/pkg/harvester/detail/harvesterhci.io.virtualmachinebackup/index.vue b/pkg/harvester/detail/harvesterhci.io.virtualmachinebackup/index.vue new file mode 100644 index 00000000..f97206f2 --- /dev/null +++ b/pkg/harvester/detail/harvesterhci.io.virtualmachinebackup/index.vue @@ -0,0 +1,221 @@ + + + diff --git a/pkg/harvester/detail/harvesterhci.io.virtualmachineimage/Storage.vue b/pkg/harvester/detail/harvesterhci.io.virtualmachineimage/Storage.vue new file mode 100644 index 00000000..6156c325 --- /dev/null +++ b/pkg/harvester/detail/harvesterhci.io.virtualmachineimage/Storage.vue @@ -0,0 +1,69 @@ + + + diff --git a/pkg/harvester/detail/harvesterhci.io.virtualmachineimage/index.vue b/pkg/harvester/detail/harvesterhci.io.virtualmachineimage/index.vue new file mode 100644 index 00000000..fcb523d3 --- /dev/null +++ b/pkg/harvester/detail/harvesterhci.io.virtualmachineimage/index.vue @@ -0,0 +1,137 @@ + + + + + diff --git a/pkg/harvester/detail/harvesterhci.io.vmsnapshot/index.vue b/pkg/harvester/detail/harvesterhci.io.vmsnapshot/index.vue new file mode 100644 index 00000000..ba96430e --- /dev/null +++ b/pkg/harvester/detail/harvesterhci.io.vmsnapshot/index.vue @@ -0,0 +1,221 @@ + + + diff --git a/pkg/harvester/detail/kubevirt.io.virtualmachine/VirtualMachineTabs/VirtualMachineBasics.vue b/pkg/harvester/detail/kubevirt.io.virtualmachine/VirtualMachineTabs/VirtualMachineBasics.vue new file mode 100644 index 00000000..8846f9f8 --- /dev/null +++ b/pkg/harvester/detail/kubevirt.io.virtualmachine/VirtualMachineTabs/VirtualMachineBasics.vue @@ -0,0 +1,283 @@ + + + + + diff --git a/pkg/harvester/detail/kubevirt.io.virtualmachine/VirtualMachineTabs/VirtualMachineEvents.vue b/pkg/harvester/detail/kubevirt.io.virtualmachine/VirtualMachineTabs/VirtualMachineEvents.vue new file mode 100644 index 00000000..56ba3d8e --- /dev/null +++ b/pkg/harvester/detail/kubevirt.io.virtualmachine/VirtualMachineTabs/VirtualMachineEvents.vue @@ -0,0 +1,75 @@ + + + diff --git a/pkg/harvester/detail/kubevirt.io.virtualmachine/VirtualMachineTabs/VirtualMachineKeypairs.vue b/pkg/harvester/detail/kubevirt.io.virtualmachine/VirtualMachineTabs/VirtualMachineKeypairs.vue new file mode 100644 index 00000000..317e49bc --- /dev/null +++ b/pkg/harvester/detail/kubevirt.io.virtualmachine/VirtualMachineTabs/VirtualMachineKeypairs.vue @@ -0,0 +1,114 @@ + + + + + diff --git a/pkg/harvester/detail/kubevirt.io.virtualmachine/VirtualMachineTabs/VirtualMachineMigration.vue b/pkg/harvester/detail/kubevirt.io.virtualmachine/VirtualMachineTabs/VirtualMachineMigration.vue new file mode 100644 index 00000000..65a940f2 --- /dev/null +++ b/pkg/harvester/detail/kubevirt.io.virtualmachine/VirtualMachineTabs/VirtualMachineMigration.vue @@ -0,0 +1,79 @@ + + + diff --git a/pkg/harvester/detail/kubevirt.io.virtualmachine/index.vue b/pkg/harvester/detail/kubevirt.io.virtualmachine/index.vue new file mode 100644 index 00000000..e3032ffa --- /dev/null +++ b/pkg/harvester/detail/kubevirt.io.virtualmachine/index.vue @@ -0,0 +1,271 @@ + + + diff --git a/pkg/harvester/detail/loadbalancer.harvesterhci.io.ippool.vue b/pkg/harvester/detail/loadbalancer.harvesterhci.io.ippool.vue new file mode 100644 index 00000000..438dadab --- /dev/null +++ b/pkg/harvester/detail/loadbalancer.harvesterhci.io.ippool.vue @@ -0,0 +1,106 @@ + + + diff --git a/pkg/harvester/detail/loadbalancer.harvesterhci.io.loadbalancer.vue b/pkg/harvester/detail/loadbalancer.harvesterhci.io.loadbalancer.vue new file mode 100644 index 00000000..bbe1cf14 --- /dev/null +++ b/pkg/harvester/detail/loadbalancer.harvesterhci.io.loadbalancer.vue @@ -0,0 +1,190 @@ + + + diff --git a/pkg/harvester/detail/network.harvesterhci.io.vlanconfig.vue b/pkg/harvester/detail/network.harvesterhci.io.vlanconfig.vue new file mode 100644 index 00000000..757550ff --- /dev/null +++ b/pkg/harvester/detail/network.harvesterhci.io.vlanconfig.vue @@ -0,0 +1,90 @@ + + + diff --git a/pkg/harvester/dialog/CloneVmDialog.vue b/pkg/harvester/dialog/CloneVmDialog.vue new file mode 100644 index 00000000..a93de39d --- /dev/null +++ b/pkg/harvester/dialog/CloneVmDialog.vue @@ -0,0 +1,134 @@ + + + + + diff --git a/pkg/harvester/dialog/ConfirmRelatedToRemoveDialog.vue b/pkg/harvester/dialog/ConfirmRelatedToRemoveDialog.vue new file mode 100644 index 00000000..2d6a68cc --- /dev/null +++ b/pkg/harvester/dialog/ConfirmRelatedToRemoveDialog.vue @@ -0,0 +1,168 @@ + + + + + diff --git a/pkg/harvester/dialog/DeepCloneVmDialog.vue b/pkg/harvester/dialog/DeepCloneVmDialog.vue new file mode 100644 index 00000000..a93de39d --- /dev/null +++ b/pkg/harvester/dialog/DeepCloneVmDialog.vue @@ -0,0 +1,134 @@ + + + + + diff --git a/pkg/harvester/dialog/EnablePassthrough.vue b/pkg/harvester/dialog/EnablePassthrough.vue new file mode 100644 index 00000000..9c9bf12f --- /dev/null +++ b/pkg/harvester/dialog/EnablePassthrough.vue @@ -0,0 +1,118 @@ + + + + + diff --git a/pkg/harvester/dialog/EnableSriovDevice.vue b/pkg/harvester/dialog/EnableSriovDevice.vue new file mode 100644 index 00000000..5a0e5491 --- /dev/null +++ b/pkg/harvester/dialog/EnableSriovDevice.vue @@ -0,0 +1,107 @@ + + + + + diff --git a/pkg/harvester/dialog/EnableVGpuDevice.vue b/pkg/harvester/dialog/EnableVGpuDevice.vue new file mode 100644 index 00000000..18a29338 --- /dev/null +++ b/pkg/harvester/dialog/EnableVGpuDevice.vue @@ -0,0 +1,114 @@ + + + + + diff --git a/pkg/harvester/dialog/HarvesterAddHotplugModal.vue b/pkg/harvester/dialog/HarvesterAddHotplugModal.vue new file mode 100644 index 00000000..b1dac56e --- /dev/null +++ b/pkg/harvester/dialog/HarvesterAddHotplugModal.vue @@ -0,0 +1,159 @@ + + + + + diff --git a/pkg/harvester/dialog/HarvesterBackupModal.vue b/pkg/harvester/dialog/HarvesterBackupModal.vue new file mode 100644 index 00000000..1b4f08e8 --- /dev/null +++ b/pkg/harvester/dialog/HarvesterBackupModal.vue @@ -0,0 +1,125 @@ + + + + + diff --git a/pkg/harvester/dialog/HarvesterCloneTemplate.vue b/pkg/harvester/dialog/HarvesterCloneTemplate.vue new file mode 100644 index 00000000..2b605869 --- /dev/null +++ b/pkg/harvester/dialog/HarvesterCloneTemplate.vue @@ -0,0 +1,147 @@ + + + + + diff --git a/pkg/harvester/dialog/HarvesterEjectCDROMDialog.vue b/pkg/harvester/dialog/HarvesterEjectCDROMDialog.vue new file mode 100644 index 00000000..92240f6f --- /dev/null +++ b/pkg/harvester/dialog/HarvesterEjectCDROMDialog.vue @@ -0,0 +1,160 @@ + + + + + diff --git a/pkg/harvester/dialog/HarvesterExportImageDialog.vue b/pkg/harvester/dialog/HarvesterExportImageDialog.vue new file mode 100644 index 00000000..1e4a3797 --- /dev/null +++ b/pkg/harvester/dialog/HarvesterExportImageDialog.vue @@ -0,0 +1,195 @@ + + + + + diff --git a/pkg/harvester/dialog/HarvesterMaintenanceDialog.vue b/pkg/harvester/dialog/HarvesterMaintenanceDialog.vue new file mode 100644 index 00000000..e32e5dc8 --- /dev/null +++ b/pkg/harvester/dialog/HarvesterMaintenanceDialog.vue @@ -0,0 +1,151 @@ + + + + + diff --git a/pkg/harvester/dialog/HarvesterMigrationDialog.vue b/pkg/harvester/dialog/HarvesterMigrationDialog.vue new file mode 100644 index 00000000..3bd1a187 --- /dev/null +++ b/pkg/harvester/dialog/HarvesterMigrationDialog.vue @@ -0,0 +1,179 @@ + + + + + diff --git a/pkg/harvester/dialog/HarvesterRestoreDialog.vue b/pkg/harvester/dialog/HarvesterRestoreDialog.vue new file mode 100644 index 00000000..6453a330 --- /dev/null +++ b/pkg/harvester/dialog/HarvesterRestoreDialog.vue @@ -0,0 +1,167 @@ + + + + + diff --git a/pkg/harvester/dialog/HarvesterSupportBundle.vue b/pkg/harvester/dialog/HarvesterSupportBundle.vue new file mode 100644 index 00000000..cbb94bad --- /dev/null +++ b/pkg/harvester/dialog/HarvesterSupportBundle.vue @@ -0,0 +1,221 @@ + + + + + diff --git a/pkg/harvester/dialog/HarvesterUnplugVolume.vue b/pkg/harvester/dialog/HarvesterUnplugVolume.vue new file mode 100644 index 00000000..719f83e0 --- /dev/null +++ b/pkg/harvester/dialog/HarvesterUnplugVolume.vue @@ -0,0 +1,118 @@ + + + + + diff --git a/pkg/harvester/dialog/HarvesterVMSnapshotDialog.vue b/pkg/harvester/dialog/HarvesterVMSnapshotDialog.vue new file mode 100644 index 00000000..f027c6c2 --- /dev/null +++ b/pkg/harvester/dialog/HarvesterVMSnapshotDialog.vue @@ -0,0 +1,149 @@ + + + + + diff --git a/pkg/harvester/dialog/HarvesterVlanConfigMigrateDialog.vue b/pkg/harvester/dialog/HarvesterVlanConfigMigrateDialog.vue new file mode 100644 index 00000000..77da5c2c --- /dev/null +++ b/pkg/harvester/dialog/HarvesterVlanConfigMigrateDialog.vue @@ -0,0 +1,138 @@ + + + + + diff --git a/pkg/harvester/dialog/MessageBox.vue b/pkg/harvester/dialog/MessageBox.vue new file mode 100644 index 00000000..d0c4f0c3 --- /dev/null +++ b/pkg/harvester/dialog/MessageBox.vue @@ -0,0 +1,68 @@ + + + + + diff --git a/pkg/harvester/dialog/RestartVMDialog.vue b/pkg/harvester/dialog/RestartVMDialog.vue new file mode 100644 index 00000000..4d5d2d7a --- /dev/null +++ b/pkg/harvester/dialog/RestartVMDialog.vue @@ -0,0 +1,120 @@ + + + + diff --git a/pkg/harvester/dialog/RestoreSnapshotDialog.vue b/pkg/harvester/dialog/RestoreSnapshotDialog.vue new file mode 100644 index 00000000..ca2b257d --- /dev/null +++ b/pkg/harvester/dialog/RestoreSnapshotDialog.vue @@ -0,0 +1,169 @@ + + + diff --git a/pkg/harvester/dialog/SnapshotDialog.vue b/pkg/harvester/dialog/SnapshotDialog.vue new file mode 100644 index 00000000..1a6a423c --- /dev/null +++ b/pkg/harvester/dialog/SnapshotDialog.vue @@ -0,0 +1,103 @@ + + + diff --git a/pkg/harvester/dialog/VolumeCloneDialog.vue b/pkg/harvester/dialog/VolumeCloneDialog.vue new file mode 100644 index 00000000..83234c79 --- /dev/null +++ b/pkg/harvester/dialog/VolumeCloneDialog.vue @@ -0,0 +1,118 @@ + + + diff --git a/pkg/harvester/edit/harvesterhci.io.addon/generic.vue b/pkg/harvester/edit/harvesterhci.io.addon/generic.vue new file mode 100644 index 00000000..fcb00ff1 --- /dev/null +++ b/pkg/harvester/edit/harvesterhci.io.addon/generic.vue @@ -0,0 +1,58 @@ + + + + + diff --git a/pkg/harvester/edit/harvesterhci.io.addon/harvester-seeder.vue b/pkg/harvester/edit/harvesterhci.io.addon/harvester-seeder.vue new file mode 100644 index 00000000..2804d4d5 --- /dev/null +++ b/pkg/harvester/edit/harvesterhci.io.addon/harvester-seeder.vue @@ -0,0 +1,58 @@ + + + + + diff --git a/pkg/harvester/edit/harvesterhci.io.addon/index.vue b/pkg/harvester/edit/harvesterhci.io.addon/index.vue new file mode 100644 index 00000000..fb3884ec --- /dev/null +++ b/pkg/harvester/edit/harvesterhci.io.addon/index.vue @@ -0,0 +1,47 @@ + + + diff --git a/pkg/harvester/edit/harvesterhci.io.addon/nvidia-driver-toolkit.vue b/pkg/harvester/edit/harvesterhci.io.addon/nvidia-driver-toolkit.vue new file mode 100644 index 00000000..fdc1f1b8 --- /dev/null +++ b/pkg/harvester/edit/harvesterhci.io.addon/nvidia-driver-toolkit.vue @@ -0,0 +1,156 @@ + + + + + diff --git a/pkg/harvester/edit/harvesterhci.io.addon/pcidevices-controller.vue b/pkg/harvester/edit/harvesterhci.io.addon/pcidevices-controller.vue new file mode 100644 index 00000000..6e5cadb9 --- /dev/null +++ b/pkg/harvester/edit/harvesterhci.io.addon/pcidevices-controller.vue @@ -0,0 +1,58 @@ + + + + + diff --git a/pkg/harvester/edit/harvesterhci.io.addon/rancher-logging.vue b/pkg/harvester/edit/harvesterhci.io.addon/rancher-logging.vue new file mode 100644 index 00000000..25b150bf --- /dev/null +++ b/pkg/harvester/edit/harvesterhci.io.addon/rancher-logging.vue @@ -0,0 +1,191 @@ + + + + + diff --git a/pkg/harvester/edit/harvesterhci.io.addon/rancher-monitoring.vue b/pkg/harvester/edit/harvesterhci.io.addon/rancher-monitoring.vue new file mode 100644 index 00000000..6ad16285 --- /dev/null +++ b/pkg/harvester/edit/harvesterhci.io.addon/rancher-monitoring.vue @@ -0,0 +1,523 @@ + + + + + diff --git a/pkg/harvester/edit/harvesterhci.io.addon/rancher-vcluster.vue b/pkg/harvester/edit/harvesterhci.io.addon/rancher-vcluster.vue new file mode 100644 index 00000000..dd2b144d --- /dev/null +++ b/pkg/harvester/edit/harvesterhci.io.addon/rancher-vcluster.vue @@ -0,0 +1,151 @@ + + + + + diff --git a/pkg/harvester/edit/harvesterhci.io.addon/vm-import-controller.vue b/pkg/harvester/edit/harvesterhci.io.addon/vm-import-controller.vue new file mode 100644 index 00000000..34fad699 --- /dev/null +++ b/pkg/harvester/edit/harvesterhci.io.addon/vm-import-controller.vue @@ -0,0 +1,234 @@ + + + + + diff --git a/pkg/harvester/edit/harvesterhci.io.cloudtemplate.vue b/pkg/harvester/edit/harvesterhci.io.cloudtemplate.vue new file mode 100644 index 00000000..2026fcf4 --- /dev/null +++ b/pkg/harvester/edit/harvesterhci.io.cloudtemplate.vue @@ -0,0 +1,123 @@ + + + + + diff --git a/pkg/harvester/edit/harvesterhci.io.host/HarvesterDisk.vue b/pkg/harvester/edit/harvesterhci.io.host/HarvesterDisk.vue new file mode 100644 index 00000000..bd10b089 --- /dev/null +++ b/pkg/harvester/edit/harvesterhci.io.host/HarvesterDisk.vue @@ -0,0 +1,293 @@ + + + + + diff --git a/pkg/harvester/edit/harvesterhci.io.host/HarvesterKsmtuned.vue b/pkg/harvester/edit/harvesterhci.io.host/HarvesterKsmtuned.vue new file mode 100644 index 00000000..541c9f10 --- /dev/null +++ b/pkg/harvester/edit/harvesterhci.io.host/HarvesterKsmtuned.vue @@ -0,0 +1,216 @@ + + + diff --git a/pkg/harvester/edit/harvesterhci.io.host/HarvesterSeeder.vue b/pkg/harvester/edit/harvesterhci.io.host/HarvesterSeeder.vue new file mode 100644 index 00000000..ffd84011 --- /dev/null +++ b/pkg/harvester/edit/harvesterhci.io.host/HarvesterSeeder.vue @@ -0,0 +1,370 @@ + + + diff --git a/pkg/harvester/edit/harvesterhci.io.host/index.vue b/pkg/harvester/edit/harvesterhci.io.host/index.vue new file mode 100644 index 00000000..74a5db28 --- /dev/null +++ b/pkg/harvester/edit/harvesterhci.io.host/index.vue @@ -0,0 +1,688 @@ + + + diff --git a/pkg/harvester/edit/harvesterhci.io.keypair.vue b/pkg/harvester/edit/harvesterhci.io.keypair.vue new file mode 100644 index 00000000..4b76e3d1 --- /dev/null +++ b/pkg/harvester/edit/harvesterhci.io.keypair.vue @@ -0,0 +1,112 @@ + + + + + diff --git a/pkg/harvester/edit/harvesterhci.io.logging.clusterflow.vue b/pkg/harvester/edit/harvesterhci.io.logging.clusterflow.vue new file mode 100644 index 00000000..c889d68f --- /dev/null +++ b/pkg/harvester/edit/harvesterhci.io.logging.clusterflow.vue @@ -0,0 +1,25 @@ + diff --git a/pkg/harvester/edit/harvesterhci.io.logging.clusteroutput.vue b/pkg/harvester/edit/harvesterhci.io.logging.clusteroutput.vue new file mode 100644 index 00000000..85d6f434 --- /dev/null +++ b/pkg/harvester/edit/harvesterhci.io.logging.clusteroutput.vue @@ -0,0 +1,21 @@ + diff --git a/pkg/harvester/edit/harvesterhci.io.logging.flow.vue b/pkg/harvester/edit/harvesterhci.io.logging.flow.vue new file mode 100644 index 00000000..e4297a7e --- /dev/null +++ b/pkg/harvester/edit/harvesterhci.io.logging.flow.vue @@ -0,0 +1,7 @@ + + diff --git a/pkg/harvester/edit/harvesterhci.io.logging.output.vue b/pkg/harvester/edit/harvesterhci.io.logging.output.vue new file mode 100644 index 00000000..495d5326 --- /dev/null +++ b/pkg/harvester/edit/harvesterhci.io.logging.output.vue @@ -0,0 +1,345 @@ + + + + + diff --git a/pkg/harvester/edit/harvesterhci.io.monitoring.alertmanagerconfig/index.vue b/pkg/harvester/edit/harvesterhci.io.monitoring.alertmanagerconfig/index.vue new file mode 100644 index 00000000..933c5bf9 --- /dev/null +++ b/pkg/harvester/edit/harvesterhci.io.monitoring.alertmanagerconfig/index.vue @@ -0,0 +1,278 @@ + + + + + diff --git a/pkg/harvester/edit/harvesterhci.io.networkattachmentdefinition.vue b/pkg/harvester/edit/harvesterhci.io.networkattachmentdefinition.vue new file mode 100644 index 00000000..42cdd31f --- /dev/null +++ b/pkg/harvester/edit/harvesterhci.io.networkattachmentdefinition.vue @@ -0,0 +1,282 @@ + + + diff --git a/pkg/harvester/edit/harvesterhci.io.secret.vue b/pkg/harvester/edit/harvesterhci.io.secret.vue new file mode 100644 index 00000000..1568f014 --- /dev/null +++ b/pkg/harvester/edit/harvesterhci.io.secret.vue @@ -0,0 +1,281 @@ + + + diff --git a/pkg/harvester/edit/harvesterhci.io.setting.vue b/pkg/harvester/edit/harvesterhci.io.setting.vue new file mode 100644 index 00000000..bad638d4 --- /dev/null +++ b/pkg/harvester/edit/harvesterhci.io.setting.vue @@ -0,0 +1,255 @@ + + + + + diff --git a/pkg/harvester/edit/harvesterhci.io.storage/index.vue b/pkg/harvester/edit/harvesterhci.io.storage/index.vue new file mode 100644 index 00000000..34dbc90b --- /dev/null +++ b/pkg/harvester/edit/harvesterhci.io.storage/index.vue @@ -0,0 +1,324 @@ + + + + + diff --git a/pkg/harvester/edit/harvesterhci.io.storage/provisioners/custom.vue b/pkg/harvester/edit/harvesterhci.io.storage/provisioners/custom.vue new file mode 100644 index 00000000..54fa3b73 --- /dev/null +++ b/pkg/harvester/edit/harvesterhci.io.storage/provisioners/custom.vue @@ -0,0 +1,25 @@ + + diff --git a/pkg/harvester/edit/harvesterhci.io.storage/provisioners/driver.longhorn.io.vue b/pkg/harvester/edit/harvesterhci.io.storage/provisioners/driver.longhorn.io.vue new file mode 100644 index 00000000..329f61d2 --- /dev/null +++ b/pkg/harvester/edit/harvesterhci.io.storage/provisioners/driver.longhorn.io.vue @@ -0,0 +1,249 @@ + + + + diff --git a/pkg/harvester/edit/harvesterhci.io.virtualmachinebackup.vue b/pkg/harvester/edit/harvesterhci.io.virtualmachinebackup.vue new file mode 100644 index 00000000..5257d9d2 --- /dev/null +++ b/pkg/harvester/edit/harvesterhci.io.virtualmachinebackup.vue @@ -0,0 +1,299 @@ + + + + + diff --git a/pkg/harvester/edit/harvesterhci.io.virtualmachineimage.vue b/pkg/harvester/edit/harvesterhci.io.virtualmachineimage.vue new file mode 100644 index 00000000..6ab9cae6 --- /dev/null +++ b/pkg/harvester/edit/harvesterhci.io.virtualmachineimage.vue @@ -0,0 +1,446 @@ + + + + + diff --git a/pkg/harvester/edit/harvesterhci.io.virtualmachinetemplateversion.vue b/pkg/harvester/edit/harvesterhci.io.virtualmachinetemplateversion.vue new file mode 100644 index 00000000..c5b7e897 --- /dev/null +++ b/pkg/harvester/edit/harvesterhci.io.virtualmachinetemplateversion.vue @@ -0,0 +1,423 @@ + + + diff --git a/pkg/harvester/edit/harvesterhci.io.vmsnapshot.vue b/pkg/harvester/edit/harvesterhci.io.vmsnapshot.vue new file mode 100644 index 00000000..60f40ce5 --- /dev/null +++ b/pkg/harvester/edit/harvesterhci.io.vmsnapshot.vue @@ -0,0 +1,279 @@ + + + + + diff --git a/pkg/harvester/edit/harvesterhci.io.volume.vue b/pkg/harvester/edit/harvesterhci.io.volume.vue new file mode 100644 index 00000000..5c8c4196 --- /dev/null +++ b/pkg/harvester/edit/harvesterhci.io.volume.vue @@ -0,0 +1,372 @@ + + + diff --git a/pkg/harvester/edit/harvesterhci.io.volumesnapshot.vue b/pkg/harvester/edit/harvesterhci.io.volumesnapshot.vue new file mode 100644 index 00000000..30fce06b --- /dev/null +++ b/pkg/harvester/edit/harvesterhci.io.volumesnapshot.vue @@ -0,0 +1,92 @@ + + diff --git a/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineAccessCredentials/AccessCredentialsUsers.vue b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineAccessCredentials/AccessCredentialsUsers.vue new file mode 100644 index 00000000..2b1d15f2 --- /dev/null +++ b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineAccessCredentials/AccessCredentialsUsers.vue @@ -0,0 +1,191 @@ + + + + + diff --git a/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineAccessCredentials/index.vue b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineAccessCredentials/index.vue new file mode 100644 index 00000000..6ea60e5f --- /dev/null +++ b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineAccessCredentials/index.vue @@ -0,0 +1,212 @@ + + + + + diff --git a/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineAccessCredentials/type/basicAuth.vue b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineAccessCredentials/type/basicAuth.vue new file mode 100644 index 00000000..f9aad32d --- /dev/null +++ b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineAccessCredentials/type/basicAuth.vue @@ -0,0 +1,94 @@ + + + + + diff --git a/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineAccessCredentials/type/sshkey.vue b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineAccessCredentials/type/sshkey.vue new file mode 100644 index 00000000..d604dbf6 --- /dev/null +++ b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineAccessCredentials/type/sshkey.vue @@ -0,0 +1,85 @@ + + + diff --git a/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineCloudConfig/DataTemplate.vue b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineCloudConfig/DataTemplate.vue new file mode 100644 index 00000000..06989607 --- /dev/null +++ b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineCloudConfig/DataTemplate.vue @@ -0,0 +1,155 @@ + + + + + diff --git a/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineCloudConfig/index.vue b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineCloudConfig/index.vue new file mode 100644 index 00000000..041a33f1 --- /dev/null +++ b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineCloudConfig/index.vue @@ -0,0 +1,287 @@ + + + + + diff --git a/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineCpuMemory.vue b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineCpuMemory.vue new file mode 100644 index 00000000..427792d1 --- /dev/null +++ b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineCpuMemory.vue @@ -0,0 +1,113 @@ + + + diff --git a/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineNetwork/__tests__/HarvesterEditNetwork.test.ts b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineNetwork/__tests__/HarvesterEditNetwork.test.ts new file mode 100644 index 00000000..0c381742 --- /dev/null +++ b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineNetwork/__tests__/HarvesterEditNetwork.test.ts @@ -0,0 +1,41 @@ +import { mount } from '@vue/test-utils'; +import HarvesterEditNetwork from '../base.vue'; +import { _EDIT } from '@shell/config/query-params'; + +describe('component: HarvesterEditNetwork', () => { + // eslint-disable-next-line jest/no-commented-out-tests + // it('should display all the inputs', () => { + // const wrapper = mount(HarvesterEditNetwork, { propsData: { mode: _EDIT } }); + + // const inputWraps = wrapper.findAll('[data-testid^=input-hen-]'); + + // expect(inputWraps).toHaveLength(5); + // }); + + it.each([ + 'name', + ])('should emit an update on %p input', (field) => { + const wrapper = mount(HarvesterEditNetwork, { propsData: { mode: _EDIT } }); + const input = wrapper.find(`[data-testid="input-hen-${ field }"]`).find('input'); + const newValue = 123; + + input.setValue(newValue); + + expect(wrapper.emitted('update')).toHaveLength(1); + }); + + it.each([ + 'model', + 'networkName', + 'type', + ])('should emit an update on %p selection change', async(field) => { + const wrapper = mount(HarvesterEditNetwork, { propsData: { mode: _EDIT } }); + const select = wrapper.find(`[data-testid="input-hen-${ field }"]`); + + select.find('button').trigger('click'); + await wrapper.trigger('keydown.down'); + await wrapper.trigger('keydown.enter'); + + expect(wrapper.emitted('update')).toHaveLength(1); + }); +}); diff --git a/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineNetwork/base.vue b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineNetwork/base.vue new file mode 100644 index 00000000..35f1530e --- /dev/null +++ b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineNetwork/base.vue @@ -0,0 +1,306 @@ + + + diff --git a/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineNetwork/index.vue b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineNetwork/index.vue new file mode 100644 index 00000000..91781a59 --- /dev/null +++ b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineNetwork/index.vue @@ -0,0 +1,165 @@ + + + + + diff --git a/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachinePciDevices/CompatibilityMatrix.vue b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachinePciDevices/CompatibilityMatrix.vue new file mode 100644 index 00000000..22c757e1 --- /dev/null +++ b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachinePciDevices/CompatibilityMatrix.vue @@ -0,0 +1,157 @@ + + + + + diff --git a/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachinePciDevices/DeviceList.vue b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachinePciDevices/DeviceList.vue new file mode 100644 index 00000000..24c437d5 --- /dev/null +++ b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachinePciDevices/DeviceList.vue @@ -0,0 +1,189 @@ + + + diff --git a/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachinePciDevices/index.vue b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachinePciDevices/index.vue new file mode 100644 index 00000000..814e3f19 --- /dev/null +++ b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachinePciDevices/index.vue @@ -0,0 +1,269 @@ + + + diff --git a/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineReserved.vue b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineReserved.vue new file mode 100644 index 00000000..dd5c694b --- /dev/null +++ b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineReserved.vue @@ -0,0 +1,50 @@ + + + diff --git a/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineSSHKey.vue b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineSSHKey.vue new file mode 100644 index 00000000..368acd91 --- /dev/null +++ b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineSSHKey.vue @@ -0,0 +1,285 @@ + + + diff --git a/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVGpuDevices/VGpuDeviceList.vue b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVGpuDevices/VGpuDeviceList.vue new file mode 100644 index 00000000..2a288006 --- /dev/null +++ b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVGpuDevices/VGpuDeviceList.vue @@ -0,0 +1,129 @@ + + + diff --git a/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVGpuDevices/index.vue b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVGpuDevices/index.vue new file mode 100644 index 00000000..70c5c4fd --- /dev/null +++ b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVGpuDevices/index.vue @@ -0,0 +1,203 @@ + + + diff --git a/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/index.vue b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/index.vue new file mode 100644 index 00000000..2663ae92 --- /dev/null +++ b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/index.vue @@ -0,0 +1,498 @@ + + + + + diff --git a/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/__tests__/HarvesterEditContainer.test.ts b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/__tests__/HarvesterEditContainer.test.ts new file mode 100644 index 00000000..d9082fe7 --- /dev/null +++ b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/__tests__/HarvesterEditContainer.test.ts @@ -0,0 +1,40 @@ +import { mount } from '@vue/test-utils'; +import HarvesterEditContainer from '../container.vue'; +import { _EDIT } from '@shell/config/query-params'; + +describe('component: HarvesterEditContainer', () => { + it('should display all the inputs', () => { + const wrapper = mount(HarvesterEditContainer, { propsData: { mode: _EDIT, value: {} } }); + + const inputWraps = wrapper.findAll('[data-testid^=input-hec-]'); + + expect(inputWraps).toHaveLength(4); + }); + + it.each([ + 'name', + 'container', + ])('should emit an update on %p input', (field) => { + const wrapper = mount(HarvesterEditContainer, { propsData: { mode: _EDIT, value: {} } }); + const input = wrapper.find(`[data-testid="input-hec-${ field }"]`).find('input'); + const newValue = 123; + + input.setValue(newValue); + + expect(wrapper.emitted('update')).toHaveLength(1); + }); + + it.each([ + 'type', + 'bus', + ])('should emit an update on %p selection change', async(field) => { + const wrapper = mount(HarvesterEditContainer, { propsData: { mode: _EDIT, value: {} } }); + const select = wrapper.find(`[data-testid="input-hec-${ field }"]`); + + select.find('button').trigger('click'); + await wrapper.trigger('keydown.down'); + await wrapper.trigger('keydown.enter'); + + expect(wrapper.emitted('update')).toHaveLength(1); + }); +}); diff --git a/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/__tests__/HarvesterEditExisting.test.ts b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/__tests__/HarvesterEditExisting.test.ts new file mode 100644 index 00000000..a9857e28 --- /dev/null +++ b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/__tests__/HarvesterEditExisting.test.ts @@ -0,0 +1,103 @@ +import { mount } from '@vue/test-utils'; +import HarvesterEditExisting from '../existing.vue'; +import { _EDIT } from '@shell/config/query-params'; + +describe('component: HarvesterEditExisting', () => { + it('should display all the inputs', () => { + const wrapper = mount(HarvesterEditExisting, { + propsData: { + mode: _EDIT, value: {}, rows: [] + }, + mocks: { + $store: { + getters: { + 'harvester/all': () => [], + 'i18n/t': jest.fn() + } + } + } + }); + + const inputWraps = wrapper.findAll('[data-testid^=input-hee-]'); + + expect(inputWraps).toHaveLength(5); + }); + + it.each([ + 'name', + ])('should emit an update on %p input', (field) => { + const wrapper = mount(HarvesterEditExisting, { + propsData: { + mode: _EDIT, value: {}, rows: [] + }, + mocks: { + $store: { + getters: { + 'harvester/all': () => [], + 'i18n/t': jest.fn() + } + } + } + }); + const input = wrapper.find(`[data-testid="input-hee-${ field }"]`).find('input'); + const newValue = 123; + + input.setValue(newValue); + + expect(wrapper.emitted('update')).toHaveLength(1); + }); + + // TODO: #6179: Restore this test when the input is allowed to edit + // eslint-disable-next-line jest/no-disabled-tests + it.skip.each([ + 'size', + ])('should emit an update on %p input and blur', (field) => { + const wrapper = mount(HarvesterEditExisting, { + propsData: { + mode: _EDIT, value: {}, rows: [] + }, + mocks: { + $store: { + getters: { + 'harvester/all': () => [], + 'i18n/t': jest.fn() + } + } + } + }); + const input = wrapper.find(`[data-testid="input-hee-${ field }"]`).find('input'); + const newValue = 123; + + input.setValue(newValue); + input.trigger('blur'); + + expect(wrapper.emitted('input')).toHaveLength(1); + }); + + it.each([ + 'type', + 'volumeName', + // 'bus', // disabled + ])('should emit an update on %p selection change', async(field) => { + const wrapper = mount(HarvesterEditExisting, { + propsData: { + mode: _EDIT, value: {}, rows: [] + }, + mocks: { + $store: { + getters: { + 'harvester/all': () => [], + 'i18n/t': jest.fn() + } + } + } + }); + const select = wrapper.find(`[data-testid="input-hee-${ field }"]`); + + select.find('button').trigger('click'); + await wrapper.trigger('keydown.down'); + await wrapper.trigger('keydown.enter'); + + expect(wrapper.emitted('update')).toHaveLength(1); + }); +}); diff --git a/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/__tests__/HarvesterEditVMImage.test.ts b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/__tests__/HarvesterEditVMImage.test.ts new file mode 100644 index 00000000..d1790fe4 --- /dev/null +++ b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/__tests__/HarvesterEditVMImage.test.ts @@ -0,0 +1,117 @@ +import { mount } from '@vue/test-utils'; +import HarvesterEditVMImage from '../vmImage.vue'; +import { _CREATE } from '@shell/config/query-params'; + +describe('component: HarvesterEditVMImage', () => { + it('should display all the inputs', () => { + const wrapper = mount(HarvesterEditVMImage, { + propsData: { + mode: _CREATE, + isVirtualType: false, + newCreateId: '123', + validateRequired: true, + idx: 1 + }, + mocks: { + $store: { + getters: { + 'harvester/all': jest.fn(), + 'i18n/t': jest.fn(), + } + }, + } + }); + + const inputWraps = wrapper.findAll('[data-testid^=input-hevi-]'); + + expect(inputWraps).toHaveLength(5); + }); + + it.each([ + 'name', + ])('should emit an update on %p input', (field) => { + const wrapper = mount(HarvesterEditVMImage, { + propsData: { + mode: _CREATE, + isVirtualType: false, + newCreateId: '123', + validateRequired: true, + idx: 1 + }, + mocks: { + $store: { + getters: { + 'harvester/all': jest.fn(), + 'i18n/t': jest.fn(), + } + }, + } + }); + const input = wrapper.find(`[data-testid="input-hevi-${ field }"]`).find('input'); + const newValue = 123; + + input.setValue(newValue); + + expect(wrapper.emitted('update')).toHaveLength(1); + }); + + it.each([ + 'size', + ])('should emit an update on %p input blur', (field) => { + const wrapper = mount(HarvesterEditVMImage, { + propsData: { + mode: _CREATE, + isVirtualType: false, + newCreateId: '123', + validateRequired: true, + idx: 1 + }, + mocks: { + $store: { + getters: { + 'harvester/all': jest.fn(), + 'i18n/t': jest.fn(), + } + }, + } + }); + const input = wrapper.find(`[data-testid="input-hevi-${ field }"]`).find('input'); + const newValue = 123; + + input.setValue(newValue); + input.trigger('blur'); + + expect(wrapper.emitted('update')).toHaveLength(1); + }); + + it.each([ + 'type', + 'image', + 'bus', + ])('should emit an update on %p selection change', async(field) => { + const wrapper = mount(HarvesterEditVMImage, { + propsData: { + mode: _CREATE, + isVirtualType: false, + newCreateId: '123', + validateRequired: true, + idx: 1 + }, + mocks: { + $store: { + getters: { + 'harvester/all': jest.fn(), + 'i18n/t': jest.fn(), + } + }, + } + }); + const select = wrapper.find(`[data-testid="input-hevi-${ field }"]`); + + select.find('button').trigger('click'); + await wrapper.trigger('keydown.down'); + await wrapper.trigger('keydown.enter'); + + expect(wrapper.emitted('update')).toHaveLength(1); + }); +}); diff --git a/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/__tests__/HarvesterEditVolume.test.ts b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/__tests__/HarvesterEditVolume.test.ts new file mode 100644 index 00000000..a44144ce --- /dev/null +++ b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/__tests__/HarvesterEditVolume.test.ts @@ -0,0 +1,74 @@ +import { mount } from '@vue/test-utils'; +import HarvesterEditVolume from '../volume.vue'; +import { _EDIT } from '@shell/config/query-params'; + +describe('component: HarvesterEditVolume', () => { + it('should display all the inputs', () => { + const wrapper = mount(HarvesterEditVolume, { + propsData: { validateRequired: true }, + mocks: { + $store: { + getters: { + 'harvester/all': jest.fn(), + 'i18n/t': jest.fn(), + 'i18n/exists': jest.fn(), + } + }, + } + }); + + const inputWraps = wrapper.findAll('[data-testid^=input-hev-]'); + + expect(inputWraps).toHaveLength(4); + }); + + it.each([ + 'name', + 'size', + ])('should emit an update on %p input blur', (field) => { + const wrapper = mount(HarvesterEditVolume, { + propsData: { mode: _EDIT, validateRequired: true }, + mocks: { + $store: { + getters: { + 'harvester/all': jest.fn(), + 'i18n/t': jest.fn(), + 'i18n/exists': jest.fn(), + } + }, + } + }); + const input = wrapper.find(`[data-testid="input-hev-${ field }"]`).find('input'); + const newValue = 123; + + input.setValue(newValue); + input.trigger('blur'); + + expect(wrapper.emitted('update')).toHaveLength(1); + }); + + it.each([ + 'type', + 'bus' + ])('should emit an update on %p selection change', async(field) => { + const wrapper = mount(HarvesterEditVolume, { + propsData: { mode: _EDIT, validateRequired: true }, + mocks: { + $store: { + getters: { + 'harvester/all': jest.fn(), + 'i18n/t': jest.fn(), + 'i18n/exists': jest.fn(), + } + }, + } + }); + const select = wrapper.find(`[data-testid="input-hev-${ field }"]`); + + select.find('button').trigger('click'); + await wrapper.trigger('keydown.down'); + await wrapper.trigger('keydown.enter'); + + expect(wrapper.emitted('update')).toHaveLength(1); + }); +}); diff --git a/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/container.vue b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/container.vue new file mode 100644 index 00000000..4a992224 --- /dev/null +++ b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/container.vue @@ -0,0 +1,132 @@ + + + diff --git a/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/existing.vue b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/existing.vue new file mode 100644 index 00000000..935697d6 --- /dev/null +++ b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/existing.vue @@ -0,0 +1,298 @@ + + + diff --git a/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/vmImage.vue b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/vmImage.vue new file mode 100644 index 00000000..3f5f9e09 --- /dev/null +++ b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/vmImage.vue @@ -0,0 +1,282 @@ + + + diff --git a/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/volume.vue b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/volume.vue new file mode 100644 index 00000000..8cd29f05 --- /dev/null +++ b/pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/volume.vue @@ -0,0 +1,230 @@ + + + diff --git a/pkg/harvester/edit/kubevirt.io.virtualmachine/index.vue b/pkg/harvester/edit/kubevirt.io.virtualmachine/index.vue new file mode 100644 index 00000000..4ec22f88 --- /dev/null +++ b/pkg/harvester/edit/kubevirt.io.virtualmachine/index.vue @@ -0,0 +1,836 @@ + + + + + diff --git a/pkg/harvester/edit/loadbalancer.harvesterhci.io.ippool/Priority.vue b/pkg/harvester/edit/loadbalancer.harvesterhci.io.ippool/Priority.vue new file mode 100644 index 00000000..883b8afd --- /dev/null +++ b/pkg/harvester/edit/loadbalancer.harvesterhci.io.ippool/Priority.vue @@ -0,0 +1,157 @@ + + + + + diff --git a/pkg/harvester/edit/loadbalancer.harvesterhci.io.ippool/PriorityRow.vue b/pkg/harvester/edit/loadbalancer.harvesterhci.io.ippool/PriorityRow.vue new file mode 100644 index 00000000..1a88916d --- /dev/null +++ b/pkg/harvester/edit/loadbalancer.harvesterhci.io.ippool/PriorityRow.vue @@ -0,0 +1,241 @@ + + + + + diff --git a/pkg/harvester/edit/loadbalancer.harvesterhci.io.ippool/Range.vue b/pkg/harvester/edit/loadbalancer.harvesterhci.io.ippool/Range.vue new file mode 100644 index 00000000..1b111010 --- /dev/null +++ b/pkg/harvester/edit/loadbalancer.harvesterhci.io.ippool/Range.vue @@ -0,0 +1,233 @@ + + + + + diff --git a/pkg/harvester/edit/loadbalancer.harvesterhci.io.ippool/Selector.vue b/pkg/harvester/edit/loadbalancer.harvesterhci.io.ippool/Selector.vue new file mode 100644 index 00000000..53d3090e --- /dev/null +++ b/pkg/harvester/edit/loadbalancer.harvesterhci.io.ippool/Selector.vue @@ -0,0 +1,101 @@ + + + diff --git a/pkg/harvester/edit/loadbalancer.harvesterhci.io.ippool/index.vue b/pkg/harvester/edit/loadbalancer.harvesterhci.io.ippool/index.vue new file mode 100644 index 00000000..982e0035 --- /dev/null +++ b/pkg/harvester/edit/loadbalancer.harvesterhci.io.ippool/index.vue @@ -0,0 +1,119 @@ + + + diff --git a/pkg/harvester/edit/loadbalancer.harvesterhci.io.loadbalancer/HealthCheck.vue b/pkg/harvester/edit/loadbalancer.harvesterhci.io.loadbalancer/HealthCheck.vue new file mode 100644 index 00000000..307ace0e --- /dev/null +++ b/pkg/harvester/edit/loadbalancer.harvesterhci.io.loadbalancer/HealthCheck.vue @@ -0,0 +1,127 @@ + + + diff --git a/pkg/harvester/edit/loadbalancer.harvesterhci.io.loadbalancer/Listeners.vue b/pkg/harvester/edit/loadbalancer.harvesterhci.io.loadbalancer/Listeners.vue new file mode 100644 index 00000000..744b979f --- /dev/null +++ b/pkg/harvester/edit/loadbalancer.harvesterhci.io.loadbalancer/Listeners.vue @@ -0,0 +1,208 @@ + + + + + diff --git a/pkg/harvester/edit/loadbalancer.harvesterhci.io.loadbalancer/index.vue b/pkg/harvester/edit/loadbalancer.harvesterhci.io.loadbalancer/index.vue new file mode 100644 index 00000000..62634720 --- /dev/null +++ b/pkg/harvester/edit/loadbalancer.harvesterhci.io.loadbalancer/index.vue @@ -0,0 +1,399 @@ + + + + + diff --git a/pkg/harvester/edit/management.cattle.io.project.vue b/pkg/harvester/edit/management.cattle.io.project.vue new file mode 100644 index 00000000..9fd84fdc --- /dev/null +++ b/pkg/harvester/edit/management.cattle.io.project.vue @@ -0,0 +1,296 @@ + + diff --git a/pkg/harvester/edit/network.harvesterhci.io.clusternetwork/index.vue b/pkg/harvester/edit/network.harvesterhci.io.clusternetwork/index.vue new file mode 100644 index 00000000..d11090b6 --- /dev/null +++ b/pkg/harvester/edit/network.harvesterhci.io.clusternetwork/index.vue @@ -0,0 +1,91 @@ + + + diff --git a/pkg/harvester/edit/network.harvesterhci.io.vlanconfig/NodeSelector.vue b/pkg/harvester/edit/network.harvesterhci.io.vlanconfig/NodeSelector.vue new file mode 100644 index 00000000..6f2065dc --- /dev/null +++ b/pkg/harvester/edit/network.harvesterhci.io.vlanconfig/NodeSelector.vue @@ -0,0 +1,171 @@ + + + diff --git a/pkg/harvester/edit/network.harvesterhci.io.vlanconfig/index.vue b/pkg/harvester/edit/network.harvesterhci.io.vlanconfig/index.vue new file mode 100644 index 00000000..7eb26860 --- /dev/null +++ b/pkg/harvester/edit/network.harvesterhci.io.vlanconfig/index.vue @@ -0,0 +1,517 @@ + + + + + diff --git a/pkg/harvester/formatters/AttachVMWithName.vue b/pkg/harvester/formatters/AttachVMWithName.vue new file mode 100644 index 00000000..716c9fff --- /dev/null +++ b/pkg/harvester/formatters/AttachVMWithName.vue @@ -0,0 +1,49 @@ + + + diff --git a/pkg/harvester/formatters/CloudInitType.vue b/pkg/harvester/formatters/CloudInitType.vue new file mode 100644 index 00000000..ef6fb7e4 --- /dev/null +++ b/pkg/harvester/formatters/CloudInitType.vue @@ -0,0 +1,27 @@ + + + diff --git a/pkg/harvester/formatters/HarvesterBackupProgressBar.vue b/pkg/harvester/formatters/HarvesterBackupProgressBar.vue new file mode 100644 index 00000000..b1f7a67a --- /dev/null +++ b/pkg/harvester/formatters/HarvesterBackupProgressBar.vue @@ -0,0 +1,107 @@ + + + + + diff --git a/pkg/harvester/formatters/HarvesterBackupTargetValidation.vue b/pkg/harvester/formatters/HarvesterBackupTargetValidation.vue new file mode 100644 index 00000000..5336901f --- /dev/null +++ b/pkg/harvester/formatters/HarvesterBackupTargetValidation.vue @@ -0,0 +1,49 @@ + + + diff --git a/pkg/harvester/formatters/HarvesterCPUUsed.vue b/pkg/harvester/formatters/HarvesterCPUUsed.vue new file mode 100644 index 00000000..f1830882 --- /dev/null +++ b/pkg/harvester/formatters/HarvesterCPUUsed.vue @@ -0,0 +1,128 @@ + + + + + diff --git a/pkg/harvester/formatters/HarvesterDiskState.vue b/pkg/harvester/formatters/HarvesterDiskState.vue new file mode 100644 index 00000000..09158858 --- /dev/null +++ b/pkg/harvester/formatters/HarvesterDiskState.vue @@ -0,0 +1,109 @@ + + + + + diff --git a/pkg/harvester/formatters/HarvesterHost.vue b/pkg/harvester/formatters/HarvesterHost.vue new file mode 100644 index 00000000..c18361da --- /dev/null +++ b/pkg/harvester/formatters/HarvesterHost.vue @@ -0,0 +1,36 @@ + + + diff --git a/pkg/harvester/formatters/HarvesterIpAddress.vue b/pkg/harvester/formatters/HarvesterIpAddress.vue new file mode 100644 index 00000000..69a788c6 --- /dev/null +++ b/pkg/harvester/formatters/HarvesterIpAddress.vue @@ -0,0 +1,103 @@ + + + diff --git a/pkg/harvester/formatters/HarvesterListener.vue b/pkg/harvester/formatters/HarvesterListener.vue new file mode 100644 index 00000000..dd38eabb --- /dev/null +++ b/pkg/harvester/formatters/HarvesterListener.vue @@ -0,0 +1,75 @@ +> + + diff --git a/pkg/harvester/formatters/HarvesterMemoryUsed.vue b/pkg/harvester/formatters/HarvesterMemoryUsed.vue new file mode 100644 index 00000000..53515204 --- /dev/null +++ b/pkg/harvester/formatters/HarvesterMemoryUsed.vue @@ -0,0 +1,146 @@ + + + + + diff --git a/pkg/harvester/formatters/HarvesterMigrationState.vue b/pkg/harvester/formatters/HarvesterMigrationState.vue new file mode 100644 index 00000000..e72a856d --- /dev/null +++ b/pkg/harvester/formatters/HarvesterMigrationState.vue @@ -0,0 +1,88 @@ + + + + + diff --git a/pkg/harvester/formatters/HarvesterStorageUsed.vue b/pkg/harvester/formatters/HarvesterStorageUsed.vue new file mode 100644 index 00000000..97ec63ea --- /dev/null +++ b/pkg/harvester/formatters/HarvesterStorageUsed.vue @@ -0,0 +1,191 @@ + + + + + diff --git a/pkg/harvester/formatters/HarvesterVFAddress.vue b/pkg/harvester/formatters/HarvesterVFAddress.vue new file mode 100644 index 00000000..be8d0749 --- /dev/null +++ b/pkg/harvester/formatters/HarvesterVFAddress.vue @@ -0,0 +1,116 @@ + + + + + diff --git a/pkg/harvester/formatters/HarvesterVFsNum.vue b/pkg/harvester/formatters/HarvesterVFsNum.vue new file mode 100644 index 00000000..f7a5bd65 --- /dev/null +++ b/pkg/harvester/formatters/HarvesterVFsNum.vue @@ -0,0 +1,34 @@ + + + diff --git a/pkg/harvester/formatters/HarvesterVGpuDevices.vue b/pkg/harvester/formatters/HarvesterVGpuDevices.vue new file mode 100644 index 00000000..fcf7391d --- /dev/null +++ b/pkg/harvester/formatters/HarvesterVGpuDevices.vue @@ -0,0 +1,113 @@ + + + + + diff --git a/pkg/harvester/formatters/HarvesterVmState.vue b/pkg/harvester/formatters/HarvesterVmState.vue new file mode 100644 index 00000000..9434ffe7 --- /dev/null +++ b/pkg/harvester/formatters/HarvesterVmState.vue @@ -0,0 +1,175 @@ + + + + + diff --git a/pkg/harvester/formatters/HarvesterVolumeState.vue b/pkg/harvester/formatters/HarvesterVolumeState.vue new file mode 100644 index 00000000..930a0a58 --- /dev/null +++ b/pkg/harvester/formatters/HarvesterVolumeState.vue @@ -0,0 +1,94 @@ + + + + + diff --git a/pkg/harvester/formatters/NetworkRouteConnectivity.vue b/pkg/harvester/formatters/NetworkRouteConnectivity.vue new file mode 100644 index 00000000..425f536a --- /dev/null +++ b/pkg/harvester/formatters/NetworkRouteConnectivity.vue @@ -0,0 +1,47 @@ + + + + + diff --git a/pkg/harvester/formatters/RelatedVolumeSnapshotCounts.vue b/pkg/harvester/formatters/RelatedVolumeSnapshotCounts.vue new file mode 100644 index 00000000..72fa4d17 --- /dev/null +++ b/pkg/harvester/formatters/RelatedVolumeSnapshotCounts.vue @@ -0,0 +1,37 @@ + + + diff --git a/pkg/harvester/formatters/SnapshotTargetVolume.vue b/pkg/harvester/formatters/SnapshotTargetVolume.vue new file mode 100644 index 00000000..7b785123 --- /dev/null +++ b/pkg/harvester/formatters/SnapshotTargetVolume.vue @@ -0,0 +1,45 @@ + + diff --git a/pkg/harvester/formatters/StateWithPopover.vue b/pkg/harvester/formatters/StateWithPopover.vue new file mode 100644 index 00000000..1d8b747b --- /dev/null +++ b/pkg/harvester/formatters/StateWithPopover.vue @@ -0,0 +1,59 @@ + + + + + diff --git a/pkg/harvester/index.ts b/pkg/harvester/index.ts index 0be76a0b..caf46dd5 100644 --- a/pkg/harvester/index.ts +++ b/pkg/harvester/index.ts @@ -1,6 +1,6 @@ import { importTypes } from '@rancher/auto-import'; import { IPlugin } from '@shell/core/types'; -import extensionRouting from './routing/extension-routing'; +import extensionRouting from './routing/harvester-routing'; import harvesterCommonStore from './store/harvester-common'; import harvesterStore from './store/harvester-store'; import customValidators from './validators'; @@ -22,7 +22,7 @@ export default function(plugin: IPlugin): void { plugin.addDashboardStore(harvesterCommonStore.config.namespace, harvesterCommonStore.specifics, harvesterCommonStore.config); plugin.addDashboardStore(harvesterStore.config.namespace, harvesterStore.specifics, harvesterStore.config, harvesterStore.init); - // plugin.validators = customValidators; + plugin.validators = customValidators; plugin.register('component', 'NavHeaderRight', () => import(/* webpackChunkName: "pkg/harvester/components" */ `./components/HarvesterUpgradeHeader.vue`)); } diff --git a/pkg/harvester/l10n/en-us.yaml b/pkg/harvester/l10n/en-us.yaml index d0abafad..67513932 100644 --- a/pkg/harvester/l10n/en-us.yaml +++ b/pkg/harvester/l10n/en-us.yaml @@ -55,7 +55,7 @@ harvester: cloneVM: title: Clone VM name: New VM Name - type: clone volume data + type: Clone volume data action: create: Create clone: Clone @@ -181,12 +181,14 @@ harvester: volumeSnapshotCounts: Snapshot Counts networkState: Network State storageClass: Storage Class + restore: Restore tab: volume: Volumes network: Networks advanced: Advanced Options accessCredentials: Access Credentials pciDevices: PCI Devices + vGpuDevices: VGPU Devices vmScheduling: VM Scheduling instanceLabel: Instance Labels fields: @@ -283,6 +285,8 @@ harvester: image: ruleTip: 'The URL you have entered ends in an extension that we do not support. We only accept image files that end in .img, .iso, .qcow, .qcow2, .raw.' ruleFileTip: 'The file you have chosen ends in an extension that we do not support. We only accept image files that end in .img, .iso, .qcow, .qcow2, .raw.' + hash: + sha512: 'Invalid SHA512 checksum.' dashboard: label: Dashboard @@ -344,6 +348,7 @@ harvester: manufacturer: Manufacturer serialNumber: Serial Number model: Model + etcd: Witness Node enableMaintenance: title: Enable Maintenance Mode protip: The operation will migrate all virtual machines on this node to other nodes. @@ -699,6 +704,8 @@ harvester: =1 {1 image is uploading, please do not refresh or close the page.} other {{count} images are uploading, please do not refresh or close the page.} } + checksum: Checksum + checksumTip: Validate the image using the SHA512 checksum, if specified. vmTemplate: label: Templates @@ -779,7 +786,22 @@ harvester: createNew: Create new replaceExisting: Replace existing virtualMachineName: Virtual Machine Name + keepMacAddress: Keep MAC Address matchTarget: The current backup target does not match the existing one. + progress: + details: Volume details + tooltip: + starting: Backup initiating + progress: Backup in progress + complete: Backup completed + + restore: + progress: + details: Volume details + tooltip: + starting: Restore initiating + progress: Restore in progress + complete: Restore completed network: label: VM Networks @@ -851,6 +873,8 @@ harvester: tip: 'IP Range should be in IPV4 format. Number of IPs Required = Number of Nodes * 4 + Number of Disks * 2 + Number of Images to Download/Upload . See doc for more details.' vmForceDeletionPolicy: period: Period + autoRotateRKE2Certs: + expiringInHours: Expiring in httpProxy: warning: 'WARNING:
If you configure "http-proxy" and "https-proxy", you must also put Harvester node's CIDR into "no-proxy", otherwise the Harvester cluster will be broken.' supportBundleImage: @@ -1094,6 +1118,7 @@ harvester: 'cattle-monitoring-system/rancher-monitoring': rancher-monitoring is an addon to collect Harvester cluster and VM metrics, view them on the embedded dashboard, and send alert(s) to remote servers. 'vm-import-controller': vm-import-controller is an addon to help migrate VM workloads from other source clusters to an existing Harvester cluster. 'pcidevices-controller': pcidevices-controller is an addon to help discover PCI devices for nodes in your cluster and allow users to prepare devices for PCI Passthrough, for use with Harvester VM and guest Clusters. + 'nvidia-driver-toolkit': 'nvidia-driver-toolkit is an addon to enable vGPU devices and assign them to Harvester VMs.' 'rancher-logging': rancher-logging is an addon to collect versatile logs, events and audits from the Harvester cluster and route them to many kinds of servers based on flows. 'rancher-monitoring': rancher-monitoring is an addon to collect Harvester cluster and VM metrics, view them on the embedded dashboard, and send alert(s) to remote servers. 'rancher-vcluster': rancher-vcluster deploys a vcluster with rancher installed. @@ -1109,8 +1134,18 @@ harvester: rancherVersion: Rancher Version password: Bootstrap Password switchFailed: "{action} {name} failed!" - - + nvidiaDriverToolkit: + titles: + basic: Controller + image: Image + driver: Driver + image: + tag: Image Tag + repository: Image Repository + driver: + location: Driver Location + parsingSpecError: + The field 'spec.valuesContent' has invalid format. loadBalancer: label: Load Balancers @@ -1153,6 +1188,9 @@ harvester: } backendServers: label: Backend Servers + healthCheck: + warning: + portInUse: Warning, Backend Port {port} is in use in Health Check settings; in case of updating the port, update the Health Check settings accordingly. ipPool: label: IP Pools @@ -1215,6 +1253,38 @@ harvester: showMore: Show More parentSriov: Filter By Parent SR-IOV + sriovgpu: + label: SR-IOV GPU Devices + nodeName: Node + numVFs: Number Of Virtual Functions + vfAddresses: Virtual Functions Addresses + vGpuDevices: vGPU Devices + showMore: Show More + parentSriov: Filter By Parent SR-IOV GPU + noPermission: Please contact system admin to add Harvester addons first + goSetting: + prefix: The nvidia-driver-toolkit addon is not enabled, click + middle: here + suffix: to enable it to manage your SR-IOV GPU devices. + + vgpu: + label: vGPU Devices + noPermission: Please contact system admin to add Harvester addons first + goSetting: + prefix: The nvidia-driver-toolkit addon is not enabled, click + middle: here + suffix: to enable it to manage your vGPU devices. + enableGroup: Enable Group + disableGroup: Disable Group + enable: + title: Select vGPU + type: Type + available: Available Devices + compatibleNodes: Compatible Nodes + impossibleSelection: 'There are no hosts with all of the selected devices.' + howToUseDevice: 'Use the table below to enable vGPU devices you want to use in this VM.' + deviceInTheSameHost: 'You can only select devices on the same host.' + harvesterVlanConfigMigrateDialog: targetClusterNetwork: label: Target Cluster Network @@ -1278,6 +1348,7 @@ advancedSettings: 'harv-additional-ca': 'Custom CA root certificates for TLS validation.' 'harv-overcommit-config': 'Resource overcommit configuration.' 'harv-support-bundle-timeout': 'Support Bundle timeout config in minutes, use 0 to disable the timeout.' + 'harv-support-bundle-expiration': 'Support Bundle expiration config in minutes.' 'harv-vm-force-reset-policy': Config the force-reset action when a VM is stuck on a node that is down. 'harv-ssl-parameters': Custom SSL Parameters for TLS validation. 'harv-storage-network': 'Longhorn storage-network setting.' @@ -1287,6 +1358,7 @@ advancedSettings: 'harv-release-download-url': This setting allows you to configure the upgrade release download URL address. Harvester will get the ISO URL and checksum value from the ($URL/$VERSION/version.yaml) file hosted by the configured URL. 'harv-default-vm-termination-grace-period-seconds': Config the VM termination grace period for VM stop. 'harv-ntp-servers': Configure NTP server. You can configure multiple IPv4 addresses or host addresses. + 'harv-auto-rotate-rke2-certs': The certificate rotation mechanism relies on Rancher. Harvester will automatically update certificates generation to trigger rotation. typeLabel: kubevirt.io.virtualmachine: |- @@ -1409,6 +1481,19 @@ typeLabel: one { SR-IOV Network Device } other { SR-IOV Network Devices } } + + devices.harvesterhci.io.sriovgpudevice: |- + {count, plural, + one { SR-IOV GPU Device } + other { SR-IOV GPU Devices } + } + + devices.harvesterhci.io.vgpudevice: |- + {count, plural, + one { vGPU Device } + other { vGPU Devices } + } + harvesterhci.io.secret: |- {count, plural, one { Secret } diff --git a/pkg/harvester/l10n/zh-hans.yaml b/pkg/harvester/l10n/zh-hans.yaml index c30cadab..4d9e3957 100644 --- a/pkg/harvester/l10n/zh-hans.yaml +++ b/pkg/harvester/l10n/zh-hans.yaml @@ -1278,6 +1278,7 @@ advancedSettings: 'harv-additional-ca': '用于 TLS 验证的自定义 CA 根证书。' 'harv-overcommit-config': '资源超额配置。' 'harv-support-bundle-timeout': 'Support Bundle 超时配置(单位:分钟),你可以使用 0 来禁用超时。' + 'harv-support-bundle-expiration': 'Support Bundle 过期配置(单位:分钟)。' 'harv-vm-force-reset-policy': 配置当虚拟机卡在停机的节点上时的强制重置动作。 'harv-ssl-parameters': 用于 TLS 验证的自定义 SSL 参数。 'harv-storage-network': 'Longhorn 存储网络设置。' diff --git a/pkg/harvester/list/devices.harvesterhci.io.pcidevice.vue b/pkg/harvester/list/devices.harvesterhci.io.pcidevice.vue new file mode 100644 index 00000000..ab0a779d --- /dev/null +++ b/pkg/harvester/list/devices.harvesterhci.io.pcidevice.vue @@ -0,0 +1,95 @@ + + + diff --git a/pkg/harvester/list/devices.harvesterhci.io.sriovgpudevice.vue b/pkg/harvester/list/devices.harvesterhci.io.sriovgpudevice.vue new file mode 100644 index 00000000..6157f868 --- /dev/null +++ b/pkg/harvester/list/devices.harvesterhci.io.sriovgpudevice.vue @@ -0,0 +1,166 @@ + + + diff --git a/pkg/harvester/list/devices.harvesterhci.io.sriovnetworkdevice.vue b/pkg/harvester/list/devices.harvesterhci.io.sriovnetworkdevice.vue new file mode 100644 index 00000000..83ac523a --- /dev/null +++ b/pkg/harvester/list/devices.harvesterhci.io.sriovnetworkdevice.vue @@ -0,0 +1,88 @@ + + + diff --git a/pkg/harvester/list/devices.harvesterhci.io.vgpudevice.vue b/pkg/harvester/list/devices.harvesterhci.io.vgpudevice.vue new file mode 100644 index 00000000..b08a3c0a --- /dev/null +++ b/pkg/harvester/list/devices.harvesterhci.io.vgpudevice.vue @@ -0,0 +1,112 @@ + + + diff --git a/pkg/harvester/list/harvesterhci.io.addon.vue b/pkg/harvester/list/harvesterhci.io.addon.vue new file mode 100644 index 00000000..1df270d0 --- /dev/null +++ b/pkg/harvester/list/harvesterhci.io.addon.vue @@ -0,0 +1,96 @@ + + + + + diff --git a/pkg/harvester/list/harvesterhci.io.cloudtemplate.vue b/pkg/harvester/list/harvesterhci.io.cloudtemplate.vue new file mode 100644 index 00000000..6daa1002 --- /dev/null +++ b/pkg/harvester/list/harvesterhci.io.cloudtemplate.vue @@ -0,0 +1,81 @@ + + + diff --git a/pkg/harvester/list/harvesterhci.io.dashboard.vue b/pkg/harvester/list/harvesterhci.io.dashboard.vue index 0b45ceb4..8cf0219e 100644 --- a/pkg/harvester/list/harvesterhci.io.dashboard.vue +++ b/pkg/harvester/list/harvesterhci.io.dashboard.vue @@ -15,6 +15,7 @@ import { REASON } from '@shell/config/table-headers'; import { EVENT, METRIC, NODE, SERVICE, PVC, LONGHORN, POD, COUNT, NETWORK_ATTACHMENT } from '@shell/config/types'; +import { HCI } from '../types'; import ResourceSummary, { resourceCounts, colorToCountName } from '@shell/components/ResourceSummary'; import { colorForState } from '@shell/plugins/dashboard-store/resource-class'; import HardwareResourceGauge from '@shell/components/HardwareResourceGauge'; @@ -24,8 +25,7 @@ import DashboardMetrics from '@shell/components/DashboardMetrics'; import metricPoller from '@shell/mixins/metric-poller'; import { allDashboardsExist } from '@shell/utils/grafana'; import { isEmpty } from '@shell/utils/object'; -import { HCI } from '../types'; -import HarvesterUpgrade from '../components/HarvesterUpgrade.vue'; +import HarvesterUpgrade from '../components/HarvesterUpgrade'; import { PRODUCT_NAME as HARVESTER_PRODUCT } from '../config/harvester'; dayjs.extend(utc); @@ -287,8 +287,8 @@ export default { let errorCount = 0; (this.nodes || []).map((node) => { - total += node.diskStatusCount?.total; - errorCount += node.diskStatusCount?.errorCount; + total += node.diskStatusCount.total; + errorCount += node.diskStatusCount.errorCount; }); out[resource.type] = { diff --git a/pkg/harvester/list/harvesterhci.io.host.vue b/pkg/harvester/list/harvesterhci.io.host.vue new file mode 100644 index 00000000..d87a4326 --- /dev/null +++ b/pkg/harvester/list/harvesterhci.io.host.vue @@ -0,0 +1,208 @@ + + + diff --git a/pkg/harvester/list/harvesterhci.io.logging.clusterflow.vue b/pkg/harvester/list/harvesterhci.io.logging.clusterflow.vue new file mode 100644 index 00000000..ae50efc0 --- /dev/null +++ b/pkg/harvester/list/harvesterhci.io.logging.clusterflow.vue @@ -0,0 +1,94 @@ + + + diff --git a/pkg/harvester/list/harvesterhci.io.logging.clusteroutput.vue b/pkg/harvester/list/harvesterhci.io.logging.clusteroutput.vue new file mode 100644 index 00000000..ee06ab00 --- /dev/null +++ b/pkg/harvester/list/harvesterhci.io.logging.clusteroutput.vue @@ -0,0 +1,93 @@ + + + diff --git a/pkg/harvester/list/harvesterhci.io.logging.flow.vue b/pkg/harvester/list/harvesterhci.io.logging.flow.vue new file mode 100644 index 00000000..f2730d4e --- /dev/null +++ b/pkg/harvester/list/harvesterhci.io.logging.flow.vue @@ -0,0 +1,99 @@ + + + diff --git a/pkg/harvester/list/harvesterhci.io.logging.output.vue b/pkg/harvester/list/harvesterhci.io.logging.output.vue new file mode 100644 index 00000000..f9246ccd --- /dev/null +++ b/pkg/harvester/list/harvesterhci.io.logging.output.vue @@ -0,0 +1,93 @@ + + + diff --git a/pkg/harvester/list/harvesterhci.io.monitoring.alertmanagerconfig.vue b/pkg/harvester/list/harvesterhci.io.monitoring.alertmanagerconfig.vue new file mode 100644 index 00000000..7640e195 --- /dev/null +++ b/pkg/harvester/list/harvesterhci.io.monitoring.alertmanagerconfig.vue @@ -0,0 +1,136 @@ + + + + + diff --git a/pkg/harvester/list/harvesterhci.io.networkattachmentdefinition.vue b/pkg/harvester/list/harvesterhci.io.networkattachmentdefinition.vue new file mode 100644 index 00000000..5d97e806 --- /dev/null +++ b/pkg/harvester/list/harvesterhci.io.networkattachmentdefinition.vue @@ -0,0 +1,208 @@ + + + + + diff --git a/pkg/harvester/list/harvesterhci.io.secret.vue b/pkg/harvester/list/harvesterhci.io.secret.vue new file mode 100644 index 00000000..e73afa8d --- /dev/null +++ b/pkg/harvester/list/harvesterhci.io.secret.vue @@ -0,0 +1,60 @@ + + + diff --git a/pkg/harvester/list/harvesterhci.io.setting.vue b/pkg/harvester/list/harvesterhci.io.setting.vue new file mode 100644 index 00000000..d5ab7fcf --- /dev/null +++ b/pkg/harvester/list/harvesterhci.io.setting.vue @@ -0,0 +1,176 @@ + + + + + diff --git a/pkg/harvester/list/harvesterhci.io.storage.vue b/pkg/harvester/list/harvesterhci.io.storage.vue new file mode 100644 index 00000000..65535dfb --- /dev/null +++ b/pkg/harvester/list/harvesterhci.io.storage.vue @@ -0,0 +1,88 @@ + + + diff --git a/pkg/harvester/list/harvesterhci.io.virtualmachinebackup.vue b/pkg/harvester/list/harvesterhci.io.virtualmachinebackup.vue new file mode 100644 index 00000000..fe5f0a5d --- /dev/null +++ b/pkg/harvester/list/harvesterhci.io.virtualmachinebackup.vue @@ -0,0 +1,236 @@ + + + diff --git a/pkg/harvester/list/harvesterhci.io.virtualmachineimage.vue b/pkg/harvester/list/harvesterhci.io.virtualmachineimage.vue new file mode 100644 index 00000000..13dad01f --- /dev/null +++ b/pkg/harvester/list/harvesterhci.io.virtualmachineimage.vue @@ -0,0 +1,80 @@ + + + diff --git a/pkg/harvester/list/harvesterhci.io.virtualmachinetemplateversion.vue b/pkg/harvester/list/harvesterhci.io.virtualmachinetemplateversion.vue new file mode 100644 index 00000000..298ae409 --- /dev/null +++ b/pkg/harvester/list/harvesterhci.io.virtualmachinetemplateversion.vue @@ -0,0 +1,185 @@ + + + + + diff --git a/pkg/harvester/list/harvesterhci.io.vmsnapshot.vue b/pkg/harvester/list/harvesterhci.io.vmsnapshot.vue new file mode 100644 index 00000000..3b617615 --- /dev/null +++ b/pkg/harvester/list/harvesterhci.io.vmsnapshot.vue @@ -0,0 +1,131 @@ + + + diff --git a/pkg/harvester/list/harvesterhci.io.volume.vue b/pkg/harvester/list/harvesterhci.io.volume.vue new file mode 100644 index 00000000..1b5faef2 --- /dev/null +++ b/pkg/harvester/list/harvesterhci.io.volume.vue @@ -0,0 +1,184 @@ + + + + + diff --git a/pkg/harvester/list/harvesterhci.io.volumesnapshot.vue b/pkg/harvester/list/harvesterhci.io.volumesnapshot.vue new file mode 100644 index 00000000..c16f8ae1 --- /dev/null +++ b/pkg/harvester/list/harvesterhci.io.volumesnapshot.vue @@ -0,0 +1,76 @@ + + + diff --git a/pkg/harvester/list/kubevirt.io.virtualmachine.vue b/pkg/harvester/list/kubevirt.io.virtualmachine.vue new file mode 100644 index 00000000..f28bf60d --- /dev/null +++ b/pkg/harvester/list/kubevirt.io.virtualmachine.vue @@ -0,0 +1,222 @@ + + + + + diff --git a/pkg/harvester/list/network.harvesterhci.io.clusternetwork.vue b/pkg/harvester/list/network.harvesterhci.io.clusternetwork.vue new file mode 100644 index 00000000..a86fdb91 --- /dev/null +++ b/pkg/harvester/list/network.harvesterhci.io.clusternetwork.vue @@ -0,0 +1,295 @@ + + + + + + + + + diff --git a/pkg/harvester/pages/c/_cluster/alertmanagerconfig/_alertmanagerconfigid/index.vue b/pkg/harvester/pages/c/_cluster/alertmanagerconfig/_alertmanagerconfigid/index.vue new file mode 100644 index 00000000..7bb98489 --- /dev/null +++ b/pkg/harvester/pages/c/_cluster/alertmanagerconfig/_alertmanagerconfigid/index.vue @@ -0,0 +1,12 @@ + + + diff --git a/pkg/harvester/pages/c/_cluster/alertmanagerconfig/_alertmanagerconfigid/receiver.vue b/pkg/harvester/pages/c/_cluster/alertmanagerconfig/_alertmanagerconfigid/receiver.vue new file mode 100644 index 00000000..65a42206 --- /dev/null +++ b/pkg/harvester/pages/c/_cluster/alertmanagerconfig/_alertmanagerconfigid/receiver.vue @@ -0,0 +1,304 @@ + + + + + diff --git a/pkg/harvester/pages/c/_cluster/alertmanagerconfig/index.vue b/pkg/harvester/pages/c/_cluster/alertmanagerconfig/index.vue new file mode 100644 index 00000000..94e7fcae --- /dev/null +++ b/pkg/harvester/pages/c/_cluster/alertmanagerconfig/index.vue @@ -0,0 +1,24 @@ + + + + + diff --git a/pkg/harvester/pages/c/_cluster/brand/index.vue b/pkg/harvester/pages/c/_cluster/brand/index.vue new file mode 100644 index 00000000..b64349a2 --- /dev/null +++ b/pkg/harvester/pages/c/_cluster/brand/index.vue @@ -0,0 +1,376 @@ + + + + diff --git a/pkg/harvester/pages/c/_cluster/console/_uid/serial.vue b/pkg/harvester/pages/c/_cluster/console/_uid/serial.vue new file mode 100644 index 00000000..91c37b22 --- /dev/null +++ b/pkg/harvester/pages/c/_cluster/console/_uid/serial.vue @@ -0,0 +1,53 @@ + + + + + diff --git a/pkg/harvester/pages/c/_cluster/console/_uid/vnc.vue b/pkg/harvester/pages/c/_cluster/console/_uid/vnc.vue new file mode 100644 index 00000000..78567847 --- /dev/null +++ b/pkg/harvester/pages/c/_cluster/console/_uid/vnc.vue @@ -0,0 +1,55 @@ + + + + + diff --git a/pkg/harvester/pages/c/_cluster/index.vue b/pkg/harvester/pages/c/_cluster/index.vue new file mode 100644 index 00000000..ef2a1d4c --- /dev/null +++ b/pkg/harvester/pages/c/_cluster/index.vue @@ -0,0 +1,23 @@ + + + diff --git a/pkg/harvester/pages/c/_cluster/members/index.vue b/pkg/harvester/pages/c/_cluster/members/index.vue new file mode 100644 index 00000000..4d600620 --- /dev/null +++ b/pkg/harvester/pages/c/_cluster/members/index.vue @@ -0,0 +1,22 @@ + + + diff --git a/pkg/harvester/pages/c/_cluster/projectsnamespaces.vue b/pkg/harvester/pages/c/_cluster/projectsnamespaces.vue new file mode 100644 index 00000000..13df4ea9 --- /dev/null +++ b/pkg/harvester/pages/c/_cluster/projectsnamespaces.vue @@ -0,0 +1,35 @@ + + + diff --git a/pkg/harvester/pages/c/_cluster/support/index.vue b/pkg/harvester/pages/c/_cluster/support/index.vue new file mode 100644 index 00000000..c6de7830 --- /dev/null +++ b/pkg/harvester/pages/c/_cluster/support/index.vue @@ -0,0 +1,251 @@ + + + + + diff --git a/pkg/harvester/pages/index.vue b/pkg/harvester/pages/index.vue deleted file mode 100644 index c7c56b3d..00000000 --- a/pkg/harvester/pages/index.vue +++ /dev/null @@ -1,8 +0,0 @@ - - - diff --git a/pkg/harvester/product.ts b/pkg/harvester/product.ts index 2c94b6f6..dc7ff85c 100644 --- a/pkg/harvester/product.ts +++ b/pkg/harvester/product.ts @@ -1,62 +1,852 @@ -import { IPlugin } from '@shell/core/types'; -import { PRODUCT_NAME, BLANK_CLUSTER, LOGO as logo } from './config/harvester'; -import { HCI } from './types'; +import { + NODE, + CONFIG_MAP, + NAMESPACE, + VIRTUAL_TYPES, + MANAGEMENT, + PVC, + NETWORK_ATTACHMENT, + MONITORING, + LOGGING, + STORAGE_CLASS, + SECRET +} from '@shell/config/types'; +import { + STATE, + NAME_UNLINKED, + NAME as NAME_COL, + AGE, + NAMESPACE as NAMESPACE_COL, + LOGGING_OUTPUT_PROVIDERS, + OUTPUT, + CLUSTER_OUTPUT, + CONFIGURED_PROVIDERS, + SUB_TYPE, + ADDRESS, +} from '@shell/config/table-headers'; +import { HCI, VOLUME_SNAPSHOT } from './types'; +import { + IMAGE_DOWNLOAD_SIZE, + FINGERPRINT, + IMAGE_PROGRESS, + SNAPSHOT_TARGET_VOLUME, +} from './config/table-headers'; -export function init($plugin: IPlugin, store: any) { +// import { IF_HAVE } from '@shell/store/type-map'; +const IF_HAVE = { MULTI_CLUSTER: false }; + +const TEMPLATE = HCI.VM_VERSION; +const MONITORING_GROUP = 'Monitoring & Logging::Monitoring'; +const LOGGING_GROUP = 'Monitoring & Logging::Logging'; + +export const PRODUCT_NAME = 'harvester'; + +export const IP_POOL_HEADERS = [ + STATE, + NAME_COL, + { + name: 'subnet', + labelKey: 'harvester.ipPool.subnet.label', + value: 'subnetDisplay', + }, + { + name: 'availableIP', + labelKey: 'harvester.ipPool.availableIP.label', + value: 'status.available', + }, + AGE +]; + +export function init($plugin: any, store: any) { const { - basicType, - configureType, product, + basicType, + headers, + configureType, virtualType, + weightGroup, + weightType, } = $plugin.DSL(store, PRODUCT_NAME); - const isSingleProduct = process.env.rancherEnv === PRODUCT_NAME; + const isSingleVirtualCluster = process.env.rancherEnv === PRODUCT_NAME; - if (isSingleProduct) { + if (isSingleVirtualCluster) { const home = { - name: `${ PRODUCT_NAME }-c-cluster`, - path: `/${ PRODUCT_NAME }/c/:cluster` + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { + product: PRODUCT_NAME, + resource: HCI.DASHBOARD + } }; store.dispatch('setIsSingleProduct', { + logo: require(`@shell/assets/images/providers/harvester.svg`), productNameKey: 'harvester.productLabel', getVersionInfo: (store: any) => store.getters[`${ PRODUCT_NAME }/byId`]?.(HCI.SETTING, 'server-version')?.value || 'unknown', afterLoginRoute: home, logoRoute: home, - supportCustomLogo: true, - logo, + supportCustomLogo: true }); } product({ - inStore: 'management', + inStore: PRODUCT_NAME, + removable: false, showNamespaceFilter: true, hideKubeShell: true, hideKubeConfig: true, showClusterSwitcher: true, hideCopyConfig: true, hideSystemResources: true, - hideNamespaceLocation: true, - weight: 100, - to: { - name: `${ PRODUCT_NAME }-c-cluster`, - path: `/${ PRODUCT_NAME }/c/:cluster`, - params: { - product: PRODUCT_NAME, - cluster: BLANK_CLUSTER, - pkg: PRODUCT_NAME + customNamespaceFilter: true, + typeStoreMap: { + [MANAGEMENT.PROJECT]: 'management', + [MANAGEMENT.CLUSTER_ROLE_TEMPLATE_BINDING]: 'management', + [MANAGEMENT.PROJECT_ROLE_TEMPLATE_BINDING]: 'management' + }, + supportRoute: { name: `${ PRODUCT_NAME }-c-cluster-support` }, + to: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { + product: PRODUCT_NAME, + resource: HCI.DASHBOARD } - } + }, + hideNamespaceLocation: true, }); basicType([HCI.DASHBOARD]); virtualType({ labelKey: 'harvester.dashboard.label', + group: 'Root', name: HCI.DASHBOARD, + weight: 500, route: { - name: `${ PRODUCT_NAME }-c-cluster`, - path: `/${ PRODUCT_NAME }/c/:cluster` + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { + product: PRODUCT_NAME, + resource: HCI.DASHBOARD + } } }); configureType(HCI.DASHBOARD, { showListMasthead: false }); + + configureType(HCI.HOST, { + location: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.HOST } + }, + resource: NODE, + resourceDetail: HCI.HOST, + resourceEdit: HCI.HOST + }); + + configureType(HCI.HOST, { isCreatable: false, isEditable: true }); + basicType([HCI.HOST]); + + virtualType({ + ifHaveType: NODE, + labelKey: 'harvester.host.label', + group: 'Root', + name: HCI.HOST, + namespaced: true, + weight: 399, + route: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.HOST } + }, + exact: false + }); + + // multiVirtualCluster + basicType(['cluster-members'], 'rbac'); + virtualType({ + ifHave: IF_HAVE.MULTI_CLUSTER, + labelKey: 'members.clusterMembers', + group: 'root', + namespaced: false, + name: VIRTUAL_TYPES.CLUSTER_MEMBERS, + weight: 100, + route: { name: `${ PRODUCT_NAME }-c-cluster-members` }, + exact: true, + ifHaveType: { + type: MANAGEMENT.CLUSTER_ROLE_TEMPLATE_BINDING, + store: 'management' + } + }); + + basicType([HCI.VM]); + virtualType({ + labelKey: 'harvester.virtualMachine.label', + group: 'root', + name: HCI.VM, + namespaced: true, + weight: 299, + route: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.VM } + }, + exact: false + }); + + basicType([HCI.VOLUME]); + configureType(HCI.VOLUME, { + location: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.VOLUME } + }, + resource: PVC, + resourceDetail: HCI.VOLUME, + resourceEdit: HCI.VOLUME + }); + virtualType({ + labelKey: 'harvester.volume.label', + group: 'root', + ifHaveType: PVC, + name: HCI.VOLUME, + namespaced: true, + weight: 199, + route: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.VOLUME } + }, + exact: false + }); + + basicType([HCI.IMAGE]); + headers(HCI.IMAGE, [ + STATE, + NAME_COL, + NAMESPACE_COL, + IMAGE_PROGRESS, + IMAGE_DOWNLOAD_SIZE, + AGE + ]); + virtualType({ + labelKey: 'harvester.image.label', + group: 'root', + name: HCI.IMAGE, + namespaced: true, + weight: 198, + route: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.IMAGE } + }, + exact: false + }); + + basicType(['projects-namespaces']); + virtualType({ + ifHave: IF_HAVE.MULTI_CLUSTER, + labelKey: 'harvester.projectNamespace.label', + group: 'root', + namespaced: true, + name: 'projects-namespaces', + weight: 98, + route: { name: `${ PRODUCT_NAME }-c-cluster-projectsnamespaces` }, + exact: true, + }); + + // singleVirtualCluster + if (isSingleVirtualCluster) { + headers(NAMESPACE, [STATE, NAME_UNLINKED, AGE]); + basicType([NAMESPACE]); + virtualType({ + labelKey: 'harvester.namespace.label', + name: NAMESPACE, + namespaced: true, + weight: 89, + route: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: NAMESPACE } + }, + exact: false, + }); + } + + basicType([ + HCI.ALERTMANAGERCONFIG + ], MONITORING_GROUP); + + basicType([ + HCI.CLUSTER_FLOW, + HCI.CLUSTER_OUTPUT, + HCI.FLOW, + HCI.OUTPUT, + ], LOGGING_GROUP); + + weightGroup('Monitoring', 2, true); + weightGroup('Logging', 1, true); + + headers(HCI.ALERTMANAGERCONFIG, [ + STATE, + NAME_COL, + NAMESPACE_COL, + { + name: 'receivers', + labelKey: 'tableHeaders.receivers', + formatter: 'ReceiverIcons', + value: 'name' + }, + ]); + + configureType(HCI.ALERTMANAGERCONFIG, { + location: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.ALERTMANAGERCONFIG }, + }, + resource: MONITORING.ALERTMANAGERCONFIG, + resourceDetail: HCI.ALERTMANAGERCONFIG, + resourceEdit: HCI.ALERTMANAGERCONFIG + }); + + virtualType({ + ifHaveType: MONITORING.ALERTMANAGERCONFIG, + labelKey: 'harvester.monitoring.alertmanagerConfig.label', + name: HCI.ALERTMANAGERCONFIG, + namespaced: true, + weight: 87, + route: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.ALERTMANAGERCONFIG } + }, + exact: false, + }); + + configureType(HCI.CLUSTER_FLOW, { + location: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.CLUSTER_FLOW }, + }, + resource: LOGGING.CLUSTER_FLOW, + resourceDetail: HCI.CLUSTER_FLOW, + resourceEdit: HCI.CLUSTER_FLOW + }); + + virtualType({ + labelKey: 'harvester.logging.clusterFlow.label', + name: HCI.CLUSTER_FLOW, + namespaced: true, + weight: 79, + route: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.CLUSTER_FLOW } + }, + exact: false, + }); + + configureType(HCI.CLUSTER_OUTPUT, { + location: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.CLUSTER_OUTPUT }, + }, + resource: LOGGING.CLUSTER_OUTPUT, + resourceDetail: HCI.CLUSTER_OUTPUT, + resourceEdit: HCI.CLUSTER_OUTPUT + }); + + virtualType({ + labelKey: 'harvester.logging.clusterOutput.label', + name: HCI.CLUSTER_OUTPUT, + namespaced: true, + weight: 78, + route: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.CLUSTER_OUTPUT } + }, + exact: false, + }); + + configureType(HCI.FLOW, { + location: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.FLOW }, + }, + resource: LOGGING.FLOW, + resourceDetail: HCI.FLOW, + resourceEdit: HCI.FLOW + }); + + virtualType({ + labelKey: 'harvester.logging.flow.label', + name: HCI.FLOW, + namespaced: true, + weight: 77, + route: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.FLOW } + }, + exact: false, + }); + + configureType(HCI.OUTPUT, { + location: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.OUTPUT }, + }, + resource: LOGGING.OUTPUT, + resourceDetail: HCI.OUTPUT, + resourceEdit: HCI.OUTPUT + }); + + virtualType({ + labelKey: 'harvester.logging.output.label', + name: HCI.OUTPUT, + namespaced: true, + weight: 76, + route: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.OUTPUT } + }, + exact: false, + }); + + headers(HCI.FLOW, [STATE, NAME_COL, NAMESPACE_COL, OUTPUT, CLUSTER_OUTPUT, CONFIGURED_PROVIDERS, AGE]); + headers(HCI.OUTPUT, [STATE, NAME_COL, NAMESPACE_COL, LOGGING_OUTPUT_PROVIDERS, AGE]); + headers(HCI.CLUSTER_FLOW, [STATE, NAME_COL, NAMESPACE_COL, CLUSTER_OUTPUT, CONFIGURED_PROVIDERS, AGE]); + headers(HCI.CLUSTER_OUTPUT, [STATE, NAME_COL, NAMESPACE_COL, LOGGING_OUTPUT_PROVIDERS, AGE]); + + basicType( + [ + HCI.CLUSTER_NETWORK, + HCI.NETWORK_ATTACHMENT, + HCI.LB, + HCI.IP_POOL, + ], + 'networks' + ); + + basicType( + [ + HCI.BACKUP, + HCI.SNAPSHOT, + HCI.VM_SNAPSHOT, + ], + 'backupAndSnapshot' + ); + + weightGroup('networks', 300, true); + weightType(NAMESPACE, 299, true); + weightGroup('backupAndSnapshot', 289, true); + + basicType( + [ + TEMPLATE, + HCI.SSH, + HCI.CLOUD_TEMPLATE, + HCI.STORAGE, + HCI.SR_IOV, + HCI.PCI_DEVICE, + HCI.SR_IOVGPU_DEVICE, + HCI.VGPU_DEVICE, + HCI.ADD_ONS, + HCI.SECRET, + HCI.SETTING + ], + 'advanced' + ); + + configureType(HCI.CLUSTER_NETWORK, { + realResource: HCI.SETTING, + showState: false + }); + + virtualType({ + labelKey: 'harvester.vmTemplate.label', + group: 'root', + name: TEMPLATE, + namespaced: true, + weight: 289, + route: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: TEMPLATE } + }, + exact: false + }); + + configureType(HCI.BACKUP, { showListMasthead: false, showConfigView: false }); + virtualType({ + labelKey: 'harvester.backup.label', + name: HCI.BACKUP, + namespaced: true, + weight: 200, + route: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.BACKUP } + }, + exact: false + }); + + configureType(HCI.VLAN_CONFIG, { hiddenNamespaceGroupButton: true }); + + configureType(HCI.CLUSTER_NETWORK, { showListMasthead: false }); + virtualType({ + labelKey: 'harvester.clusterNetwork.title', + name: HCI.CLUSTER_NETWORK, + ifHaveType: HCI.CLUSTER_NETWORK, + namespaced: false, + weight: 189, + route: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.CLUSTER_NETWORK } + }, + exact: false, + }); + + configureType(HCI.NETWORK_ATTACHMENT, { + location: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.NETWORK_ATTACHMENT } + }, + resource: NETWORK_ATTACHMENT, + resourceDetail: HCI.NETWORK_ATTACHMENT, + resourceEdit: HCI.NETWORK_ATTACHMENT + }); + + virtualType({ + labelKey: 'harvester.network.label', + name: HCI.NETWORK_ATTACHMENT, + namespaced: true, + weight: 188, + route: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.NETWORK_ATTACHMENT } + }, + exact: false + }); + + configureType(HCI.SNAPSHOT, { + isCreatable: false, + location: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.SNAPSHOT }, + }, + resource: VOLUME_SNAPSHOT, + resourceDetail: HCI.SNAPSHOT, + resourceEdit: HCI.SNAPSHOT, + }); + headers(HCI.SNAPSHOT, [STATE, NAME_COL, NAMESPACE_COL, SNAPSHOT_TARGET_VOLUME, AGE]); + virtualType({ + labelKey: 'harvester.snapshot.label', + name: HCI.SNAPSHOT, + namespaced: true, + weight: 190, + route: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.SNAPSHOT } + }, + exact: false, + }); + + configureType(HCI.VM_SNAPSHOT, { + showListMasthead: false, + location: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.VM_SNAPSHOT } + }, + resource: HCI.BACKUP, + resourceDetail: HCI.VM_SNAPSHOT, + resourceEdit: HCI.VM_SNAPSHOT + }); + + virtualType({ + labelKey: 'harvester.vmSnapshot.label', + name: HCI.VM_SNAPSHOT, + namespaced: true, + weight: 191, + route: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.VM_SNAPSHOT } + }, + exact: false + }); + + headers(HCI.SSH, [STATE, NAME_COL, NAMESPACE_COL, FINGERPRINT, AGE]); + virtualType({ + labelKey: 'harvester.sshKey.label', + name: HCI.SSH, + namespaced: true, + weight: 170, + route: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.SSH } + }, + exact: false + }); + + configureType(HCI.CLOUD_TEMPLATE, { + location: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.CLOUD_TEMPLATE } + }, + resource: CONFIG_MAP, + resourceDetail: HCI.CLOUD_TEMPLATE, + resourceEdit: HCI.CLOUD_TEMPLATE + }); + + virtualType({ + labelKey: 'harvester.cloudTemplate.label', + name: HCI.CLOUD_TEMPLATE, + namespaced: true, + weight: 87, + route: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.CLOUD_TEMPLATE } + }, + exact: false + }); + + headers(HCI.SECRET, [ + STATE, + NAME_COL, + NAMESPACE_COL, + SUB_TYPE, + { + name: 'data', + labelKey: 'tableHeaders.data', + value: 'dataPreview', + formatter: 'SecretData' + }, + AGE + ]); + + configureType(HCI.SECRET, { + location: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.SECRET } + }, + resource: SECRET, + resourceDetail: HCI.SECRET, + resourceEdit: HCI.SECRET, + notFilterNamespace: ['cattle-monitoring-system', 'cattle-logging-system'] + }); + + virtualType({ + labelKey: 'harvester.secret.label', + name: HCI.SECRET, + namespaced: true, + weight: -999, + route: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.SECRET } + }, + exact: false + }); + + // settings + configureType(HCI.SETTING, { isCreatable: false }); + virtualType({ + ifHaveType: HCI.SETTING, + ifHaveVerb: 'POST', + labelKey: 'harvester.setting.label', + name: HCI.SETTING, + namespaced: true, + weight: -1000, + route: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.SETTING } + }, + exact: false + }); + + configureType(HCI.STORAGE, { + location: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.STORAGE } + }, + resource: STORAGE_CLASS, + resourceDetail: HCI.STORAGE, + resourceEdit: HCI.STORAGE, + isCreatable: true, + }); + virtualType({ + labelKey: 'harvester.storage.title', + group: 'root', + ifHaveType: STORAGE_CLASS, + name: HCI.STORAGE, + namespaced: false, + weight: 79, + route: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.STORAGE } + }, + exact: false, + }); + + virtualType({ + label: 'PCI Devices', + group: 'advanced', + weight: 14, + name: HCI.PCI_DEVICE, + namespaced: false, + route: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.PCI_DEVICE } + }, + exact: false, + }); + + configureType(HCI.PCI_DEVICE, { + isCreatable: false, + hiddenNamespaceGroupButton: true, + listGroups: [ + { + icon: 'icon-list-grouped', + value: 'description', + field: 'groupByDevice', + hideColumn: 'description', + tooltipKey: 'resourceTable.groupBy.device' + }, + { + icon: 'icon-cluster', + value: 'node', + field: 'groupByNode', + hideColumn: 'node', + tooltipKey: 'resourceTable.groupBy.node' + } + ] + }); + + virtualType({ + ifHaveType: HCI.SR_IOV, + labelKey: 'harvester.sriov.label', + group: 'advanced', + weight: 15, + name: HCI.SR_IOV, + namespaced: false, + route: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.SR_IOV } + }, + exact: false + }); + + configureType(HCI.SR_IOV, { + isCreatable: false, + hiddenNamespaceGroupButton: true, + }); + + virtualType({ + ifHaveType: HCI.SR_IOVGPU_DEVICE, + labelKey: 'harvester.sriovgpu.label', + group: 'advanced', + weight: 13, + name: HCI.SR_IOVGPU_DEVICE, + namespaced: false, + route: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.SR_IOVGPU_DEVICE } + }, + exact: false, + }); + + configureType(HCI.SR_IOVGPU_DEVICE, { + isCreatable: false, + hiddenNamespaceGroupButton: true, + }); + + virtualType({ + labelKey: 'harvester.vgpu.label', + group: 'advanced', + weight: 12, + name: HCI.VGPU_DEVICE, + namespaced: false, + route: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.VGPU_DEVICE } + }, + exact: false, + }); + + configureType(HCI.VGPU_DEVICE, { + isCreatable: false, + hiddenNamespaceGroupButton: true, + listGroups: [ + { + icon: 'icon-cluster', + value: 'node', + field: 'groupByNode', + hideColumn: 'node', + tooltipKey: 'resourceTable.groupBy.node' + } + ] + }); + + configureType(HCI.ADD_ONS, { + isCreatable: false, + isRemovable: false, + showState: false, + }); + + virtualType({ + label: 'Addons', + group: 'advanced', + name: HCI.ADD_ONS, + ifHaveType: HCI.ADD_ONS, + weight: -900, + namespaced: false, + route: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.ADD_ONS } + }, + exact: false, + }); + + configureType(HCI.LB, { + location: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.LB } + }, + }); + virtualType({ + labelKey: 'harvester.loadBalancer.label', + name: HCI.LB, + namespaced: true, + weight: 185, + route: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.LB } + }, + exact: false, + ifHaveType: HCI.LB, + }); + headers(HCI.LB, [ + STATE, + NAME_COL, + { + ...ADDRESS, + formatter: 'HarvesterListener', + }, + { + name: 'workloadType', + labelKey: 'harvester.loadBalancer.workloadType.label', + value: 'workloadTypeDisplay', + }, + { + name: 'ipam', + labelKey: 'harvester.loadBalancer.ipam.label', + value: 'ipamDisplay', + }, + AGE + ]); + + configureType(HCI.IP_POOL, { + location: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.IP_POOL } + }, + }); + virtualType({ + labelKey: 'harvester.ipPool.label', + name: HCI.IP_POOL, + namespaced: false, + weight: 184, + route: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.IP_POOL } + }, + exact: false, + ifHaveType: HCI.IP_POOL, + }); + headers(HCI.IP_POOL, IP_POOL_HEADERS); } diff --git a/pkg/harvester/promptRemove/kubevirt.io.virtualmachine.vue b/pkg/harvester/promptRemove/kubevirt.io.virtualmachine.vue new file mode 100644 index 00000000..53ba008c --- /dev/null +++ b/pkg/harvester/promptRemove/kubevirt.io.virtualmachine.vue @@ -0,0 +1,164 @@ + + + diff --git a/pkg/harvester/routing/extension-routing.js b/pkg/harvester/routing/extension-routing.js deleted file mode 100644 index befe07f2..00000000 --- a/pkg/harvester/routing/extension-routing.js +++ /dev/null @@ -1,19 +0,0 @@ -// Don't forget to create a VueJS page called index.vue in the /pages folder!!! -import Dashboard from '../pages/index.vue'; -import Home from '../list/harvesterhci.io.dashboard.vue'; -import { PRODUCT_NAME, BLANK_CLUSTER } from '../config/harvester'; - -const routes = [ - { - name: `${ PRODUCT_NAME }-c-cluster`, - path: `/${ PRODUCT_NAME }/c/:cluster`, - component: Home, - meta: { - product: PRODUCT_NAME, - cluster: BLANK_CLUSTER, - pkg: PRODUCT_NAME - } - } -]; - -export default routes; diff --git a/pkg/harvester/routing/harvester-routing.ts b/pkg/harvester/routing/harvester-routing.ts new file mode 100644 index 00000000..a5adb39b --- /dev/null +++ b/pkg/harvester/routing/harvester-routing.ts @@ -0,0 +1,82 @@ +// import { RouteConfig } from 'vue-router'; +import { PRODUCT_NAME } from '../config/harvester'; + +import Root from '../pages/c/_cluster/index.vue'; +import HarvesterSupport from '../pages/c/_cluster/support/index.vue'; +import HarvesterConsoleSerial from '../pages/c/_cluster/console/_uid/serial.vue'; +import HarvesterConsoleVnc from '../pages/c/_cluster/console/_uid/vnc.vue'; +import ListHarvesterResource from '../pages/c/_cluster/_resource/index.vue'; +import HarvesterBrand from '../pages/c/_cluster/brand/index.vue'; +import CreateHarvesterResource from '../pages/c/_cluster/_resource/create.vue'; +import ViewHarvesterResource from '../pages/c/_cluster/_resource/_id.vue'; +import ViewHarvesterNsResource from '../pages/c/_cluster/_resource/_namespace/_id.vue'; +import HarvesterAirgapUpdgrade from '../pages/c/_cluster/airgapupgrade/index.vue'; +import HarvesterMembers from '../pages/c/_cluster/members/index.vue'; +import ProjectNamespaces from '../pages/c/_cluster/projectsnamespaces.vue'; +import HarvesterAlertmanagerReceiver from '../pages/c/_cluster/alertmanagerconfig/_alertmanagerconfigid/receiver.vue'; + +const routes: any[] = [ + { + name: `${ PRODUCT_NAME }-c-cluster-support`, + path: `/:product/c/:cluster/support`, + component: HarvesterSupport, + }, + { + name: `${ PRODUCT_NAME }-c-cluster-console-uid-serial`, + path: `/:product/c/:cluster/console/:uid/serial`, + component: HarvesterConsoleSerial, + }, + { + name: `${ PRODUCT_NAME }-c-cluster-console-uid-vnc`, + path: `/:product/c/:cluster/console/:uid/vnc`, + component: HarvesterConsoleVnc, + }, + { + name: `${ PRODUCT_NAME }-c-cluster-airgapupgrade`, + path: `/:product/c/:cluster/airgapupgrade`, + component: HarvesterAirgapUpdgrade, + }, + { + name: `${ PRODUCT_NAME }-c-cluster-brand`, + path: `/:product/c/:cluster/brand`, + component: HarvesterBrand, + }, + { + name: `${ PRODUCT_NAME }-c-cluster-alertmanagerconfig-alertmanagerconfigid-receiver`, + path: `/:product/c/:cluster/alertmanagerconfig/:alertmanagerconfigid/receiver`, + component: HarvesterAlertmanagerReceiver, + }, + { + name: `${ PRODUCT_NAME }-c-cluster-members`, + path: `/:product/c/:cluster/members`, + component: HarvesterMembers, + }, + { + name: `${ PRODUCT_NAME }-c-cluster`, + path: `/:product/c/:cluster`, + component: Root, + }, { + name: `${ PRODUCT_NAME }-c-cluster-projectsnamespaces`, + path: `/:product/c/:cluster/projectsnamespaces`, + component: ProjectNamespaces, + }, { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + path: `/:product/c/:cluster/:resource`, + component: ListHarvesterResource, + }, { + name: `${ PRODUCT_NAME }-c-cluster-resource-create`, + path: `/:product/c/:cluster/:resource/create`, + component: CreateHarvesterResource, + }, { + name: `${ PRODUCT_NAME }-c-cluster-resource-id`, + path: `/:product/c/:cluster/:resource/:id`, + component: ViewHarvesterResource, + }, { + name: `${ PRODUCT_NAME }-c-cluster-resource-namespace-id`, + path: `/:product/c/:cluster/:resource/:namespace/:id`, + component: ViewHarvesterNsResource, + }, + +]; + +export default routes; diff --git a/pkg/harvester/types.ts b/pkg/harvester/types.ts index 70910b38..6638cacc 100644 --- a/pkg/harvester/types.ts +++ b/pkg/harvester/types.ts @@ -35,6 +35,8 @@ export const HCI = { PCI_DEVICE: 'devices.harvesterhci.io.pcidevice', PCI_CLAIM: 'devices.harvesterhci.io.pcideviceclaim', SR_IOV: 'devices.harvesterhci.io.sriovnetworkdevice', + VGPU_DEVICE: 'devices.harvesterhci.io.vgpudevice', + SR_IOVGPU_DEVICE: 'devices.harvesterhci.io.sriovgpudevice', VLAN_CONFIG: 'network.harvesterhci.io.vlanconfig', VLAN_STATUS: 'network.harvesterhci.io.vlanstatus', ADD_ONS: 'harvesterhci.io.addon', diff --git a/pkg/harvester/utils/promise.js b/pkg/harvester/utils/promise.js new file mode 100644 index 00000000..62a89390 --- /dev/null +++ b/pkg/harvester/utils/promise.js @@ -0,0 +1,18 @@ +export function allSettled(hash) { + const keys = Object.keys(hash); + const promises = Object.values(hash); + + return Promise.allSettled(promises).then((res) => { + const out = {}; + + for ( let i = 0 ; i < keys.length ; i++ ) { + if (res[i].status === 'fulfilled') { + out[keys[i]] = res[i].value; + } else { + out[keys[i]] = []; + } + } + + return out; + }); +} diff --git a/pkg/harvester/utils/regular.js b/pkg/harvester/utils/regular.js new file mode 100644 index 00000000..d060d486 --- /dev/null +++ b/pkg/harvester/utils/regular.js @@ -0,0 +1,14 @@ + +export function isValidMac(value) { + return /^[A-Fa-f0-9]{2}(-[A-Fa-f0-9]{2}){5}$|^[A-Fa-f0-9]{2}(:[A-Fa-f0-9]{2}){5}$/.test(value); +} + +/** + * RFC 1123 + * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-label-names + */ +export function isValidDNSLabelName(str) { + const reg = /^[a-z0-9]([-a-z0-9]*[a-z0-9])?$/; + + return reg.test(str); +} diff --git a/pkg/harvester/utils/vm.js b/pkg/harvester/utils/vm.js new file mode 100644 index 00000000..ca7d6fbc --- /dev/null +++ b/pkg/harvester/utils/vm.js @@ -0,0 +1,11 @@ +import { HCI as HCI_ANNOTATIONS } from '@pkg/harvester/config/labels-annotations'; + +export function parseVolumeClaimTemplates(data) { + let out = []; + + try { + out = JSON.parse(data?.metadata?.annotations?.[HCI_ANNOTATIONS.VOLUME_CLAIM_TEMPLATE]) || []; + } catch (e) {} + + return out; +} diff --git a/pkg/harvester/validators/vm.js b/pkg/harvester/validators/vm.js index c1ded608..7dd7b44a 100644 --- a/pkg/harvester/validators/vm.js +++ b/pkg/harvester/validators/vm.js @@ -87,7 +87,7 @@ export function vmDisks(spec, getters, errors, validatorArgs, displayKey, value) errors.push(getters['i18n/t']('harvester.validation.generic.tabError', { prefix, message })); } - if (typeValue?.spec?.resources?.requests?.storage && !/^([1-9][0-9]{0,8})[a-zA-Z]+$/.test(typeValue?.spec?.resources?.requests?.storage)) { + if (typeValue?.spec?.resources?.requests?.storage && !/^([0-9][0-9]{0,8})[a-zA-Z]+$/.test(typeValue?.spec?.resources?.requests?.storage)) { const message = getters['i18n/t']('harvester.validation.generic.maximumSize', { max: '999999999 GiB' }); errors.push(getters['i18n/t']('harvester.validation.generic.tabError', { prefix, message })); diff --git a/pkg/harvester/validators/volume.js b/pkg/harvester/validators/volume.js index 24c885bf..2f75bc27 100644 --- a/pkg/harvester/validators/volume.js +++ b/pkg/harvester/validators/volume.js @@ -1,5 +1,11 @@ export function volumeSize(size, getters, errors, validatorArgs, displayKey, value) { - if (!/^([1-9][0-9]{0,8})[a-zA-Z]+$/.test(size)) { + if (!size) { + const key = getters['i18n/t']('harvester.volume.size'); + + errors.push(getters['i18n/t']('validation.required', { key })); + } + + if (size && !/^([0-9][0-9]{0,8})[a-zA-Z]+$/.test(size)) { const message = getters['i18n/t']('harvester.validation.generic.maximumSize', { max: '999999999 GiB' }); errors.push(message);