Self-service host removal. DELETE /api/fleet/hosts/:id (server.manage, tenant-guarded): refuses while the host is 'connected' (409 — a live agent re-registers on its next heartbeat, stop it first), deletes the host's game_instances explicitly (FK is SET NULL, would otherwise orphan them; instance_stats cascade), and clears the legacy server_connections row if it was the license's last host. Fleet view: offline host cards get a Remove button with inline confirm + toast. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
16 lines
614 B
TypeScript
16 lines
614 B
TypeScript
import { Module } from '@nestjs/common';
|
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
|
import { FleetController } from './fleet.controller';
|
|
import { FleetService } from './fleet.service';
|
|
import { AgentHost } from '../../entities/agent-host.entity';
|
|
import { GameInstance } from '../../entities/game-instance.entity';
|
|
import { ServerConnection } from '../../entities/server-connection.entity';
|
|
|
|
@Module({
|
|
imports: [TypeOrmModule.forFeature([AgentHost, GameInstance, ServerConnection])],
|
|
controllers: [FleetController],
|
|
providers: [FleetService],
|
|
exports: [FleetService],
|
|
})
|
|
export class FleetModule {}
|