mirror of
https://github.com/ansible/awx.git
synced 2026-05-21 15:57:52 -02:30
Remove 'hop' node type from Add Instance form.
This commit is contained in:
@@ -12,18 +12,8 @@ import { FormColumnLayout } from 'components/FormLayout';
|
|||||||
import FormField, { FormSubmitError } from 'components/FormField';
|
import FormField, { FormSubmitError } from 'components/FormField';
|
||||||
import FormActionGroup from 'components/FormActionGroup';
|
import FormActionGroup from 'components/FormActionGroup';
|
||||||
import { required } from 'util/validators';
|
import { required } from 'util/validators';
|
||||||
import AnsibleSelect from 'components/AnsibleSelect';
|
|
||||||
|
|
||||||
// This is hard coded because the API does not have the ability to send us a list that contains
|
|
||||||
// only the types of instances that can be added. Control and Hybrid instances cannot be added.
|
|
||||||
|
|
||||||
const INSTANCE_TYPES = [
|
|
||||||
{ id: 'execution', name: t`Execution` },
|
|
||||||
{ id: 'hop', name: t`Hop` },
|
|
||||||
];
|
|
||||||
|
|
||||||
function InstanceFormFields() {
|
function InstanceFormFields() {
|
||||||
const [instanceType, , instanceTypeHelpers] = useField('node_type');
|
|
||||||
const [enabled, , enabledHelpers] = useField('enabled');
|
const [enabled, , enabledHelpers] = useField('enabled');
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -55,27 +45,13 @@ function InstanceFormFields() {
|
|||||||
type="number"
|
type="number"
|
||||||
isRequired
|
isRequired
|
||||||
/>
|
/>
|
||||||
<FormGroup
|
<FormField
|
||||||
fieldId="instanceType"
|
id="instance-type"
|
||||||
label={t`Instance Type`}
|
label={t`Instance Type`}
|
||||||
name="type"
|
name="node_type"
|
||||||
isRequired
|
type="text"
|
||||||
validated={required(null)}
|
isDisabled
|
||||||
>
|
/>
|
||||||
<AnsibleSelect
|
|
||||||
{...instanceType}
|
|
||||||
id="instanceType-select"
|
|
||||||
data={INSTANCE_TYPES.map((type) => ({
|
|
||||||
key: type.id,
|
|
||||||
value: type.id,
|
|
||||||
label: type.name,
|
|
||||||
}))}
|
|
||||||
value={instanceType.value}
|
|
||||||
onChange={(e, opt) => {
|
|
||||||
instanceTypeHelpers.setValue(opt);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</FormGroup>
|
|
||||||
<FormGroup
|
<FormGroup
|
||||||
label={t`Enable Instance`}
|
label={t`Enable Instance`}
|
||||||
aria-label={t`Enable Instance`}
|
aria-label={t`Enable Instance`}
|
||||||
|
|||||||
Reference in New Issue
Block a user