Skip to content

Commit

Permalink
minor fix before test
Browse files Browse the repository at this point in the history
  • Loading branch information
kaganrua committed Sep 24, 2024
1 parent a59b7f2 commit b627786
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
11 changes: 11 additions & 0 deletions frontend/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,17 @@ export default function App() {
]);
setErrModalOpen(true);
}
} else {
//this is in case, in any point user wishes to change an already pinging config.
try {
const kubeResponse = await axios.get(
`${serverAddress}/get-kube-contexts`,
);
setAvailableKubeContexts(kubeResponse.data);
} catch (err) {

}

}
}
}
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/components/ui/modal/AnvilConfigurationsModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
isPackaged,
choosenKubeContexts,
chosenDriver,
availableKubeContexts
} from "@/atoms/kubecontextAtom";
import { activeConfigurationAtom } from "@/atoms/anvilConfigurationsAtom";
import axios from "axios";
Expand Down Expand Up @@ -39,6 +40,7 @@ export default function AnvilConfigurationsModal(props) {
const [userDriver] = useAtom(chosenDriver);
const [logViewerOpen, SystemLogViewerOpen] = useState(false);
const [loading, setIsLoading] = useState(false);
const [_, setAvailableKubeContexts] = useAtom(availableKubeContexts);

function handleNew() {
setInitialConfiguration(undefined);
Expand All @@ -56,6 +58,12 @@ export default function AnvilConfigurationsModal(props) {
const res = axios.get(`${serverAddress}/isPackaged`).then((response) => {
setAppIsPackaged(response.data);
});

axios.get(
`${serverAddress}/get-kube-contexts`,
).then((res) => {
setAvailableKubeContexts(res.data)
})
}, []);

function handleEdit(userConfigurationIndex, configuration) {
Expand Down

0 comments on commit b627786

Please sign in to comment.