diff --git a/.travis.yml b/.travis.yml index 3a77b61..8af2664 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,8 +8,8 @@ env: matrix: fast_finish: true include: - - php: 7.3 - - php: 7.3 + - php: 7.4 + - php: 7.4 env: SETUP=lowest - php: 8.0 - php: 8.0 diff --git a/README.md b/README.md index ea8ff45..5a7cd75 100644 --- a/README.md +++ b/README.md @@ -21,8 +21,8 @@ Symfony bundle dedicated to Ibexa, to add a log management interface to the back ## Requirements -* php: >=7.3 -* ibexa: 3.3.* +* php: >=7.4 +* ibexa: 4.0+ :warning: Warning, in its current version, the bundle **only supports** log files in `Monolog/LineFormatter` format. [LineFormatter from Github](https://github.com/Seldaek/monolog/blob/master/src/Monolog/Formatter/LineFormatter.php) diff --git a/composer.json b/composer.json index 59cecd0..22877bb 100644 --- a/composer.json +++ b/composer.json @@ -22,9 +22,11 @@ } }, "require": { - "php": ">=7.3", + "php": ">=7.4", "ext-json": "*", - "ezsystems/ezplatform-admin-ui": "^2.3", + "http-interop/http-factory-guzzle": "^1.2", + "ibexa/admin-ui": "^4.0", + "ibexa/core": "^4.0", "monolog/monolog": "^2.2", "symfony/cache": "^5.2", "symfony/web-profiler-bundle": "^5.2" @@ -38,6 +40,9 @@ "prefer-stable": true, "config": { "optimize-autoloader": true, - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "php-http/discovery": true + } } } diff --git a/src/Controller/LogsManagerController.php b/src/Controller/LogsManagerController.php index 64eb5bc..b675c18 100644 --- a/src/Controller/LogsManagerController.php +++ b/src/Controller/LogsManagerController.php @@ -2,10 +2,10 @@ namespace IbexaLogsUi\Bundle\Controller; -use eZ\Publish\Core\MVC\Symfony\Security\Authorization\Attribute; +use Ibexa\Core\MVC\Symfony\Security\Authorization\Attribute; use IbexaLogsUi\Bundle\LogManager\LogFile; use IbexaLogsUi\Bundle\LogManager\LogsCache; -use EzSystems\EzPlatformAdminUiBundle\Controller\Controller; +use Ibexa\Contracts\AdminUi\Controller\Controller; use Monolog\Handler\HandlerInterface; use Monolog\Logger; use Symfony\Component\HttpFoundation\Response; @@ -116,7 +116,7 @@ private function renderLogs( array $logs = [], array $logLevels = LogFile::LOG_LEVELS ): Response { - return $this->render('@ezdesign/logs/logs.html.twig', [ + return $this->render('@ibexadesign/logs/logs.html.twig', [ 'log_path' => $logPath, 'level' => $level, 'page' => $page, diff --git a/src/EventSubscriber/MenuSubscriber.php b/src/EventSubscriber/MenuSubscriber.php index 9dfa87e..fa3d5db 100644 --- a/src/EventSubscriber/MenuSubscriber.php +++ b/src/EventSubscriber/MenuSubscriber.php @@ -26,6 +26,7 @@ public function onConfigureMenu(ConfigureMenuEvent $event): void $menu[MainMenuBuilder::ITEM_ADMIN]->addChild('logs_ui', [ 'label' => 'logs_ui.menu.label', 'route' => 'ibexa_logs_ui_index', + 'extras' => ['translation_domain' => 'messages'] ]); } } diff --git a/src/IbexaLogsUiBundle.php b/src/IbexaLogsUiBundle.php index 882f9e0..f0fc541 100644 --- a/src/IbexaLogsUiBundle.php +++ b/src/IbexaLogsUiBundle.php @@ -20,7 +20,7 @@ public function build(ContainerBuilder $container): void { parent::build($container); - $eZExtension = $container->getExtension('ezpublish'); + $eZExtension = $container->getExtension('ibexa'); $eZExtension->addPolicyProvider(new LogsUiProvider); } } diff --git a/src/Resources/views/themes/admin/logs/logs.html.twig b/src/Resources/views/themes/admin/logs/logs.html.twig index c02c4c9..7298caf 100644 --- a/src/Resources/views/themes/admin/logs/logs.html.twig +++ b/src/Resources/views/themes/admin/logs/logs.html.twig @@ -1,14 +1,14 @@ -{% extends ['@ezdesign/layout.html.twig', '@ezdesign/ui/layout.html.twig'] %} +{% extends ['@ibexadesign/layout.html.twig', '@ibexadesign/ui/layout.html.twig'] %} {% block breadcrumbs %} - {% include ['@ezdesign/parts/breadcrumbs.html.twig', '@ezdesign/ui/breadcrumbs.html.twig'] with { items: [ + {% include ['@ibexadesign/parts/breadcrumbs.html.twig', '@ibexadesign/ui/breadcrumbs.html.twig'] with { items: [ { value: 'breadcrumb.admin'|trans(domain='messages')|desc('Admin') }, { value: 'logs_ui.menu.label'|trans } ]} %} {% endblock %} -{% block page_title %} - {% include ['@ezdesign/parts/page_title.html.twig', '@ezdesign/ui/page_title.html.twig'] with { +{% block header %} + {% include ['@ibexadesign/parts/page_title.html.twig', '@ibexadesign/ui/page_title.html.twig'] with { title: 'logs_ui.menu.label'|trans, iconName: 'contentlist' } %} @@ -19,43 +19,37 @@ {% set max_logs = constant('IbexaLogsUi\\Bundle\\Controller\\LogsManagerController::MAX_LOGS') %} {% set pages = (total / per_page_logs)|round(0, 'ceil') %} -
Date | -Logger | -Message | +|||
---|---|---|---|---|---|
Date | +Logger | +Message | |||
{{ log.date|date('d/m/Y H:i:s') }} | -
-
+ {{ log.date|date('d/m/Y H:i:s') }} |
+
+ |
-
{{ log.logger }}.{{ log.level }}
+ |
{{ dump_log_message(log.message, log.context) }}
{% if log.context is not empty or log.extra is not empty %}
|
@@ -117,7 +111,7 @@
|