-
Notifications
You must be signed in to change notification settings - Fork 900
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
Enable server-push using ActionCable #10965
Conversation
887c8fc
to
39bf779
Compare
Ack. from backend perspective. |
@@ -830,7 +830,9 @@ function miqAjaxAuth(url) { | |||
|
|||
// TODO API.autorenew is called on (non-login) page load - when? | |||
}) | |||
.then(null, function() { | |||
.then(function () { |
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.
aah, can you do this in a separate .then
? Because now failures from ws_init
would be ignored..
39bf779
to
70217ea
Compare
@himdel check it out now |
@@ -0,0 +1,23 @@ | |||
//= require action_cable | |||
|
|||
miqInitNotifications = function () { |
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.
var miqInitNotifications = function () {
or function miqInitNotifications() {
please :)
70217ea
to
93f1014
Compare
delete sessionStorage.miq_token; | ||
}; | ||
|
||
API.init = function() { | ||
API.autorenew(); | ||
miqInitNotifications(); |
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.
Feels wrong to add something quite unrelated to API code since there's no real direct dependency.
Can you rewert the autorenew
-> init
change please and just call miqInitNotifications
in application.html.haml
?
Or move this init function outside the API code.
93f1014
to
10ddbb6
Compare
10ddbb6
to
fb40688
Compare
fb40688
to
ced4ed3
Compare
Checked commits skateman/manageiq@bd94c54~...ced4ed3 with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1 app/channels/application_cable/connection.rb
|
This PR enables server-push in ManageIQ using ActionCable. The plan is to use it for asynchronous notifications displayed in the form of PatternFly toasts. This PR just implements a PoC solution, where the notifications are logged into the browser's JS console.
For testing it is necessary to run run
cp config/cable.yml.sample config/cable.yml
or re-runbin/setup
. Then log in to the Web UI and open the browser's JavaScript console. Notifications can be emitted using a rails console in the following form:Where
user_id
is the numerical database ID of the logged in user and themessage
is an instance of aHash
object.