feat: cloud options

This commit is contained in:
jialin
2025-09-16 11:26:17 +08:00
parent 632f206228
commit 6e5a7035c8
29 changed files with 788 additions and 276 deletions
@@ -0,0 +1,49 @@
import { FieldSchema } from '@/components/dynamic-form/config/types';
export const fields = {
volumes: {
type: 'array',
minItems: 1,
items: {
type: 'object',
properties: {
name: { type: 'string' },
size_gb: { type: 'number', unit: 'GB' },
format: { type: 'string' }
},
required: ['name', 'size_gb', 'format']
}
}
};
export const fieldConfig: Record<string, FieldSchema> = {
volumes: {
type: 'array',
title: 'Volumes',
name: 'volumes',
properties: {
name: {
name: 'name',
type: 'string',
title: 'Name',
widget: 'Input'
},
size_gb: {
name: 'size_gb',
type: 'number',
title: 'Size (GB)',
widget: 'InputNumber',
min: 0,
style: { width: 120 }
},
format: {
name: 'format',
type: 'string',
title: 'Format',
widget: 'Select',
enum: ['ext4', 'xfs', 'btrfs'],
style: { width: 150 }
}
}
}
};
@@ -155,3 +155,10 @@ export const regionList: {
{ label: 'Frankfurt', datacenter: 'Datacenter 1', value: 'fra1', icon: '🇩🇪' },
{ label: 'Sydney', datacenter: 'Datacenter 1', value: 'syd1', icon: '🇦🇺' }
];
export const CloudOptionItems = [
{
label: 'Volumes',
key: 'volumes'
}
];