mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-07 19:26:36 +00:00
🚧 blueprints page
This commit is contained in:
@@ -1152,6 +1152,8 @@
|
|||||||
"sidebarClients": "Clients",
|
"sidebarClients": "Clients",
|
||||||
"sidebarDomains": "Domains",
|
"sidebarDomains": "Domains",
|
||||||
"sidebarBluePrints": "Blueprints",
|
"sidebarBluePrints": "Blueprints",
|
||||||
|
"blueprints": "Blueprints",
|
||||||
|
"blueprintsDescription": "Blueprints are declarative YAML configurations that define your resources and their settings",
|
||||||
"enableDockerSocket": "Enable Docker Blueprint",
|
"enableDockerSocket": "Enable Docker Blueprint",
|
||||||
"enableDockerSocketDescription": "Enable Docker Socket label scraping for blueprint labels. Socket path must be provided to Newt.",
|
"enableDockerSocketDescription": "Enable Docker Socket label scraping for blueprint labels. Socket path must be provided to Newt.",
|
||||||
"enableDockerSocketLink": "Learn More",
|
"enableDockerSocketLink": "Learn More",
|
||||||
|
|||||||
@@ -1,6 +1,13 @@
|
|||||||
|
import SettingsSectionTitle from "@app/components/SettingsSectionTitle";
|
||||||
|
import { internal } from "@app/lib/api";
|
||||||
|
import { authCookieHeader } from "@app/lib/api/cookies";
|
||||||
|
import OrgProvider from "@app/providers/OrgProvider";
|
||||||
|
import { ListBlueprintsResponse } from "@server/routers/blueprints";
|
||||||
|
import { GetOrgResponse } from "@server/routers/org";
|
||||||
|
import { AxiosResponse } from "axios";
|
||||||
|
import { getTranslations } from "next-intl/server";
|
||||||
|
import { redirect } from "next/navigation";
|
||||||
|
import { cache } from "react";
|
||||||
|
|
||||||
|
|
||||||
type BluePrintsPageProps = {
|
type BluePrintsPageProps = {
|
||||||
@@ -8,7 +15,48 @@ type BluePrintsPageProps = {
|
|||||||
searchParams: Promise<{ view?: string }>;
|
searchParams: Promise<{ view?: string }>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export default async function BluePrintsPage(props: BluePrintsPageProps) {
|
export default async function BluePrintsPage(props: BluePrintsPageProps) {
|
||||||
const params = await props.params;
|
const params = await props.params;
|
||||||
return <></>
|
|
||||||
|
let blueprints: any[] = [];
|
||||||
|
try {
|
||||||
|
const res = await internal.get<
|
||||||
|
AxiosResponse<ListBlueprintsResponse>
|
||||||
|
>(`/org/${params.orgId}/domains`, await authCookieHeader());
|
||||||
|
|
||||||
|
blueprints = res.data.data.domains as any[];
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
let org = null;
|
||||||
|
try {
|
||||||
|
const getOrg = cache(async () =>
|
||||||
|
internal.get<AxiosResponse<GetOrgResponse>>(
|
||||||
|
`/org/${params.orgId}`,
|
||||||
|
await authCookieHeader()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
const res = await getOrg();
|
||||||
|
org = res.data.data;
|
||||||
|
} catch {
|
||||||
|
redirect(`/${params.orgId}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!org) {
|
||||||
|
}
|
||||||
|
|
||||||
|
const t = await getTranslations();
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<OrgProvider org={org}>
|
||||||
|
<SettingsSectionTitle
|
||||||
|
title={t("blueprints")}
|
||||||
|
description={t("blueprintsDescription")}
|
||||||
|
/>
|
||||||
|
{/* <DomainsTable domains={domains} /> */}
|
||||||
|
</OrgProvider>
|
||||||
|
</>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user