|
|
@ -71,6 +71,13 @@ type FileMetadataForProvisionServer = { |
|
|
|
fileName: string; |
|
|
|
fileName: string; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type OrganizedServerMetadataForProvisionServer = Omit< |
|
|
|
|
|
|
|
ServerMetadataForProvisionServer, |
|
|
|
|
|
|
|
'serverMemory' |
|
|
|
|
|
|
|
> & { |
|
|
|
|
|
|
|
serverMemory: bigint; |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
type OrganizedStorageGroupMetadataForProvisionServer = Omit< |
|
|
|
type OrganizedStorageGroupMetadataForProvisionServer = Omit< |
|
|
|
StorageGroupMetadataForProvisionServer, |
|
|
|
StorageGroupMetadataForProvisionServer, |
|
|
|
'storageGroupSize' | 'storageGroupFree' |
|
|
|
'storageGroupSize' | 'storageGroupFree' |
|
|
@ -114,11 +121,7 @@ type OrganizedAnvilDetailMetadataForProvisionServer = Omit< |
|
|
|
hostMemory: bigint; |
|
|
|
hostMemory: bigint; |
|
|
|
} |
|
|
|
} |
|
|
|
>; |
|
|
|
>; |
|
|
|
servers: Array< |
|
|
|
servers: Array<OrganizedServerMetadataForProvisionServer>; |
|
|
|
Omit<ServerMetadataForProvisionServer, 'serverMemory'> & { |
|
|
|
|
|
|
|
serverMemory: bigint; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
>; |
|
|
|
|
|
|
|
storageGroupUUIDs: string[]; |
|
|
|
storageGroupUUIDs: string[]; |
|
|
|
storageGroups: Array<OrganizedStorageGroupMetadataForProvisionServer>; |
|
|
|
storageGroups: Array<OrganizedStorageGroupMetadataForProvisionServer>; |
|
|
|
fileUUIDs: string[]; |
|
|
|
fileUUIDs: string[]; |
|
|
@ -132,6 +135,10 @@ type FileUUIDMapToData = { |
|
|
|
[uuid: string]: FileMetadataForProvisionServer; |
|
|
|
[uuid: string]: FileMetadataForProvisionServer; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type ServerNameMapToData = { |
|
|
|
|
|
|
|
[name: string]: OrganizedServerMetadataForProvisionServer; |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
type StorageGroupUUIDMapToData = { |
|
|
|
type StorageGroupUUIDMapToData = { |
|
|
|
[uuid: string]: OrganizedStorageGroupMetadataForProvisionServer; |
|
|
|
[uuid: string]: OrganizedStorageGroupMetadataForProvisionServer; |
|
|
|
}; |
|
|
|
}; |
|
|
@ -293,6 +300,7 @@ const organizeAnvils = (data: AnvilDetailMetadataForProvisionServer[]) => { |
|
|
|
files: FileMetadataForProvisionServer[]; |
|
|
|
files: FileMetadataForProvisionServer[]; |
|
|
|
fileSelectItems: SelectItem[]; |
|
|
|
fileSelectItems: SelectItem[]; |
|
|
|
fileUUIDMapToData: FileUUIDMapToData; |
|
|
|
fileUUIDMapToData: FileUUIDMapToData; |
|
|
|
|
|
|
|
serverNameMapToData: ServerNameMapToData; |
|
|
|
storageGroups: OrganizedStorageGroupMetadataForProvisionServer[]; |
|
|
|
storageGroups: OrganizedStorageGroupMetadataForProvisionServer[]; |
|
|
|
storageGroupSelectItems: SelectItem[]; |
|
|
|
storageGroupSelectItems: SelectItem[]; |
|
|
|
storageGroupUUIDMapToData: StorageGroupUUIDMapToData; |
|
|
|
storageGroupUUIDMapToData: StorageGroupUUIDMapToData; |
|
|
@ -387,10 +395,17 @@ const organizeAnvils = (data: AnvilDetailMetadataForProvisionServer[]) => { |
|
|
|
...host, |
|
|
|
...host, |
|
|
|
hostMemory: BigInt(host.hostMemory), |
|
|
|
hostMemory: BigInt(host.hostMemory), |
|
|
|
})), |
|
|
|
})), |
|
|
|
servers: servers.map((server) => ({ |
|
|
|
servers: servers.map(({ serverMemory, serverName, ...serverRest }) => { |
|
|
|
...server, |
|
|
|
const resultServer = { |
|
|
|
serverMemory: BigInt(server.serverMemory), |
|
|
|
...serverRest, |
|
|
|
})), |
|
|
|
serverMemory: BigInt(serverMemory), |
|
|
|
|
|
|
|
serverName, |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
reduceContainer.serverNameMapToData[serverName] = resultServer; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return resultServer; |
|
|
|
|
|
|
|
}), |
|
|
|
storageGroupUUIDs: anvilStorageGroupUUIDs, |
|
|
|
storageGroupUUIDs: anvilStorageGroupUUIDs, |
|
|
|
storageGroups: anvilStorageGroups, |
|
|
|
storageGroups: anvilStorageGroups, |
|
|
|
fileUUIDs, |
|
|
|
fileUUIDs, |
|
|
@ -440,6 +455,7 @@ const organizeAnvils = (data: AnvilDetailMetadataForProvisionServer[]) => { |
|
|
|
files: [], |
|
|
|
files: [], |
|
|
|
fileSelectItems: [], |
|
|
|
fileSelectItems: [], |
|
|
|
fileUUIDMapToData: {}, |
|
|
|
fileUUIDMapToData: {}, |
|
|
|
|
|
|
|
serverNameMapToData: {}, |
|
|
|
storageGroups: [], |
|
|
|
storageGroups: [], |
|
|
|
storageGroupSelectItems: [], |
|
|
|
storageGroupSelectItems: [], |
|
|
|
storageGroupUUIDMapToData: {}, |
|
|
|
storageGroupUUIDMapToData: {}, |
|
|
@ -914,6 +930,8 @@ const ProvisionServerDialog = ({ |
|
|
|
const [fileUUIDMapToData, setFileUUIDMapToData] = useState<FileUUIDMapToData>( |
|
|
|
const [fileUUIDMapToData, setFileUUIDMapToData] = useState<FileUUIDMapToData>( |
|
|
|
{}, |
|
|
|
{}, |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
const [serverNameMapToData, setServerNameMapToData] = |
|
|
|
|
|
|
|
useState<ServerNameMapToData>({}); |
|
|
|
const [storageGroupUUIDMapToData, setStorageGroupUUIDMapToData] = |
|
|
|
const [storageGroupUUIDMapToData, setStorageGroupUUIDMapToData] = |
|
|
|
useState<StorageGroupUUIDMapToData>({}); |
|
|
|
useState<StorageGroupUUIDMapToData>({}); |
|
|
|
|
|
|
|
|
|
|
@ -1017,6 +1035,16 @@ const ProvisionServerDialog = ({ |
|
|
|
}, |
|
|
|
}, |
|
|
|
test: ({ value }) => /^[a-zA-Z0-9_-]+$/.test(value as string), |
|
|
|
test: ({ value }) => /^[a-zA-Z0-9_-]+$/.test(value as string), |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
onFailure: () => { |
|
|
|
|
|
|
|
setInputServerNameMessage({ |
|
|
|
|
|
|
|
text: `This server name already exists, please choose another name.`, |
|
|
|
|
|
|
|
type: 'warning', |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
test: ({ value }) => |
|
|
|
|
|
|
|
serverNameMapToData[value as string] === undefined, |
|
|
|
|
|
|
|
}, |
|
|
|
], |
|
|
|
], |
|
|
|
}, |
|
|
|
}, |
|
|
|
cpuCores: { |
|
|
|
cpuCores: { |
|
|
@ -1452,6 +1480,7 @@ const ProvisionServerDialog = ({ |
|
|
|
anvilUUIDMapToData: ueAnvilUUIDMapToData, |
|
|
|
anvilUUIDMapToData: ueAnvilUUIDMapToData, |
|
|
|
fileSelectItems: ueFileSelectItems, |
|
|
|
fileSelectItems: ueFileSelectItems, |
|
|
|
fileUUIDMapToData: ueFileUUIDMapToData, |
|
|
|
fileUUIDMapToData: ueFileUUIDMapToData, |
|
|
|
|
|
|
|
serverNameMapToData: ueServerNameMapToData, |
|
|
|
storageGroupSelectItems: ueStorageGroupSelectItems, |
|
|
|
storageGroupSelectItems: ueStorageGroupSelectItems, |
|
|
|
storageGroupUUIDMapToData: ueStorageGroupUUIDMapToData, |
|
|
|
storageGroupUUIDMapToData: ueStorageGroupUUIDMapToData, |
|
|
|
} = organizeAnvils(data.anvils); |
|
|
|
} = organizeAnvils(data.anvils); |
|
|
@ -1459,6 +1488,7 @@ const ProvisionServerDialog = ({ |
|
|
|
setAllAnvils(ueAllAnvils); |
|
|
|
setAllAnvils(ueAllAnvils); |
|
|
|
setAnvilUUIDMapToData(ueAnvilUUIDMapToData); |
|
|
|
setAnvilUUIDMapToData(ueAnvilUUIDMapToData); |
|
|
|
setFileUUIDMapToData(ueFileUUIDMapToData); |
|
|
|
setFileUUIDMapToData(ueFileUUIDMapToData); |
|
|
|
|
|
|
|
setServerNameMapToData(ueServerNameMapToData); |
|
|
|
setStorageGroupUUIDMapToData(ueStorageGroupUUIDMapToData); |
|
|
|
setStorageGroupUUIDMapToData(ueStorageGroupUUIDMapToData); |
|
|
|
|
|
|
|
|
|
|
|
setAnvilSelectItems(ueAnvilSelectItems); |
|
|
|
setAnvilSelectItems(ueAnvilSelectItems); |
|
|
|