Skip to content
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

Add sse support for alert center, no need to manually refresh the page, add slide-in animation #3051

Merged
merged 11 commits into from
Feb 6, 2025

Conversation

zqr10159
Copy link
Member

@zqr10159 zqr10159 commented Feb 5, 2025

What's changed?

Add sse support for alert center, no need to manually refresh the page, add slide-in animation

20250205171458.mp4

Checklist

  • I have read the Contributing Guide
  • I have written the necessary doc or comment.
  • I have added the necessary unit tests and all cases have passed.

Add or update API

  • I have added the necessary e2e tests and all cases have passed.

… notifications

- Add AlertSseManager to handle SSE emitters and broadcast alerts
- Create AlertSseController to manage SSE connections
- Update AlertNoticeDispatch to send alerts via SSE
- Modify NotifyComponent to use SSE for real-time updates
- Update Manager to enable async support
…ts (SSE)

- Add SSE subscription to receive real-time alerts
- Update alert list with new data from SSE
- Handle SSE errors and close connection on component destruction- Remove refresh button as real-time updates eliminate the need for manual refreshing
- Add log statement in AlertNoticeDispatch before broadcasting alert to SSE client
- Improve traceability and debugging for alert broadcasting process
- Add slide-in animation for new alerts
- Implement alert filtering based on status and content
- Update alert list handling in component
- Modify alert store and dispatch logic
- Format alert timestamps in JSON response
@github-actions github-actions bot added the webapp label Feb 5, 2025
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

license-eye has checked 2975 files.

Valid Invalid Ignored Fixed
1544 2 1429 0
Click to see the invalid file list
  • hertzbeat-alerter/src/main/java/org/apache/hertzbeat/alert/config/AlertSseManager.java
  • hertzbeat-alerter/src/main/java/org/apache/hertzbeat/alert/controller/AlertSseController.java
Use this command to fix any missing license headers
```bash

docker run -it --rm -v $(pwd):/github/workspace apache/skywalking-eyes header fix

</details>

zqr10159 and others added 7 commits February 5, 2025 17:25
…fig/AlertSseManager.java

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: Logic <[email protected]>
…troller/AlertSseController.java

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: Logic <[email protected]>
…tSseManager

- Added class comment for AlertSseController: "SSE controller for alert"
- Added class comment for AlertSseManager: "SSE manager for alert"
- Improved code readability and maintainability
- Introduce mock object for AlertSseManager
- Inject the mock into AlertNoticeDispatch instance
- This change prepares for testing server-sent events (SSE) related functionality
- Introduce mock object for AlertSseManager
- Inject the mock into AlertNoticeDispatch instance
- This change prepares for testing server-sent events (SSE) related functionality
@tomsun28 tomsun28 added this to the 1.7.0 milestone Feb 6, 2025
Copy link
Contributor

@tomsun28 tomsun28 left a comment

Choose a reason for hiding this comment

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

lgtm!

@tomsun28 tomsun28 merged commit 4ddf0a9 into master Feb 6, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

2 participants