feat(xo6): add SR create form - #10251
Conversation
dadcc69 to
a0f1a4b
Compare
a0f1a4b to
8b03c27
Compare
8b03c27 to
22b1095
Compare
| <template #title>{{ t('action:create-sr') }}</template> | ||
|
|
||
| <template #content> | ||
| <NewStorageRepositoryForm ref="formRef" :pool-id="poolId" :host-id="hostId" /> |
There was a problem hiding this comment.
| <NewStorageRepositoryForm ref="formRef" :pool-id="poolId" :host-id="hostId" /> | |
| <NewStorageRepositoryForm ref="formRef" :pool-id :host-id /> |
| @@ -0,0 +1,158 @@ | |||
| <template> | |||
| <VtsForm class="new-sr-form"> | |||
There was a problem hiding this comment.
To match the component's name:
| <VtsForm class="new-sr-form"> | |
| <VtsForm class="new-storage-repository-form"> |
| "host-internal-networks": "Host internal networks", | ||
| "host-not-running": "Host not running", | ||
| "host-off": "Host is powered off", | ||
| "host-required": "@:job:arg:host-required", |
There was a problem hiding this comment.
I think it will be better to reverse the linked message:
host-required become Host is required and job:arg:host-required links to host-required
| "sr-type-ext": "ext", | ||
| "sr-type-local": "Local", | ||
| "sr-type-lvm": "LVM", | ||
| "sr-type-smb": "SMB", | ||
| "sr-type-smbiso": "SMB ISO", |
There was a problem hiding this comment.
For reusability, these keys could be:
| "sr-type-ext": "ext", | |
| "sr-type-local": "Local", | |
| "sr-type-lvm": "LVM", | |
| "sr-type-smb": "SMB", | |
| "sr-type-smbiso": "SMB ISO", | |
| "ext": "ext", | |
| "local": "Local", | |
| "lvm": "LVM", | |
| "smb": "SMB", | |
| "smb-iso": "SMB ISO", |
local already exists
| "sr-connect-info-pool-shared": "Le SR sera connecté à {hostsCount} hôtes de ce pool. | Chaque SR partagé sera connecté à tous les hôtes de ce pool.", | ||
| "sr-connect-title": "Vous êtes sur le point de connecter 1 SR | Vous êtes sur le point de connecter {n} SRs", | ||
| "sr-create-erase-confirm": "Cette opération effacera l'intégralité du disque ou de la partition ({device}) pour créer un nouveau SR. Voulez-vous vraiment continuer ?", | ||
| "sr-create-erase-confirm-title": "Créer un nouvel SR", |
There was a problem hiding this comment.
To match the other translations:
| "sr-create-erase-confirm-title": "Créer un nouvel SR", | |
| "sr-create-erase-confirm-title": "Créer un nouveau SR", |
And given the translation becomes the same as action:create-sr, what do you think of using a linked message here?
| requiredIf: withMessage( | ||
| requiredIf(() => formData.type === 'lvm' || formData.type === 'ext'), | ||
| () => t('form:error:required') | ||
| ), |
There was a problem hiding this comment.
| requiredIf: withMessage( | |
| requiredIf(() => formData.type === 'lvm' || formData.type === 'ext'), | |
| () => t('form:error:required') | |
| ), | |
| requiredIf: requiredIf(() => formData.type === 'lvm' || formData.type === 'ext'), |
| requiredIf: withMessage( | ||
| requiredIf(() => formData.type === 'local'), | ||
| () => t('form:error:required') | ||
| ), |
There was a problem hiding this comment.
| requiredIf: withMessage( | |
| requiredIf(() => formData.type === 'local'), | |
| () => t('form:error:required') | |
| ), | |
| requiredIf: requiredIf(() => formData.type === 'local'), |
| return | ||
| } | ||
|
|
||
| formData.poolId = pools.value.find(pool => pool.id === contextPoolId.value)?.id |
There was a problem hiding this comment.
You can use getPoolById:
| formData.poolId = pools.value.find(pool => pool.id === contextPoolId.value)?.id | |
| formData.poolId = getPoolById(contextPoolId.value)?.id |
| return | ||
| } | ||
|
|
||
| const masterHostId = pools.value.find(pool => pool.id === formData.poolId)?.master |
There was a problem hiding this comment.
Same here:
| const masterHostId = pools.value.find(pool => pool.id === formData.poolId)?.master | |
| const masterHostId = getPoolById(formData.poolId)?.master |
Description
[XO 6] Create SR
Added SR creation from the Host and Pool Storage tabs via a new drawer form.
Supported types for this first pass: ext, local, lvm, smb, and smbiso.
Note:
The "Create new SR" button is alone in a dropdown menu for now, but the "Attach existing SR" action will be placed there later.
Screenshots
Testing
Creation of a
localSR/test/iso(directory must exist)Erase confirm modal