Feature #360
closedlisting the hosts with a specific class
Added by Gustavo Soares over 14 years ago. Updated about 14 years ago.
Description
In the edit page of a specific puppetclass it would be nice to see which hosts are using it.
The implementation of this is in my github's foreman fork repository.
http://github.com/gustavosoares/foreman/commit/8524b064fbe7cd10cc45112f7fcc055fca04ad02
A printscreen of the result has been attached.
Files
foreman_puppetclass_feature.png | View foreman_puppetclass_feature.png | 76.3 KB | Gustavo Soares, 07/28/2010 06:47 PM |
Updated by Ohad Levy over 14 years ago
- Category set to Web Interface
- Assignee set to Gustavo Soares
- Target version set to 0.1-6
thats nice :) can you refactor it so it uses the normal host list? (instead of copy paste almost the same code?)
Updated by Gustavo Soares over 14 years ago
Ohad Levy wrote:
thats nice :) can you refactor it so it uses the normal host list? (instead of copy paste almost the same code?)
I have tried, but I am getting the following error:
ActionView::TemplateError (undefined method `hosts_controller?' for #<ActionView::Base:0x2b81609bcfc8>) on line #17 of app/views/hosts/_minilist.html.erb:
14: <% hosts.each do |host| ->
15: <tr class="<= cycle("even", "odd") ->">
16: <td>
17: <= check_box_tag "host_ids[]", host.id, selected?(host), :class => 'host_select_boxes', :onClick => 'insertHostVal(this)' if hosts_controller? ->
18: <=name_column(host) >
19: </td>
20: <td><=h host.try(:os) %></td>
Updated by Gustavo Soares over 14 years ago
Gustavo Soares wrote:
Ohad Levy wrote:
thats nice :) can you refactor it so it uses the normal host list? (instead of copy paste almost the same code?)
I have tried, but I am getting the following error:
ActionView::TemplateError (undefined method `hosts_controller?' for #<ActionView::Base:0x2b81609bcfc8>) on line #17 of app/views/hosts/_minilist.html.erb:
14: <% hosts.each do |host| ->
15: <tr class="<= cycle("even", "odd") ->">
16: <td>
17: <= check_box_tag "host_ids[]", host.id, selected?(host), :class => 'host_select_boxes', :onClick => 'insertHostVal(this)' if hosts_controller? ->
18: <=name_column(host) >
19: </td>
20: <td><=h host.try(:os) %></td>
sorry about that... the hosts_helper was missing :))
Updated by Gustavo Soares over 14 years ago
- % Done changed from 0 to 60
see if it is ok now...
http://github.com/gustavosoares/foreman/commit/0659c728886341b737c2bc52aa85a64d8356c7c8
Updated by Gustavo Soares over 14 years ago
- % Done changed from 60 to 100
done.
Ohad, if you think it is ok now, please you may close this issue.
Thanks in advance,
Gus
Updated by Ohad Levy over 14 years ago
Gustavo Soares wrote:
done.
Ohad, if you think it is ok now, please you may close this issue.
Thanks in advance,
Gus
Hi Gus, Sorry for the late response.. moving a country.
can you please squash it? (so it would appear as one commit against the current develop branch).
thanks,
Ohad
Updated by Ohad Levy about 14 years ago
Hi Gus,
please let me know if you can find the time to finish this patch - thanks
Updated by Gustavo Soares about 14 years ago
Hi Ohad,
I believe the patch is finished.. you asked me to squash it, to appear as one commit. But I didn't get the point.. since it seems not related to the implementation of the patch.
Gus
Updated by Ohad Levy about 14 years ago
Gustavo Soares wrote:
Hi Ohad,
I believe the patch is finished.. you asked me to squash it, to appear as one commit. But I didn't get the point.. since it seems not related to the implementation of the patch.
Maybe I'm just confused, but there are many patches on your branch, which one is the right one (the one above undo some other changes that were introduced in an earlier commit..)
I would appreciate it if you could create a new single commit, which I could merge ontop of the latest develop branch.
Updated by Gustavo Soares about 14 years ago
take a look now and see if it's ok.
http://github.com/gustavosoares/foreman/commit/7c8e596fa424a8d5878601b832def76d8d269d46
(the undos that you saw was after some comments that you made earlier in this thread)
Updated by Ohad Levy about 14 years ago
Gustavo Soares wrote:
take a look now and see if it's ok.
http://github.com/gustavosoares/foreman/commit/7c8e596fa424a8d5878601b832def76d8d269d46
(the undos that you saw was after some comments that you made earlier in this thread)
Hi Gus,
I'm not sure which commit I should be using... is it possible for you to start a new branch (based on the current development branch)
something in the line of:
git remote add upstream git://github.com/ohadlevy/foreman.git git fetch upstream git checkout -b feature/360 upstream/develop apply your modifications (the original patch?) (if you want to ensure that all test cases are running, type rake:test) git commit -m "fixes 360 ......." git push
are you availble on irc? (#theforeman at freenode) - probably much easier to discuss it there.
Thanks,
Ohad
Updated by Ohad Levy about 14 years ago
- Assignee changed from Gustavo Soares to Ohad Levy
I've reviewed the patch, and I'm working on generalizing it (so we can reuse it in many different places).
I'm not so happy with the current implementation that we have(based on search logic) and might accept a simple solution like http://railscasts.com/episodes/228-sortable-table-columns.
in any case, this requires a bit of plumping before we can get it in properly...
Updated by Ohad Levy about 14 years ago
- Status changed from New to Closed
this seemed to be resolved with the attached patch, please reopen if required.
Updated by Ohad Levy about 14 years ago
- Status changed from Closed to New
sorry, closed the wrong ticket :(
Updated by Gustavo Soares about 14 years ago
All right, let me know if you need anything.
Meanwhile I will still be using the previous implementation in the foreman version that I've beeng using.. :))
I will watch the railscasts video.
Ohad Levy wrote:
I've reviewed the patch, and I'm working on generalizing it (so we can reuse it in many different places).
I'm not so happy with the current implementation that we have(based on search logic) and might accept a simple solution like http://railscasts.com/episodes/228-sortable-table-columns.
in any case, this requires a bit of plumping before we can get it in properly...
Updated by Ohad Levy about 14 years ago
- Status changed from New to Ready For Testing
Applied in changeset 1070e14607b45cd3bb4bbd0e5bed08b970d3e98d.
Updated by Ohad Levy about 14 years ago
- Status changed from Ready For Testing to Closed
#439 was created as a follow up of the original request.