mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-23 23:04:04 +00:00
Fix: Handle trailing slash for status page routing (#4185)
* Fix: Handle trailing slash * Chore: Add desc for default slug * Chore: Use margin instead of space * Minor
This commit is contained in:
parent
65e57e5621
commit
89beb5f264
3 changed files with 10 additions and 0 deletions
|
@ -21,6 +21,12 @@ class StatusPage extends BeanModel {
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
static async handleStatusPageResponse(response, indexHTML, slug) {
|
static async handleStatusPageResponse(response, indexHTML, slug) {
|
||||||
|
// Handle url with trailing slash (http://localhost:3001/status/)
|
||||||
|
// The slug comes from the route "/status/:slug". If the slug is empty, express converts it to "index.html"
|
||||||
|
if (slug === "index.html") {
|
||||||
|
slug = "default";
|
||||||
|
}
|
||||||
|
|
||||||
let statusPage = await R.findOne("status_page", " slug = ? ", [
|
let statusPage = await R.findOne("status_page", " slug = ? ", [
|
||||||
slug
|
slug
|
||||||
]);
|
]);
|
||||||
|
|
|
@ -323,6 +323,7 @@
|
||||||
"Accept characters:": "Accept characters:",
|
"Accept characters:": "Accept characters:",
|
||||||
"startOrEndWithOnly": "Start or end with {0} only",
|
"startOrEndWithOnly": "Start or end with {0} only",
|
||||||
"No consecutive dashes": "No consecutive dashes",
|
"No consecutive dashes": "No consecutive dashes",
|
||||||
|
"statusPageSpecialSlugDesc": "Special slug {0}: this page will be shown when no slug is provided",
|
||||||
"Next": "Next",
|
"Next": "Next",
|
||||||
"The slug is already taken. Please choose another slug.": "The slug is already taken. Please choose another slug.",
|
"The slug is already taken. Please choose another slug.": "The slug is already taken. Please choose another slug.",
|
||||||
"No Proxy": "No Proxy",
|
"No Proxy": "No Proxy",
|
||||||
|
|
|
@ -25,6 +25,9 @@
|
||||||
<mark>a-z</mark> <mark>0-9</mark>
|
<mark>a-z</mark> <mark>0-9</mark>
|
||||||
</i18n-t>
|
</i18n-t>
|
||||||
<li>{{ $t("No consecutive dashes") }} <mark>--</mark></li>
|
<li>{{ $t("No consecutive dashes") }} <mark>--</mark></li>
|
||||||
|
<i18n-t tag="li" keypath="statusPageSpecialSlugDesc">
|
||||||
|
<mark class="me-1">default</mark>
|
||||||
|
</i18n-t>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue