Skip to content

feat: add sorting to status pages#5766

Merged
CommanderStorm merged 5 commits intolouislam:masterfrom
MarshuMax:sorting-and-search
Nov 23, 2025
Merged

feat: add sorting to status pages#5766
CommanderStorm merged 5 commits intolouislam:masterfrom
MarshuMax:sorting-and-search

Conversation

@MarshuMax
Copy link
Contributor

@MarshuMax MarshuMax commented Apr 11, 2025

This PR implements group and global sorting and searching features with corresponding UI improvements. Resolves #1936.

Features

  • Introduced global and group-level sorting with a status bar
  • Implemented global search functionality with improved logic
  • Added certificate expiration label and persistence of sorting state
  • Enhanced UI layout: background styling, component positioning
  • Performed language adaptation and canonical annotation cleanups

Additional Notes

  • A sorting option (ascending/descending) and search bar are now available both globally and within individual groups
  • Global sorting can be applied while also setting specific sorting rules for one or more selected groups

image

Closes #1936

@CommanderStorm
Copy link
Collaborator

Sorry, a +1.1k rewrite of one component implementing different features is not reviewable.
You will need to split this apart.

Looking at the screenshot:

  • From the UI side, this does not really fit into our existing style. Look at how buttons are rounded for exampe.
  • In terms of functionality, I think this is a bit too complex. This adds multiple search bars and multiple sorting options.

@CommanderStorm CommanderStorm requested a review from Copilot April 11, 2025 11:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 3 out of 5 changed files in this pull request and generated no comments.

Files not reviewed (2)
  • src/lang/en.json: Language not supported
  • src/lang/zh-CN.json: Language not supported
Comments suppressed due to low confidence (1)

src/pages/StatusPage.vue:778

  • The new monitor reordering logic would benefit from unit test coverage to ensure that monitors are ordered correctly under various heartbeat conditions.
if (!this.enableEditMode) {

@CommanderStorm CommanderStorm marked this pull request as draft April 12, 2025 10:54
@CommanderStorm CommanderStorm added the A:status-page Issues or PRs related to the status page label Apr 12, 2025
@MarshuMax MarshuMax force-pushed the sorting-and-search branch 2 times, most recently from 5564fc2 to 436ac1b Compare April 13, 2025 15:16
@MarshuMax
Copy link
Contributor Author

Hi @CommanderStorm ,

Thanks for the feedback!

Sorry, a +1.1k rewrite of one component implementing different features is not reviewable. You will need to split this apart.

I'll split the PR into smaller, more focused changes. I'll also add some necessary comments to make the logic clearer.

Looking at the screenshot:

  • From the UI side, this does not really fit into our existing style. Look at how buttons are rounded for exampe.

I'll update the UI to better match the existing style—thanks for pointing that out.

  • In terms of functionality, I think this is a bit too complex. This adds multiple search bars and multiple sorting options.

Do you have any suggestions regarding the sorting feature?
Also, would it still make sense to include a search function here, or do you think it's unnecessary?

I’ll revise the implementation based on your suggestions and follow up with updated PRs soon. Thanks again!

BR,
Marshu

@CommanderStorm
Copy link
Collaborator

CommanderStorm commented Apr 15, 2025

I'd like to simplify this to one button on the top right (at the group level) with just sorting.
No search bar required

We could add it here (nicely out of the way) via a dropdown-button type interaction
image

Also note that the state for this should be an url query parameter
=> make it possible to share the exact sorting with others.

@MarshuMax
Copy link
Contributor Author

MarshuMax commented Apr 16, 2025

I'd like to simplify this to one button on the top right (at the group level) with just sorting. No search bar required

We could add it here (nicely out of the way) via a dropdown-button type interaction image

Ok, will remove the search functionality, and I believe what you're describing would work like this:
image

Also note that the state for this should be an url query parameter => make it possible to share the exact sorting with others.

I’d like to clarify a few points:

  1. Based on your description, it seems the sorting is group-level rather than global.
    Should we remove the global sorting then?

  2. Also, is it currently possible to share links with group-level sorting defined?
    If we want to show different sorting for each group, would the URL look something like this:
    group1_sort=name&group1_order=asc&group2_sort=uptime&group2_order=desc?

@CommanderStorm
Copy link
Collaborator

Based on your description, it seems the sorting is group-level rather than global.
Should we remove the global sorting then?

Yes, please do that. That has the addtional advantage of simplifies the PR ^^

Also, is it currently possible to share links with group-level sorting defined?
If we want to show different sorting for each group, would the URL look something like this:
group1_sort=name&group1_order=asc?

That sounds reasonable. Maybe sort_group1=name_asc since these are trigged by the same thing?
If simpler to implement the other way around, lets use your version, otherwise my.
That is hard bikeshedding theretorium.

@CommanderStorm
Copy link
Collaborator

you're describing would work like this

Yes, that is approximately what I was thinking about.
Maybe with an icon instead of text (more out of the way), but that is for you to decide what you like better.

@MarshuMax
Copy link
Contributor Author

MarshuMax commented Apr 19, 2025

Hi @CommanderStorm ,

Thank you for your suggestions. Based on your advice, I have made the following adjustments.

For the adjustments to the sorting

Removed the search functionality and global sorting. The group sorting options are now displayed through a dropdown button, as shown in the image below.
image

I replaced the "Sort by" text on the button with an upward arrow and a downward arrow. When no sorting option is selected, both arrows are gray. When the sorting is in ascending order, the upward arrow turns green; otherwise, the downward arrow turns green. Allow switching between ascending and descending order by clicking the already selected sorting attribute again.

Support for link-sharing of personal sorting

Implemented the link-sharing feature.
For example, I have two groups named group1 and group2. I defined the sorting rule for group1 as uptime in ascending order, and group2 as status in descending order. The link would be:
http://localhost:3000/status/guess?sort_group1=uptime_asc&sort_group2=status_desc.

When others visit this link, they will see the same sorting effects.
image

The current pull request is half the size of the original pull request, please check it when you have time. Thanks!

@CommanderStorm CommanderStorm added the pr:needs review this PR needs a review by maintainers or other community members label Apr 20, 2025
@MarshuMax MarshuMax marked this pull request as ready for review April 21, 2025 10:22
@CommanderStorm CommanderStorm changed the title feat: add group/global sorting and search with UI enhancements feat: add sorting to status pages May 7, 2025
@CommanderStorm CommanderStorm removed the pr:needs review this PR needs a review by maintainers or other community members label May 7, 2025
Copy link
Collaborator

@CommanderStorm CommanderStorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks quite nicely.
I think this needs another round of polishing though.

The main bug is that the query part does not reflect the state..
image

I have commented in a few other places below too, but those should be minor

@CommanderStorm CommanderStorm added the pr:please address review comments this PR needs a bit more work to be mergable label May 7, 2025
@MarshuMax
Copy link
Contributor Author

Thanks for the review and detailed feedback! Just saw this I’ll go through the comments and update accordingly soon.

@MarshuMax
Copy link
Contributor Author

MarshuMax commented Jul 18, 2025

Hi @CommanderStorm,

Sorry for the long delay in responding to your review. I had to switch to my corporate email for this contribution due to company policy requirements, which took some time to get approved through our internal processes.

I’ve now addressed all your review comments.

Thanks for your patience and the detailed reviews, they really helped improve the code quality. Looking forward to your feedback.

Best regards,
Marshu

@MarshuMax MarshuMax requested a review from CommanderStorm July 18, 2025 08:53
@MarshuMax
Copy link
Contributor Author

Looks quite nicely. I think this needs another round of polishing though.

The main bug is that the query part does not reflect the state.. image

I have commented in a few other places below too, but those should be minor

Thanks for testing. I can’t reproduce the issue on my side, the url query parameters update correctly when I change the sorting. I suspect it might be a caching problem, but I don’t have many leads yet.

@CommanderStorm CommanderStorm added pr:needs review this PR needs a review by maintainers or other community members and removed pr:please address review comments this PR needs a bit more work to be mergable labels Jul 18, 2025
@MarshuMax
Copy link
Contributor Author

Hi @CommanderStorm, do you have any review comments or suggestions for the next steps? Thanks!

@CommanderStorm
Copy link
Collaborator

sorry, I have been super buisy with non-uptime-kuma things.
I won't be able to give a review given the stress that I am currently under from other things.

I would appreciated if other people could test-drive this PR.

@MarshuMax
Copy link
Contributor Author

Hi @CommanderStorm,

Sorry for the late reply, and thanks again for your previous message.
I completely understand you’ve been busy — hope things have been going well for you.

I just wanted to gently check in on this PR and see if there’s anything I can do to help move it forward.
If you’re still busy, no worries at all — perhaps you could suggest someone else who might be able to review it, or I can reach out to other active contributors to help test-drive it.

I’m happy to update the code or run any additional tests if needed.

Thanks again!

@CommanderStorm
Copy link
Collaborator

Sorry for dragging the review out for so long and thanks for the ping.

So the main bug that I would like to see adressed is the bug I noted in the previous review:

image

That should be resonably simple to fix by either using an already existing ID for this or by passing the ID through.

@CommanderStorm
Copy link
Collaborator

The feature works really nicely and I would love to have it

@MarshuMax
Copy link
Contributor Author

MarshuMax commented Nov 23, 2025

Sorry for dragging the review out for so long and thanks for the ping.

So the main bug that I would like to see adressed is the bug I noted in the previous review:

image That should be resonably simple to fix by either using an already existing ID for this or by passing the ID through.

Thanks for the comment! I've fixed this issue.

The current fix uses the group’s backend ID (or the index if no ID is available) as the unique key, which resolves the issue on the status page where groups with the same name were incorrectly coupled in sorting.
The change is in src/components/GroupSortDropdown.vue

This is the current display:
image

Please bother to help review it again if you have time, and let me know if there are any comments, Thanks!

Copy link
Collaborator

@CommanderStorm CommanderStorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

Thank you for impelementing this improvement 🎉

@CommanderStorm CommanderStorm merged commit 23498e4 into louislam:master Nov 23, 2025
20 checks passed
@CommanderStorm CommanderStorm added this to the 2.1.0 milestone Nov 23, 2025
@MarshuMax
Copy link
Contributor Author

Thanks again for reviewing and merging this PR!

Building on the status page improvements here, I’ve opened a separate PR (#6452) that adds a simple search/filter for monitors. This makes it easier to quickly find a specific monitor on large status pages. The PR description has more details.

If you have some time, I’d really appreciate it if you could take a look when convenient. Thanks!

@CommanderStorm CommanderStorm removed the pr:needs review this PR needs a review by maintainers or other community members label Jan 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A:status-page Issues or PRs related to the status page pr:needs-testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Status Page: Sort offline monitors at the top of the status page in 'offline' group

2 participants