-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Calendar graph #4419
base: master
Are you sure you want to change the base?
Calendar graph #4419
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.
From the changes you made I am mostly not getting the why and think that this PR was created somewhat accidentally (?):
- Why did you choose said libraries, was this not possible with
chart.js
? - You seem to not have used
tippy.js
. Is this intentional? - You commented out some code. Was this for testing purposes or is there a reason?
- Please do fill out the description we provide. I have added the template.
|
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 have had the time to look over this PR and have made a few inline comments about some defects and other stuff.
In general:
- to be mergable, the design needs to fit into the current design. Currently, you are using blue accents. Please try to keep the design close to our
- Sorry if we were unclear about this part of the UI having to be configurable if significant changes like this one are made
- Have you tested that this works as intended? See my concearns about the ´shortBeatList´.
- While I like the way this looks, I am confused what a
counts
is. Please display normal metrics like daily uptime (in %) instead.
src/components/HeartbeatBar.vue
Outdated
<div>{{ timeSinceFirstBeat }} ago</div> | ||
<div v-if="$root.styleElapsedTime === 'with-line'" class="connecting-line"></div> | ||
<div>{{ timeSinceLastBeat }}</div> | ||
<CalendarHeatmap :style="{ fill: '#fff' }" class="heat-map" :values="values" :end-date="endDate" no-data-text="Down" tooltip-unit="counts" /> |
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.
Here you removed the existing beat list.
Please make what is displayed configurable in the sidebars appreeance settings
package.json
Outdated
@@ -142,7 +142,9 @@ | |||
"tar": "~6.1.11", | |||
"tcp-ping": "~0.1.1", | |||
"thirty-two": "~1.0.2", | |||
"tippy.js": "^6.3.7", |
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.
A bit more context is needed on this one:
We already have popperjs installed.
Is there a reason why you chose this library?
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.
Yes, the Vue-Calendar-Heatmap has suggested to use it as mentioned in the documentation.
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.
Can we use popperjs instead for these popups?
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.
@CommanderStorm Tippy.js seems to be a peer dependency to the calendar heat-map package. As per their documentation this is a required dev dependency. I also tried disabling tooltip and removing the tippy.js dependency, that throw an error ERROR: Could not resolve "tippy.js"
. For now I have moved them to the dev dependency.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
As long as this is configurable and is well integrated, such an alternate display mode is fine by me. |
by "alternate display mode" I mean that in the sidebar appearance settings a setting should be added that allows switching between the bigger calendar graph and the shorter beats graph. |
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.
This has improved, but not to the level we require.
These points from my previous review are not resolved.
@@ -80,20 +80,32 @@ router.get("/api/status-page/heartbeat/:slug", cache("1 minutes"), async (reques | |||
]); | |||
|
|||
for (let monitorID of monitorIDList) { | |||
// Calculating the percentage of uptime per day with the status count to show full year data |
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.
This is better (removing XY clounts
), but still not what I meant when I said
in the sidebar appearance settings a setting should be added that allows switching between the bigger calendar graph and the shorter beats graph.
You switched all monitors to the calendar.
Please make this configurable either on
- a per monitor (see the show link feature and the badge generator) or
- per status page level.
ORDER BY COUNT(*) DESC | ||
LIMIT 1 | ||
) as status | ||
FROM heartbeat as main |
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.
@chakflying You have a better grasp at this (this is why the review-request).
Is this query correct? Should this not use stat_daily
instead?
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.
Yes, in the near future, the heartbeats table will only keep data for the last 48 hours. The getDataArray
function in UptimeCalculator
should be used instead. The raw counts data can retrieved that way, and the precentage calculated in the front-end.
Since this was only implemented recently, with the only component utilizing it (PingChart
) still in PR state (#4264), any feedback on the implementation is welcome.
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.
@chakflying correct me if i'm wrong, In near future ur gonna save only 48 hrs monitoring data right. so if I use getDataArray
function, Will I get the last 365 days monitoring data?
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.
The getDataArray
function does not use the heartbeats
table, and instead uses the various stats_
tables. You can take a look at the function implementation as it is in master. We have no time limit when using the 'day' interval.
getDataArray(num, type = "day") {
if (type === "hour" && num > 24 * 30) {
throw new Error("The maximum number of hours is 720");
}
if (type === "minute" && num > 24 * 60) {
throw new Error("The maximum number of minutes is 1440");
}
...
1fdeea0
to
6990d73
Compare
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
Fixes #1984
Type of change
Please delete any options that are not relevant.
Checklist
Screenshots (if any)