From 0e88a15edb51990340322bca6146b05789350309 Mon Sep 17 00:00:00 2001 From: Jean-Yves <7360784+docjyJ@users.noreply.github.com> Date: Sat, 1 Mar 2025 20:57:21 +0100 Subject: [PATCH 1/3] Add container state component for improved status display and hide password by default Signed-off-by: Jean-Yves <7360784+docjyJ@users.noreply.github.com> --- php/templates/components/container-state.twig | 23 +++++++++++++ php/templates/containers.twig | 34 +------------------ 2 files changed, 24 insertions(+), 33 deletions(-) create mode 100644 php/templates/components/container-state.twig diff --git a/php/templates/components/container-state.twig b/php/templates/components/container-state.twig new file mode 100644 index 00000000..cdf70016 --- /dev/null +++ b/php/templates/components/container-state.twig @@ -0,0 +1,23 @@ +{# @var c \App\Containers\Container #} +
  • + {% if c.GetStartingState().value == 'starting' %} + + {% elseif c.GetRunningState().value == 'running' %} + + {% else %} + + {% endif %} + + {{ c.GetDisplayName() }} + (Stopped) + {% if c.GetDocumentation() != '' %} + (docs) + {% endif %} + + {% if c.GetUiSecret() != '' %} +
    + Show password +

    {{ c.GetUiSecret() }}

    +
    + {% endif %} +
  • \ No newline at end of file diff --git a/php/templates/containers.twig b/php/templates/containers.twig index 1124c51a..96687dac 100644 --- a/php/templates/containers.twig +++ b/php/templates/containers.twig @@ -275,39 +275,7 @@ {# @var containers \AIO\Container\Container[] #} {% for container in containers %} {% if container.GetDisplayName() != '' %} -
  • - {% if container.GetStartingState().value == 'starting' %} - - {{ container.GetDisplayName() }} (Starting) - {% if container.GetDocumentation() != '' %} - (docs) - {% endif %} - {% if container.GetUiSecret() != '' %} - (password: {{ container.GetUiSecret() }}) - {% endif %} - - {% elseif container.GetRunningState().value == 'running' %} - - {{ container.GetDisplayName() }} (Running) - {% if container.GetDocumentation() != '' %} - (docs) - {% endif %} - {% if container.GetUiSecret() != '' %} - (password: {{ container.GetUiSecret() }}) - {% endif %} - - {% else %} - - {{ container.GetDisplayName() }} (Stopped) - {% if container.GetDocumentation() != '' %} - (docs) - {% endif %} - {% if container.GetUiSecret() != '' %} - (password: {{ container.GetUiSecret() }}) - {% endif %} - - {% endif %} -
  • + {% include 'components/container-state.twig' with {'c': container} only %} {% endif %} {% endfor %} From 06b31c5680d1204e4c6c142deb21e84fee3e27bb Mon Sep 17 00:00:00 2001 From: Jean-Yves <7360784+docjyJ@users.noreply.github.com> Date: Thu, 6 Mar 2025 15:54:53 +0100 Subject: [PATCH 2/3] Update php/templates/components/container-state.twig Co-authored-by: Simon L. Signed-off-by: Jean-Yves <7360784+docjyJ@users.noreply.github.com> --- php/templates/components/container-state.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/templates/components/container-state.twig b/php/templates/components/container-state.twig index cdf70016..a79db31e 100644 --- a/php/templates/components/container-state.twig +++ b/php/templates/components/container-state.twig @@ -16,7 +16,7 @@ {% if c.GetUiSecret() != '' %}
    - Show password + Show password for {{ c.GetDisplayName() }}

    {{ c.GetUiSecret() }}

    {% endif %} From e6bf224a9a38c704c1136f470d220cc51c0ca468 Mon Sep 17 00:00:00 2001 From: Jean-Yves <7360784+docjyJ@users.noreply.github.com> Date: Thu, 6 Mar 2025 16:00:39 +0100 Subject: [PATCH 3/3] Fix request Signed-off-by: Jean-Yves <7360784+docjyJ@users.noreply.github.com> --- php/templates/components/container-state.twig | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/php/templates/components/container-state.twig b/php/templates/components/container-state.twig index a79db31e..8bc8c559 100644 --- a/php/templates/components/container-state.twig +++ b/php/templates/components/container-state.twig @@ -1,15 +1,19 @@ {# @var c \App\Containers\Container #}
  • - {% if c.GetStartingState().value == 'starting' %} - - {% elseif c.GetRunningState().value == 'running' %} - - {% else %} - - {% endif %} - {{ c.GetDisplayName() }} - (Stopped) + {% if c.GetRunningState().value == 'running' %} + + {{ c.GetDisplayName() }} + (Running) + {% elseif c.GetStartingState().value == 'starting' %} + + {{ c.GetDisplayName() }} + (Starting) + {% else %} + + {{ c.GetDisplayName() }} + (Stopped) + {% endif %} {% if c.GetDocumentation() != '' %} (docs) {% endif %} @@ -17,7 +21,7 @@ {% if c.GetUiSecret() != '' %}
    Show password for {{ c.GetDisplayName() }} -

    {{ c.GetUiSecret() }}

    +
    {% endif %}
  • \ No newline at end of file