Justin Rhee пре 3 година
родитељ
комит
28b5dc558d

+ 29 - 0
api/server/router/stack.go

@@ -84,6 +84,35 @@ func getStackRoutes(
 		Router:   r,
 	})
 
+	// POST /api/projects/{project_id}/clusters/{cluster_id}/stacks/update_config -> stacks.NewCreateStackHandler
+	createPorterAppEndpoint := factory.NewAPIEndpoint(
+		&types.APIRequestMetadata{
+			Verb:   types.APIVerbCreate,
+			Method: types.HTTPVerbPost,
+			Path: &types.Path{
+				Parent:       basePath,
+				RelativePath: relPath + "/update_config",
+			},
+			Scopes: []types.PermissionScope{
+				types.UserScope,
+				types.ProjectScope,
+				types.ClusterScope,
+			},
+		},
+	)
+
+	createPorterAppHandler := stacks.NewCreatePorterAppHandler(
+		config,
+		factory.GetDecoderValidator(),
+		factory.GetResultWriter(),
+	)
+
+	routes = append(routes, &router.Route{
+		Endpoint: createPorterAppEndpoint,
+		Handler:  createPorterAppHandler,
+		Router:   r,
+	})
+
 	// POST /api/projects/{project_id}/clusters/{cluster_id}/stacks -> stacks.NewCreateStackHandler
 	createEndpoint := factory.NewAPIEndpoint(
 		&types.APIRequestMetadata{

BIN
dashboard/src/assets/not-found.png


+ 11 - 9
dashboard/src/main/home/add-on-dashboard/AddOnDashboard.tsx

@@ -51,6 +51,7 @@ const templateBlacklist = [
   "web",
   "worker",
   "job",
+  "umbrella",
 ];
 
 const AppDashboard: React.FC<Props> = ({
@@ -62,22 +63,23 @@ const AppDashboard: React.FC<Props> = ({
   const [isLoading, setIsLoading] = useState(true);
 
   const filteredAddOns = useMemo(() => {
+    const filtered = addOns.filter((app: any) => {
+      return (
+        !namespaceBlacklist.includes(app.namespace) && 
+        !templateBlacklist.includes(app.chart.metadata.name)
+      );
+    });
+
     const filteredBySearch = search(
-      addOns ?? [],
+      filtered ?? [],
       searchValue,
       {
         keys: ["name", "chart.metadata.name"],
         isCaseSensitive: false,
       }
     );
-    const filtered = filteredBySearch.filter((app: any) => {
-      return (
-        !namespaceBlacklist.includes(app.namespace) && 
-        !templateBlacklist.includes(app.chart.metadata.name)
-      );
-    });
 
-    return _.sortBy(filtered);
+    return _.sortBy(filteredBySearch);
   }, [addOns, searchValue]);
 
   const getAddOns = async () => {
@@ -232,7 +234,7 @@ const AppDashboard: React.FC<Props> = ({
 export default AppDashboard;
 
 const PlaceholderIcon = styled.img`
-  height: 16px;
+  height: 13px;
   margin-right: 12px;
   opacity: 0.65;
 `;

+ 1 - 1
dashboard/src/main/home/add-on-dashboard/NewAddOnFlow.tsx

@@ -152,7 +152,7 @@ const NewAddOnFlow: React.FC<Props> = ({
 export default NewAddOnFlow;
 
 const PlaceholderIcon = styled.img`
-  height: 16px;
+  height: 13px;
   margin-right: 12px;
   opacity: 0.65;
 `;

+ 8 - 1
dashboard/src/main/home/app-dashboard/new-app-flow/NewAppFlow.tsx

@@ -165,7 +165,14 @@ const NewAppFlow: React.FC<Props> = ({ ...props }) => {
     <CenterWrapper>
       <Div>
         <StyledConfigureTemplate>
-          {/* ... */}
+          <Back to="/apps" />
+          <DashboardHeader
+            prefix={<Icon src={web} />}
+            title="Deploy a new application"
+            capitalize={false}
+            disableLineBreak
+          />
+          <DarkMatter />
           <VerticalSteps
             currentStep={currentStep}
             steps={[