mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-28 01:04:05 +00:00
Apply formatting suggestions from code review
Co-authored-by: Adam Stachowicz <saibamenppl@gmail.com>
This commit is contained in:
parent
191b81ee07
commit
e5d6410caf
2 changed files with 4 additions and 4 deletions
|
@ -149,7 +149,7 @@ router.get("/api/status-page/monitor-list", cache("5 minutes"), async (_request,
|
||||||
for (let groupBean of list) {
|
for (let groupBean of list) {
|
||||||
let monitorGroup = await groupBean.toPublicJSON();
|
let monitorGroup = await groupBean.toPublicJSON();
|
||||||
if (tagsVisible) {
|
if (tagsVisible) {
|
||||||
monitorGroup.monitorList = await Promise.all(monitorGroup.monitorList.map( async (monitor)=>{
|
monitorGroup.monitorList = await Promise.all(monitorGroup.monitorList.map(async (monitor) => {
|
||||||
// Includes tags as an array in response, allows for tags to be displayed on public status page
|
// Includes tags as an array in response, allows for tags to be displayed on public status page
|
||||||
const tags = await R.getAll(
|
const tags = await R.getAll(
|
||||||
`SELECT monitor_tag.monitor_id, monitor_tag.value, tag.name, tag.color
|
`SELECT monitor_tag.monitor_id, monitor_tag.value, tag.name, tag.color
|
||||||
|
@ -158,7 +158,7 @@ router.get("/api/status-page/monitor-list", cache("5 minutes"), async (_request,
|
||||||
ON monitor_tag.tag_id = tag.id
|
ON monitor_tag.tag_id = tag.id
|
||||||
WHERE monitor_tag.monitor_id = ?`, [monitor.id]
|
WHERE monitor_tag.monitor_id = ?`, [monitor.id]
|
||||||
);
|
);
|
||||||
return {...monitor,tags: tags}
|
return {...monitor, tags: tags}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -493,10 +493,10 @@ export default {
|
||||||
// On load, the status page will not include tags if it's not enabled for security reasons
|
// On load, the status page will not include tags if it's not enabled for security reasons
|
||||||
// Which means if we enable tags, it won't show in the UI until saved
|
// Which means if we enable tags, it won't show in the UI until saved
|
||||||
// So we have this to enhance UX and load in the tags from the authenticated source instantly
|
// So we have this to enhance UX and load in the tags from the authenticated source instantly
|
||||||
this.$root.publicGroupList = this.$root.publicGroupList.map((group)=>{
|
this.$root.publicGroupList = this.$root.publicGroupList.map((group) => {
|
||||||
return {
|
return {
|
||||||
...group,
|
...group,
|
||||||
monitorList: group.monitorList.map((monitor)=> {
|
monitorList: group.monitorList.map((monitor) => {
|
||||||
// We only include the tags if visible so we can reuse the logic to hide the tags on disable
|
// We only include the tags if visible so we can reuse the logic to hide the tags on disable
|
||||||
return {
|
return {
|
||||||
...monitor,
|
...monitor,
|
||||||
|
|
Loading…
Reference in a new issue