Full-stack implementation of the Reckue Dev platform: API: JWT auth, CRUD for users/projects/machines/workspaces/sessions, WebSocket gateway for real-time agent communication. Web: Login/register, dashboard with stats, project/machine/session management pages, sidebar navigation, dark theme. Agent: Rust WebSocket client with PTY terminal management, heartbeat, reconnection logic, Socket.IO protocol support. Deploy: Updated docker-compose and env configuration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
30 lines
885 B
TypeScript
30 lines
885 B
TypeScript
import { Controller, Get, Post, Patch, Body, Param, Query, UseGuards } from '@nestjs/common';
|
|
import { SessionsService } from './sessions.service';
|
|
import { JwtAuthGuard } from '../auth/jwt-auth.guard';
|
|
|
|
@Controller('sessions')
|
|
@UseGuards(JwtAuthGuard)
|
|
export class SessionsController {
|
|
constructor(private sessionsService: SessionsService) {}
|
|
|
|
@Post()
|
|
create(@Body() body: { workspaceId: string; command?: string }) {
|
|
return this.sessionsService.create(body);
|
|
}
|
|
|
|
@Get()
|
|
findByWorkspace(@Query('workspaceId') workspaceId: string) {
|
|
return this.sessionsService.findByWorkspace(workspaceId);
|
|
}
|
|
|
|
@Get(':id')
|
|
findOne(@Param('id') id: string) {
|
|
return this.sessionsService.findById(id);
|
|
}
|
|
|
|
@Patch(':id/status')
|
|
updateStatus(@Param('id') id: string, @Body() body: { status: string }) {
|
|
return this.sessionsService.updateStatus(id, body.status);
|
|
}
|
|
}
|