mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-07 19:26:36 +00:00
Starting to create frontend
This commit is contained in:
@@ -1891,5 +1891,7 @@
|
|||||||
"cannotbeUndone": "This can not be undone.",
|
"cannotbeUndone": "This can not be undone.",
|
||||||
"toConfirm": "to confirm",
|
"toConfirm": "to confirm",
|
||||||
"deleteClientQuestion": "Are you sure you want to remove the client from the site and organization?",
|
"deleteClientQuestion": "Are you sure you want to remove the client from the site and organization?",
|
||||||
"clientMessageRemove": "Once removed, the client will no longer be able to connect to the site."
|
"clientMessageRemove": "Once removed, the client will no longer be able to connect to the site.",
|
||||||
|
"sidebarLogs": "Logs",
|
||||||
|
"request": "Request"
|
||||||
}
|
}
|
||||||
|
|||||||
54
src/app/[orgId]/settings/logs/access/page.tsx
Normal file
54
src/app/[orgId]/settings/logs/access/page.tsx
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
"use client";
|
||||||
|
import ConfirmDeleteDialog from "@app/components/ConfirmDeleteDialog";
|
||||||
|
import AuthPageSettings, {
|
||||||
|
AuthPageSettingsRef
|
||||||
|
} from "@app/components/private/AuthPageSettings";
|
||||||
|
|
||||||
|
import { Button } from "@app/components/ui/button";
|
||||||
|
import { useOrgContext } from "@app/hooks/useOrgContext";
|
||||||
|
import { userOrgUserContext } from "@app/hooks/useOrgUserContext";
|
||||||
|
import { toast } from "@app/hooks/useToast";
|
||||||
|
import { useState, useRef } from "react";
|
||||||
|
import {
|
||||||
|
Form,
|
||||||
|
FormControl,
|
||||||
|
FormDescription,
|
||||||
|
FormField,
|
||||||
|
FormItem,
|
||||||
|
FormLabel,
|
||||||
|
FormMessage
|
||||||
|
} from "@/components/ui/form";
|
||||||
|
import { Input } from "@/components/ui/input";
|
||||||
|
|
||||||
|
import { z } from "zod";
|
||||||
|
import { useForm } from "react-hook-form";
|
||||||
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
|
import { createApiClient } from "@app/lib/api";
|
||||||
|
import { useEnvContext } from "@app/hooks/useEnvContext";
|
||||||
|
import { formatAxiosError } from "@app/lib/api";
|
||||||
|
import { AxiosResponse } from "axios";
|
||||||
|
import { DeleteOrgResponse, ListUserOrgsResponse } from "@server/routers/org";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
import {
|
||||||
|
SettingsContainer,
|
||||||
|
SettingsSection,
|
||||||
|
SettingsSectionHeader,
|
||||||
|
SettingsSectionTitle,
|
||||||
|
SettingsSectionDescription,
|
||||||
|
SettingsSectionBody,
|
||||||
|
SettingsSectionForm,
|
||||||
|
SettingsSectionFooter
|
||||||
|
} from "@app/components/Settings";
|
||||||
|
import { useUserContext } from "@app/hooks/useUserContext";
|
||||||
|
import { useTranslations } from "next-intl";
|
||||||
|
import { build } from "@server/build";
|
||||||
|
|
||||||
|
export default function GeneralPage() {
|
||||||
|
const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);
|
||||||
|
const router = useRouter();
|
||||||
|
const api = createApiClient(useEnvContext());
|
||||||
|
const t = useTranslations();
|
||||||
|
const { env } = useEnvContext();
|
||||||
|
|
||||||
|
return <p>access</p>;
|
||||||
|
}
|
||||||
56
src/app/[orgId]/settings/logs/layout.tsx
Normal file
56
src/app/[orgId]/settings/logs/layout.tsx
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
import { internal } from "@app/lib/api";
|
||||||
|
import { authCookieHeader } from "@app/lib/api/cookies";
|
||||||
|
import SettingsSectionTitle from "@app/components/SettingsSectionTitle";
|
||||||
|
import { HorizontalTabs } from "@app/components/HorizontalTabs";
|
||||||
|
import { verifySession } from "@app/lib/auth/verifySession";
|
||||||
|
import OrgProvider from "@app/providers/OrgProvider";
|
||||||
|
import OrgUserProvider from "@app/providers/OrgUserProvider";
|
||||||
|
import { GetOrgResponse } from "@server/routers/org";
|
||||||
|
import { GetOrgUserResponse } from "@server/routers/user";
|
||||||
|
import { AxiosResponse } from "axios";
|
||||||
|
import { redirect } from "next/navigation";
|
||||||
|
import { cache } from "react";
|
||||||
|
import { getTranslations } from "next-intl/server";
|
||||||
|
|
||||||
|
type GeneralSettingsProps = {
|
||||||
|
children: React.ReactNode;
|
||||||
|
params: Promise<{ orgId: string }>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default async function GeneralSettingsPage({
|
||||||
|
children,
|
||||||
|
params
|
||||||
|
}: GeneralSettingsProps) {
|
||||||
|
const { orgId } = await params;
|
||||||
|
|
||||||
|
const getUser = cache(verifySession);
|
||||||
|
const user = await getUser();
|
||||||
|
|
||||||
|
if (!user) {
|
||||||
|
redirect(`/`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const t = await getTranslations();
|
||||||
|
|
||||||
|
const navItems = [
|
||||||
|
{
|
||||||
|
title: t("access"),
|
||||||
|
href: `/{orgId}/settings/logs/access`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("request"),
|
||||||
|
href: `/{orgId}/settings/logs/request`
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<SettingsSectionTitle
|
||||||
|
title={t("logs")}
|
||||||
|
description={t("logsSettingsDescription")}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<HorizontalTabs items={navItems}>{children}</HorizontalTabs>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
54
src/app/[orgId]/settings/logs/page.tsx
Normal file
54
src/app/[orgId]/settings/logs/page.tsx
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
"use client";
|
||||||
|
import ConfirmDeleteDialog from "@app/components/ConfirmDeleteDialog";
|
||||||
|
import AuthPageSettings, {
|
||||||
|
AuthPageSettingsRef
|
||||||
|
} from "@app/components/private/AuthPageSettings";
|
||||||
|
|
||||||
|
import { Button } from "@app/components/ui/button";
|
||||||
|
import { useOrgContext } from "@app/hooks/useOrgContext";
|
||||||
|
import { userOrgUserContext } from "@app/hooks/useOrgUserContext";
|
||||||
|
import { toast } from "@app/hooks/useToast";
|
||||||
|
import { useState, useRef } from "react";
|
||||||
|
import {
|
||||||
|
Form,
|
||||||
|
FormControl,
|
||||||
|
FormDescription,
|
||||||
|
FormField,
|
||||||
|
FormItem,
|
||||||
|
FormLabel,
|
||||||
|
FormMessage
|
||||||
|
} from "@/components/ui/form";
|
||||||
|
import { Input } from "@/components/ui/input";
|
||||||
|
|
||||||
|
import { z } from "zod";
|
||||||
|
import { useForm } from "react-hook-form";
|
||||||
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
|
import { createApiClient } from "@app/lib/api";
|
||||||
|
import { useEnvContext } from "@app/hooks/useEnvContext";
|
||||||
|
import { formatAxiosError } from "@app/lib/api";
|
||||||
|
import { AxiosResponse } from "axios";
|
||||||
|
import { DeleteOrgResponse, ListUserOrgsResponse } from "@server/routers/org";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
import {
|
||||||
|
SettingsContainer,
|
||||||
|
SettingsSection,
|
||||||
|
SettingsSectionHeader,
|
||||||
|
SettingsSectionTitle,
|
||||||
|
SettingsSectionDescription,
|
||||||
|
SettingsSectionBody,
|
||||||
|
SettingsSectionForm,
|
||||||
|
SettingsSectionFooter
|
||||||
|
} from "@app/components/Settings";
|
||||||
|
import { useUserContext } from "@app/hooks/useUserContext";
|
||||||
|
import { useTranslations } from "next-intl";
|
||||||
|
import { build } from "@server/build";
|
||||||
|
|
||||||
|
export default function GeneralPage() {
|
||||||
|
const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);
|
||||||
|
const router = useRouter();
|
||||||
|
const api = createApiClient(useEnvContext());
|
||||||
|
const t = useTranslations();
|
||||||
|
const { env } = useEnvContext();
|
||||||
|
|
||||||
|
return <p>dfas</p>;
|
||||||
|
}
|
||||||
@@ -16,7 +16,8 @@ import {
|
|||||||
MonitorUp, // Added from 'dev' branch
|
MonitorUp, // Added from 'dev' branch
|
||||||
Server,
|
Server,
|
||||||
Zap,
|
Zap,
|
||||||
CreditCard
|
CreditCard,
|
||||||
|
Logs
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
|
|
||||||
export type SidebarNavSection = {
|
export type SidebarNavSection = {
|
||||||
@@ -138,6 +139,11 @@ export const orgNavSections = (
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
: []),
|
: []),
|
||||||
|
{
|
||||||
|
title: "sidebarLogs",
|
||||||
|
href: "/{orgId}/settings/logs",
|
||||||
|
icon: <Logs className="h-4 w-4" />
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: "sidebarSettings",
|
title: "sidebarSettings",
|
||||||
href: "/{orgId}/settings/general",
|
href: "/{orgId}/settings/general",
|
||||||
|
|||||||
Reference in New Issue
Block a user