[PR #5662] [CLOSED] Add MetricsApiController with /api/status endpoint #6544

Closed
opened 2026-02-05 10:35:10 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/BookStackApp/BookStack/pull/5662
Author: @Jandalslap
Created: 6/19/2025
Status: Closed

Base: developmentHead: feature/status-endpoint


📝 Commits (1)

  • 68e08ee Add MetricsApiController with /api/status endpoint

📊 Changes

2 files changed (+39 additions, -0 deletions)

View changed files

app/Api/MetricsApiController.php (+36 -0)
📝 routes/api.php (+3 -0)

📄 Description

Introduced MetricsApiController to expose basic system stats for BookStack. Provides a JSON response with counts for shelves, books, pages, and users. Registered the endpoint at /api/status for use in monitoring and dashboards.

Specifically getHomepage in my case.

Screenshot 2025-06-19 095603

Using the customapi service feature settings below:

  • Documentation:
    • bookstack:
      icon: /icons/bookstack.png
      href: "{{HOMEPAGE_VAR_BOOKSTACK_HREF}}"
      ping: http://bookstack:80
      description: document manager
      widget:
      type: customapi
      url: http://bookstack:80/api/status
      refreshInterval: 60000
      method: GET
      display: block
      mappings:
      - field: shelves
      label: Shelves
      format: number
      - field: books
      label: Books
      format: number
      - field: pages
      label: Pages
      format: number
      - field: users
      label: Users
      format: number

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/BookStackApp/BookStack/pull/5662 **Author:** [@Jandalslap](https://github.com/Jandalslap) **Created:** 6/19/2025 **Status:** ❌ Closed **Base:** `development` ← **Head:** `feature/status-endpoint` --- ### 📝 Commits (1) - [`68e08ee`](https://github.com/BookStackApp/BookStack/commit/68e08eecf1bba18517e92f8829b46a34cf38793e) Add MetricsApiController with /api/status endpoint ### 📊 Changes **2 files changed** (+39 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `app/Api/MetricsApiController.php` (+36 -0) 📝 `routes/api.php` (+3 -0) </details> ### 📄 Description Introduced MetricsApiController to expose basic system stats for BookStack. Provides a JSON response with counts for shelves, books, pages, and users. Registered the endpoint at /api/status for use in monitoring and dashboards. Specifically getHomepage in my case. ![Screenshot 2025-06-19 095603](https://github.com/user-attachments/assets/4476d784-ecb5-4a76-a8d4-6201be667ebc) Using the customapi service feature settings below: - Documentation: - bookstack: icon: /icons/bookstack.png href: "{{HOMEPAGE_VAR_BOOKSTACK_HREF}}" ping: http://bookstack:80 description: document manager widget: type: customapi url: http://bookstack:80/api/status refreshInterval: 60000 method: GET display: block mappings: - field: shelves label: Shelves format: number - field: books label: Books format: number - field: pages label: Pages format: number - field: users label: Users format: number --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 10:35:10 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#6544