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

[Improvement] Add Web Notifications API in WebUI #510

Open
Azef1 opened this issue Jun 16, 2016 · 7 comments
Open

[Improvement] Add Web Notifications API in WebUI #510

Azef1 opened this issue Jun 16, 2016 · 7 comments

Comments

@Azef1
Copy link

Azef1 commented Jun 16, 2016

Hi,
It's a suggestion :
When the state of a service/host change, generate a notification with Web Notifications API from W3C.
This new API allow to alert the user outside of a web page by displaying notifications (that do not require interaction by the user). Some browsers are compatibles with this API see. Demo here
The users can subscribe or not to this feature.
This feature will be very cool for users who are often on their browser. Users doesn't need to check periodically Shinken WebUI.

What do you think ?

@mohierf
Copy link
Contributor

mohierf commented Jun 16, 2016

Nice idea !

@maethor
Copy link
Contributor

maethor commented May 30, 2017

It doesn't seem easy to implement because we don't detect state changes, we only display them. This feature would need a change queue, something like that. I don't know how to implement this kind of stuff.

But it's a nice idead. Would be usefull, I agree.

@mohierf
Copy link
Contributor

mohierf commented May 30, 2017

@maethor : this may be implemented with the brok management that is done in the manage_brok_thread function. When it receives an host/service/contact update brok, you should raise a notification

@maethor
Copy link
Contributor

maethor commented May 30, 2017

Yes, but I don't know how to route it to the webui. I'm not a web developer 😄

@maethor
Copy link
Contributor

maethor commented May 30, 2017

I mean, how do you implement this?

Do you make an infinite loop in the frontend to check if there is notifications to display? If so, where do you store the notifications until you display them?

Do you push the notifications from the backend when manage_brok_thread detect something? How do you do that?

@maethor
Copy link
Contributor

maethor commented May 30, 2017

If I understand correctly, we should do it with websockets. Sadly I don't have time to learn it, so I won't do it.

@mohierf
Copy link
Contributor

mohierf commented May 30, 2017

What I would do?

For the server part, I would create a new thread function (copy of the existing one) to get the host/service status update broks. If an host/service status changed, I would store this information in a global notifications list.

Then, for the Web part, the WebUI client periodically raises an Ajax call to /gotfirstdata which may be used to pull information from the notifications list and raise a popp on the client browser side.

It is almost the same as what is done on the currenty view to inform about changes in the counters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants