Alexander Belanger 5 лет назад
Родитель
Сommit
a6651dd359

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

@@ -134,6 +134,7 @@ export default class DOFormSection extends Component<PropsType, StateType> {
     selectedInfras.forEach((option: { value: string; label: string }) => {
       redirectUrl += `&infras=${option.value}`;
     });
+    redirectUrl += "&tab=provisioner"
     window.location.href = redirectUrl;
   };
 

+ 22 - 1
dashboard/src/main/home/provisioner/Provisioner.tsx

@@ -44,6 +44,18 @@ class Provisioner extends Component<PropsType, StateType> {
   };
 
   componentDidMount() {
+    this.updateInfras()
+  }
+
+  refresh = () => {
+    this.updateInfras()
+  }
+
+  updateInfras = () => {
+    this.setState({
+      loading: true,
+    });
+
     let { currentProject } = this.state;
 
     api
@@ -99,7 +111,9 @@ class Provisioner extends Component<PropsType, StateType> {
 
     return (
       <StyledProvisioner>
-        You have not provisioned any resources for this project through Porter.
+        You have not provisioned any resources for this project through Porter. <RefreshText
+          onClick={this.refresh}
+        >Refresh</RefreshText>
       </StyledProvisioner>
     );
   }
@@ -128,3 +142,10 @@ const TabWrapper = styled.div`
   height: 100%;
   overflow-y: auto;
 `;
+
+const RefreshText = styled.div`
+  display: inline;
+  margin-left: 4px;
+  color: #8590ff;
+  cursor: pointer;
+`