feat: initial commit - Scrapyd UI web interface
- Next.js 16.0.1 + React 19.2.0 + Tailwind CSS 4.1.16 - Complete Scrapyd API integration (all 12 endpoints) - Dashboard with real-time job monitoring - Projects management (upload, list, delete) - Spiders management with scheduling - Jobs monitoring with filtering and cancellation - System status monitoring - Dark/light theme toggle with next-themes - Server-side authentication via environment variables - Docker deployment with multi-stage builds - GitHub Actions CI/CD workflow 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
38
app/api/scrapyd/projects/route.ts
Normal file
38
app/api/scrapyd/projects/route.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { ScrapydClient } from "@/lib/scrapyd-client";
|
||||
|
||||
export async function GET() {
|
||||
try {
|
||||
const data = await ScrapydClient.listProjects();
|
||||
return NextResponse.json(data);
|
||||
} catch (error) {
|
||||
console.error("Failed to fetch projects:", error);
|
||||
return NextResponse.json(
|
||||
{ error: "Failed to fetch projects" },
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export async function DELETE(request: NextRequest) {
|
||||
try {
|
||||
const body = await request.json();
|
||||
const { project } = body;
|
||||
|
||||
if (!project) {
|
||||
return NextResponse.json(
|
||||
{ error: "Project name is required" },
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
|
||||
const data = await ScrapydClient.deleteProject({ project });
|
||||
return NextResponse.json(data);
|
||||
} catch (error) {
|
||||
console.error("Failed to delete project:", error);
|
||||
return NextResponse.json(
|
||||
{ error: "Failed to delete project" },
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user