Explorar o código

Merge branch 'beta.3.integration-frontend' of https://github.com/porter-dev/porter into sean-testing

Sean Rhee %!s(int64=5) %!d(string=hai) anos
pai
achega
c1dd85d09a

+ 3 - 4
dashboard/src/components/TabRegion.tsx

@@ -11,7 +11,6 @@ type PropsType = {
   defaultTab?: string,
   defaultTab?: string,
   addendum?: any,
   addendum?: any,
   color?: string | null,
   color?: string | null,
-  overflowY?: string,
 };
 };
 
 
 type StateType = {
 type StateType = {
@@ -64,7 +63,7 @@ export default class TabRegion extends Component<PropsType, StateType> {
 
 
   render() {
   render() {
     return (
     return (
-      <StyledTabRegion overflowY={this.props.overflowY}>
+      <StyledTabRegion>
         {this.renderContents()}
         {this.renderContents()}
       </StyledTabRegion>
       </StyledTabRegion>
     );
     );
@@ -99,9 +98,9 @@ const Gap = styled.div`
   height: 30px;
   height: 30px;
 `;
 `;
 
 
-const StyledTabRegion = styled.div<{ overflowY: string }>`
+const StyledTabRegion = styled.div`
   width: 100%;
   width: 100%;
   height: 100%;
   height: 100%;
   position: relative;
   position: relative;
-  overflow-y: ${props => props.overflowY};
+  overflow-y: auto;
 `;
 `;

+ 1 - 0
dashboard/src/main/home/cluster-dashboard/expanded-chart/status/Logs.tsx

@@ -186,6 +186,7 @@ const LogStream = styled.div`
   background: #202227;
   background: #202227;
   user-select: text;
   user-select: text;
   max-width: 65%;
   max-width: 65%;
+  overflow-y: auto;
   overflow-wrap: break-word; 
   overflow-wrap: break-word; 
 `;
 `;
 
 

+ 0 - 1
dashboard/src/main/home/project-settings/ProjectSettings.tsx

@@ -63,7 +63,6 @@ export default class ProjectSettings extends Component<PropsType, StateType> {
           <Title>Project Settings</Title>
           <Title>Project Settings</Title>
         </TitleSection>
         </TitleSection>
         <TabRegion
         <TabRegion
-          overflowY='visible'
           currentTab={this.state.currentTab}
           currentTab={this.state.currentTab}
           setCurrentTab={(x: string) => this.setState({ currentTab: x })}
           setCurrentTab={(x: string) => this.setState({ currentTab: x })}
           options={tabOptions}
           options={tabOptions}

+ 0 - 1
dashboard/src/main/home/provisioner/ProvisionerStatus.tsx

@@ -211,7 +211,6 @@ export default class ProvisionerStatus extends Component<PropsType, StateType> {
           if (clusters.length > 0) {
           if (clusters.length > 0) {
             // console.log('response :', res.data);
             // console.log('response :', res.data);
             this.props.setCurrentView('dashboard');
             this.props.setCurrentView('dashboard');
-            alert('setting to dashboard');
             // console.log('provision end project: ', this.context.currentProject);
             // console.log('provision end project: ', this.context.currentProject);
             // console.log('provision end cluster: ', this.context.currentCluster);
             // console.log('provision end cluster: ', this.context.currentCluster);
             clearInterval(myInterval);
             clearInterval(myInterval);

+ 27 - 6
dashboard/src/main/home/templates/expanded-template/LaunchTemplate.tsx

@@ -9,7 +9,7 @@ import { PorterTemplate, ChoiceType, ClusterType, StorageType } from '../../../.
 import Selector from '../../../../components/Selector';
 import Selector from '../../../../components/Selector';
 import ImageSelector from '../../../../components/image-selector/ImageSelector';
 import ImageSelector from '../../../../components/image-selector/ImageSelector';
 import TabRegion from '../../../../components/TabRegion';
 import TabRegion from '../../../../components/TabRegion';
-import Heading from '../../../../components/values-form/Heading';
+import InputRow from '../../../../components/values-form/InputRow';
 import SaveButton from '../../../../components/SaveButton';
 import SaveButton from '../../../../components/SaveButton';
 import ValuesWrapper from '../../../../components/values-form/ValuesWrapper';
 import ValuesWrapper from '../../../../components/values-form/ValuesWrapper';
 import ValuesForm from '../../../../components/values-form/ValuesForm';
 import ValuesForm from '../../../../components/values-form/ValuesForm';
@@ -31,6 +31,7 @@ type StateType = {
   selectedCluster: string,
   selectedCluster: string,
   selectedImageUrl: string | null,
   selectedImageUrl: string | null,
   selectedTag: string | null,
   selectedTag: string | null,
+  templateName: string,
   tabOptions: ChoiceType[],
   tabOptions: ChoiceType[],
   currentTab: string | null,
   currentTab: string | null,
   tabContents: any
   tabContents: any
@@ -45,6 +46,7 @@ export default class LaunchTemplate extends Component<PropsType, StateType> {
     selectedCluster: this.context.currentCluster.name,
     selectedCluster: this.context.currentCluster.name,
     selectedNamespace: "default",
     selectedNamespace: "default",
     selectedImageUrl: '' as string | null,
     selectedImageUrl: '' as string | null,
+    templateName: '',
     selectedTag: '' as string | null,
     selectedTag: '' as string | null,
     tabOptions: [] as ChoiceType[],
     tabOptions: [] as ChoiceType[],
     currentTab: null as string | null,
     currentTab: null as string | null,
@@ -54,7 +56,7 @@ export default class LaunchTemplate extends Component<PropsType, StateType> {
 
 
   onSubmitAddon = (wildcard?: any) => {
   onSubmitAddon = (wildcard?: any) => {
     let { currentCluster, currentProject } = this.context;
     let { currentCluster, currentProject } = this.context;
-    let name = randomWords({ exactly: 3, join: '-' });
+    let name = this.state.templateName || randomWords({ exactly: 3, join: '-' });
     this.setState({ saveValuesStatus: 'loading' });
     this.setState({ saveValuesStatus: 'loading' });
 
 
     let values = {};
     let values = {};
@@ -85,7 +87,7 @@ export default class LaunchTemplate extends Component<PropsType, StateType> {
 
 
   onSubmit = (rawValues: any) => {
   onSubmit = (rawValues: any) => {
     let { currentCluster, currentProject } = this.context;
     let { currentCluster, currentProject } = this.context;
-    let name = randomWords({ exactly: 3, join: '-' });
+    let name = this.state.templateName || randomWords({ exactly: 3, join: '-' });
     this.setState({ saveValuesStatus: 'loading' });
     this.setState({ saveValuesStatus: 'loading' });
 
 
     // Convert dotted keys to nested objects
     // Convert dotted keys to nested objects
@@ -262,7 +264,10 @@ export default class LaunchTemplate extends Component<PropsType, StateType> {
     if (this.props.form?.hasSource) {
     if (this.props.form?.hasSource) {
       return (
       return (
         <>
         <>
-          <Subtitle>Select the container image you would like to connect to this template.</Subtitle>
+          <Subtitle>
+            Select the container image you would like to connect to this template.
+            <Required>*</Required>
+          </Subtitle>
           <DarkMatter />
           <DarkMatter />
           <ImageSelector
           <ImageSelector
             selectedTag={this.state.selectedTag}
             selectedTag={this.state.selectedTag}
@@ -322,6 +327,15 @@ export default class LaunchTemplate extends Component<PropsType, StateType> {
             closeOverlay={true}
             closeOverlay={true}
           />
           />
         </ClusterSection>
         </ClusterSection>
+        <Subtitle>Give a unique name to this template (optional).</Subtitle>
+        <DarkMatter antiHeight='-27px' />
+        <InputRow
+          type='text'
+          value={this.state.templateName}
+          setValue={(x: string) => this.setState({ templateName: x })}
+          placeholder='ex: doctor-scientist'
+          width='100%'
+        />
         {this.renderSourceSelector()}
         {this.renderSourceSelector()}
         {this.renderTabRegion()}
         {this.renderTabRegion()}
       </StyledLaunchTemplate>
       </StyledLaunchTemplate>
@@ -331,6 +345,11 @@ export default class LaunchTemplate extends Component<PropsType, StateType> {
 
 
 LaunchTemplate.contextType = Context;
 LaunchTemplate.contextType = Context;
 
 
+const Required = styled.div`
+  margin-left: 8px;
+  color: #fc4976;
+`;
+
 const Link = styled.a`
 const Link = styled.a`
   margin-left: 5px;
   margin-left: 5px;
 `;
 `;
@@ -362,9 +381,9 @@ const Placeholder = styled.div`
   justify-content: center;
   justify-content: center;
 `;
 `;
 
 
-const DarkMatter = styled.div`
+const DarkMatter = styled.div<{ antiHeight?: string }>`
   width: 100%;
   width: 100%;
-  margin-top: -15px;
+  margin-top: ${props => props.antiHeight || '-15px'};
 `;
 `;
 
 
 const Subtitle = styled.div`
 const Subtitle = styled.div`
@@ -373,6 +392,8 @@ const Subtitle = styled.div`
   font-size: 13px;
   font-size: 13px;
   color: #aaaabb;
   color: #aaaabb;
   line-height: 1.6em;
   line-height: 1.6em;
+  display: flex;
+  align-items: center;
 `;
 `;
 
 
 const ClusterLabel = styled.div`
 const ClusterLabel = styled.div`

+ 17 - 0
dashboard/src/main/home/templates/expanded-template/TemplateInfo.tsx

@@ -95,6 +95,22 @@ export default class TemplateInfo extends Component<PropsType, StateType> {
           </Banner>
           </Banner>
         </>
         </>
       );
       );
+    } else if (this.props.currentTemplate.name.toLowerCase() === 'https-issuer') {
+      return (
+        <>
+          <Br />
+          <Banner>
+            <i className="material-icons-outlined">info</i>
+            To use this template you must first follow
+            <Link 
+              target="_blank"
+              href="https://docs.getporter.dev/docs/https-and-custom-domains"
+            >
+              Porter's HTTPS setup guide
+            </Link> (5 minutes).
+          </Banner>
+        </>
+      );
     }
     }
   }
   }
 
 
@@ -141,6 +157,7 @@ TemplateInfo.contextType = Context;
 
 
 const Link = styled.a`
 const Link = styled.a`
   color: #8590ff;
   color: #8590ff;
+  margin-right: 5px;
   cursor: pointer;
   cursor: pointer;
   margin-left: 5px;
   margin-left: 5px;
 `;
 `;