Skip to content

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

@alametti

Description

@alametti

πŸ“‘ 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

πŸ“ 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A:status-pageIssues or PRs related to the status pagefeature-requestRequest for new features to be added

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions