Extending Foreman By Adding a Button

Hi All,

Getting on well with foreman and puppet but for somethings its just not a
good fit for some of the tasks, so my fix to this is to add a button next
to the edit button on the hosts page that will bring up an iFrame of a web
site running on the provisioned host which i can use to do some application
specific functions. The problem I have is… I am not a ruby/rails
programmer, (it is on my TODO list). Had a quick nose around last night
and none of it looked instantly legible could any one help with this ? So
just want some information of which file to edit and where would be really
good :slight_smile:

Richie

I'd suggest writing a plugin rather than hacking on core, then you get
separation of code. That way you'll be able to upgrade more easily without
losing your changes.

As for adding a button, well, that's just a hyperlink with some CSS
styling. you'll find the Edit button in app/helpers/hosts_helper.rb in the
title_actions method.

HTH
Greg

··· On 20 September 2013 09:56, Richie Rees wrote:

Hi All,

Getting on well with foreman and puppet but for somethings its just not a
good fit for some of the tasks, so my fix to this is to add a button next
to the edit button on the hosts page that will bring up an iFrame of a web
site running on the provisioned host which i can use to do some application
specific functions. The problem I have is… I am not a ruby/rails
programmer, (it is on my TODO list). Had a quick nose around last night
and none of it looked instantly legible could any one help with this ? So
just want some information of which file to edit and where would be really
good :slight_smile:

Thanks Greg, will look at writing a plugin but for now will insert a
button, for expediency.

Richie,

··· On Friday, 20 September 2013 10:55:51 UTC+1, Greg Sutcliffe wrote: > > On 20 September 2013 09:56, Richie Rees <richard...@gmail.com > > wrote: > >> Hi All, >> >> Getting on well with foreman and puppet but for somethings its just not a >> good fit for some of the tasks, so my fix to this is to add a button next >> to the edit button on the hosts page that will bring up an iFrame of a web >> site running on the provisioned host which i can use to do some application >> specific functions. The problem I have is... I am not a ruby/rails >> programmer, (it is on my TODO list). Had a quick nose around last night >> and none of it looked instantly legible could any one help with this ? So >> just want some information of which file to edit and where would be really >> good :) >> > > I'd suggest writing a plugin rather than hacking on core, then you get > separation of code. That way you'll be able to upgrade more easily without > losing your changes. > > As for adding a button, well, that's just a hyperlink with some CSS > styling. you'll find the Edit button in app/helpers/hosts_helper.rb in the > title_actions method. > > HTH > Greg >

When you come to start writing a plugin, have a look at this, as I did
something very similar (adds a dropdown to the left of "Edit"):

https://github.com/theforeman/foreman_bootdisk/blob/master/app/helpers/concerns/bootdisk/hosts_helper_ext.rb

··· -- Dominic Cleal Red Hat Engineering

On 20/09/13 11:34, Richie Rees wrote:

Thanks Greg, will look at writing a plugin but for now will insert a
button, for expediency.

Richie,

On Friday, 20 September 2013 10:55:51 UTC+1, Greg Sutcliffe wrote:

On 20 September 2013 09:56, Richie Rees <richard...@gmail.com >     <javascript:>> wrote:

    Hi All, 

    Getting on well with foreman and puppet but for somethings its
    just not a good fit for some of the tasks, so my fix to this is
    to add a button next to the edit button on the hosts page that
    will bring up an iFrame of a web site running on the provisioned
    host which i can use to do some application specific functions.
    The problem I have is... I am not a ruby/rails programmer, (it
    is on my TODO list).  Had a quick nose around last night and
    none of it looked instantly legible could any one help with this
    ?  So just want some information of which file to edit and where
    would be really good :) 


I'd suggest writing a plugin rather than hacking on core, then you
get separation of code. That way you'll be able to upgrade more
easily without losing your changes.

As for adding a button, well, that's just a hyperlink with some CSS
styling. you'll find the Edit button in app/helpers/hosts_helper.rb
in the title_actions method.

HTH
Greg 


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/groups/opt_out.