parameter_renderer

eric at aisling-technologies.com eric at aisling-technologies.com
Wed Nov 22 15:03:33 EST 2017


It does now, thank you.

 

From: Users [mailto:users-bounces at lists.genieacs.com] On Behalf Of Dan Morphis
Sent: Wednesday, November 22, 2017 2:11 PM
To: Community support for GenieACS users <users at lists.genieacs.com>
Subject: Re: parameter_renderer

 

#gui/config/index_parameters.yml

PPPoE Username: VirtualParameters.pppoeUsername

 

 

That will create a column on the device listing labeled 'PPPoE Username' that will display the VirtualParameters.pppoeUsername value. If there was no mapping in parameter_renderers, then the plain text would be output. But because of this line:

 

#gui/config/parameter_renderers.yml

VirtualParameters.pppoeUsername: username_link

 

The username_link ruby function will be executed for each row.  Make sense?

 

-dan

 

On Tue, Nov 21, 2017 at 3:08 PM, <eric at aisling-technologies.com <mailto:eric at aisling-technologies.com> > wrote:

Ok, but how do I use this in index_parameters.yml to display it in the device list?

 

From: Users [mailto:users-bounces at lists.genieacs.com <mailto:users-bounces at lists.genieacs.com> ] On Behalf Of Dan Morphis
Sent: Tuesday, November 21, 2017 6:01 PM
To: Community support for GenieACS users <users at lists.genieacs.com <mailto:users at lists.genieacs.com> >
Subject: Re: parameter_renderer

 

#gui/config/parameter_renderers.yml

VirtualParameters.pppoeUsername: username_link

 

When the GUI renders that vParam, it will call the function named 'username_link'

 

#gui/config/parameter_renderers/username_link.rb

def username_link(val)

  username = val.sub(/\@broadband/, '')

  if username != 'UNKNOWN'

    "<a href=\"#{Rails.configuration.dashboard_base_url}/Broadband/Customer/Account/#{username}\" target=\"_blank\">#{username}</a>"

  end

end

 

This turns the username into a clickable URL that links to our subscriber management software

 

 

On Tue, Nov 21, 2017 at 1:53 PM, <eric at aisling-technologies.com <mailto:eric at aisling-technologies.com> > wrote:

I am trying to get a handle on how to use the parameter_renderer.yml, using the sample with the uptime.  I see how the script and everything works, however, I have not found how to use it in my parameters.json to display in Index or summary?  Any help is greatly appreciated.


_______________________________________________
Users mailing list
Users at lists.genieacs.com <mailto:Users at lists.genieacs.com> 
http://lists.genieacs.com/mailman/listinfo/users

 


_______________________________________________
Users mailing list
Users at lists.genieacs.com <mailto:Users at lists.genieacs.com> 
http://lists.genieacs.com/mailman/listinfo/users

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.genieacs.com/pipermail/users/attachments/20171122/91808ab8/attachment.html>


More information about the Users mailing list