mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-31 12:48:10 +00:00
feat(app-store): add port conflict indicator to deploy sheet (#533)
Show a pulsating warning dot next to host ports that are already in use by a running container. Hovering over the dot reveals which Sencho-managed stack or external app occupies the port. Adds GET /api/ports/in-use endpoint that returns a map of bound host ports with ownership info, and a getPortsInUse method on DockerController that reuses the existing container-to-stack resolution logic.
This commit is contained in:
@@ -3167,6 +3167,19 @@ app.get('/api/containers', async (req: Request, res: Response) => {
|
||||
}
|
||||
});
|
||||
|
||||
app.get('/api/ports/in-use', async (req: Request, res: Response) => {
|
||||
try {
|
||||
const fsService = FileSystemService.getInstance(req.nodeId);
|
||||
const stacks = await fsService.getStacks();
|
||||
const dockerController = DockerController.getInstance(req.nodeId);
|
||||
const portsInUse = await dockerController.getPortsInUse(stacks);
|
||||
res.json(portsInUse);
|
||||
} catch (error) {
|
||||
console.error('[Ports] Failed to fetch ports in use:', error);
|
||||
res.status(500).json({ error: 'Failed to fetch ports in use' });
|
||||
}
|
||||
});
|
||||
|
||||
// --- Label Routes (Skipper+) ---
|
||||
|
||||
app.get('/api/labels', authMiddleware, async (req: Request, res: Response): Promise<void> => {
|
||||
|
||||
Reference in New Issue
Block a user