|
@@ -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;
|
|
|
|
|
+`;
|