Justin Rhee 3 лет назад
Родитель
Сommit
ea60f3536e

+ 2 - 2
dashboard/src/main/home/Home.tsx

@@ -14,7 +14,7 @@ import ClusterDashboard from "./cluster-dashboard/ClusterDashboard";
 import Dashboard from "./dashboard/Dashboard";
 import WelcomeForm from "./WelcomeForm";
 import Integrations from "./integrations/Integrations";
-import Templates from "./launch/Launch";
+import LaunchWrapper from "./launch/LaunchWrapper";
 
 import Navbar from "./navbar/Navbar";
 import ProjectSettings from "./project-settings/ProjectSettings";
@@ -503,7 +503,7 @@ class Home extends Component<PropsType, StateType> {
               path={"/project-settings"}
               render={() => <GuardedProjectSettings />}
             />
-            <Route path={"*"} render={() => <Templates />} />
+            <Route path={"*"} render={() => <LaunchWrapper />} />
           </Switch>
         </ViewWrapper>
 

+ 0 - 3
dashboard/src/main/home/cluster-dashboard/expanded-chart/ExpandedChart.tsx

@@ -225,7 +225,6 @@ const ExpandedChart: React.FC<Props> = (props) => {
   const onSubmit = async (props: any) => {
     const rawValues = props.values;
 
-    // console.log("raw", rawValues);
     // Convert dotted keys to nested objects
     let values: any = {};
 
@@ -306,7 +305,6 @@ const ExpandedChart: React.FC<Props> = (props) => {
 
     setSaveValueStatus("loading");
 
-    // console.log("valuesYaml", valuesYaml);
     try {
       await api.upgradeChartValues(
         "<token>",
@@ -413,7 +411,6 @@ const ExpandedChart: React.FC<Props> = (props) => {
   const renderTabContents = (currentTab: string) => {
     let { setSidebar } = props;
     let chart = currentChart;
-    // console.log("CONTROLLERS", controllers);
     switch (currentTab) {
       case "metrics":
         return <MetricsSection currentChart={chart} />;

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

@@ -196,13 +196,7 @@ const LogsFC: React.FC<{
             Show previous Logs
           </Scroll>
         )}
-        <Refresh
-          onClick={() => {
-            // this.refreshLogs();
-            // console.log("Refresh logs");
-            refresh();
-          }}
-        >
+        <Refresh onClick={() => refresh()}>
           <i className="material-icons">autorenew</i>
           Refresh
         </Refresh>

+ 13 - 0
dashboard/src/main/home/launch/Boilerplate.tsx

@@ -0,0 +1,13 @@
+import React, { useState } from "react";
+
+import styled from "styled-components";
+
+type Props = {};
+
+export const Boilerplate: React.FC<Props> = (props) => {
+  const [someState, setSomeState] = useState("");
+
+  return <StyledBoilerplate></StyledBoilerplate>;
+};
+
+const StyledBoilerplate = styled.div``;

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

@@ -59,11 +59,13 @@ class Templates extends Component<PropsType, StateType> {
   };
 
   async componentDidMount() {
+    let default_addon_helm_repo_url = this.context?.capabilities?.default_addon_helm_repo_url;
+    let default_app_helm_repo_url = this.context?.capabilities?.default_app_helm_repo_url;
     try {
       const res = await api.getTemplates(
         "<token>",
         {
-          repo_url: process.env.ADDON_CHART_REPO_URL,
+          repo_url: default_addon_helm_repo_url,
         },
         {}
       );
@@ -90,7 +92,7 @@ class Templates extends Component<PropsType, StateType> {
       const res = await api.getTemplates(
         "<token>",
         {
-          repo_url: process.env.APPLICATION_CHART_REPO_URL,
+          repo_url: default_app_helm_repo_url,
         },
         {}
       );
@@ -117,8 +119,6 @@ class Templates extends Component<PropsType, StateType> {
         currentTemplate = sortedVersionData.find(
           (v: any) => v.name === template_name
         );
-
-        // console.log(currentTemplate);
         if (currentTemplate.versions.find((v: any) => v === version)) {
           currentTemplate.currentVersion = version;
         }

+ 22 - 0
dashboard/src/main/home/launch/LaunchWrapper.tsx

@@ -0,0 +1,22 @@
+import React, { useState, useContext } from "react";
+import { Context } from "shared/Context";
+
+import styled from "styled-components";
+import Launch from "./Launch";
+
+type Props = {};
+
+const LaunchWrapper: React.FC<Props> = (props) => {
+  const { capabilities } = useContext(Context);
+  return (
+    <>
+      {
+        capabilities && <Launch />
+      }
+    </>
+  );
+};
+
+export default LaunchWrapper;
+
+const StyledLaunchWrapper = styled.div``;

+ 2 - 0
dashboard/src/shared/types.tsx

@@ -321,6 +321,8 @@ export interface CapabilityType {
   github: boolean;
   provisioner: boolean;
   version?: string;
+  default_app_helm_repo_url?: string;
+  default_addon_helm_repo_url?: string;
 }
 
 export interface ContextProps {