diff --git a/app/api/supervisor/config/group/route.ts b/app/api/supervisor/config/group/route.ts
new file mode 100644
index 0000000..67f028f
--- /dev/null
+++ b/app/api/supervisor/config/group/route.ts
@@ -0,0 +1,60 @@
+import { NextRequest, NextResponse } from 'next/server';
+import { createSupervisorClient } from '@/lib/supervisor/client';
+
+// POST - Add a process group
+export async function POST(request: NextRequest) {
+ try {
+ const body = await request.json();
+ const { name } = body;
+
+ if (!name) {
+ return NextResponse.json(
+ { error: 'Group name is required' },
+ { status: 400 }
+ );
+ }
+
+ const client = createSupervisorClient();
+ const result = await client.addProcessGroup(name);
+
+ return NextResponse.json({
+ success: result,
+ message: `Process group '${name}' added successfully`,
+ });
+ } catch (error: any) {
+ console.error('Supervisor add process group error:', error);
+ return NextResponse.json(
+ { error: error.message || 'Failed to add process group' },
+ { status: 500 }
+ );
+ }
+}
+
+// DELETE - Remove a process group
+export async function DELETE(request: NextRequest) {
+ try {
+ const body = await request.json();
+ const { name } = body;
+
+ if (!name) {
+ return NextResponse.json(
+ { error: 'Group name is required' },
+ { status: 400 }
+ );
+ }
+
+ const client = createSupervisorClient();
+ const result = await client.removeProcessGroup(name);
+
+ return NextResponse.json({
+ success: result,
+ message: `Process group '${name}' removed successfully`,
+ });
+ } catch (error: any) {
+ console.error('Supervisor remove process group error:', error);
+ return NextResponse.json(
+ { error: error.message || 'Failed to remove process group' },
+ { status: 500 }
+ );
+ }
+}
diff --git a/app/api/supervisor/config/reload/route.ts b/app/api/supervisor/config/reload/route.ts
new file mode 100644
index 0000000..4ee3e39
--- /dev/null
+++ b/app/api/supervisor/config/reload/route.ts
@@ -0,0 +1,21 @@
+import { NextResponse } from 'next/server';
+import { createSupervisorClient } from '@/lib/supervisor/client';
+
+// POST - Reload configuration
+export async function POST() {
+ try {
+ const client = createSupervisorClient();
+ const result = await client.reloadConfig();
+ return NextResponse.json({
+ success: true,
+ message: 'Configuration reloaded',
+ result,
+ });
+ } catch (error: any) {
+ console.error('Supervisor reload config error:', error);
+ return NextResponse.json(
+ { error: error.message || 'Failed to reload configuration' },
+ { status: 500 }
+ );
+ }
+}
diff --git a/app/api/supervisor/config/route.ts b/app/api/supervisor/config/route.ts
new file mode 100644
index 0000000..70330ce
--- /dev/null
+++ b/app/api/supervisor/config/route.ts
@@ -0,0 +1,17 @@
+import { NextResponse } from 'next/server';
+import { createSupervisorClient } from '@/lib/supervisor/client';
+
+// GET - Get all process configurations
+export async function GET() {
+ try {
+ const client = createSupervisorClient();
+ const configs = await client.getAllConfigInfo();
+ return NextResponse.json(configs);
+ } catch (error: any) {
+ console.error('Supervisor get config error:', error);
+ return NextResponse.json(
+ { error: error.message || 'Failed to fetch configuration' },
+ { status: 500 }
+ );
+ }
+}
diff --git a/app/config/page.tsx b/app/config/page.tsx
index fe53395..34dc945 100644
--- a/app/config/page.tsx
+++ b/app/config/page.tsx
@@ -1,25 +1,76 @@
'use client';
-import { Settings } from 'lucide-react';
-import { Card, CardContent } from '@/components/ui/card';
+import { useConfig } from '@/lib/hooks/useSupervisor';
+import { ConfigTable } from '@/components/config/ConfigTable';
+import { ReloadConfigButton } from '@/components/config/ReloadConfigButton';
+import { ProcessGroupForm } from '@/components/config/ProcessGroupForm';
+import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
+import { AlertCircle } from 'lucide-react';
export default function ConfigPage() {
+ const { data: configs, isLoading, isError } = useConfig();
+
+ if (isError) {
+ return (
+
+
Configuration
+
+
+
+
Failed to load configuration
+
+ Could not connect to Supervisor. Please check your configuration.
+
+
+
+
+ );
+ }
+
return (
-
-
Configuration
-
Manage Supervisor settings
+
+
+
Configuration
+
+ Manage process configurations and supervisor settings
+
+
+
-
-
-
-
Configuration Coming Soon
-
- This feature will allow you to reload configuration, add/remove process groups, and manage settings.
+ {/* Process Group Management */}
+
+
+ {/* Configuration Table */}
+