@ -101,6 +101,10 @@ router.get("/api/status-page/config", async (_request, response) => {
config . statusPagePublished = true ;
config . statusPagePublished = true ;
}
}
if ( ! config . statusPageTags ) {
config . statusPageTags = "hidden" ;
}
if ( ! config . title ) {
if ( ! config . title ) {
config . title = "Uptime Kuma" ;
config . title = "Uptime Kuma" ;
}
}
@ -143,11 +147,15 @@ router.get("/api/status-page/monitor-list", cache("5 minutes"), async (_request,
let list = await R . find ( "group" , " public = 1 ORDER BY weight " ) ;
let list = await R . find ( "group" , " public = 1 ORDER BY weight " ) ;
for ( let groupBean of list ) {
for ( let groupBean of list ) {
let monitorGroup = await groupBean . toPublicJSON ( )
let monitorGroup = await groupBean . toPublicJSON ( )
monitorGroup . monitorList = await Promise . all ( monitorGroup . monitorList . map ( async ( monitor ) => {
console . log ( "\n\nsettings" , await getSettings ( "statusPage" ) )
// Includes tags as an array in response, allows for tags to be displayed on public status page
if ( ( await getSettings ( "statusPage" ) ) . statusPageTags == "visible" ) {
let tags = await R . getAll ( "SELECT mt.monitor_id,mt.value, tag.name, tag.color FROM monitor_tag mt JOIN tag ON mt.tag_id = tag.id WHERE mt.monitor_id = ?" , [ monitor . id ] ) ;
monitorGroup . monitorList = await Promise . all ( monitorGroup . monitorList . map ( async ( monitor ) => {
return { ... monitor , tags : tags }
// Includes tags as an array in response, allows for tags to be displayed on public status page
} ) )
let tags = await R . getAll ( "SELECT mt.monitor_id,mt.value, tag.name, tag.color FROM monitor_tag mt JOIN tag ON mt.tag_id = tag.id WHERE mt.monitor_id = ?" , [ monitor . id ] ) ;
return { ... monitor , tags : tags }
} ) )
}
publicGroupList . push ( monitorGroup ) ;
publicGroupList . push ( monitorGroup ) ;
}
}