Badges on the status page should default their suffix based on the requested duration #4754

Open
opened 2026-02-28 04:14:06 -05:00 by deekerman · 1 comment
Owner

Originally created by @alametti on GitHub (Feb 26, 2026).

Relates to #2808, which was created before v2.0.0 and the badge endpoint rework so is no longer relevant.

🛡️ Security Policy

📝 Description

The /api/badge/:monitor/uptime/:duration accepts a duration such as 1y but the generated badge says 1h, as the h suffix appears to be hard-coded.

👟 Reproduction steps

  1. Access https://up.metti.ca/api/badge/8/uptime/1y
  2. Image is as follows:
    Image

👀 Expected behavior

Badge should read: (1y)

😓 Actual Behavior

Badge reads: (1h)

🐻 Uptime-Kuma Version

2.1.3

💻 Operating System and Arch

Amazon Linux 2023.10.20260202 x86_64

🌐 Browser

Mozilla/5.0 (X11; Linux x86_64; rv:148.0) Gecko/20100101 Firefox/148.0

🖥️ Deployment Environment

  • Runtime Environment:
    • Docker: Version 25.0.14
    • Docker Compose: Version 2.38.2
  • Database:
    • SQLite: Embedded
  • Database Storage:
    • Filesystem:
      • Linux: Unknown (EC2)
    • Storage Medium: Unknown (EC2)
  • Uptime Kuma Setup:
    • Number of monitors: 21

📝 Relevant log output


Originally created by @alametti on GitHub (Feb 26, 2026). ### 📑 I have found these related issues/pull requests Relates to #2808, which was created before v2.0.0 and the badge endpoint rework so is no longer relevant. ### 🛡️ Security Policy - [x] I have read and agree to Uptime Kuma's [Security Policy](https://github.com/louislam/uptime-kuma/security/policy). ### 📝 Description The `/api/badge/:monitor/uptime/:duration` accepts a duration such as `1y` but the generated badge says `1h`, as the `h` suffix appears to be hard-coded. ### 👟 Reproduction steps 1. Access `https://up.metti.ca/api/badge/8/uptime/1y` 2. Image is as follows: <img width="130" height="20" alt="Image" src="https://github.com/user-attachments/assets/723b640e-9124-4e3d-95b4-6b52ae42e39e" /> ### 👀 Expected behavior Badge should read: `(1y)` ### 😓 Actual Behavior Badge reads: `(1h)` ### 🐻 Uptime-Kuma Version 2.1.3 ### 💻 Operating System and Arch Amazon Linux 2023.10.20260202 x86_64 ### 🌐 Browser Mozilla/5.0 (X11; Linux x86_64; rv:148.0) Gecko/20100101 Firefox/148.0 ### 🖥️ Deployment Environment - **Runtime Environment**: - Docker: Version `25.0.14` - Docker Compose: Version `2.38.2` - **Database**: - SQLite: Embedded - **Database Storage**: - **Filesystem**: - Linux: Unknown (EC2) - **Storage Medium**: Unknown (EC2) - **Uptime Kuma Setup**: - Number of monitors: `21` ### 📝 Relevant log output ```bash session ```
Author
Owner

@CommanderStorm commented on GitHub (Feb 26, 2026):

Please refer to the docs, that is how it currently works, not a bug.
You can change the suffix though..

https://github.com/louislam/uptime-kuma/wiki/Badge#ping-uptime-avg-response-and-response-badge

Likely the default should be different though.

@CommanderStorm commented on GitHub (Feb 26, 2026): Please refer to the docs, that is how it currently works, not a bug. You can change the suffix though.. https://github.com/louislam/uptime-kuma/wiki/Badge#ping-uptime-avg-response-and-response-badge Likely the default should be different though.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/uptime-kuma#4754
No description provided.