mirror of
https://github.com/okieselbach/AutopilotMonitor.git
synced 2026-10-24 20:53:06 +00:00
re-org admin settings #2
This commit is contained in:
@@ -14,8 +14,8 @@ function TrendingUpIcon({ className = "w-5 h-5" }: { className?: string }) {
|
||||
}
|
||||
|
||||
const SECTION_ICONS: Record<string, React.ReactNode> = {
|
||||
"platform-metrics": <ChartBarIcon />,
|
||||
"platform-usage": <TrendingUpIcon />,
|
||||
"agent-metrics": <ChartBarIcon />,
|
||||
"usage": <TrendingUpIcon />,
|
||||
};
|
||||
|
||||
const metricsItems: PageSectionItem[] = METRICS_NAV_SECTIONS.map((s) => ({
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
import { useParams } from "next/navigation";
|
||||
import { notFound } from "next/navigation";
|
||||
import { METRICS_NAV_SECTIONS, type MetricsSectionId } from "../metricsNavSections";
|
||||
import { SectionPlatformMetrics } from "../sections/SectionPlatformMetrics";
|
||||
import { type MetricsSectionId } from "../metricsNavSections";
|
||||
import { SectionAgentMetrics } from "../sections/SectionAgentMetrics";
|
||||
import { SectionPlatformUsage } from "../sections/SectionPlatformUsage";
|
||||
|
||||
const SECTION_COMPONENTS: Record<MetricsSectionId, React.ComponentType> = {
|
||||
"platform-metrics": SectionPlatformMetrics,
|
||||
"platform-usage": SectionPlatformUsage,
|
||||
"agent-metrics": SectionAgentMetrics,
|
||||
"usage": SectionPlatformUsage,
|
||||
};
|
||||
|
||||
export default function MetricsSectionPage() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
export const METRICS_NAV_SECTIONS = [
|
||||
{ id: "platform-metrics", label: "Platform Metrics", description: "Platform-wide metrics dashboard" },
|
||||
{ id: "platform-usage", label: "Platform Usage", description: "Platform usage statistics across all tenants" },
|
||||
{ id: "agent-metrics", label: "Agent Metrics", description: "Agent version distribution, footprints, and detailed breakdown" },
|
||||
{ id: "usage", label: "Platform Usage", description: "Platform usage statistics across all tenants" },
|
||||
] as const;
|
||||
|
||||
export type MetricsSectionId = (typeof METRICS_NAV_SECTIONS)[number]["id"];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
export default function MetricsPage() {
|
||||
redirect("/admin/metrics/platform-metrics");
|
||||
redirect("/admin/metrics/agent-metrics");
|
||||
}
|
||||
|
||||
+2
-2
@@ -92,7 +92,7 @@ function pN(values: number[], percentile: number): number {
|
||||
|
||||
// ── Component ──────────────────────────────────────────────────────────────────
|
||||
|
||||
export function SectionPlatformMetrics() {
|
||||
export function SectionAgentMetrics() {
|
||||
const router = useRouter();
|
||||
|
||||
useEffect(() => { trackEvent("platform_metrics_viewed"); }, []);
|
||||
@@ -256,7 +256,7 @@ export function SectionPlatformMetrics() {
|
||||
<div className="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">
|
||||
<div className="flex items-center justify-between">
|
||||
<div>
|
||||
<h1 className="text-2xl font-normal text-gray-900">Platform Metrics</h1>
|
||||
<h1 className="text-2xl font-normal text-gray-900">Agent Metrics</h1>
|
||||
{cacheInfo && (
|
||||
<p className="text-xs text-gray-400 mt-1">
|
||||
{cacheInfo.fromCache ? 'From cache' : `Computed in ${cacheInfo.computeDurationMs}ms`}
|
||||
@@ -216,7 +216,7 @@ export function SettingsMenu({
|
||||
{galacticAdminMode && (
|
||||
<div className="border-t border-gray-200 pt-3">
|
||||
<a
|
||||
href="/admin/metrics/platform-usage"
|
||||
href="/admin/metrics/usage"
|
||||
className="block w-full p-3 text-left rounded-lg hover:bg-gray-50 transition-colors"
|
||||
>
|
||||
<div className="flex items-center justify-between">
|
||||
|
||||
@@ -119,12 +119,12 @@ export const NAV_GROUPS: NavGroup[] = [
|
||||
visibility: "galacticAdmin",
|
||||
style: "galactic",
|
||||
items: [
|
||||
{ id: "admin-metrics", label: "Metrics", href: "/admin/metrics", icon: <ChartBarIcon /> },
|
||||
{ id: "admin-tenants", label: "Tenants", href: "/admin/tenants", icon: <DocumentMagnifyingGlassIcon /> },
|
||||
{ id: "admin-metrics", label: "Metrics", href: "/admin/metrics", icon: <ChartBarIcon /> },
|
||||
{ id: "admin-reports", label: "Reports", href: "/admin/reports", icon: <ClipboardDocumentIcon /> },
|
||||
{ id: "admin-settings", label: "Settings", href: "/admin/settings", icon: <GearIcon /> },
|
||||
{ id: "admin-security", label: "Security", href: "/admin/security", icon: <ShieldCheckIcon /> },
|
||||
{ id: "admin-ops", label: "Ops", href: "/admin/ops", icon: <HeartIcon /> },
|
||||
{ id: "admin-settings", label: "Settings", href: "/admin/settings", icon: <GearIcon /> },
|
||||
{ id: "admin-software", label: "Software", href: "/admin/software", icon: <GlobeAltIcon /> },
|
||||
],
|
||||
},
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user