Display certain parameters value in show device
Fabien Bazille
fab.baz22 at gmail.com
Fri May 22 08:55:07 EDT 2015
Hi,
I would like to display some values on the show device page, I managed to
display them on the index page, but i think the problem should be in the
parameter.json.
Parameter.json:
"InternetGatewayDevice.WANDevice./^\\d+$/.WANConnectionDevice./^\\d+$/.WANIPConnection./^\\d+$/.MACAddress"
: {"alias" : "summary.mac", "type" : "mac"},
"InternetGatewayDevice.WANDevice./^\\d+$/.WANConnectionDevice./^\\d+$/.WANPPPConnection./^\\d+$/.ExternalIPAddress"
: {"alias" : "summary.ip"},
"InternetGatewayDevice.LANDevice./^\\d+$/.WLANConfiguration./^\\d+$/.SSID"
: {"alias" : "summary.wlanSsid"},
"InternetGatewayDevice.LANDevice./^\\d+$/.WLANConfiguration./^\\d+$/.PreSharedKey./^\\d+$/.KeyPassphrase"
: {"alias" : "summary.wlanPassphrase"},
"InternetGatewayDevice.WANDevice./^\\d+$/.WANDSLInterfaceConfig.DownstreamAttenuation"
: {"alias" : "summary.DownstreamAttenuation"},
"InternetGatewayDevice.WANDevice./^\\d+$/.WANDSLInterfaceConfig.UpstreamAttenuation"
: {"alias" : "summary.UpstreamAttenuation"},
"InternetGatewayDevice.WANDevice./^\\d+$/.WANDSLInterfaceConfig.DownstreamNoiseMargin"
: {"alias" : "summary.DownstreamNoiseMargin"},
"InternetGatewayDevice.WANDevice./^\\d+$/.WANDSLInterfaceConfig.UpstreamNoiseMargin"
: {"alias" : "summary.UpstreamNoiseMargin"},
"InternetGatewayDevice.WANDevice./^\\d+$/.WANDSLInterfaceConfig.DownstreamCurrRate"
: {"alias" : "summary.DownstreamCurrRate"},
"InternetGatewayDevice.WANDevice./^\\d+$/.WANDSLInterfaceConfig.UpstreamCurrRate"
: {"alias" : "summary.UpstreamCurrRate"},
I think it's the show.html.erb in the div summary who cause my trouble:
<div class="summary">
<% for k,v in Rails.configuration.summary_parameters %>
<% if v.is_a?(String) %>
<p>
<strong><%= k %>:</strong>
<%= param_value(v, @device) %>
<% if (p = get_param(v, @device)) != nil and p['_writable'] and
can_edit_parameters %>
—
<% options =
Rails.configuration.parameters_edit[p['_path'].gsub(/\.\d+\./, '..')] %>
<a href="#" onclick='editParam("<%= v %>", "<%= p['_type'] %>", <%=
p['_value'].to_json.html_safe %>, <%= options.to_json.html_safe %>);return
false;'>Edit</a>
<% end %>
</p>
<% else %>
<h2><%= k %></h2>
<%= render partial: 'object_table', locals: {params: v} %>
<% end %>
<% end %>
</div>
If you have an advice, i'll take it.
Thanks for your time
Regards,
Fabien B
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.genieacs.com/pipermail/users/attachments/20150522/f5d5ff58/attachment.html>
More information about the Users
mailing list