feat(fleet): remove host — DELETE /api/fleet/hosts/:id + Fleet card action
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>
This commit is contained in:
@@ -4,9 +4,10 @@ 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])],
|
||||
imports: [TypeOrmModule.forFeature([AgentHost, GameInstance, ServerConnection])],
|
||||
controllers: [FleetController],
|
||||
providers: [FleetService],
|
||||
exports: [FleetService],
|
||||
|
||||
Reference in New Issue
Block a user