diff --git a/Classes/EventListener/AddVersionToSystemInformationToolbar.php b/Classes/EventListener/AddVersionToSystemInformationToolbar.php new file mode 100644 index 0000000..1a2a83d --- /dev/null +++ b/Classes/EventListener/AddVersionToSystemInformationToolbar.php @@ -0,0 +1,26 @@ +get('t3meilisearch'); + $client = new Client($settings['host'], $settings['apiKey']); + $version = $client->version()['pkgVersion']; + + $event->getToolbarItem()->addSystemInformation( + 'Meilisearch Version', + $version, + 'actions-search', + InformationStatus::STATUS_NOTICE + ); + } +} diff --git a/Configuration/Services.yaml b/Configuration/Services.yaml index 7a2a051..6f3857f 100644 --- a/Configuration/Services.yaml +++ b/Configuration/Services.yaml @@ -6,3 +6,7 @@ services: VV\T3meilisearch\: resource: '../Classes/*' + + VV\T3meilisearch\EventListener\AddVersionToSystemInformationToolbar: + tags: + - name: event.listener