Jo Chuang 5 лет назад
Родитель
Сommit
4d388c4ccc

+ 2 - 2
dashboard/src/main/home/cluster-dashboard/ClusterDashboard.tsx

@@ -109,8 +109,8 @@ class ClusterDashboard extends Component<PropsType, StateType> {
         <LineBreak />
         <LineBreak />
 
 
         <ControlRow>
         <ControlRow>
-          <Button onClick={() => this.props.history.push("templates")}>
-            <i className="material-icons">add</i> Deploy Template
+          <Button onClick={() => this.props.history.push("launch")}>
+            <i className="material-icons">add</i> Launch Template
           </Button>
           </Button>
           <SortFilterWrapper>
           <SortFilterWrapper>
             <SortSelector
             <SortSelector

+ 1 - 1
dashboard/src/main/home/launch/Launch.tsx

@@ -44,7 +44,7 @@ export default class Templates extends Component<PropsType, StateType> {
           this.state.porterTemplates.sort((a, b) =>
           this.state.porterTemplates.sort((a, b) =>
             a.name === "docker" ? -1 : b.name === "docker" ? 1 : 0
             a.name === "docker" ? -1 : b.name === "docker" ? 1 : 0
           );
           );
-          // TODO: properly find "docker" template instead of relying on first
+          // TODO: properly find "docker" template instead of relying on first entry
           this.setState({
           this.setState({
             loading: false,
             loading: false,
             currentTemplate: this.state.porterTemplates[0],
             currentTemplate: this.state.porterTemplates[0],

+ 1 - 1
dashboard/src/main/home/launch/expanded-template/ExpandedTemplate.tsx

@@ -131,5 +131,5 @@ const LoadingWrapper = styled.div`
 const StyledExpandedTemplate = styled.div`
 const StyledExpandedTemplate = styled.div`
   width: calc(90% - 150px);
   width: calc(90% - 150px);
   min-width: 300px;
   min-width: 300px;
-  padding-top: 10px;
+  padding-top: 30px;
 `;
 `;

+ 35 - 20
dashboard/src/main/home/launch/expanded-template/LaunchTemplate.tsx

@@ -351,7 +351,7 @@ export default class LaunchTemplate extends Component<PropsType, StateType> {
     );
     );
   };
   };
 
 
-  renderTabRegion = () => {
+  renderSettingsRegion = () => {
     if (this.state.tabOptions.length > 0) {
     if (this.state.tabOptions.length > 0) {
       return (
       return (
         <>
         <>
@@ -392,7 +392,7 @@ export default class LaunchTemplate extends Component<PropsType, StateType> {
   };
   };
 
 
   // Display if current template uses source (image or repo)
   // Display if current template uses source (image or repo)
-  renderSourceSelector = () => {
+  renderSourceSelectorContent = () => {
     let { currentProject } = this.context;
     let { currentProject } = this.context;
 
 
     if (this.props.form?.hasSource) {
     if (this.props.form?.hasSource) {
@@ -429,22 +429,6 @@ export default class LaunchTemplate extends Component<PropsType, StateType> {
               >
               >
                 log in with GitHub
                 log in with GitHub
               </A>{" "}
               </A>{" "}
-              or
-              <Highlight
-                onClick={() =>
-                  this.setState({
-                    sourceType: "registry",
-                    actionConfig: {
-                      git_repo: "",
-                      image_repo_uri: "",
-                      git_repo_id: 0,
-                      dockerfile_path: "",
-                    } as ActionConfigType,
-                  })
-                }
-              >
-                link an image registry
-              </Highlight>
               .<Required>*</Required>
               .<Required>*</Required>
             </Subtitle>
             </Subtitle>
             <ActionConfEditor
             <ActionConfEditor
@@ -468,6 +452,25 @@ export default class LaunchTemplate extends Component<PropsType, StateType> {
     }
     }
   };
   };
 
 
+  renderSourceSelector = () => {
+    return (
+      <>
+        <TabRegion
+          options={[
+            { label: "Registry", value: "registry" },
+            { label: "Github", value: "github" },
+          ]}
+          currentTab={this.state.sourceType}
+          setCurrentTab={(x) => this.setState({ sourceType: x })}
+        >
+          <StyledSourceBox>
+            {this.renderSourceSelectorContent()}
+          </StyledSourceBox>
+        </TabRegion>
+      </>
+    );
+  };
+
   render() {
   render() {
     let { name, icon } = this.props.currentTemplate;
     let { name, icon } = this.props.currentTemplate;
     let { currentTemplate } = this.props;
     let { currentTemplate } = this.props;
@@ -541,7 +544,7 @@ export default class LaunchTemplate extends Component<PropsType, StateType> {
           width="100%"
           width="100%"
         />
         />
         {this.renderSourceSelector()}
         {this.renderSourceSelector()}
-        {this.renderTabRegion()}
+        {this.renderSettingsRegion()}
       </StyledLaunchTemplate>
       </StyledLaunchTemplate>
     );
     );
   }
   }
@@ -654,7 +657,6 @@ const ClusterSection = styled.div`
   font-family: "Work Sans", sans-serif;
   font-family: "Work Sans", sans-serif;
   font-size: 14px;
   font-size: 14px;
   font-weight: 500;
   font-weight: 500;
-  margin-top: 20px;
   margin-bottom: 15px;
   margin-bottom: 15px;
 
 
   > i {
   > i {
@@ -721,3 +723,16 @@ const A = styled.a`
   padding-right: ${(props: { padRight?: boolean }) =>
   padding-right: ${(props: { padRight?: boolean }) =>
     props.padRight ? "5px" : ""};
     props.padRight ? "5px" : ""};
 `;
 `;
+
+const StyledSourceBox = styled.div`
+  width: 100%;
+  height: 100%;
+  background: #ffffff11;
+  color: #ffffff;
+  padding: 10px 35px 25px;
+  position: relative;
+  border-radius: 5px;
+  font-size: 13px;
+  overflow: auto;
+  margin-bottom: 25px;
+`;

+ 1 - 1
dashboard/src/main/home/launch/expanded-template/TemplateInfo.tsx

@@ -297,7 +297,7 @@ const Title = styled.div`
 
 
 const TitleSection = styled.div`
 const TitleSection = styled.div`
   display: flex;
   display: flex;
-  margin-left: -42px;
+  margin-left: 0px;
   flex-direction: row;
   flex-direction: row;
   height: 40px;
   height: 40px;
   justify-content: space-between;
   justify-content: space-between;

+ 2 - 2
dashboard/src/main/home/sidebar/Sidebar.tsx

@@ -2,7 +2,7 @@ import React, { Component } from "react";
 import styled from "styled-components";
 import styled from "styled-components";
 import category from "assets/category.svg";
 import category from "assets/category.svg";
 import integrations from "assets/integrations.svg";
 import integrations from "assets/integrations.svg";
-import filter from "assets/filter.svg";
+import rocket from "assets/rocket.png";
 import settings from "assets/settings.svg";
 import settings from "assets/settings.svg";
 
 
 import { Context } from "shared/Context";
 import { Context } from "shared/Context";
@@ -115,7 +115,7 @@ class Sidebar extends Component<PropsType, StateType> {
             onClick={() => this.props.history.push("launch")}
             onClick={() => this.props.history.push("launch")}
             selected={currentView === "launch"}
             selected={currentView === "launch"}
           >
           >
-            <Img src={filter} />
+            <Img src={rocket} />
             Launch
             Launch
           </NavButton>
           </NavButton>
           <NavButton
           <NavButton