mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-07-21 14:08:53 -04:00
[status page] crop and resize logo
This commit is contained in:
parent
2ab06f87b8
commit
e8f4fabcd0
4 changed files with 135 additions and 11 deletions
|
@ -85,14 +85,32 @@ router.get("/api/status-page/heartbeat", async (_request, response) => {
|
|||
}
|
||||
});
|
||||
|
||||
router.post("/api/status-page/upload-logo", async (request, response) => {
|
||||
allowDevAllOrigin(response);
|
||||
|
||||
// TODO: Check Bearer token
|
||||
|
||||
console.log(request);
|
||||
|
||||
response.json({});
|
||||
});
|
||||
|
||||
async function checkPublished() {
|
||||
if (! await isPublished()) {
|
||||
throw new Error("The status page is not published");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Default is published
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
async function isPublished() {
|
||||
return await setting("statusPagePublished");
|
||||
const value = await setting("statusPagePublished");
|
||||
if (value === null) {
|
||||
return true;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
function send403(res, msg = "") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue