fix(striker-ui): remove MTU from manifest forms

main^2
Tsu-ba-me 6 months ago
parent f5351cb50c
commit 9f888fbe27
  1. 2
      striker-ui/components/ManageManifest/AddManifestInputGroup.tsx
  2. 44
      striker-ui/components/ManageManifest/AnNetworkConfigInputGroup.tsx
  3. 2
      striker-ui/components/ManageManifest/EditManifestInputGroup.tsx
  4. 7
      striker-ui/components/ManageManifest/ManageManifestPanel.tsx
  5. 8
      striker-ui/components/ManageManifest/RunManifestInputGroup.tsx
  6. 2
      striker-ui/types/ManageManifest.d.ts

@ -8,7 +8,6 @@ import AnIdInputGroup, {
} from './AnIdInputGroup';
import AnNetworkConfigInputGroup, {
INPUT_ID_ANC_DNS,
INPUT_ID_ANC_MTU,
INPUT_ID_ANC_NTP,
} from './AnNetworkConfigInputGroup';
import FlexBox from '../FlexBox';
@ -41,7 +40,6 @@ const AddManifestInputGroup = <
| typeof INPUT_ID_AI_PREFIX
| typeof INPUT_ID_AI_SEQUENCE
| typeof INPUT_ID_ANC_DNS
| typeof INPUT_ID_ANC_MTU
| typeof INPUT_ID_ANC_NTP]: string;
},
>({

@ -10,21 +10,16 @@ import Grid from '../Grid';
import IconButton from '../IconButton';
import InputWithRef from '../InputWithRef';
import OutlinedInputWithLabel from '../OutlinedInputWithLabel';
import {
buildIpCsvTestBatch,
buildNumberTestBatch,
} from '../../lib/test_input';
import { buildIpCsvTestBatch } from '../../lib/test_input';
const INPUT_ID_PREFIX_AN_NETWORK_CONFIG = 'an-network-config-input';
const INPUT_CELL_ID_PREFIX_ANC = `${INPUT_ID_PREFIX_AN_NETWORK_CONFIG}-cell`;
const INPUT_ID_ANC_DNS = `${INPUT_ID_PREFIX_AN_NETWORK_CONFIG}-dns`;
const INPUT_ID_ANC_MTU = `${INPUT_ID_PREFIX_AN_NETWORK_CONFIG}-mtu`;
const INPUT_ID_ANC_NTP = `${INPUT_ID_PREFIX_AN_NETWORK_CONFIG}-ntp`;
const INPUT_LABEL_ANC_DNS = 'DNS';
const INPUT_LABEL_ANC_MTU = 'MTU';
const INPUT_LABEL_ANC_NTP = 'NTP';
const DEFAULT_DNS_CSV = '8.8.8.8,8.8.4.4';
@ -73,17 +68,13 @@ const guessNetworkMinIp = ({
const AnNetworkConfigInputGroup = <
M extends MapToInputTestID & {
[K in
| typeof INPUT_ID_ANC_DNS
| typeof INPUT_ID_ANC_MTU
| typeof INPUT_ID_ANC_NTP]: string;
[K in typeof INPUT_ID_ANC_DNS | typeof INPUT_ID_ANC_NTP]: string;
},
>({
formUtils,
networkListEntries,
previous: {
dnsCsv: previousDnsCsv = DEFAULT_DNS_CSV,
mtu: previousMtu,
ntpCsv: previousNtpCsv,
} = {},
setNetworkList,
@ -448,41 +439,12 @@ const AnNetworkConfigInputGroup = <
/>
),
},
'an-network-config-input-cell-mtu': {
children: (
<InputWithRef
input={
<OutlinedInputWithLabel
id={INPUT_ID_ANC_MTU}
inputProps={{ placeholder: '1500' }}
label={INPUT_LABEL_ANC_MTU}
value={previousMtu}
/>
}
inputTestBatch={buildNumberTestBatch(
INPUT_LABEL_ANC_MTU,
() => {
setMessage(INPUT_ID_ANC_MTU);
},
{
onFinishBatch:
buildFinishInputTestBatchFunction(INPUT_ID_ANC_MTU),
},
(message) => {
setMessage(INPUT_ID_ANC_MTU, { children: message });
},
)}
onFirstRender={buildInputFirstRenderFunction(INPUT_ID_ANC_MTU)}
valueType="number"
/>
),
},
}}
spacing="1em"
/>
);
};
export { INPUT_ID_ANC_DNS, INPUT_ID_ANC_MTU, INPUT_ID_ANC_NTP };
export { INPUT_ID_ANC_DNS, INPUT_ID_ANC_NTP };
export default AnNetworkConfigInputGroup;

@ -7,7 +7,6 @@ import {
} from './AnIdInputGroup';
import {
INPUT_ID_ANC_DNS,
INPUT_ID_ANC_MTU,
INPUT_ID_ANC_NTP,
} from './AnNetworkConfigInputGroup';
import AddManifestInputGroup from './AddManifestInputGroup';
@ -19,7 +18,6 @@ const EditManifestInputGroup = <
| typeof INPUT_ID_AI_PREFIX
| typeof INPUT_ID_AI_SEQUENCE
| typeof INPUT_ID_ANC_DNS
| typeof INPUT_ID_ANC_MTU
| typeof INPUT_ID_ANC_NTP]: string;
},
>({

@ -18,7 +18,6 @@ import {
} from './AnNetworkInputGroup';
import {
INPUT_ID_ANC_DNS,
INPUT_ID_ANC_MTU,
INPUT_ID_ANC_NTP,
} from './AnNetworkConfigInputGroup';
import api from '../../lib/api';
@ -66,14 +65,10 @@ const getFormData = (
const { value: dnsCsv } = elements.namedItem(
INPUT_ID_ANC_DNS,
) as HTMLInputElement;
const { value: rawMtu } = elements.namedItem(
INPUT_ID_ANC_MTU,
) as HTMLInputElement;
const { value: ntpCsv } = elements.namedItem(
INPUT_ID_ANC_NTP,
) as HTMLInputElement;
const mtu = Number.parseInt(rawMtu, 10);
const sequence = Number.parseInt(rawSequence, 10);
return Object.values(elements).reduce<APIBuildManifestRequestBody>(
@ -105,7 +100,6 @@ const getFormData = (
hostConfig: { hosts: {} },
networkConfig: {
dnsCsv,
mtu,
networks: {},
ntpCsv,
},
@ -193,7 +187,6 @@ const ManageManifestPanel: FC = () => {
INPUT_ID_AI_PREFIX,
INPUT_ID_AI_SEQUENCE,
INPUT_ID_ANC_DNS,
INPUT_ID_ANC_MTU,
INPUT_ID_ANC_NTP,
],
messageGroupRef,

@ -45,7 +45,7 @@ const RunManifestInputGroup = <M extends MapToInputTestID>({
const passwordRef = useRef<InputForwardedRefContent<'string'>>({});
const { hosts: initHostList = {} } = hostConfig;
const { dnsCsv, mtu, networks: initNetworkList = {}, ntpCsv } = networkConfig;
const { dnsCsv, networks: initNetworkList = {}, ntpCsv } = networkConfig;
const hostListEntries = useMemo(
() => Object.entries(initHostList),
@ -426,12 +426,6 @@ const RunManifestInputGroup = <M extends MapToInputTestID>({
'run-manifest-ntp-csv-cell': {
children: <EndMono>{ntpCsv || MANIFEST_PARAM_NONE}</EndMono>,
},
'run-manifest-mtu-cell-header': {
children: <BodyText>MTU</BodyText>,
},
'run-manifest-mtu-cell': {
children: <EndMono>{mtu}</EndMono>,
},
}}
spacing="0.4em"
/>

@ -18,8 +18,6 @@ type ManifestNetworkList = {
type ManifestNetworkConfig = {
dnsCsv: string;
/** Max Transmission Unit (MTU); unit: bytes */
mtu: number;
networks: ManifestNetworkList;
ntpCsv: string;
};

Loading…
Cancel
Save