fix(striker-ui): always show test button in init host

main
Tsu-ba-me 11 months ago
parent 6264aada30
commit 325594ef4b
  1. 15
      striker-ui/components/PrepareHostForm.tsx

@ -88,7 +88,6 @@ const PrepareHostForm: FC = () => {
useState<boolean>(true); useState<boolean>(true);
const [isShowAccessSection, setIsShowAccessSection] = const [isShowAccessSection, setIsShowAccessSection] =
useState<boolean>(false); useState<boolean>(false);
const [isShowAccessSubmit, setIsShowAccessSubmit] = useState<boolean>(true);
const [isShowOptionalSection, setIsShowOptionalSection] = const [isShowOptionalSection, setIsShowOptionalSection] =
useState<boolean>(false); useState<boolean>(false);
const [isShowRedhatPassword, setIsShowRedhatPassword] = const [isShowRedhatPassword, setIsShowRedhatPassword] =
@ -191,7 +190,6 @@ const PrepareHostForm: FC = () => {
const accessSection = useMemo( const accessSection = useMemo(
() => ( () => (
<GateForm <GateForm
allowSubmit={isShowAccessSubmit}
gridProps={{ gridProps={{
wrapperBoxProps: { wrapperBoxProps: {
sx: { sx: {
@ -205,7 +203,6 @@ const PrepareHostForm: FC = () => {
if (connectedHostIPAddress) { if (connectedHostIPAddress) {
const isIdentifierChanged = value !== connectedHostIPAddress; const isIdentifierChanged = value !== connectedHostIPAddress;
setIsShowAccessSubmit(isIdentifierChanged);
setIsShowOptionalSection(!isIdentifierChanged); setIsShowOptionalSection(!isIdentifierChanged);
setIsShowRedhatSection(!isIdentifierChanged); setIsShowRedhatSection(!isIdentifierChanged);
} }
@ -254,7 +251,6 @@ const PrepareHostForm: FC = () => {
setConnectedHostPassword(password); setConnectedHostPassword(password);
setConnectedHostUUID(hostUUID); setConnectedHostUUID(hostUUID);
setIsShowAccessSubmit(false);
setIsShowOptionalSection(true); setIsShowOptionalSection(true);
} else { } else {
setGateMessage({ setGateMessage({
@ -274,17 +270,10 @@ const PrepareHostForm: FC = () => {
}); });
}} }}
passphraseLabel="Host root password" passphraseLabel="Host root password"
submitLabel="Test access" submitLabel={`${connectedHostUUID ? 'Retest' : 'Test'} access`}
/> />
), ),
[ [connectedHostIPAddress, connectedHostUUID, isShowAccessSection, testInput],
isShowAccessSection,
isShowAccessSubmit,
connectedHostIPAddress,
setConnectedHostPassword,
setConnectedHostUUID,
testInput,
],
); );
const optionalSection = useMemo( const optionalSection = useMemo(

Loading…
Cancel
Save