This commit is contained in:
Milo Schwartz
2024-10-26 19:58:01 -04:00
9 changed files with 45 additions and 35 deletions

View File

@@ -68,18 +68,17 @@ export default async function ConfigurationLaytout(
}
let orgs: ListOrgsResponse["orgs"] = [];
try {
const res = await internal.get<AxiosResponse<ListOrgsResponse>>(
`/orgs`,
cookie
);
if (res && res.data.data.orgs) {
orgs = res.data.data.orgs;
}
} catch (e) {
console.error("Error fetching orgs", e);
}
// try {
// const res = await internal.get<AxiosResponse<ListOrgsResponse>>(
// `/orgs`,
// cookie
// );
// if (res && res.data.data.orgs) {
// orgs = res.data.data.orgs;
// }
// } catch (e) {
// console.error("Error fetching orgs", e);
// }
return (
<>
<div className="w-full bg-muted mb-6 select-none sm:px-0 px-3 pt-3">

View File

@@ -76,7 +76,7 @@ export function CreateSiteForm() {
setIsLoading(false);
api
.get(`/site/pickSiteDefaults`)
.get(`/org/${orgId}/pickSiteDefaults`)
.catch((e) => {
toast({
title: "Error creating site..."
@@ -93,7 +93,8 @@ export function CreateSiteForm() {
const res = await api
.put(`/org/${orgId}/site/`, {
name: data.name,
// subdomain: data.subdomain,
subnet: siteDefaults?.subnet,
exitNodeId: siteDefaults?.exitNodeId,
pubKey: keypair?.publicKey,
})
.catch((e) => {
@@ -117,7 +118,7 @@ PrivateKey = ${keypair.privateKey}
[Peer]
PublicKey = ${siteDefaults.publicKey}
AllowedIPs = ${siteDefaults.address}
AllowedIPs = ${siteDefaults.address.split("/")[0]}/32
Endpoint = ${siteDefaults.endpoint}:${siteDefaults.listenPort}
PersistentKeepalive = 5`
: "";