Ver código fonte

hotfix internal url (#3798)

Feroze Mohideen 2 anos atrás
pai
commit
3602c36752

+ 1 - 0
dashboard/src/main/home/app-dashboard/app-view/tabs/Overview.tsx

@@ -75,6 +75,7 @@ const Overview: React.FC<Props> = ({ buttonStatus }) => {
         serviceVersionStatus={serviceVersionStatus}
         maxCPU={currentClusterResources.maxCPU}
         maxRAM={currentClusterResources.maxRAM}
+        namespace={deploymentTarget.namespace}
       />
       <Spacer y={0.75} />
       <Button

+ 3 - 1
dashboard/src/main/home/app-dashboard/validate-apply/services-settings/ServiceContainer.tsx

@@ -27,6 +27,7 @@ interface ServiceProps {
   status?: PorterAppVersionStatus[];
   maxCPU: number;
   maxRAM: number;
+  namespace: string;
 }
 
 const ServiceContainer: React.FC<ServiceProps> = ({
@@ -37,6 +38,7 @@ const ServiceContainer: React.FC<ServiceProps> = ({
   status,
   maxCPU,
   maxRAM,
+  namespace,
 }) => {
   const [height, setHeight] = useState<Height>(service.expanded ? "auto" : 0);
 
@@ -63,7 +65,7 @@ const ServiceContainer: React.FC<ServiceProps> = ({
   const renderTabs = (service: ClientService) => {
     return match(service)
       .with({ config: { type: "web" } }, (svc) => (
-        <WebTabs index={index} service={svc} maxCPU={maxCPU} maxRAM={maxRAM} />
+        <WebTabs index={index} service={svc} maxCPU={maxCPU} maxRAM={maxRAM} namespace={namespace} />
       ))
       .with({ config: { type: "worker" } }, (svc) => (
         <WorkerTabs

+ 3 - 0
dashboard/src/main/home/app-dashboard/validate-apply/services-settings/ServiceList.tsx

@@ -51,6 +51,7 @@ type ServiceListProps = {
   serviceVersionStatus?: Record<string, PorterAppVersionStatus[]>;
   maxCPU: number;
   maxRAM: number;
+  namespace?: string;
 };
 
 const ServiceList: React.FC<ServiceListProps> = ({
@@ -62,6 +63,7 @@ const ServiceList: React.FC<ServiceListProps> = ({
   serviceVersionStatus,
   maxCPU,
   maxRAM,
+  namespace = "",
 }) => {
   // top level app form
   const { control: appControl } = useFormContext<PorterAppFormData>();
@@ -195,6 +197,7 @@ const ServiceList: React.FC<ServiceListProps> = ({
                 status={serviceVersionStatus?.[svc.name.value]}
                 maxCPU={maxCPU}
                 maxRAM={maxRAM}
+                namespace={namespace}
               />
             ) : null;
           })}

+ 2 - 3
dashboard/src/main/home/app-dashboard/validate-apply/services-settings/tabs/WebTabs.tsx

@@ -19,15 +19,14 @@ interface Props {
   chart?: any;
   maxRAM: number;
   maxCPU: number;
+  namespace: string;
 }
 
-const WebTabs: React.FC<Props> = ({ index, service, maxRAM, maxCPU }) => {
+const WebTabs: React.FC<Props> = ({ index, service, maxRAM, maxCPU, namespace }) => {
   const [currentTab, setCurrentTab] = React.useState<
     "main" | "resources" | "networking" | "advanced"
   >("main");
 
-  const { deploymentTarget: { namespace } } = useLatestRevision();
-
   return (
     <>
       <TabSelector

+ 2 - 0
dashboard/src/main/home/cluster-dashboard/preview-environments/v2/setup-app/AppTemplateForm.tsx

@@ -61,6 +61,7 @@ const AppTemplateForm: React.FC<Props> = ({ existingTemplate }) => {
     servicesFromYaml,
     clusterId,
     projectId,
+    deploymentTarget,
   } = useLatestRevision();
 
   const { data: baseEnvGroups = [] } = useQuery(
@@ -279,6 +280,7 @@ const AppTemplateForm: React.FC<Props> = ({ existingTemplate }) => {
                 fieldArrayName={"app.services"}
                 maxCPU={currentClusterResources.maxCPU}
                 maxRAM={currentClusterResources.maxRAM}
+                namespace={deploymentTarget.namespace}
               />
             </>,
             <>