Merge pull request #588 from ylei-tsubame/issues/414-reconnect-init-host
Web UI: replace prepare host step in manage anvil node(s)main
commit
77b7f2bb37
59 changed files with 747 additions and 865 deletions
@ -0,0 +1,48 @@ |
||||
import { FC, useState } from 'react'; |
||||
|
||||
import CrudList from '../CrudList'; |
||||
import PrepareHostForm from './PrepareHostForm'; |
||||
import TestAccessForm from './TestAccessForm'; |
||||
import { BodyText } from '../Text'; |
||||
|
||||
const ManageHost: FC = () => { |
||||
const [inquireHostResponse, setInquireHostResponse] = useState< |
||||
InquireHostResponse | undefined |
||||
>(); |
||||
|
||||
return ( |
||||
<CrudList<APIHostOverview, APIHostDetail> |
||||
addHeader="Initialize host" |
||||
editHeader="" |
||||
entriesUrl="/host?types=dr,node" |
||||
entryUrlPrefix="/host" |
||||
getDeleteErrorMessage={(children, ...rest) => ({ |
||||
...rest, |
||||
children: <>Failed to delete host(s). {children}</>, |
||||
})} |
||||
getDeleteHeader={(count) => `Delete the following ${count} host(s)?`} |
||||
getDeleteSuccessMessage={() => ({ |
||||
children: <>Successfully deleted host(s)</>, |
||||
})} |
||||
listEmpty="No host(s) found" |
||||
listProps={{ allowAddItem: true, allowEdit: false }} |
||||
renderAddForm={(tools) => ( |
||||
<> |
||||
<TestAccessForm setResponse={setInquireHostResponse} /> |
||||
{inquireHostResponse && ( |
||||
<PrepareHostForm host={inquireHostResponse} tools={tools} /> |
||||
)} |
||||
</> |
||||
)} |
||||
renderDeleteItem={(hosts, { key }) => { |
||||
const host = hosts?.[key]; |
||||
|
||||
return <BodyText>{host?.shortHostName}</BodyText>; |
||||
}} |
||||
renderEditForm={() => <></>} |
||||
renderListItem={(uuid, { hostName }) => <BodyText>{hostName}</BodyText>} |
||||
/> |
||||
); |
||||
}; |
||||
|
||||
export default ManageHost; |
@ -0,0 +1,228 @@ |
||||
import { Grid } from '@mui/material'; |
||||
import { FC, useMemo } from 'react'; |
||||
|
||||
import ActionGroup from '../ActionGroup'; |
||||
import api from '../../lib/api'; |
||||
import FormSummary from '../FormSummary'; |
||||
import handleAPIError from '../../lib/handleAPIError'; |
||||
import MessageGroup from '../MessageGroup'; |
||||
import OutlinedInputWithLabel from '../OutlinedInputWithLabel'; |
||||
import RadioGroupWithLabel from '../RadioGroupWithLabel'; |
||||
import schema from './schema'; |
||||
import UncontrolledInput from '../UncontrolledInput'; |
||||
import useFormikUtils from '../../hooks/useFormikUtils'; |
||||
|
||||
const HOST_TYPE_OPTIONS: RadioItemList = { |
||||
subnode: { label: 'Subnode', value: 'subnode' }, |
||||
dr: { label: 'Disaster Recovery (DR) host', value: 'dr' }, |
||||
}; |
||||
|
||||
const PrepareHostForm: FC<PreapreHostFormProps> = (props) => { |
||||
const { host, tools } = props; |
||||
|
||||
const { disabledSubmit, formik, formikErrors, handleChange } = |
||||
useFormikUtils<PrepareHostFormikValues>({ |
||||
initialValues: { |
||||
ip: host.hostIpAddress, |
||||
name: host.hostName, |
||||
password: host.hostPassword, |
||||
type: '', |
||||
uuid: host.hostUUID, |
||||
}, |
||||
onSubmit: (values, { setSubmitting }) => { |
||||
const { |
||||
enterpriseKey, |
||||
ip, |
||||
name, |
||||
password, |
||||
type, |
||||
uuid, |
||||
redhatPassword, |
||||
redhatUsername, |
||||
} = values; |
||||
|
||||
tools.confirm.prepare({ |
||||
actionProceedText: 'Prepare', |
||||
content: <FormSummary entries={values} hasPassword />, |
||||
onCancelAppend: () => setSubmitting(false), |
||||
onProceedAppend: () => { |
||||
tools.confirm.loading(true); |
||||
|
||||
api |
||||
.put('/host/prepare', { |
||||
enterpriseUUID: enterpriseKey, |
||||
hostIPAddress: ip, |
||||
hostName: name, |
||||
hostPassword: password, |
||||
hostType: type === 'subnode' ? 'node' : type, |
||||
hostUUID: uuid, |
||||
redhatPassword, |
||||
redhatUser: redhatUsername, |
||||
}) |
||||
.then(() => { |
||||
tools.confirm.finish('Success', { |
||||
children: <>Started job to prepare host at {ip}.</>, |
||||
}); |
||||
|
||||
tools.add.open(false); |
||||
}) |
||||
.catch((error) => { |
||||
const emsg = handleAPIError(error); |
||||
|
||||
emsg.children = ( |
||||
<> |
||||
Failed to prepare host at {ip}. {emsg.children} |
||||
</> |
||||
); |
||||
|
||||
tools.confirm.finish('Error', emsg); |
||||
|
||||
setSubmitting(false); |
||||
}); |
||||
}, |
||||
titleText: `Prepare host at ${values.ip} with the following?`, |
||||
}); |
||||
|
||||
tools.confirm.open(); |
||||
}, |
||||
validationSchema: schema, |
||||
}); |
||||
|
||||
const enterpriseKeyChain = useMemo<string>(() => 'enterpriseKey', []); |
||||
const nameChain = useMemo<string>(() => 'name', []); |
||||
const redhatConfirmPasswordChain = useMemo<string>( |
||||
() => 'redhatConfirmPassword', |
||||
[], |
||||
); |
||||
const redhatPasswordChain = useMemo<string>(() => 'redhatPassword', []); |
||||
const redhatUsernameChain = useMemo<string>(() => 'redhatUsername', []); |
||||
const typeChain = useMemo<string>(() => 'type', []); |
||||
|
||||
const showRedhatSection = useMemo<boolean>( |
||||
() => |
||||
host.isInetConnected && /rhel/i.test(host.hostOS) && !host.isOSRegistered, |
||||
[host.hostOS, host.isInetConnected, host.isOSRegistered], |
||||
); |
||||
|
||||
return ( |
||||
<Grid |
||||
columns={{ xs: 1, sm: 2 }} |
||||
component="form" |
||||
container |
||||
onSubmit={(event) => { |
||||
event.preventDefault(); |
||||
|
||||
formik.submitForm(); |
||||
}} |
||||
spacing="1em" |
||||
> |
||||
<Grid item width="100%"> |
||||
<UncontrolledInput |
||||
input={ |
||||
<RadioGroupWithLabel |
||||
id={typeChain} |
||||
label="Host type" |
||||
name={typeChain} |
||||
onChange={handleChange} |
||||
radioItems={HOST_TYPE_OPTIONS} |
||||
value={formik.values.type} |
||||
/> |
||||
} |
||||
/> |
||||
</Grid> |
||||
<Grid item xs={1}> |
||||
<UncontrolledInput |
||||
input={ |
||||
<OutlinedInputWithLabel |
||||
id={nameChain} |
||||
label="Host name" |
||||
name={nameChain} |
||||
onChange={handleChange} |
||||
required |
||||
value={formik.values.name} |
||||
/> |
||||
} |
||||
/> |
||||
</Grid> |
||||
<Grid item xs={1}> |
||||
<UncontrolledInput |
||||
input={ |
||||
<OutlinedInputWithLabel |
||||
id={enterpriseKeyChain} |
||||
label="Alteeve enterprise key" |
||||
name={enterpriseKeyChain} |
||||
onChange={handleChange} |
||||
value={formik.values.enterpriseKey} |
||||
/> |
||||
} |
||||
/> |
||||
</Grid> |
||||
{showRedhatSection && ( |
||||
<> |
||||
<Grid item xs={1}> |
||||
<UncontrolledInput |
||||
input={ |
||||
<OutlinedInputWithLabel |
||||
disableAutofill |
||||
id={redhatUsernameChain} |
||||
label="RedHat username" |
||||
name={redhatUsernameChain} |
||||
onChange={handleChange} |
||||
value={formik.values.redhatUsername} |
||||
/> |
||||
} |
||||
/> |
||||
</Grid> |
||||
<Grid item xs={1}> |
||||
<UncontrolledInput |
||||
input={ |
||||
<OutlinedInputWithLabel |
||||
disableAutofill |
||||
id={redhatPasswordChain} |
||||
label="RedHat password" |
||||
name={redhatPasswordChain} |
||||
onChange={handleChange} |
||||
type="password" |
||||
value={formik.values.redhatPassword} |
||||
/> |
||||
} |
||||
/> |
||||
</Grid> |
||||
<Grid display={{ xs: 'none', sm: 'initial' }} item sm={1} /> |
||||
<Grid item xs={1}> |
||||
<UncontrolledInput |
||||
input={ |
||||
<OutlinedInputWithLabel |
||||
disableAutofill |
||||
id={redhatConfirmPasswordChain} |
||||
label="Confirm RedHat password" |
||||
name={redhatConfirmPasswordChain} |
||||
onChange={handleChange} |
||||
type="password" |
||||
value={formik.values.redhatConfirmPassword} |
||||
/> |
||||
} |
||||
/> |
||||
</Grid> |
||||
</> |
||||
)} |
||||
<Grid item width="100%"> |
||||
<MessageGroup count={1} messages={formikErrors} /> |
||||
</Grid> |
||||
<Grid item width="100%"> |
||||
<ActionGroup |
||||
actions={[ |
||||
{ |
||||
background: 'blue', |
||||
children: 'Prepare host', |
||||
disabled: disabledSubmit, |
||||
type: 'submit', |
||||
}, |
||||
]} |
||||
/> |
||||
</Grid> |
||||
</Grid> |
||||
); |
||||
}; |
||||
|
||||
export default PrepareHostForm; |
@ -0,0 +1,149 @@ |
||||
import { FC, useCallback, useMemo, useRef, useState } from 'react'; |
||||
import { Grid } from '@mui/material'; |
||||
|
||||
import ActionGroup from '../ActionGroup'; |
||||
import api from '../../lib/api'; |
||||
import handleAPIError from '../../lib/handleAPIError'; |
||||
import MessageGroup, { MessageGroupForwardedRefContent } from '../MessageGroup'; |
||||
import OutlinedInputWithLabel from '../OutlinedInputWithLabel'; |
||||
import UncontrolledInput from '../UncontrolledInput'; |
||||
import useFormikUtils from '../../hooks/useFormikUtils'; |
||||
import Spinner from '../Spinner'; |
||||
import schema from './testAccessSchema'; |
||||
|
||||
const TestAccessForm: FC<TestAccessFormProps> = (props) => { |
||||
const { setResponse } = props; |
||||
|
||||
const messageGroupRef = useRef<MessageGroupForwardedRefContent>(null); |
||||
|
||||
const [loadingInquiry, setLoadingInquiry] = useState<boolean>(false); |
||||
|
||||
const setApiMessage = useCallback( |
||||
(message?: Message) => |
||||
messageGroupRef?.current?.setMessage?.call(null, 'api', message), |
||||
[], |
||||
); |
||||
|
||||
const { disabledSubmit, formik, formikErrors, handleChange } = |
||||
useFormikUtils<TestAccessFormikValues>({ |
||||
initialValues: { |
||||
ip: '', |
||||
password: '', |
||||
}, |
||||
onSubmit: (values, { setSubmitting }) => { |
||||
setLoadingInquiry(true); |
||||
setResponse(undefined); |
||||
|
||||
const { ip, password } = values; |
||||
|
||||
api |
||||
.put<APICommandInquireHostResponseBody>('/command/inquire-host', { |
||||
ipAddress: ip, |
||||
password, |
||||
}) |
||||
.then(({ data }) => { |
||||
setResponse({ |
||||
...data, |
||||
hostIpAddress: ip, |
||||
hostPassword: password, |
||||
}); |
||||
|
||||
setApiMessage(); |
||||
}) |
||||
.catch((error) => { |
||||
const emsg = handleAPIError(error); |
||||
|
||||
emsg.children = ( |
||||
<> |
||||
Failed to access {ip}. {emsg.children} |
||||
</> |
||||
); |
||||
|
||||
setApiMessage(emsg); |
||||
}) |
||||
.finally(() => { |
||||
setSubmitting(false); |
||||
setLoadingInquiry(false); |
||||
}); |
||||
}, |
||||
validationSchema: schema, |
||||
}); |
||||
|
||||
const ipChain = useMemo<string>(() => 'ip', []); |
||||
const passwordChain = useMemo<string>(() => 'password', []); |
||||
|
||||
return ( |
||||
<Grid |
||||
component="form" |
||||
container |
||||
columns={{ xs: 1, sm: 2 }} |
||||
onSubmit={(event) => { |
||||
event.preventDefault(); |
||||
|
||||
formik.submitForm(); |
||||
}} |
||||
spacing="1em" |
||||
> |
||||
<Grid item xs={1}> |
||||
<UncontrolledInput |
||||
input={ |
||||
<OutlinedInputWithLabel |
||||
disableAutofill |
||||
id={ipChain} |
||||
label="IP address" |
||||
name={ipChain} |
||||
onChange={handleChange} |
||||
required |
||||
value={formik.values.ip} |
||||
/> |
||||
} |
||||
/> |
||||
</Grid> |
||||
<Grid item xs={1}> |
||||
<UncontrolledInput |
||||
input={ |
||||
<OutlinedInputWithLabel |
||||
disableAutofill |
||||
id={passwordChain} |
||||
label="Password" |
||||
name={passwordChain} |
||||
onChange={handleChange} |
||||
required |
||||
type="password" |
||||
value={formik.values.password} |
||||
/> |
||||
} |
||||
/> |
||||
</Grid> |
||||
{loadingInquiry ? ( |
||||
<Grid item width="100%"> |
||||
<Spinner /> |
||||
</Grid> |
||||
) : ( |
||||
<> |
||||
<Grid item width="100%"> |
||||
<MessageGroup |
||||
count={1} |
||||
messages={formikErrors} |
||||
ref={messageGroupRef} |
||||
/> |
||||
</Grid> |
||||
<Grid item width="100%"> |
||||
<ActionGroup |
||||
actions={[ |
||||
{ |
||||
background: 'blue', |
||||
children: 'Test access', |
||||
disabled: disabledSubmit, |
||||
type: 'submit', |
||||
}, |
||||
]} |
||||
/> |
||||
</Grid> |
||||
</> |
||||
)} |
||||
</Grid> |
||||
); |
||||
}; |
||||
|
||||
export default TestAccessForm; |
@ -0,0 +1,4 @@ |
||||
import ManageHost from './ManageHost'; |
||||
import PrepareHostForm from './PrepareHostForm'; |
||||
|
||||
export { ManageHost, PrepareHostForm }; |
@ -0,0 +1,35 @@ |
||||
import * as yup from 'yup'; |
||||
|
||||
import { REP_IPV4 } from '../../lib/consts/REG_EXP_PATTERNS'; |
||||
|
||||
const schema = yup.object().shape( |
||||
{ |
||||
enterpriseKey: yup.string().uuid().optional(), |
||||
ip: yup.string().matches(REP_IPV4, { |
||||
message: 'Expected IP address to be a valid IPv4 address.', |
||||
}), |
||||
name: yup.string().required(), |
||||
redhatConfirmPassword: yup |
||||
.string() |
||||
.when('redhatPassword', (redhatPassword, field) => |
||||
String(redhatPassword).length > 0 |
||||
? field.required().oneOf([yup.ref('redhatPassword')]) |
||||
: field.optional(), |
||||
), |
||||
redhatPassword: yup |
||||
.string() |
||||
.when('redhatUsername', (redhatUsername, field) => |
||||
String(redhatUsername).length > 0 ? field.required() : field.optional(), |
||||
), |
||||
redhatUsername: yup |
||||
.string() |
||||
.when('redhatPassword', (redhatPassword, field) => |
||||
String(redhatPassword).length > 0 ? field.required() : field.optional(), |
||||
), |
||||
type: yup.string().oneOf(['dr', 'subnode']).required(), |
||||
uuid: yup.string().uuid().required(), |
||||
}, |
||||
[['redhatUsername', 'redhatPassword']], |
||||
); |
||||
|
||||
export default schema; |
@ -0,0 +1,15 @@ |
||||
import * as yup from 'yup'; |
||||
|
||||
import { REP_IPV4 } from '../../lib/consts/REG_EXP_PATTERNS'; |
||||
|
||||
const schema = yup.object({ |
||||
ip: yup |
||||
.string() |
||||
.matches(REP_IPV4, { |
||||
message: 'Expected IP address to be a valid IPv4 address.', |
||||
}) |
||||
.required(), |
||||
password: yup.string().required(), |
||||
}); |
||||
|
||||
export default schema; |
@ -1,671 +0,0 @@ |
||||
import { |
||||
Visibility as MUIVisibilityIcon, |
||||
VisibilityOff as MUIVisibilityOffIcon, |
||||
} from '@mui/icons-material'; |
||||
import { Box as MUIBox, IconButton as MUIIconButton } from '@mui/material'; |
||||
import { FC, useCallback, useMemo, useRef, useState } from 'react'; |
||||
|
||||
import { GREY } from '../lib/consts/DEFAULT_THEME'; |
||||
import INPUT_TYPES from '../lib/consts/INPUT_TYPES'; |
||||
|
||||
import api from '../lib/api'; |
||||
import handleAPIError from '../lib/handleAPIError'; |
||||
import { |
||||
buildDomainTestBatch, |
||||
buildIPAddressTestBatch, |
||||
buildPeacefulStringTestBatch, |
||||
buildUUIDTestBatch, |
||||
createTestInputFunction, |
||||
} from '../lib/test_input'; |
||||
|
||||
import ConfirmDialog from './ConfirmDialog'; |
||||
import ContainedButton from './ContainedButton'; |
||||
import FlexBox from './FlexBox'; |
||||
import GateForm from './GateForm'; |
||||
import Grid from './Grid'; |
||||
import InputWithRef, { InputForwardedRefContent } from './InputWithRef'; |
||||
import { Message } from './MessageBox'; |
||||
import MessageGroup, { MessageGroupForwardedRefContent } from './MessageGroup'; |
||||
import OutlinedInputWithLabel from './OutlinedInputWithLabel'; |
||||
import { Panel, PanelHeader } from './Panels'; |
||||
import RadioGroupWithLabel from './RadioGroupWithLabel'; |
||||
import Spinner from './Spinner'; |
||||
import { BodyText, HeaderText, MonoText } from './Text'; |
||||
|
||||
const ENTERPRISE_KEY_LABEL = 'Alteeve enterprise key'; |
||||
const HOST_IP_LABEL = 'Host IP address'; |
||||
const HOST_NAME_LABEL = 'Host name'; |
||||
const REDHAT_PASSWORD_LABEL = 'RedHat password'; |
||||
const REDHAT_USER_LABEL = 'RedHat user'; |
||||
const SUCCESS_MESSAGE_TIMEOUT = 5000; |
||||
|
||||
const IT_IDS = { |
||||
enterpriseKey: 'enterpriseKey', |
||||
hostName: 'hostName', |
||||
redhatPassword: 'redhatPassword', |
||||
redhatUser: 'redhatUser', |
||||
}; |
||||
|
||||
const GRID_COLUMNS: Exclude<GridProps['columns'], undefined> = { |
||||
xs: 1, |
||||
sm: 2, |
||||
}; |
||||
const GRID_SPACING: Exclude<GridProps['spacing'], undefined> = '1em'; |
||||
|
||||
const PrepareHostForm: FC = () => { |
||||
const confirmDialogRef = useRef<ConfirmDialogForwardedRefContent>({}); |
||||
const inputEnterpriseKeyRef = useRef<InputForwardedRefContent<'string'>>({}); |
||||
const inputHostNameRef = useRef<InputForwardedRefContent<'string'>>({}); |
||||
const inputRedhatPassword = useRef<InputForwardedRefContent<'string'>>({}); |
||||
const inputRedhatUser = useRef<InputForwardedRefContent<'string'>>({}); |
||||
const messageGroupRef = useRef<MessageGroupForwardedRefContent>({}); |
||||
|
||||
const [confirmValues, setConfirmValues] = useState< |
||||
| { |
||||
enterpriseKey: string; |
||||
hostName: string; |
||||
redhatPassword: string; |
||||
redhatPasswordHidden: string; |
||||
redhatUser: string; |
||||
} |
||||
| undefined |
||||
>(); |
||||
const [connectedHostIPAddress, setConnectedHostIPAddress] = useState< |
||||
string | undefined |
||||
>(); |
||||
const [connectedHostPassword, setConnectedHostPassword] = useState< |
||||
string | undefined |
||||
>(); |
||||
const [connectedHostUUID, setConnectedHostUUID] = useState<string>(''); |
||||
const [inputHostType, setInputHostType] = useState<string>(''); |
||||
const [isInputEnterpriseKeyValid, setIsInputEnterpriseKeyValid] = |
||||
useState<boolean>(true); |
||||
const [isInputHostNameValid, setIsInputHostNameValid] = |
||||
useState<boolean>(false); |
||||
const [isInputRedhatPasswordValid, setIsInputRedhatPasswordValid] = |
||||
useState<boolean>(true); |
||||
const [isInputRedhatUserValid, setIsInputRedhatUserValid] = |
||||
useState<boolean>(true); |
||||
const [isShowAccessSection, setIsShowAccessSection] = |
||||
useState<boolean>(false); |
||||
const [isShowAccessSubmit, setIsShowAccessSubmit] = useState<boolean>(true); |
||||
const [isShowOptionalSection, setIsShowOptionalSection] = |
||||
useState<boolean>(false); |
||||
const [isShowRedhatPassword, setIsShowRedhatPassword] = |
||||
useState<boolean>(false); |
||||
const [isShowRedhatSection, setIsShowRedhatSection] = |
||||
useState<boolean>(false); |
||||
const [isSubmittingPrepareHost, setIsSubmittingPrepareHost] = |
||||
useState<boolean>(false); |
||||
|
||||
const setHostNameInputMessage = useCallback((message?: Message) => { |
||||
messageGroupRef.current.setMessage?.call(null, IT_IDS.hostName, message); |
||||
}, []); |
||||
const setEnterpriseKeyInputMessage = useCallback((message?: Message) => { |
||||
messageGroupRef.current.setMessage?.call( |
||||
null, |
||||
IT_IDS.enterpriseKey, |
||||
message, |
||||
); |
||||
}, []); |
||||
const setRedhatPasswordInputMessage = useCallback((message?: Message) => { |
||||
messageGroupRef.current.setMessage?.call( |
||||
null, |
||||
IT_IDS.redhatPassword, |
||||
message, |
||||
); |
||||
}, []); |
||||
const setRedhatUserInputMessage = useCallback((message?: Message) => { |
||||
messageGroupRef.current.setMessage?.call(null, IT_IDS.redhatUser, message); |
||||
}, []); |
||||
const setSubmitPrepareHostMessage = useCallback( |
||||
(message?: Message) => |
||||
messageGroupRef.current.setMessage?.call( |
||||
null, |
||||
'submitPrepareHost', |
||||
message, |
||||
), |
||||
[], |
||||
); |
||||
|
||||
const inputTests = useMemo( |
||||
() => ({ |
||||
[IT_IDS.enterpriseKey]: buildUUIDTestBatch( |
||||
ENTERPRISE_KEY_LABEL, |
||||
() => { |
||||
setEnterpriseKeyInputMessage(); |
||||
}, |
||||
undefined, |
||||
(message) => { |
||||
setEnterpriseKeyInputMessage({ children: message, type: 'warning' }); |
||||
}, |
||||
), |
||||
[IT_IDS.hostName]: buildDomainTestBatch( |
||||
HOST_NAME_LABEL, |
||||
() => { |
||||
setHostNameInputMessage(); |
||||
}, |
||||
undefined, |
||||
(message) => { |
||||
setHostNameInputMessage({ children: message, type: 'warning' }); |
||||
}, |
||||
), |
||||
[IT_IDS.redhatPassword]: buildPeacefulStringTestBatch( |
||||
REDHAT_PASSWORD_LABEL, |
||||
() => { |
||||
setRedhatPasswordInputMessage(); |
||||
}, |
||||
undefined, |
||||
(message) => { |
||||
setRedhatPasswordInputMessage({ children: message, type: 'warning' }); |
||||
}, |
||||
), |
||||
[IT_IDS.redhatUser]: buildPeacefulStringTestBatch( |
||||
REDHAT_USER_LABEL, |
||||
() => { |
||||
setRedhatUserInputMessage(); |
||||
}, |
||||
undefined, |
||||
(message) => { |
||||
setRedhatUserInputMessage({ children: message, type: 'warning' }); |
||||
}, |
||||
), |
||||
}), |
||||
[ |
||||
setEnterpriseKeyInputMessage, |
||||
setHostNameInputMessage, |
||||
setRedhatPasswordInputMessage, |
||||
setRedhatUserInputMessage, |
||||
], |
||||
); |
||||
const testInput = useMemo( |
||||
() => createTestInputFunction(inputTests), |
||||
[inputTests], |
||||
); |
||||
|
||||
const redhatElementSxDisplay = useMemo( |
||||
() => (isShowRedhatSection ? undefined : 'none'), |
||||
[isShowRedhatSection], |
||||
); |
||||
|
||||
const accessSection = useMemo( |
||||
() => ( |
||||
<GateForm |
||||
allowSubmit={isShowAccessSubmit} |
||||
gridProps={{ |
||||
wrapperBoxProps: { |
||||
sx: { |
||||
display: isShowAccessSection ? 'flex' : 'none', |
||||
}, |
||||
}, |
||||
}} |
||||
identifierInputTestBatchBuilder={buildIPAddressTestBatch} |
||||
identifierLabel={HOST_IP_LABEL} |
||||
onIdentifierBlurAppend={({ target: { value } }) => { |
||||
if (connectedHostIPAddress) { |
||||
const isIdentifierChanged = value !== connectedHostIPAddress; |
||||
|
||||
setIsShowAccessSubmit(isIdentifierChanged); |
||||
setIsShowOptionalSection(!isIdentifierChanged); |
||||
setIsShowRedhatSection(!isIdentifierChanged); |
||||
} |
||||
}} |
||||
onSubmitAppend={( |
||||
ipAddress, |
||||
password, |
||||
setGateMessage, |
||||
setGateIsSubmitting, |
||||
) => { |
||||
const body = { ipAddress, password }; |
||||
|
||||
api |
||||
.put<APICommandInquireHostResponseBody>( |
||||
'/command/inquire-host', |
||||
body, |
||||
) |
||||
.then( |
||||
({ |
||||
data: { |
||||
hostName, |
||||
hostOS, |
||||
hostUUID, |
||||
isConnected, |
||||
isInetConnected, |
||||
isOSRegistered, |
||||
}, |
||||
}) => { |
||||
if (isConnected) { |
||||
inputHostNameRef.current.setValue?.call(null, hostName); |
||||
|
||||
const valid = testInput({ |
||||
inputs: { [IT_IDS.hostName]: { value: hostName } }, |
||||
}); |
||||
setIsInputHostNameValid(valid); |
||||
|
||||
if ( |
||||
isInetConnected && |
||||
/rhel/i.test(hostOS) && |
||||
!isOSRegistered |
||||
) { |
||||
setIsShowRedhatSection(true); |
||||
} |
||||
|
||||
setConnectedHostIPAddress(ipAddress); |
||||
setConnectedHostPassword(password); |
||||
setConnectedHostUUID(hostUUID); |
||||
|
||||
setIsShowAccessSubmit(false); |
||||
setIsShowOptionalSection(true); |
||||
} else { |
||||
setGateMessage({ |
||||
children: `Failed to establish a connection with the given host credentials.`, |
||||
type: 'error', |
||||
}); |
||||
} |
||||
}, |
||||
) |
||||
.catch((apiError) => { |
||||
const emsg = handleAPIError(apiError); |
||||
|
||||
setGateMessage?.call(null, emsg); |
||||
}) |
||||
.finally(() => { |
||||
setGateIsSubmitting(false); |
||||
}); |
||||
}} |
||||
passphraseLabel="Host root password" |
||||
submitLabel="Test access" |
||||
/> |
||||
), |
||||
[ |
||||
isShowAccessSection, |
||||
isShowAccessSubmit, |
||||
connectedHostIPAddress, |
||||
setConnectedHostPassword, |
||||
setConnectedHostUUID, |
||||
testInput, |
||||
], |
||||
); |
||||
|
||||
const optionalSection = useMemo( |
||||
() => ( |
||||
<Grid |
||||
columns={GRID_COLUMNS} |
||||
layout={{ |
||||
'preparehost-host-name': { |
||||
children: ( |
||||
<InputWithRef |
||||
input={ |
||||
<OutlinedInputWithLabel |
||||
formControlProps={{ sx: { width: '100%' } }} |
||||
id="preparehost-host-name-input" |
||||
inputProps={{ |
||||
onBlur: ({ target: { value } }) => { |
||||
const valid = testInput({ |
||||
inputs: { [IT_IDS.hostName]: { value } }, |
||||
}); |
||||
setIsInputHostNameValid(valid); |
||||
}, |
||||
onFocus: () => { |
||||
setHostNameInputMessage(); |
||||
}, |
||||
}} |
||||
label={HOST_NAME_LABEL} |
||||
/> |
||||
} |
||||
ref={inputHostNameRef} |
||||
/> |
||||
), |
||||
}, |
||||
'preparehost-enterprise-key': { |
||||
children: ( |
||||
<InputWithRef |
||||
input={ |
||||
<OutlinedInputWithLabel |
||||
formControlProps={{ sx: { width: '100%' } }} |
||||
id="preparehost-enterprise-key-input" |
||||
inputProps={{ |
||||
onBlur: ({ target: { value } }) => { |
||||
if (value) { |
||||
const valid = testInput({ |
||||
inputs: { [IT_IDS.enterpriseKey]: { value } }, |
||||
}); |
||||
setIsInputEnterpriseKeyValid(valid); |
||||
} |
||||
}, |
||||
onFocus: () => { |
||||
setEnterpriseKeyInputMessage(); |
||||
}, |
||||
}} |
||||
label={ENTERPRISE_KEY_LABEL} |
||||
/> |
||||
} |
||||
ref={inputEnterpriseKeyRef} |
||||
/> |
||||
), |
||||
}, |
||||
}} |
||||
spacing={GRID_SPACING} |
||||
wrapperBoxProps={{ |
||||
sx: { display: isShowOptionalSection ? undefined : 'none' }, |
||||
}} |
||||
/> |
||||
), |
||||
[ |
||||
isShowOptionalSection, |
||||
setEnterpriseKeyInputMessage, |
||||
setHostNameInputMessage, |
||||
testInput, |
||||
], |
||||
); |
||||
|
||||
const redhatSection = useMemo( |
||||
() => ( |
||||
<Grid |
||||
columns={GRID_COLUMNS} |
||||
layout={{ |
||||
'preparehost-redhat-user': { |
||||
children: ( |
||||
<InputWithRef |
||||
input={ |
||||
<OutlinedInputWithLabel |
||||
formControlProps={{ sx: { width: '100%' } }} |
||||
id="preparehost-redhat-user-input" |
||||
inputProps={{ |
||||
onBlur: ({ target: { value } }) => { |
||||
if (value) { |
||||
const valid = testInput({ |
||||
inputs: { [IT_IDS.redhatUser]: { value } }, |
||||
}); |
||||
setIsInputRedhatUserValid(valid); |
||||
} |
||||
}, |
||||
onFocus: () => { |
||||
setRedhatUserInputMessage(); |
||||
}, |
||||
}} |
||||
label={REDHAT_USER_LABEL} |
||||
/> |
||||
} |
||||
ref={inputRedhatUser} |
||||
/> |
||||
), |
||||
}, |
||||
'preparehost-redhat-password': { |
||||
children: ( |
||||
<InputWithRef |
||||
input={ |
||||
<OutlinedInputWithLabel |
||||
formControlProps={{ sx: { width: '100%' } }} |
||||
id="preparehost-redhat-password-input" |
||||
inputProps={{ |
||||
onBlur: ({ target: { value } }) => { |
||||
if (value) { |
||||
const valid = testInput({ |
||||
inputs: { [IT_IDS.redhatPassword]: { value } }, |
||||
}); |
||||
setIsInputRedhatPasswordValid(valid); |
||||
} |
||||
}, |
||||
onFocus: () => { |
||||
setRedhatPasswordInputMessage(); |
||||
}, |
||||
onPasswordVisibilityAppend: (type) => { |
||||
setIsShowRedhatPassword(type !== INPUT_TYPES.password); |
||||
}, |
||||
type: INPUT_TYPES.password, |
||||
}} |
||||
label={REDHAT_PASSWORD_LABEL} |
||||
/> |
||||
} |
||||
ref={inputRedhatPassword} |
||||
/> |
||||
), |
||||
}, |
||||
}} |
||||
spacing={GRID_SPACING} |
||||
wrapperBoxProps={{ |
||||
sx: { display: redhatElementSxDisplay }, |
||||
}} |
||||
/> |
||||
), |
||||
[ |
||||
redhatElementSxDisplay, |
||||
setRedhatPasswordInputMessage, |
||||
setRedhatUserInputMessage, |
||||
testInput, |
||||
], |
||||
); |
||||
|
||||
const messageSection = useMemo( |
||||
() => ( |
||||
<MUIBox sx={{ display: isShowOptionalSection ? undefined : 'none' }}> |
||||
<MessageGroup count={1} ref={messageGroupRef} /> |
||||
</MUIBox> |
||||
), |
||||
[isShowOptionalSection], |
||||
); |
||||
|
||||
const submitSection = useMemo( |
||||
() => |
||||
isSubmittingPrepareHost ? ( |
||||
<Spinner mt={0} /> |
||||
) : ( |
||||
<FlexBox |
||||
row |
||||
sx={{ |
||||
display: isShowOptionalSection ? 'flex' : 'none', |
||||
justifyContent: 'flex-end', |
||||
}} |
||||
> |
||||
<ContainedButton |
||||
disabled={ |
||||
!isInputHostNameValid || |
||||
!isInputEnterpriseKeyValid || |
||||
!isInputRedhatUserValid || |
||||
!isInputRedhatPasswordValid |
||||
} |
||||
onClick={() => { |
||||
const redhatPasswordInputValue = |
||||
inputRedhatPassword.current.getValue?.call(null); |
||||
|
||||
setConfirmValues({ |
||||
enterpriseKey: |
||||
inputEnterpriseKeyRef.current.getValue?.call(null) || |
||||
'none; using community version', |
||||
hostName: inputHostNameRef.current.getValue?.call(null) || '', |
||||
redhatPassword: redhatPasswordInputValue || 'none', |
||||
redhatPasswordHidden: |
||||
redhatPasswordInputValue?.replace(/./g, '*') || 'none', |
||||
redhatUser: |
||||
inputRedhatUser.current.getValue?.call(null) || 'none', |
||||
}); |
||||
setSubmitPrepareHostMessage(); |
||||
|
||||
confirmDialogRef.current.setOpen?.call(null, true); |
||||
}} |
||||
> |
||||
Prepare host |
||||
</ContainedButton> |
||||
</FlexBox> |
||||
), |
||||
[ |
||||
isInputEnterpriseKeyValid, |
||||
isInputHostNameValid, |
||||
isInputRedhatPasswordValid, |
||||
isInputRedhatUserValid, |
||||
isShowOptionalSection, |
||||
isSubmittingPrepareHost, |
||||
setSubmitPrepareHostMessage, |
||||
], |
||||
); |
||||
|
||||
return ( |
||||
<> |
||||
<Panel> |
||||
<PanelHeader> |
||||
<HeaderText>Prepare a host to include in Anvil!</HeaderText> |
||||
</PanelHeader> |
||||
<FlexBox> |
||||
<RadioGroupWithLabel |
||||
id="preparehost-host-type" |
||||
label="Host type" |
||||
onChange={(event, value) => { |
||||
setInputHostType(value); |
||||
setIsShowAccessSection(true); |
||||
}} |
||||
radioItems={{ |
||||
node: { label: 'Subnode', value: 'node' }, |
||||
dr: { label: 'Disaster Recovery (DR) host', value: 'dr' }, |
||||
}} |
||||
/> |
||||
{accessSection} |
||||
{optionalSection} |
||||
{redhatSection} |
||||
{messageSection} |
||||
{submitSection} |
||||
</FlexBox> |
||||
</Panel> |
||||
<ConfirmDialog |
||||
actionProceedText="Prepare" |
||||
closeOnProceed |
||||
content={ |
||||
<Grid |
||||
calculateItemBreakpoints={(index) => ({ |
||||
xs: index % 2 === 0 ? 1 : 2, |
||||
})} |
||||
columns={3} |
||||
layout={{ |
||||
'preparehost-confirm-host-type-label': { |
||||
children: <BodyText>Host type</BodyText>, |
||||
}, |
||||
'preparehost-confirm-host-type-value': { |
||||
children: ( |
||||
<MonoText> |
||||
{inputHostType === 'dr' |
||||
? 'Disaster Recovery (DR)' |
||||
: 'Subnode'} |
||||
</MonoText> |
||||
), |
||||
}, |
||||
'preparehost-confirm-host-name-label': { |
||||
children: <BodyText>Host name</BodyText>, |
||||
}, |
||||
'preparehost-confirm-host-name-value': { |
||||
children: <MonoText>{confirmValues?.hostName}</MonoText>, |
||||
}, |
||||
'preparehost-confirm-enterprise-key-label': { |
||||
children: <BodyText>Alteeve enterprise key</BodyText>, |
||||
}, |
||||
'preparehost-confirm-enterprise-key-value': { |
||||
children: <MonoText>{confirmValues?.enterpriseKey}</MonoText>, |
||||
}, |
||||
'preparehost-confirm-redhat-user-label': { |
||||
children: <BodyText>RedHat user</BodyText>, |
||||
sx: { display: redhatElementSxDisplay }, |
||||
}, |
||||
'preparehost-confirm-redhat-user-value': { |
||||
children: <MonoText>{confirmValues?.redhatUser}</MonoText>, |
||||
sx: { display: redhatElementSxDisplay }, |
||||
}, |
||||
'preparehost-confirm-redhat-password-label': { |
||||
children: <BodyText>RedHat password</BodyText>, |
||||
sx: { display: redhatElementSxDisplay }, |
||||
}, |
||||
'preparehost-confirm-redhat-password-value': { |
||||
children: ( |
||||
<FlexBox |
||||
row |
||||
sx={{ |
||||
height: '100%', |
||||
maxWidth: '100%', |
||||
}} |
||||
> |
||||
<MonoText |
||||
sx={{ |
||||
flexGrow: 1, |
||||
maxWidth: 'calc(100% - 3em)', |
||||
overflowX: 'scroll', |
||||
}} |
||||
> |
||||
{isShowRedhatPassword |
||||
? confirmValues?.redhatPassword |
||||
: confirmValues?.redhatPasswordHidden} |
||||
</MonoText> |
||||
<MUIIconButton |
||||
onClick={() => { |
||||
setIsShowRedhatPassword((previous) => !previous); |
||||
}} |
||||
sx={{ color: GREY, padding: 0 }} |
||||
> |
||||
{isShowRedhatPassword ? ( |
||||
<MUIVisibilityOffIcon /> |
||||
) : ( |
||||
<MUIVisibilityIcon /> |
||||
)} |
||||
</MUIIconButton> |
||||
</FlexBox> |
||||
), |
||||
sx: { display: redhatElementSxDisplay }, |
||||
}, |
||||
}} |
||||
spacing=".6em" |
||||
/> |
||||
} |
||||
onCancelAppend={() => { |
||||
setIsShowRedhatPassword(false); |
||||
}} |
||||
onProceedAppend={() => { |
||||
setIsSubmittingPrepareHost(true); |
||||
|
||||
api |
||||
.put('/host/prepare', { |
||||
enterpriseUUID: |
||||
inputEnterpriseKeyRef.current.getValue?.call(null), |
||||
hostIPAddress: connectedHostIPAddress, |
||||
hostName: inputHostNameRef.current.getValue?.call(null), |
||||
hostPassword: connectedHostPassword, |
||||
hostType: inputHostType, |
||||
hostUUID: connectedHostUUID, |
||||
redhatPassword: inputRedhatPassword.current.getValue?.call(null), |
||||
redhatUser: inputRedhatUser.current.getValue?.call(null), |
||||
}) |
||||
.then(() => { |
||||
setSubmitPrepareHostMessage({ |
||||
children: `Successfully initiated prepare host.`, |
||||
}); |
||||
|
||||
setTimeout(() => { |
||||
setSubmitPrepareHostMessage(); |
||||
}, SUCCESS_MESSAGE_TIMEOUT); |
||||
}) |
||||
.catch((error) => { |
||||
const errorMessage = handleAPIError(error, { |
||||
onResponseErrorAppend: ({ status }) => { |
||||
let result: Message | undefined; |
||||
|
||||
if (status === 400) { |
||||
result = { |
||||
children: `The API found invalid values. Did you forget to fill in one of the RedHat fields?`, |
||||
type: 'warning', |
||||
}; |
||||
} |
||||
|
||||
return result; |
||||
}, |
||||
}); |
||||
|
||||
setSubmitPrepareHostMessage(errorMessage); |
||||
}) |
||||
.finally(() => { |
||||
setIsSubmittingPrepareHost(false); |
||||
}); |
||||
}} |
||||
ref={confirmDialogRef} |
||||
titleText="Confirm host preparation" |
||||
/> |
||||
</> |
||||
); |
||||
}; |
||||
|
||||
export default PrepareHostForm; |
@ -0,0 +1,9 @@ |
||||
import { capitalize } from 'lodash'; |
||||
|
||||
const disassembleCamel = (value: string) => { |
||||
const spaced = value.replace(/([a-z\d])([A-Z])/g, '$1 $2'); |
||||
|
||||
return capitalize(spaced); |
||||
}; |
||||
|
||||
export default disassembleCamel; |
@ -1 +0,0 @@ |
||||
self.__BUILD_MANIFEST=function(s,c,a,t,e,i,n,f,b,u,k,h,j,d,g,r,l,_,o,m){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/":[s,a,t,i,n,f,u,"static/chunks/6-dbef3ba2a090cb05.js",c,e,b,k,g,r,"static/chunks/pages/index-6febd0ab3b8c828c.js"],"/_error":["static/chunks/pages/_error-a9572f84d60f21da.js"],"/anvil":[s,a,t,i,n,f,u,"static/chunks/924-2a2fdb45d3e02493.js",c,e,b,k,g,"static/chunks/pages/anvil-38307a04a51f8094.js"],"/config":[s,a,t,n,h,d,c,e,j,"static/chunks/pages/config-1c39d13147dfe819.js"],"/file-manager":[s,a,t,i,f,h,l,"static/chunks/486-1480d7483e28c6f3.js",c,e,b,_,"static/chunks/pages/file-manager-c8a2ce2c02dc39fc.js"],"/init":[s,a,i,n,f,u,d,o,c,e,b,j,m,"static/chunks/pages/init-210f96453904f447.js"],"/login":[s,a,t,n,c,e,j,"static/chunks/pages/login-5fd1d7a2717b59af.js"],"/mail-config":[s,a,t,i,n,f,u,h,l,c,e,b,k,_,"static/chunks/pages/mail-config-14cdc2dd46514057.js"],"/manage-element":[s,a,t,i,n,f,u,h,d,o,"static/chunks/569-fa9b9ac8a7639d2d.js",c,e,b,k,j,m,"static/chunks/pages/manage-element-766bd9ef38ccbfa4.js"],"/server":[s,t,i,c,r,"static/chunks/pages/server-d81577dd0b817ba2.js"],sortedPages:["/","/_app","/_error","/anvil","/config","/file-manager","/init","/login","/mail-config","/manage-element","/server"]}}("static/chunks/494-413067ecdf8ec8f0.js","static/chunks/775-3f1c58f77437bd5d.js","static/chunks/804-a6d43595270ed0d2.js","static/chunks/416-b31c470a96d10e58.js","static/chunks/675-235890fb4812bd16.js","static/chunks/50-af452066db73e3df.js","static/chunks/263-5784adae0d1d8513.js","static/chunks/213-67c4f0768a44e039.js","static/chunks/633-900b9341a6a3bc53.js","static/chunks/310-4edb13985847ab25.js","static/chunks/733-a945bbb3c5f55f74.js","static/chunks/461-c4e18a515455805e.js","static/chunks/556-dbf62d8622405edc.js","static/chunks/203-ea1ab9b7c3c7694b.js","static/chunks/750-b9b6c5fdabc264a0.js","static/chunks/302-6490e226661e8e00.js","static/chunks/264-1be1a496ee1255c6.js","static/chunks/380-0eff6addb79bd61f.js","static/chunks/197-c291e38a27168218.js","static/chunks/270-56592f453c639f63.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); |
@ -0,0 +1 @@ |
||||
self.__BUILD_MANIFEST=function(s,c,a,e,t,i,n,f,b,u,d,k,h,j,g,r,l,_,o,m){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/":[s,a,e,i,n,f,u,"static/chunks/6-dbef3ba2a090cb05.js",c,t,b,d,r,l,"static/chunks/pages/index-0e23f6af1e089a97.js"],"/_error":["static/chunks/pages/_error-a9572f84d60f21da.js"],"/anvil":[s,a,e,i,n,f,u,"static/chunks/924-2a2fdb45d3e02493.js",c,t,b,d,r,"static/chunks/pages/anvil-38307a04a51f8094.js"],"/config":[s,a,e,n,k,j,c,t,h,"static/chunks/pages/config-144ed56943e89e8c.js"],"/file-manager":[s,a,e,i,f,k,g,"static/chunks/486-45903b907cd7ece3.js",c,t,b,"static/chunks/pages/file-manager-8a23bb0baebac7f6.js"],"/init":[s,a,i,n,f,u,j,_,c,t,b,h,o,"static/chunks/pages/init-210f96453904f447.js"],"/login":[s,a,e,n,c,t,h,"static/chunks/pages/login-1d03dfaf2cb572f8.js"],"/mail-config":[s,a,e,i,n,f,u,k,g,c,t,b,d,m,"static/chunks/pages/mail-config-77c70d16ef879e90.js"],"/manage-element":[s,a,e,i,n,f,u,k,g,j,_,"static/chunks/814-6420b976d086fe20.js",c,t,b,d,h,o,m,"static/chunks/pages/manage-element-7ac129e45d98ff58.js"],"/server":[s,e,i,c,l,"static/chunks/pages/server-d81577dd0b817ba2.js"],sortedPages:["/","/_app","/_error","/anvil","/config","/file-manager","/init","/login","/mail-config","/manage-element","/server"]}}("static/chunks/494-413067ecdf8ec8f0.js","static/chunks/775-3f1c58f77437bd5d.js","static/chunks/804-a6d43595270ed0d2.js","static/chunks/416-b31c470a96d10e58.js","static/chunks/675-9a50fb0ae255b835.js","static/chunks/50-af452066db73e3df.js","static/chunks/263-5784adae0d1d8513.js","static/chunks/213-67c4f0768a44e039.js","static/chunks/633-900b9341a6a3bc53.js","static/chunks/310-4edb13985847ab25.js","static/chunks/733-a945bbb3c5f55f74.js","static/chunks/461-c4e18a515455805e.js","static/chunks/556-0c0cace3593e5307.js","static/chunks/203-ea1ab9b7c3c7694b.js","static/chunks/264-683b93ad6e70a8fb.js","static/chunks/750-9f873f4e10dbcacd.js","static/chunks/302-6490e226661e8e00.js","static/chunks/197-c291e38a27168218.js","static/chunks/270-9058c1049a825f7d.js","static/chunks/17-0593dc8fdd9c512e.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,38 @@ |
||||
type InquireHostResponse = APICommandInquireHostResponseBody & { |
||||
hostIpAddress: string; |
||||
hostPassword: string; |
||||
}; |
||||
|
||||
/** TestAccessForm */ |
||||
|
||||
type TestAccessFormikValues = { |
||||
ip: string; |
||||
password: string; |
||||
}; |
||||
|
||||
type TestAccessFormProps = { |
||||
setResponse: React.Dispatch< |
||||
React.SetStateAction<InquireHostResponse | undefined> |
||||
>; |
||||
}; |
||||
|
||||
/** PrepareHostForm */ |
||||
|
||||
/** |
||||
* @property hostType - Type of host to prepare; note that `node` is `subnode` |
||||
* due to renaming. |
||||
*/ |
||||
type PrepareHostFormikValues = TestAccessFormikValues & { |
||||
enterpriseKey?: string; |
||||
name: string; |
||||
redhatConfirmPassword?: string; |
||||
redhatPassword?: string; |
||||
redhatUsername?: string; |
||||
type: '' | 'dr' | 'subnode'; |
||||
uuid: string; |
||||
}; |
||||
|
||||
type PreapreHostFormProps = { |
||||
host: InquireHostResponse; |
||||
tools: CrudListFormTools; |
||||
}; |
Loading…
Reference in new issue