|
|
@ -13,12 +13,12 @@ import { v4 as uuidv4 } from 'uuid'; |
|
|
|
|
|
|
|
|
|
|
|
import { BLUE, RED, TEXT } from '../lib/consts/DEFAULT_THEME'; |
|
|
|
import { BLUE, RED, TEXT } from '../lib/consts/DEFAULT_THEME'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import api from '../lib/api'; |
|
|
|
import Autocomplete from './Autocomplete'; |
|
|
|
import Autocomplete from './Autocomplete'; |
|
|
|
import ConfirmDialog from './ConfirmDialog'; |
|
|
|
import ConfirmDialog from './ConfirmDialog'; |
|
|
|
import ContainedButton from './ContainedButton'; |
|
|
|
import ContainedButton from './ContainedButton'; |
|
|
|
import { dsize, dsizeToByte } from '../lib/format_data_size_wrappers'; |
|
|
|
import { dsize, dsizeToByte } from '../lib/format_data_size_wrappers'; |
|
|
|
import IconButton, { IconButtonProps } from './IconButton'; |
|
|
|
import IconButton, { IconButtonProps } from './IconButton'; |
|
|
|
import mainAxiosInstance from '../lib/singletons/mainAxiosInstance'; |
|
|
|
|
|
|
|
import MessageBox, { MessageBoxProps } from './MessageBox'; |
|
|
|
import MessageBox, { MessageBoxProps } from './MessageBox'; |
|
|
|
import OutlinedInputWithLabel from './OutlinedInputWithLabel'; |
|
|
|
import OutlinedInputWithLabel from './OutlinedInputWithLabel'; |
|
|
|
import OutlinedLabeledInputWithSelect from './OutlinedLabeledInputWithSelect'; |
|
|
|
import OutlinedLabeledInputWithSelect from './OutlinedLabeledInputWithSelect'; |
|
|
@ -1462,16 +1462,14 @@ const ProvisionServerDialog = ({ |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
mainAxiosInstance |
|
|
|
api |
|
|
|
.get('/anvil', { |
|
|
|
.get('/anvil', { |
|
|
|
params: { |
|
|
|
params: { |
|
|
|
anvilUUIDs: 'all', |
|
|
|
anvilUUIDs: 'all', |
|
|
|
isForProvisionServer: true, |
|
|
|
isForProvisionServer: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}) |
|
|
|
}) |
|
|
|
.then(({ data: stringData }) => { |
|
|
|
.then(({ data }) => { |
|
|
|
const data = JSON.parse(stringData); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { |
|
|
|
const { |
|
|
|
anvils: ueAllAnvils, |
|
|
|
anvils: ueAllAnvils, |
|
|
|
anvilSelectItems: ueAnvilSelectItems, |
|
|
|
anvilSelectItems: ueAnvilSelectItems, |
|
|
@ -1787,7 +1785,7 @@ const ProvisionServerDialog = ({ |
|
|
|
setIsOpenProvisionConfirmDialog(false); |
|
|
|
setIsOpenProvisionConfirmDialog(false); |
|
|
|
}} |
|
|
|
}} |
|
|
|
onProceedAppend={() => { |
|
|
|
onProceedAppend={() => { |
|
|
|
const requestBody = JSON.stringify({ |
|
|
|
const requestBody = { |
|
|
|
serverName: inputServerNameValue, |
|
|
|
serverName: inputServerNameValue, |
|
|
|
cpuCores: inputCPUCoresValue, |
|
|
|
cpuCores: inputCPUCoresValue, |
|
|
|
memory: memory.toString(), |
|
|
|
memory: memory.toString(), |
|
|
@ -1799,18 +1797,14 @@ const ProvisionServerDialog = ({ |
|
|
|
driverISOFileUUID: inputDriverISOFileUUID, |
|
|
|
driverISOFileUUID: inputDriverISOFileUUID, |
|
|
|
anvilUUID: inputAnvilValue, |
|
|
|
anvilUUID: inputAnvilValue, |
|
|
|
optimizeForOS: inputOptimizeForOSValue?.key, |
|
|
|
optimizeForOS: inputOptimizeForOSValue?.key, |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
setIsProvisionRequestInProgress(true); |
|
|
|
setIsProvisionRequestInProgress(true); |
|
|
|
|
|
|
|
|
|
|
|
mainAxiosInstance |
|
|
|
api.post('/server', requestBody).then(() => { |
|
|
|
.post('/server', requestBody, { |
|
|
|
setIsProvisionRequestInProgress(false); |
|
|
|
headers: { 'Content-Type': 'application/json' }, |
|
|
|
setSuccessfulProvisionCount(successfulProvisionCount + 1); |
|
|
|
}) |
|
|
|
}); |
|
|
|
.then(() => { |
|
|
|
|
|
|
|
setIsProvisionRequestInProgress(false); |
|
|
|
|
|
|
|
setSuccessfulProvisionCount(successfulProvisionCount + 1); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setIsOpenProvisionConfirmDialog(false); |
|
|
|
setIsOpenProvisionConfirmDialog(false); |
|
|
|
}} |
|
|
|
}} |
|
|
|