From 95cd3b608c824047dbf89f19df2046545cf350fe Mon Sep 17 00:00:00 2001 From: Tomas Date: Wed, 24 Feb 2021 13:49:03 +0100 Subject: [PATCH] fixed collector twig template --- bin/grumphp_hooks/environment_spinup | 2 +- docker-compose.yaml | 6 ++-- grumphp.yml | 2 +- src/Resources/config/config.yml | 2 +- .../views/Collector/phystrix.html.twig | 30 ++++++++++--------- 5 files changed, 22 insertions(+), 20 deletions(-) diff --git a/bin/grumphp_hooks/environment_spinup b/bin/grumphp_hooks/environment_spinup index 90064dc..2e00536 100755 --- a/bin/grumphp_hooks/environment_spinup +++ b/bin/grumphp_hooks/environment_spinup @@ -8,6 +8,6 @@ export PATH="/usr/local/bin:$PATH" # DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -if [[ -z `docker-compose ps -q php-phystrix-bundle` ]] || [[ -z `docker ps -q --no-trunc | grep $(docker-compose ps -q php-phystrix-bundle)` ]]; then +if [[ -z `docker-compose ps -q phystrix-bundle-php` ]] || [[ -z `docker ps -q --no-trunc | grep $(docker-compose ps -q phystrix-bundle-php)` ]]; then docker-compose up -d fi diff --git a/docker-compose.yaml b/docker-compose.yaml index 9d7087e..87e591b 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,9 +1,9 @@ version: '3.3' services: - php-phystrix-bundle: - container_name: php-phystrix-bundle - image: php:7.4-cli + phystrix-bundle-php: + container_name: phystrix-bundle-php + image: php:7.4-fpm volumes: - .:/app:delegated working_dir: /app diff --git a/grumphp.yml b/grumphp.yml index 026ff05..765a24b 100644 --- a/grumphp.yml +++ b/grumphp.yml @@ -4,7 +4,7 @@ grumphp: process_timeout: 600 ignore_unstaged_changes: true git_hook_variables: - EXEC_GRUMPHP_COMMAND: './bin/grumphp_hooks/environment_spinup && docker exec -i php-phystrix-bundle' + EXEC_GRUMPHP_COMMAND: './bin/grumphp_hooks/environment_spinup && docker exec -i phystrix-bundle-php' tasks: phpcs: standard: 'phpcs.ruleset.xml' diff --git a/src/Resources/config/config.yml b/src/Resources/config/config.yml index 3b5bc1c..892d894 100644 --- a/src/Resources/config/config.yml +++ b/src/Resources/config/config.yml @@ -59,4 +59,4 @@ services: arguments: - "@phystrix.request_log" tags: - - { name: data_collector, template: "OdeskPhystrixBundle:Collector:phystrix", id: "phystrix"} + - { name: data_collector, template: "@OdeskPhystrix/Collector/phystrix.html.twig", id: "phystrix"} diff --git a/src/Resources/views/Collector/phystrix.html.twig b/src/Resources/views/Collector/phystrix.html.twig index 649eae3..00a7bcd 100644 --- a/src/Resources/views/Collector/phystrix.html.twig +++ b/src/Resources/views/Collector/phystrix.html.twig @@ -2,29 +2,31 @@ {% block toolbar %} {% set icon %} - + {% if collector.commands|length %} - {{ collector.commands|length }} Phystrix commands executed + {{ collector.commands|length }} Phystrix commands executed {% else %} - No Phystrix commands executed + + No Phystrix commands executed + {% endif %} {% endset %} - {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': profiler_url } %} -{% endblock %} + {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': profiler_url } %} + {% endblock %} -{% block menu %} - + {% block menu %} + Phystrix -{% endblock %} + {% endblock %} -{% block panel %} -

Phystrix commands executed

+ {% block panel %} +

Phystrix commands executed

{% if collector.commands|length %} - +
@@ -43,8 +45,8 @@
Command
{% else %} -

+

No Phystrix commands have been executed

- {% endif %} -{% endblock %} + {% endif %} + {% endblock %}