1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-27 07:31:46 +01:00

feat: supports swarm mode with stacks and services on remote hosts 🙌🏼 (#2961)

This commit is contained in:
Amir Raminfar
2024-05-23 10:17:16 -07:00
committed by GitHub
parent 68908e57b7
commit ba0206a903
89 changed files with 1931 additions and 1000 deletions

View File

@@ -213,6 +213,12 @@ func (d *httpClient) ListContainers() ([]Container, error) {
if len(c.Names) > 0 {
name = strings.TrimPrefix(c.Names[0], "/")
}
group := ""
if c.Labels["dev.dozzle.group"] != "" {
group = c.Labels["dev.dozzle.group"]
}
container := Container{
ID: c.ID[:12],
Names: c.Names,
@@ -227,6 +233,7 @@ func (d *httpClient) ListContainers() ([]Container, error) {
Health: findBetweenParentheses(c.Status),
Labels: c.Labels,
Stats: utils.NewRingBuffer[ContainerStat](300), // 300 seconds of stats
Group: group,
}
containers = append(containers, container)
}
@@ -303,7 +310,7 @@ func (d *httpClient) ContainerLogs(ctx context.Context, id string, since string,
ShowStdout: stdType&STDOUT != 0,
ShowStderr: stdType&STDERR != 0,
Follow: true,
Tail: "300",
Tail: strconv.Itoa(100),
Timestamps: true,
Since: since,
}