Merge branch 'dev' into clients-user

This commit is contained in:
miloschwartz
2025-12-04 11:38:05 -05:00
31 changed files with 3098 additions and 313 deletions

View File

@@ -0,0 +1,28 @@
import { LogAnalyticsData } from "@app/components/LogAnalyticsData";
import SettingsSectionTitle from "@app/components/SettingsSectionTitle";
import { getTranslations } from "next-intl/server";
import { Suspense } from "react";
export interface AnalyticsPageProps {
params: Promise<{ orgId: string }>;
searchParams: Promise<Record<string, string>>;
}
export default async function AnalyticsPage(props: AnalyticsPageProps) {
const t = await getTranslations();
const orgId = (await props.params).orgId;
return (
<>
<SettingsSectionTitle
title={t("requestAnalytics")}
description={t("requestAnalyticsDescription")}
/>
<div className="container mx-auto max-w-12xl">
<LogAnalyticsData orgId={orgId} />
</div>
</>
);
}

View File

@@ -98,7 +98,7 @@ import { ListTargetsResponse } from "@server/routers/target";
import { DockerManager, DockerState } from "@app/lib/docker";
import { parseHostTarget } from "@app/lib/parseHostTarget";
import { toASCII, toUnicode } from "punycode";
import { DomainRow } from "../../../../../components/DomainsTable";
import { DomainRow } from "@app/components/DomainsTable";
import { finalizeSubdomainSanitize } from "@app/lib/subdomain-utils";
import {
Tooltip,

View File

@@ -136,6 +136,24 @@
}
}
@layer base {
:root {
--chart-1: oklch(0.646 0.222 41.116);
--chart-2: oklch(0.6 0.118 184.704);
--chart-3: oklch(0.398 0.07 227.392);
--chart-4: oklch(0.828 0.189 84.429);
--chart-5: oklch(0.769 0.188 70.08);
}
.dark {
--chart-1: oklch(0.488 0.243 264.376);
--chart-2: oklch(0.696 0.17 162.48);
--chart-3: oklch(0.769 0.188 70.08);
--chart-4: oklch(0.627 0.265 303.9);
--chart-5: oklch(0.645 0.246 16.439);
}
}
p {
word-break: keep-all;
white-space: normal;

View File

@@ -21,6 +21,7 @@ import { build } from "@server/build";
import { TopLoader } from "@app/components/Toploader";
import Script from "next/script";
import { TanstackQueryProvider } from "@app/components/TanstackQueryProvider";
import { TailwindIndicator } from "@app/components/TailwindIndicator";
export const metadata: Metadata = {
title: `Dashboard - ${process.env.BRANDING_APP_NAME || "Pangolin"}`,
@@ -129,6 +130,10 @@ export default async function RootLayout({
</ThemeDataProvider>
</ThemeProvider>
</NextIntlClientProvider>
{process.env.NODE_ENV === "development" && (
<TailwindIndicator />
)}
</body>
</html>
);

View File

@@ -20,7 +20,8 @@ import {
ScanEye,
GlobeLock,
Smartphone,
Laptop
Laptop,
ChartLine
} from "lucide-react";
export type SidebarNavSection = {
@@ -40,7 +41,7 @@ export const orgLangingNavItems: SidebarNavItem[] = [
export const orgNavSections = (): SidebarNavSection[] => [
{
heading: "General",
heading: "sidebarGeneral",
items: [
{
title: "sidebarSites",
@@ -103,7 +104,7 @@ export const orgNavSections = (): SidebarNavSection[] => [
]
},
{
heading: "Access Control",
heading: "accessControls",
items: [
{
title: "sidebarUsers",
@@ -144,7 +145,7 @@ export const orgNavSections = (): SidebarNavSection[] => [
]
},
{
heading: "Analytics",
heading: "sidebarLogsAndAnalytics",
items: (() => {
const logItems: SidebarNavItem[] = [
{
@@ -168,13 +169,20 @@ export const orgNavSections = (): SidebarNavSection[] => [
: [])
];
const analytics = {
title: "sidebarLogsAnalytics",
href: "/{orgId}/settings/logs/analytics",
icon: <ChartLine className="h-4 w-4" />
};
// If only one log item, return it directly without grouping
if (logItems.length === 1) {
return logItems;
return [analytics, ...logItems];
}
// If multiple log items, create a group
return [
analytics,
{
title: "sidebarLogs",
icon: <Logs className="size-4 flex-none" />,
@@ -184,7 +192,7 @@ export const orgNavSections = (): SidebarNavSection[] => [
})()
},
{
heading: "Organization",
heading: "sidebarOrganization",
items: [
{
title: "sidebarApiKeys",
@@ -220,7 +228,7 @@ export const orgNavSections = (): SidebarNavSection[] => [
export const adminNavSections: SidebarNavSection[] = [
{
heading: "Admin",
heading: "sidebarAdmin",
items: [
{
title: "sidebarAllUsers",