mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-19 22:16:49 +00:00
Add container state component for improved status display and hide password by default
Signed-off-by: Jean-Yves <7360784+docjyJ@users.noreply.github.com>
This commit is contained in:
parent
2ca49f8962
commit
0e88a15edb
2 changed files with 24 additions and 33 deletions
23
php/templates/components/container-state.twig
Normal file
23
php/templates/components/container-state.twig
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
{# @var c \App\Containers\Container #}
|
||||||
|
<li>
|
||||||
|
{% if c.GetStartingState().value == 'starting' %}
|
||||||
|
<span class="status running"></span>
|
||||||
|
{% elseif c.GetRunningState().value == 'running' %}
|
||||||
|
<span class="status success"></span>
|
||||||
|
{% else %}
|
||||||
|
<span class="status error"></span>
|
||||||
|
{% endif %}
|
||||||
|
<span>
|
||||||
|
{{ c.GetDisplayName() }}
|
||||||
|
(<a href="/api/docker/logs?id={{ c.GetIdentifier() }}" target="_blank">Stopped</a>)
|
||||||
|
{% if c.GetDocumentation() != '' %}
|
||||||
|
(<a target="_blank" href="{{ c.GetDocumentation() }}">docs</a>)
|
||||||
|
{% endif %}
|
||||||
|
</span>
|
||||||
|
{% if c.GetUiSecret() != '' %}
|
||||||
|
<details>
|
||||||
|
<summary>Show password</summary>
|
||||||
|
<p>{{ c.GetUiSecret() }}</p>
|
||||||
|
</details>
|
||||||
|
{% endif %}
|
||||||
|
</li>
|
||||||
|
|
@ -275,39 +275,7 @@
|
||||||
{# @var containers \AIO\Container\Container[] #}
|
{# @var containers \AIO\Container\Container[] #}
|
||||||
{% for container in containers %}
|
{% for container in containers %}
|
||||||
{% if container.GetDisplayName() != '' %}
|
{% if container.GetDisplayName() != '' %}
|
||||||
<li>
|
{% include 'components/container-state.twig' with {'c': container} only %}
|
||||||
{% if container.GetStartingState().value == 'starting' %}
|
|
||||||
<span class="status running"></span>
|
|
||||||
<span>{{ container.GetDisplayName() }} (<a href="/api/docker/logs?id={{ container.GetIdentifier() }}" target="_blank">Starting</a>)
|
|
||||||
{% if container.GetDocumentation() != '' %}
|
|
||||||
(<a target="_blank" href="{{ container.GetDocumentation() }}">docs</a>)
|
|
||||||
{% endif %}
|
|
||||||
{% if container.GetUiSecret() != '' %}
|
|
||||||
(password: {{ container.GetUiSecret() }})
|
|
||||||
{% endif %}
|
|
||||||
</span>
|
|
||||||
{% elseif container.GetRunningState().value == 'running' %}
|
|
||||||
<span class="status success"></span>
|
|
||||||
<span>{{ container.GetDisplayName() }} (<a href="/api/docker/logs?id={{ container.GetIdentifier() }}" target="_blank">Running</a>)
|
|
||||||
{% if container.GetDocumentation() != '' %}
|
|
||||||
(<a target="_blank" href="{{ container.GetDocumentation() }}">docs</a>)
|
|
||||||
{% endif %}
|
|
||||||
{% if container.GetUiSecret() != '' %}
|
|
||||||
(password: {{ container.GetUiSecret() }})
|
|
||||||
{% endif %}
|
|
||||||
</span>
|
|
||||||
{% else %}
|
|
||||||
<span class="status error"></span>
|
|
||||||
<span>{{ container.GetDisplayName() }} (<a href="/api/docker/logs?id={{ container.GetIdentifier() }}" target="_blank">Stopped</a>)
|
|
||||||
{% if container.GetDocumentation() != '' %}
|
|
||||||
(<a target="_blank" href="{{ container.GetDocumentation() }}">docs</a>)
|
|
||||||
{% endif %}
|
|
||||||
{% if container.GetUiSecret() != '' %}
|
|
||||||
(password: {{ container.GetUiSecret() }})
|
|
||||||
{% endif %}
|
|
||||||
</span>
|
|
||||||
{% endif %}
|
|
||||||
</li>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue