Browse Source

Update Cluster Settings Hotfix (#3343)

sdess09 2 years ago
parent
commit
29d7bf8b64

+ 1 - 2
dashboard/src/main/home/cluster-dashboard/dashboard/ClusterSettings.tsx

@@ -221,7 +221,7 @@ const ClusterSettings: React.FC<Props> = (props) => {
 
   let overrideAWSClusterNameSection =
     currentCluster?.aws_integration_id &&
-    currentCluster?.aws_integration_id != 0 ? (
+      currentCluster?.aws_integration_id != 0 ? (
       <InputRow
         type="text"
         value={newAWSClusterID}
@@ -347,7 +347,6 @@ const ClusterSettings: React.FC<Props> = (props) => {
         {props.ingressIp && (
           <>{configureUrl(props.ingressIp, props.ingressError)}</>
         )}
-
         <DarkMatter />
         {enableAgentIntegration}
         <DarkMatter />

+ 6 - 2
dashboard/src/main/home/cluster-dashboard/dashboard/Dashboard.tsx

@@ -44,8 +44,8 @@ export const Dashboard: React.FunctionComponent = () => {
   const [selectedClusterVersion, setSelectedClusterVersion] = useState(null);
   const [showProvisionerStatus, setShowProvisionerStatus] = useState(false);
   const [provisionFailureReason, setProvisionFailureReason] = useState("");
-  const [ingressIp, setIngressIp] = useState(null);
-  const [ingressError, setIngressError] = useState(null);
+  const [ingressIp, setIngressIp] = useState("");
+  const [ingressError, setIngressError] = useState("");
   const [cloudProvider, setCloudProvider] = useState("azure");
 
   const context = useContext(Context);
@@ -169,6 +169,10 @@ export const Dashboard: React.FunctionComponent = () => {
     updateClusterWithDetailedData();
   }, []);
 
+  useEffect(() => {
+    updateClusterWithDetailedData();
+  }, [context.currentCluster]);
+
   const renderContents = () => {
     if (context.currentProject?.capi_provisioner_enabled) {
       return (