-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: mutiple incidents #4986
base: master
Are you sure you want to change the base?
feat: mutiple incidents #4986
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work 👍🏻
I have left some minor change-reuquests, but those should be fairly straitforeward.
incident = incident.toPublicJSON(); | ||
} | ||
// Incident List | ||
const incidentList = await StatusPage.getIncidentList(statusPage.id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In cases such as these two lines, please use Promise.all()
to not await twice (=a bit faster)
We know that this is an issue accross the app and that performance could be improved this way ^^
@@ -4,6 +4,7 @@ dist | |||
dist-ssr | |||
*.local | |||
.idea | |||
.history/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could not find good docs what the folder does.
What does this ignore do?
.history/ |
@@ -69,14 +65,15 @@ module.exports.statusPageSocketHandler = (socket) => { | |||
} | |||
}); | |||
|
|||
socket.on("unpinIncident", async (slug, callback) => { | |||
socket.on("unpinIncident", async (slug, incident, callback) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change this to be just the incidentId
, as incident.id
is the only part from this which is used
if (this.incidentList[index].content != null) { | ||
return DOMPurify.sanitize(marked(this.incidentList[index].content)); | ||
} else { | ||
return ""; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets simplify our live a bit
if (this.incidentList[index].content != null) { | |
return DOMPurify.sanitize(marked(this.incidentList[index].content)); | |
} else { | |
return ""; | |
} | |
const markedContent = marked(this.incidentList[index].content ?? ""); | |
return DOMPurify.sanitize(markedContent); |
{{ $t("Last Updated") }}: {{ $root.datetime(incident.lastUpdatedDate) }} ({{ dateFromNow(incident.lastUpdatedDate) }}) | ||
</span> | ||
</div> | ||
<template v-for="(incidentItem, index) in incidentList" :key="incidentItem.id"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that the incidents should be refactored into their own component. This is getting somewhat messy currently (as can be seen on editIncidentMode(..)
, incidentClass
and others existing ^^)
return publicIncidentList; | ||
|
||
} catch (error) { | ||
return []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you add a warning log here? (seems scarry to just ignore the error, I know that you did it to match the above)
<button id="dropdownMenuButton1" class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false"> | ||
{{ $t("Style") }}: {{ $t(incidentItem.style) }} | ||
</button> | ||
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
</ul> | ||
</div> | ||
|
||
<button v-if="!editIncidentMode(index) && incidentItem.id" class="btn btn-light me-2" @click="unpinIncident(index)"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @joebnb What is the status on PR? |
https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md#can-i-create-a-pull-request-for-uptime-kuma
Tick the checkbox if you understand [x]:
Description
Feat: #4953
As previously mentioned, we want uptime-kuma to support displaying multiple incidents simultaneously.
Changes required:
Type of change
Please delete any options that are not relevant.
Checklist
Screenshots (if any)
incognito window
deletion
Please do not use any external image service. Instead, just paste in or drag and drop the image here, and it will be uploaded automatically.