-
Notifications
You must be signed in to change notification settings - Fork 987
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
fixes #15919 statistics page is now loaded via AJAX #3691
Conversation
test failures seems unrelated. |
037eb3e
to
e282076
Compare
@tbrisker fixed rubocop. |
rebased |
[test] |
I'm not sure how this relates to #3438 or if it's worth thinking about? |
@sean797 - nice - I missed that PR. I could see how the two can integrate, but in that case I would also like to discuss dashboard widgets (e.g. what is the different between a widget and statistics model?) I believe my patch will simplify your patch (e.g. in terms of statistics chart type - host counter, fact counter etc). |
tests are passing, its just katello job which is unstable atm. |
<% @stats.each do |stat| %> | ||
<div data-ajax-url=<%= stat.url %> class='stats-well' data-on-complete='refreshCharts'> | ||
<div class='statistics-pie-placeholder'> | ||
<h4 class='ca pie-title'> <span class='spinner spinner-xl spinner-inline'> </span> <%= stat.title %> </h4> |
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.
There is no spinner-xl
, the largest is spinner-lg
. Also, looks strange to have the spinner inline before the title, maybe move it down to where the chart should be?
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.
CountHosts.new(:count_by => :operatingsystem, :title => ("OS Distribution"), :search =>"os_title=~VAL~"), | ||
CountHosts.new(:count_by => :architecture, :title => _("Architecture Distribution"), :search => "facts.architecture=~VAL~"), | ||
CountHosts.new(:count_by => :environment, :title => _("Environment Distribution"), :search => "environment=~VAL~"), | ||
CountFacts.new(:count_by => 'processorcount', :unit => Nn_('%s core', '%s cores'), :title => "Number of CPUs", :search => "facts.processorcount=~VAL1~"), |
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.
why are some count_by strings and some symbols?
@ohadlevy Thanks, looks good in general, just a few minor comments and one permissions issue. |
@tbrisker fixed all of your comments beside the spinner location, looking for suggestions on this one. |
ca70ed0
to
333a688
Compare
@tbrisker I can't reproduce your issue with permissions, can you provide a trace? |
8bbf176
to
007f47f
Compare
Also: - refactor how statistics data is being called, now it should be trivial to add additional charts or consume other data from it. It should make it much easier to reuse statistics charts in other places (e.g. dashboard) or unify how fact charts are done. - remove unused JSON response from the statistics controller.
end | ||
|
||
def id | ||
@id || count_by.to_s |
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.
why not move this into the initializer? also, why not leave it as a symbol?
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.
some of the queries required string (e.g. facts) instead of changing that and everywhere that uses it, I chose to change it here.
No description provided.