From 2c6e6b12a531aaff2546d9c804fb719cb36c718f Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 2 Sep 2020 11:17:15 +0200 Subject: [PATCH] Bug 22417: Add rabbitmq status indicator on the about page Signed-off-by: Kyle M Hall Signed-off-by: Jonathan Druart --- about.pl | 12 ++++++++++ .../intranet-tmpl/prog/en/modules/about.tt | 22 ++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/about.pl b/about.pl index 2396ad13f4..68abd8cab6 100755 --- a/about.pl +++ b/about.pl @@ -43,6 +43,7 @@ use C4::Installer::PerlModules; use Koha; use Koha::DateUtils qw(dt_from_string output_pref); use Koha::Acquisition::Currencies; +use Koha::BackgroundJob; use Koha::BiblioFrameworks; use Koha::Email; use Koha::Patron::Categories; @@ -555,6 +556,17 @@ $template->param( 'bad_yaml_prefs' => \@bad_yaml_prefs ) if @bad_yaml_prefs; $template->param( warnHiddenBiblionumbers => \@hidden_biblionumbers ); } +{ + # BackgroundJob - test connection to message broker + eval { + Koha::BackgroundJob->connect; + }; + if ( $@ ) { + warn $@; + $template->param( warnConnectBroker => $@ ); + } +} + my %versions = C4::Context::get_versions(); $template->param( diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt index b115967186..da675b086d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt @@ -113,6 +113,17 @@ [% ELSIF (errZebraConnection) %] Warning Error message from Zebra: [% ( errZebraConnection ) | html %] [% END %] + + Message broker: + + Status: + [% IF warnConnectBroker %] + connection failed + [% ELSE %] + running + [% END %] + + Date and time: [% current_date_and_time | $KohaDates with_hours => 1 %] @@ -184,7 +195,7 @@
- [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnPrefKohaAdminEmailAddress || warnNoActiveCurrency || warnIsRootUser || xml_config_warnings.size || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || has_ai_issues || oauth2_missing_deps || bad_yaml_prefs || warnRelationships || log4perl_errors || config_bcrypt_settings_no_set || warnHiddenBiblionumbers.size %] + [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnPrefKohaAdminEmailAddress || warnNoActiveCurrency || warnIsRootUser || xml_config_warnings.size || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || has_ai_issues || oauth2_missing_deps || bad_yaml_prefs || warnRelationships || log4perl_errors || config_bcrypt_settings_no_set || warnHiddenBiblionumbers.size || warnConnectBroker %] [% IF (warnIsRootUser) %]

Warning regarding current user

You are logged in as the database administrative user. This is not recommended because some parts of Koha will not function as expected when using this account.

@@ -259,6 +270,15 @@ [% END %] [% END %] + [% IF warnConnectBroker %] +

Impossible to connect to the message broker

+ There is an error when trying to connect to the message broker (RabbitMQ), check the Koha log files. +
+ Maybe it is not installed and configured correctly? +
+ Contact your system administrator. + [% END %] + [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnPrefKohaAdminEmailAddress || warnNoActiveCurrency || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || oauth2_missing_deps || bad_yaml_prefs || warnIssuingRules || config_bcrypt_settings_no_set || warnHiddenBiblionumbers.size %]

Warnings regarding the system configuration

-- 2.39.5