Give all containers a display_name, hide from list by dedicated attribute

We want a display-name for all containers in the overlay-log, but still want
to exclude some containers from the list on top of the web UI.

Signed-off-by: Pablo Zmdl <pablo@nextcloud.com>
This commit is contained in:
Pablo Zmdl
2026-03-12 15:44:19 +01:00
parent eda48383b4
commit d86eee5847
5 changed files with 19 additions and 6 deletions

View File

@@ -49,6 +49,9 @@
"type": "string",
"pattern": "^[()A-Za-z &0-9-]+$"
},
"hide_from_list": {
"type": "boolean"
},
"environment": {
"type": "array",
"items": {
@@ -229,4 +232,4 @@
}
}
}
}
}}

View File

@@ -530,6 +530,8 @@
},
{
"container_name": "nextcloud-aio-borgbackup",
"display_name": "Borgbackup",
"hide_from_list": true,
"image_tag": "%AIO_CHANNEL%",
"image": "ghcr.io/nextcloud-releases/aio-borgbackup",
"init": true,
@@ -598,6 +600,8 @@
},
{
"container_name": "nextcloud-aio-watchtower",
"display_name": "Watchtower",
"hide_from_list": true,
"image_tag": "%AIO_CHANNEL%",
"image": "ghcr.io/nextcloud-releases/aio-watchtower",
"init": true,
@@ -618,6 +622,8 @@
},
{
"container_name": "nextcloud-aio-domaincheck",
"display_name": "Domaincheck",
"hide_from_list": true,
"image_tag": "%AIO_CHANNEL%",
"image": "ghcr.io/nextcloud-releases/aio-domaincheck",
"init": true,

View File

@@ -38,7 +38,8 @@ readonly class Container {
public string $imageTag,
public AioVariables $aioVariables,
public string $documentation,
private DockerActionManager $dockerActionManager
private DockerActionManager $dockerActionManager,
public bool $hideFromList
) {
}

View File

@@ -324,6 +324,8 @@ readonly class ContainerDefinitionFetcher {
$documentation = $entry['documentation'];
}
$hideFromList = $entry['hide_from_list'] ?? false;
$containers[] = new Container(
$entry['container_name'],
$displayName,
@@ -349,7 +351,8 @@ readonly class ContainerDefinitionFetcher {
$imageTag,
$aioVariables,
$documentation,
$this->container->get(DockerActionManager::class)
$this->container->get(DockerActionManager::class),
$hideFromList
);
}

View File

@@ -47,10 +47,10 @@
{% endif %}
{% for container in containers %}
{% if container.displayName != '' and container.GetRunningState().value == 'running' %}
{% if container.hideFromList != true and container.GetRunningState().value == 'running' %}
{% set isAnyRunning = true %}
{% endif %}
{% if container.displayName != '' and container.GetRestartingState().value == 'restarting' %}
{% if container.hideFromList != true and container.GetRestartingState().value == 'restarting' %}
{% set isAnyRestarting = true %}
{% endif %}
{% if container.identifier == 'nextcloud-aio-watchtower' and container.GetRunningState().value == 'running' %}
@@ -282,7 +282,7 @@
<ul>
{# @var containers \AIO\Container\Container[] #}
{% for container in containers %}
{% if container.displayName != '' %}
{% if container.hideFromList != true %}
{% include 'components/container-state.twig' with {'c': container} only %}
{% endif %}
{% endfor %}