-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Badge generator for status pages #5572
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
base: master
Are you sure you want to change the base?
Conversation
You cannot edit other language file. Only the see the contribution guide: https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md#translations |
@cyril59310 I translated pt-BR.json because it is my native language, I misinterpreted this part of the guide line. Is it possible to revert this by maintaining this pull request? |
@cyril59310 I reverted the pt-BR.json file to the last authorized commit on master using the command below. But now I believe it is following all the guidelines. git checkout 489b73a7a638b6bc248e79800257808a19b15253 -- src/lang/pt-BR.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the long wait-time.
This is a larger PR and it took me a longer time to review.
Was on my backlog for longer but got pushed back by smaller simpler to digest PRs.
<label for="badge-builder-badge-style" class="form-label">{{ $t("Badge Style") }}</label> | ||
<select id="badge-builder-badge-style" v-model="config.badgeStyle" class="form-select"> | ||
<option value="flat">Flat</option> | ||
<option value="flat-square">Flat Square</option> | ||
<option value="for-the-badge">For The Badge</option> | ||
<option value="plastic">Plastic</option> | ||
<option value="social">Social</option> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please make sure that all values that are english are translatable ($t
) and are in the translation file en.json
.
If they are not, our kickass team of translators won't be able to translate them
response.set("Content-Type", "image/svg+xml"); | ||
response.send(await StatusPage.renderSVG(slug, config, statusPage)); | ||
} else { | ||
response.status(404).send(await StatusPage.renderSVG(slug, config, null)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In cases of 404s, aborting early is usually a good call.
aborting here also has downstream effects in the code of renderSVG
and upstream in the html
response.status(404).send(await StatusPage.renderSVG(slug, config, null)); | |
response.status(404).send(UptimeKumaServer.getInstance().indexHTML); |
<div class="mb-3"> | ||
<label for="badge-not-found-text" class="form-label">{{ $t("Return to not found") }}</label> | ||
<input | ||
id="badge-not-found-text" v-model="config.notFoundText" type="text" | ||
class="form-control" | ||
> | ||
</div> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is nessesary, please remove it here and in all references to notFoundText
or Return to not found
<div class="mb-3"> | |
<label for="badge-not-found-text" class="form-label">{{ $t("Return to not found") }}</label> | |
<input | |
id="badge-not-found-text" v-model="config.notFoundText" type="text" | |
class="form-control" | |
> | |
</div> |
|
||
computed: { | ||
}, | ||
|
||
watch: { | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not nessesary
computed: { | |
}, | |
watch: { | |
}, |
@@ -19,7 +19,10 @@ | |||
<!-- Description --> | |||
<div class="my-3"> | |||
<label for="description" class="form-label">{{ $t("Description") }}</label> | |||
<textarea id="description" v-model="config.description" class="form-control" data-testid="description-input"></textarea> | |||
<textarea |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove all accidental changes to this file.
It is a large enough PR as is.
// calculate RSS feed description | ||
let status = StatusPage.overallStatus(heartbeats); | ||
|
||
switch (status) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not a status page and not a description. lets inline
// calculate RSS feed description | |
let status = StatusPage.overallStatus(heartbeats); | |
switch (status) { | |
switch (StatusPage.overallStatus(heartbeats)) { |
|
||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-primary" @click="copyImageURL()"> | ||
<!-- <div v-if="processing" class="spinner-border spinner-border-sm me-1"></div> --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<!-- <div v-if="processing" class="spinner-border spinner-border-sm me-1"></div> --> |
@@ -0,0 +1,152 @@ | |||
<template> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rename this component StatusPageSVGBadgeDialog.vue
to reflect the tight focus of this component.
</h5> | ||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" /> | ||
</div> | ||
<div class="modal-body"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add an info alert here to inform users that
Note that adding badges at a monitor level is possible too if they are on any public status page
switch (status) { | ||
case STATUS_PAGE_ALL_DOWN: | ||
return makeBadge({ | ||
message: userConfig.allDownText ?? "all down", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please stick to the options we defined on https://github.com/louislam/uptime-kuma/wiki/Badge where possible.
Different options for different apis is okay, but explaining this difference is a bit too confusing imo.
@CommanderStorm If this PR brings a new feature, it may not be necessary blocking 2.0.0-beta4. May this be in 2.1.0 instead? |
True, I was a bit sloppy in #5177. |
https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md#can-i-create-a-pull-request-for-uptime-kuma
Tick the checkbox if you understand [x]:
Description
I implemented a new feature to generate statusPage badges as discussed in issue #5507
Type of change
Please delete any options that are not relevant.
Checklist
Screenshots (if any)
@louislam @CommanderStorm 🚀