fix(proxmox): align ISO frontend validation with backend
All checks were successful
Test / frontend-tests (pull_request) Successful in 1m44s
Test / frontend-typecheck (pull_request) Successful in 1m53s
PR Review Automation / review (pull_request) Successful in 6m9s
Test / rust-fmt-check (pull_request) Successful in 12m1s
Test / rust-clippy (pull_request) Successful in 13m33s
Test / rust-tests (pull_request) Successful in 15m5s
All checks were successful
Test / frontend-tests (pull_request) Successful in 1m44s
Test / frontend-typecheck (pull_request) Successful in 1m53s
PR Review Automation / review (pull_request) Successful in 6m9s
Test / rust-fmt-check (pull_request) Successful in 12m1s
Test / rust-clippy (pull_request) Successful in 13m33s
Test / rust-tests (pull_request) Successful in 15m5s
Frontend regex required a .iso suffix that the backend does not enforce. Changed from /^[a-zA-Z0-9_-]+:iso\/.+\.iso$/ to /^[a-zA-Z0-9_-]+:iso\/[^,]+$/ to match the backend rule: must start with storage:iso/ and contain no commas. Updated hint and error text accordingly.
This commit is contained in:
parent
51311b9e83
commit
e6dddc1b27
@ -70,11 +70,11 @@ export function CreateVmDialog({ isOpen, clusterId, onClose, onCreated }: Create
|
|||||||
});
|
});
|
||||||
}, [isOpen, clusterId]);
|
}, [isOpen, clusterId]);
|
||||||
|
|
||||||
const ISO_RE = /^[a-zA-Z0-9_-]+:iso\/.+\.iso$/;
|
const ISO_RE = /^[a-zA-Z0-9_-]+:iso\/[^,]+$/;
|
||||||
|
|
||||||
const validateIso = (value: string): string => {
|
const validateIso = (value: string): string => {
|
||||||
if (!value) return '';
|
if (!value) return '';
|
||||||
return ISO_RE.test(value) ? '' : "Must be in the format 'storage:iso/filename.iso'";
|
return ISO_RE.test(value) ? '' : "Must be in the format 'storage:iso/filename'";
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleIsoChange = (value: string) => {
|
const handleIsoChange = (value: string) => {
|
||||||
@ -279,7 +279,7 @@ export function CreateVmDialog({ isOpen, clusterId, onClose, onCreated }: Create
|
|||||||
{isoError ? (
|
{isoError ? (
|
||||||
<p className="text-xs text-red-500">{isoError}</p>
|
<p className="text-xs text-red-500">{isoError}</p>
|
||||||
) : (
|
) : (
|
||||||
<p className="text-xs text-muted-foreground">Format: storage:iso/filename.iso</p>
|
<p className="text-xs text-muted-foreground">Format: storage:iso/filename</p>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user