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

fixes #15919 statistics page is now loaded via AJAX #3691

Closed
wants to merge 1 commit into from

Conversation

ohadlevy
Copy link
Member

No description provided.

@ohadlevy
Copy link
Member Author

test failures seems unrelated.

@ohadlevy ohadlevy force-pushed the statistics branch 3 times, most recently from 037eb3e to e282076 Compare August 1, 2016 10:27
@ohadlevy
Copy link
Member Author

ohadlevy commented Aug 1, 2016

@tbrisker fixed rubocop.

@ohadlevy
Copy link
Member Author

ohadlevy commented Aug 1, 2016

rebased

@ohadlevy
Copy link
Member Author

ohadlevy commented Aug 1, 2016

[test]

@sean797
Copy link
Member

sean797 commented Aug 1, 2016

I'm not sure how this relates to #3438 or if it's worth thinking about?

@ohadlevy
Copy link
Member Author

ohadlevy commented Aug 1, 2016

@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).

@ohadlevy
Copy link
Member Author

ohadlevy commented Aug 2, 2016

tests are passing, its just katello job which is unstable atm.

@tbrisker tbrisker self-assigned this Aug 3, 2016
@tbrisker
Copy link
Member

tbrisker commented Aug 3, 2016

Seems like somewhere some permissions are missing, when trying to view as non-admin this is what it looks like:
screenshot from 2016-08-03 11-45-29

<% @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>
Copy link
Member

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?

Copy link
Member Author

@ohadlevy ohadlevy Aug 3, 2016 via email

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~"),
Copy link
Member

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?

@tbrisker
Copy link
Member

tbrisker commented Aug 3, 2016

@ohadlevy Thanks, looks good in general, just a few minor comments and one permissions issue.

@ohadlevy
Copy link
Member Author

ohadlevy commented Aug 3, 2016

@tbrisker fixed all of your comments beside the spinner location, looking for suggestions on this one.

@ohadlevy ohadlevy force-pushed the statistics branch 2 times, most recently from ca70ed0 to 333a688 Compare August 3, 2016 15:01
@ohadlevy
Copy link
Member Author

ohadlevy commented Aug 3, 2016

@tbrisker I can't reproduce your issue with permissions, can you provide a trace?

@ohadlevy ohadlevy force-pushed the statistics branch 3 times, most recently from 8bbf176 to 007f47f Compare August 3, 2016 19:13
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
Copy link
Member

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?

Copy link
Member Author

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.

@tbrisker
Copy link
Member

tbrisker commented Aug 4, 2016

merged as 4202625 with minor changes, thanks @ohadlevy!

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

Successfully merging this pull request may close these issues.

4 participants