Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Looking for help] Adopt Badge API to the new database schemas #5177

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

louislam
Copy link
Owner

@louislam louislam commented Oct 9, 2024

Description

I just realized that I completely forgot that this part is not adopted to the new database schemas.

I am currently focusing on #5075, if anyone would like to work on this, let me know in the comment.🙏

https://github.com/louislam/uptime-kuma/blob/master/server/routers/api-router.js
Endpoints start with /api/badge/.

  • Rewrite some sql statements
  • Query from new tables: stat_daily, stat_hourly, stat_minutely

@louislam louislam added the help wanted May need your help to test or answer label Oct 9, 2024
@louislam louislam added this to the 2.0.0 milestone Oct 9, 2024
@Houbsi
Copy link

Houbsi commented Oct 9, 2024

Hi @louislam,
would this be a good first / easy one to get into?
If yes, i would be happy to setup a dev env.

@louislam
Copy link
Owner Author

louislam commented Oct 9, 2024

Actually, I just realize that some of them has been fixed by #4850 (@ZhaoQi99)

If you don't mind, could you help to check if all endpoints whether is working first?

The endpoints can be found in https://github.com/louislam/uptime-kuma/wiki/Badge

Thank you so much.

@Houbsi
Copy link

Houbsi commented Oct 9, 2024

I used Bruno to query the api on my localhost and get the following:

I tried status and ping for now.

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="31" height="20" role="img" aria-label="N/A">
    <title>N/A</title>
    <linearGradient id="s" x2="0" y2="100%">
        <stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
        <stop offset="1" stop-opacity=".1"/>
    </linearGradient>
    <clipPath id="r">
        <rect width="31" height="20" rx="3" fill="#fff"/>
    </clipPath>
    <g clip-path="url(#r)">
        <rect width="0" height="20" fill="#999"/>
        <rect x="0" width="31" height="20" fill="#999"/>
        <rect width="31" height="20" fill="url(#s)"/>
    </g>
    <g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110">
        <text aria-hidden="true" x="155" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="210">N/A</text>
        <text x="155" y="140" transform="scale(.1)" fill="#fff" textLength="210">N/A</text>
    </g>
</svg>

But the Badge Generator shows the correct Status

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted May need your help to test or answer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants