mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 06:26:57 +00:00
allow to add documentation on containers
Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
parent
ec6448fe5f
commit
c1c96ee08a
10 changed files with 30 additions and 4 deletions
|
|
@ -108,6 +108,10 @@
|
|||
"type": "string",
|
||||
"pattern": "^([a-z0-9.-]+|%AIO_CHANNEL%)$"
|
||||
},
|
||||
"documentation": {
|
||||
"type": "string",
|
||||
"pattern": "^https://.*$"
|
||||
},
|
||||
"devices": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ class Container {
|
|||
private bool $init;
|
||||
private string $imageTag;
|
||||
private AioVariables $aioVariables;
|
||||
private string $documentation;
|
||||
private DockerActionManager $dockerActionManager;
|
||||
|
||||
public function __construct(
|
||||
|
|
@ -60,6 +61,7 @@ class Container {
|
|||
bool $init,
|
||||
string $imageTag,
|
||||
AioVariables $aioVariables,
|
||||
string $documentation,
|
||||
DockerActionManager $dockerActionManager
|
||||
) {
|
||||
$this->identifier = $identifier;
|
||||
|
|
@ -84,6 +86,7 @@ class Container {
|
|||
$this->init = $init;
|
||||
$this->imageTag = $imageTag;
|
||||
$this->aioVariables = $aioVariables;
|
||||
$this->documentation = $documentation;
|
||||
$this->dockerActionManager = $dockerActionManager;
|
||||
}
|
||||
|
||||
|
|
@ -193,4 +196,8 @@ class Container {
|
|||
public function GetAioVariables() : AioVariables {
|
||||
return $this->aioVariables;
|
||||
}
|
||||
|
||||
public function GetDocumentation() : string {
|
||||
return $this->documentation;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -304,6 +304,11 @@ class ContainerDefinitionFetcher
|
|||
$imageTag = $entry['image_tag'];
|
||||
}
|
||||
|
||||
$documentation = '';
|
||||
if (isset($entry['documentation'])) {
|
||||
$documentation = $entry['documentation'];
|
||||
}
|
||||
|
||||
$containers[] = new Container(
|
||||
$entry['container_name'],
|
||||
$displayName,
|
||||
|
|
@ -327,6 +332,7 @@ class ContainerDefinitionFetcher
|
|||
$init,
|
||||
$imageTag,
|
||||
$aioVariables,
|
||||
$documentation,
|
||||
$this->container->get(DockerActionManager::class)
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -255,15 +255,19 @@
|
|||
{% for container in containers %}
|
||||
{% if container.GetDisplayName() != '' %}
|
||||
<li>
|
||||
{% set displayName = container.GetDisplayName() %}
|
||||
{% if container.GetDocumentation() != '' %}
|
||||
{% set displayName = '<a href="' ~ container.GetDocumentation() ~ '">' ~ displayName ~ '</a>' %}
|
||||
{% endif %}
|
||||
{% if class(container.GetStartingState()) == 'AIO\\Container\\State\\StartingState' %}
|
||||
<span class="status running"></span>
|
||||
<span>{{container.GetDisplayName()}} (<a href="/api/docker/logs?id={{ container.GetIdentifier() }}">Starting</a>)</span>
|
||||
<span>{{ displayName }} (<a href="/api/docker/logs?id={{ container.GetIdentifier() }}">Starting</a>)</span>
|
||||
{% elseif class(container.GetRunningState()) == 'AIO\\Container\\State\\RunningState' %}
|
||||
<span class="status success"></span>
|
||||
<span>{{container.GetDisplayName()}} (<a href="/api/docker/logs?id={{ container.GetIdentifier() }}">Running</a>)</span>
|
||||
<span>{{ displayName }} (<a href="/api/docker/logs?id={{ container.GetIdentifier() }}">Running</a>)</span>
|
||||
{% else %}
|
||||
<span class="status error"></span>
|
||||
<span>{{container.GetDisplayName()}} (<a href="/api/docker/logs?id={{ container.GetIdentifier() }}">Stopped</a>)</span>
|
||||
<span>{{ displayName }} (<a href="/api/docker/logs?id={{ container.GetIdentifier() }}">Stopped</a>)</span>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endif %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue