-
Notifications
You must be signed in to change notification settings - Fork 357
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 alerts to dashboard #1234
Add alerts to dashboard #1234
Conversation
@miq-bot add_label enhancement |
errors = @ems.miq_alert_statuses.where(:severity => "error").count | ||
else | ||
warnings = MiqAlertStatus.where(:severity => "warning").count | ||
errors = MiqAlertStatus.where(:severity => "error").count |
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.
Are alert statuses exclusive to containers providers? Seems like there should be a filter here
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.
👍 💯 Thanks ! working on that now ...
e99ed52
to
ec1997c
Compare
@zeari Thanks fixed using @moolitayer's suggestion |
ec1997c
to
dd8a0bd
Compare
@himdel @cben codeclimate thinks that
is similar to:
with gravity 48 ! what is going on here ? |
@yaacov Yeah, just ignore codeclimate here, aparently any 3 assignments in a condition are too similar :) |
LGTM @yaacov! |
|
@serenamarie125 looking at the way it looks with zero alerts, I changed it to: |
@yaacov I'd suggest that we never show 0. If there errors of any severity, just show a green check with no number. See the standard card example here: http://www.patternfly.org/pattern-library/cards/aggregate-status-card/ |
8d55807
to
735ecb3
Compare
Every thing is fine: |
a2d1ef1
to
e816661
Compare
@serenamarie125 changed the no alerts to: |
e816661
to
3897256
Compare
@simon3z can we remove the POC from this ? |
Note the alerts feature isn't fully functional upstream (not in the cm-ops flow). So the counts might always be 0 for all our customers. We should how and when this can be available upstream |
11b6d0f
to
69f0f8a
Compare
else | ||
warnings = MiqAlertStatus.where.not(:ems_id => nil).where(:severity => "warning").count | ||
errors = MiqAlertStatus.where.not(:ems_id => nil).where(:severity => "error").count | ||
end |
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.
relation = @ems || MiqAlertStatus.where.not(:ems_id => nil)
warnings, errors = relation.group(:severity).count.values_at(*%w(warning error))
something like this to cut the number of SQL queries (and also source lines) by 2 (3)?
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.
@martinpovolny Nice, thanks 👍 fixed
@miq-bot add_label ux/review |
808b643
to
18d57de
Compare
@@ -96,6 +97,28 @@ def providers | |||
result.values | |||
end | |||
|
|||
def alerts | |||
relation = @ems ? @ems.miq_alert_statuses : MiqAlertStatus.where.not(:ems_id => nil) |
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.
switch MiqAlertStatus.where.not(:ems_id => nil)
with something like MiqAlertStatus.where(:ems_id => ContainerManager.all.pluck(:id))
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.
👍 right, thanks
b3109f9
to
f7e8d8a
Compare
removing POC and WIP but this is still pending core. |
Checked commits yaacov/manageiq-ui-classic@0cabfdb~...b25a37e with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
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.
LGTM @yaacov
This might need to be converted to an (angular) component. Ping @h-kataria, please, take a look. |
Depends on ManageIQ/manageiq#14976
Description
We are discussing adding alerts to the dashboard:
This PR is a POC for adding alerts to the dashboard.
Screenshots
System
One Provider
Current
Mockup