Procházet zdrojové kódy

auto-generate cluster name

Justin Rhee před 3 roky
rodič
revize
c93e53a976

+ 1 - 1
dashboard/src/components/ProvisionerForm.tsx

@@ -28,7 +28,7 @@ const ProvisionerForm: React.FC<Props> = ({
         Configure settings
         Configure settings
       </Heading>
       </Heading>
       <Helper>
       <Helper>
-        Configure settings for your new cluster.
+        Configure settings for your AWS environment.
       </Helper>
       </Helper>
       <ProvisionerSettings credentialId={credentialId} />
       <ProvisionerSettings credentialId={credentialId} />
     </>
     </>

+ 4 - 23
dashboard/src/components/ProvisionerSettings.tsx

@@ -179,6 +179,7 @@ const ProvisionerSettings: React.FC<Props> = props => {
         currentCluster.status === "UPDATING_UNAVAILABLE"
         currentCluster.status === "UPDATING_UNAVAILABLE"
       )
       )
     );
     );
+    setClusterName(`${currentProject.name}-cluster`);
   }, []);
   }, []);
 
 
   useEffect(() => {
   useEffect(() => {
@@ -205,20 +206,10 @@ const ProvisionerSettings: React.FC<Props> = props => {
     if (!props.clusterId) {
     if (!props.clusterId) {
       return (
       return (
         <>
         <>
-          <Heading isAtTop>Cluster configuration</Heading>
+          <Heading isAtTop>Select an AWS region</Heading>
           <Helper>
           <Helper>
-            Porter will create a new cluster for your applications in the specified region.
+            Porter will automatically provision your infrastructure in the specified region.
           </Helper>
           </Helper>
-          <InputRow
-            width="350px"
-            isRequired
-            disabled={isReadOnly}
-            type="string"
-            value={clusterName}
-            setValue={(x: string) => setClusterName(x)}
-            label="🏷️ Cluster name"
-            placeholder="ex: total-perspective-vortex"
-          />
           <SelectRow
           <SelectRow
             options={regionOptions}
             options={regionOptions}
             width="350px"
             width="350px"
@@ -227,7 +218,7 @@ const ProvisionerSettings: React.FC<Props> = props => {
             scrollBuffer={true}
             scrollBuffer={true}
             dropdownMaxHeight="240px"
             dropdownMaxHeight="240px"
             setActiveValue={setAwsRegion}
             setActiveValue={setAwsRegion}
-            label="📍 Select an AWS region"
+            label="📍 AWS region"
           />
           />
         </>
         </>
       )
       )
@@ -237,16 +228,6 @@ const ProvisionerSettings: React.FC<Props> = props => {
     return (
     return (
       <>
       <>
         <Heading isAtTop>EKS configuration</Heading>
         <Heading isAtTop>EKS configuration</Heading>
-        <InputRow
-          width="350px"
-          isRequired
-          disabled={isReadOnly || true}
-          type="string"
-          value={clusterName}
-          setValue={(x: string) => setClusterName(x)}
-          label="🏷️ Cluster name"
-          placeholder="ex: total-perspective-vortex"
-        />
         <SelectRow
         <SelectRow
           options={regionOptions}
           options={regionOptions}
           width="350px"
           width="350px"