mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-09 23:24:07 -08: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
|
@ -21,6 +21,12 @@ class StatusPage extends BeanModel {
|
|||
* @returns {void}
|
||||
*/
|
||||
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 = ? ", [
|
||||
slug
|
||||
]);
|
||||
|
|
|
@ -323,6 +323,7 @@
|
|||
"Accept characters:": "Accept characters:",
|
||||
"startOrEndWithOnly": "Start or end with {0} only",
|
||||
"No consecutive dashes": "No consecutive dashes",
|
||||
"statusPageSpecialSlugDesc": "Special slug {0}: this page will be shown when no slug is provided",
|
||||
"Next": "Next",
|
||||
"The slug is already taken. Please choose another slug.": "The slug is already taken. Please choose another slug.",
|
||||
"No Proxy": "No Proxy",
|
||||
|
|
|
@ -25,6 +25,9 @@
|
|||
<mark>a-z</mark> <mark>0-9</mark>
|
||||
</i18n-t>
|
||||
<li>{{ $t("No consecutive dashes") }} <mark>--</mark></li>
|
||||
<i18n-t tag="li" keypath="statusPageSpecialSlugDesc">
|
||||
<mark class="me-1">default</mark>
|
||||
</i18n-t>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue