feat(ops-dashboard): stream user service logs to the ops dashboard and resolve service containers for Docker log streaming

This commit is contained in:
2026-03-17 23:39:24 +00:00
parent f63be883ce
commit 6defdb4431
11 changed files with 169 additions and 42 deletions

View File

@@ -1019,7 +1019,23 @@ export class OneboxDockerManager {
callback: (line: string, isError: boolean) => void
): Promise<void> {
try {
const container = await this.dockerClient!.getContainerById(containerID);
let container: any = null;
try {
container = await this.dockerClient!.getContainerById(containerID);
} catch {
// Not a direct container ID — try Swarm service lookup
}
if (!container) {
const serviceContainerId = await this.getContainerIdForService(containerID);
if (serviceContainerId) {
try {
container = await this.dockerClient!.getContainerById(serviceContainerId);
} catch {
// Service container also not found
}
}
}
if (!container) {
throw new Error(`Container not found: ${containerID}`);