https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43137

--- Comment #29 from David Nind <[email protected]> ---
Created attachment 202440
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202440&action=edit
Bug 43137: Add health status boxes to System information tab

Adds an asynchronous health status section to the about.pl System
information tab. On page load, fetches GET /api/v1/health and renders
stacked alert boxes per check:

- Green box with 'Operational' text when healthy
- Yellow box with warning messages
- Red box with critical messages
- Restricted checks show a generic translatable message

Core check labels are translated client-side using a mapping from
check IDs. Plugin checks display their label field as-is.
The optional 'detail' field is shown in parentheses after the label.

Falls back to a warning if the API is unreachable.

Test plan:
1. Apply patch
2. Launch KTD:
   $ ktd --name bug_43137 --search-engine es9 --proxy up -d
   $ ktd --name bug_43137 --wait-ready 120
3. Bundle API spec and restart:
   $ ktd --name bug_43137 --shell
  k$ yarn api:bundle && koha-plack --restart kohadev
4. Navigate to About -> System information tab
=> SUCCESS: Observe green box: 'Search engine (Elasticsearch) - Operational'
6. Test Elasticsearch failure:
  k$ sudo xmlstarlet ed -L -u '//elasticsearch/server' \
        -v 'localhost:1234' /etc/koha/sites/kohadev/koha-conf.xml
  k$ restart_all
   - Refresh page -> red box with 'Cannot connect to Elasticsearch'
   - Revert: sudo xmlstarlet ed -L -u '//elasticsearch/server' \
        -v 'es:9200' /etc/koha/sites/kohadev/koha-conf.xml
  k$ restart_all
7. Test Zebra engine:
  k$ koha-mysql kohadev -e "UPDATE systempreferences \
        SET value='Zebra' WHERE variable='SearchEngine';"
  k$ koha-plack --restart kohadev
   - Refresh page
=> SUCCESS: green box: 'Search engine (Zebra) - Operational'
8. Test Zebra failure:
  k$ sudo koha-zebra --stop kohadev
   - Refresh page
=> SUCCESS: red box with 'Cannot connect to Zebra'
  k$ sudo koha-zebra --start kohadev
   - Refresh page
SUCCESS: green box again
9. Sign off :-D

Assisted-by: Sonnet 4 (Anthropic)
Signed-off-by: David Nind <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to