AI Assistant c7f037c58a feat: Complete OpenClaw Dashboard with all features
- Dashboard Overview with real-time status display
- Live Log Viewer (scrollable, filterable)
- Config Editor with JSON syntax highlighting
- Model Switcher for provider management
- Provider Manager for API key configuration
- Quick Actions for common tasks
- API Routes: status, logs, config, actions, models, providers

Tech Stack:
- Next.js 14 (App Router)
- TypeScript
- Tailwind CSS
- shadcn/ui components
- CodeMirror for JSON editing
- Docker support with docker-compose
2026-02-27 05:55:23 +00:00

36 lines
868 B
TypeScript

import { NextResponse } from 'next/server';
import { startGateway, stopGateway, restartGateway } from '@/lib/openclaw';
export async function POST(request: Request) {
try {
const { action } = await request.json();
if (!action || !['start', 'stop', 'restart'].includes(action)) {
return NextResponse.json(
{ error: 'Invalid action. Must be start, stop, or restart' },
{ status: 400 }
);
}
let result;
switch (action) {
case 'start':
result = await startGateway();
break;
case 'stop':
result = await stopGateway();
break;
case 'restart':
result = await restartGateway();
break;
}
return NextResponse.json(result);
} catch (error) {
return NextResponse.json(
{ error: (error as Error).message },
{ status: 500 }
);
}
}