Changeset 209

Show
Ignore:
Timestamp:
08/01/08 15:18:02 (4 months ago)
Author:
pwh
Message:

Reverted changes that caused the views to be mixed up with those from the IP VPN controller.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • nethorus/app/views/device_admin/edit.html.erb

    r206 r209  
    11<h1> 
    2  <% if @ipvpn.id.nil? %> 
    3   New IP VPN 
     2 <% if @device.id.nil? %> 
     3  New Device 
    44 <% else %> 
    5   Editing <%=h @ipvpn.ipvpn_name.blank? ? "a new IP VPN" : @ipvpn.ipvpn_name %><% if !@ipvpn.ipvpn_rd.blank? %> (RD <%=h @ipvpn.ipvpn_rd %>)<% end %> 
     5  Editing <%=h @device.hostname.blank? ? "an unnamed device" : @device.hostname %><% if !@device.ipv4_address.blank? %> (<%=h @device.ipv4_address %>)<% end %> 
    66 <% end %> 
    77</h1> 
    88 
    9 <% form_for :ipvpn, @ipvpn, :url => { :action => @ipvpn.id ? 'edit' : 'new' , :ipvpn_id => @ipvpn.id } do |form| %> 
     9<% form_for :device, @device, :url => { :action => @device.id ? 'edit' : 'new' , :device_id => @device.id } do |form| %> 
    1010 
    11  <% if @ipvpn.id %><%= form.hidden_field :id %><% end %> 
     11 <% if @device.id %><%= form.hidden_field :id %><% end %> 
    1212 
    13  <% if params[:ipvpn] && !@ipvpn.valid? %> 
    14   <%= form.error_messages :header_message => "", :message => "This ipvpn couldn't be saved for the following reasons:" %> 
     13 <% if params[:device] && !@device.valid? %> 
     14  <%= form.error_messages :header_message => "", :message => "This device couldn't be saved for the following reasons:" %> 
    1515 <% end %> 
    1616 
     17 
    1718 <fieldset> 
    18   <legend>VPN Details</legend> 
    19   <label for="ipvpn_rd" accesskey="h">Route Distinguisher</label><%= form.text_field :ipvpn_rd %><br /> 
    20   <label for="ipvpn_name" accesskey="d">Name</label><%= form.text_field :ipvpn_name %><br /> 
     19  <legend>Essentials</legend> 
     20  <label for="hostname" accesskey="h">Hostname</label><%= form.text_field :hostname %><br /> 
     21  <label for="description" accesskey="d">Description</label><%= form.text_field :description %><br /> 
     22  <label for="site" accesskey="s">Site</label><%= collection_select(:device, :site_id, Site.find(:all), :id, :description) %><br /> 
    2123 </fieldset> 
    2224 
    23  <%= submit_tag @ipvpn.id ? 'Save' : 'Create' %> 
     25 <fieldset> 
     26  <legend>Management</legend> 
     27  <label for="ipv4_address" accesskey="a">IP Address</label><%= form.text_field :ipv4_address %><br /> 
     28  <%= form.radio_button("snmp_version", "1", { :onchange => "Element.show('snmpv1_data'); Element.hide('snmpv2_data'); Element.hide('snmpv3_data');" } ) %>SNMPv1<br /> 
     29  <%= form.radio_button("snmp_version", "2", { :onchange => "Element.hide('snmpv1_data'); Element.show('snmpv2_data'); Element.hide('snmpv3_data');" } ) %>SNMPv2<br /> 
     30  <%= form.radio_button("snmp_version", "3", { :onchange => "Element.hide('snmpv1_data'); Element.hide('snmpv2_data'); Element.show('snmpv3_data');" } ) %>SNMPv3<br /> 
     31 </fieldset> 
    2432 
     33 <fieldset id="snmpv1_data"> 
     34  <legend>SNMPv1 Settings</legend> 
     35  <p><strong>Select SNMPv1 only when you are certain this device does not support SNMPv2.  Although SNMPv1 is backward compatible, it will not use GETBULK, which may delay gathering data.</strong></p> 
     36  <label for="snmp_community" accesskey="c">Community string</label><%= form.text_field :snmp_community %><br /> 
     37 </fieldset> 
     38 
     39 <fieldset id="snmpv2_data"> 
     40  <legend>SNMPv2 Settings</legend> 
     41  <label for="snmp_community" accesskey="c">Community string</label><%= form.text_field :snmp_community %><br /> 
     42 </fieldset> 
     43 
     44 <fieldset id="snmpv3_data"> 
     45  <legend>SNMPv3 Settings</legend> 
     46  <label for="snmpv3_security_level">Security Level</label><%= select('snmpv3_security_level', '', [ ['None', 'noAuthNoPriv'], ['Authentication', 'authNoPriv'], ['Privacy', 'authPriv'] ]) %><br /> 
     47  <label for="snmpv3_auth_protocol">Authentication</label><%= select('snmpv3_auth_protocol', '', [ ['SHA', 'sha'], ['MD5', 'md5'] ]) %><%= form.text_field :snmpv3_auth_passphrase %><br /> 
     48  <label for="snmpv3_priv_protocol">Privacy</label><%= select('snmpv3_priv_protocol', '', [ ['AES', 'aes'], ['DES', 'des'] ]) %><%= form.text_field :snmpv3_priv_passphrase %><br /> 
     49  <label for="snmpv3_security_name">Security Name</label><%= form.text_field :snmpv3_security_name %><br /> 
     50 </fieldset> 
     51 
     52 <% if @device.snmp_version == 1 %> 
     53  <%= javascript_tag "Element.hide('snmpv2_data'); Element.hide('snmpv3_data');" %> 
     54 <% elsif @device.snmp_version == 3 %> 
     55  <%= javascript_tag "Element.hide('snmpv1_data'); Element.hide('snmpv2_data');" %> 
     56 <% else %> 
     57  <%= javascript_tag "Element.hide('snmpv1_data'); Element.hide('snmpv3_data');" %> 
     58 <% end %> 
     59 
     60 <%= submit_tag @device.id ? 'Save' : 'Create' %> 
     61 
     62 <% if @device.id %> 
     63  <%= link_to 'Delete', :action => 'delete', :device_id => @device.id %> 
    2564 <% end %> 
    2665 
  • nethorus/app/views/device_admin/index.html.erb

    r185 r209  
    1 <h1>IP VPNs</h1> 
     1<h1>Devices</h1> 
    22 
    3 <p><%= link_to "New IP VPN", { :controller => 'ipvpn_admin', :action => 'new' } %></p> 
     3<p><%= link_to "New device", { :controller => 'device_admin', :action => 'new' } %></p> 
    44 
    55<table class="vert"> 
    66 <tr> 
    7   <th>Route Distinguisher</th> 
    8   <th>Description</th> 
     7  <th>Hostname</th> 
     8  <th>Site</th> 
    99 </tr> 
    10 <% @all_ipvpns.each do |ipvpn| %> 
     10<% @all_devices.each do |device| %> 
    1111 <tr> 
    12   <td><%= link_to ipvpn.ipvpn_rd, { :controller => 'ipvpn_admin', :action => 'edit', :ipvpn_id => ipvpn.id } %></td> 
    13   <td><%= ipvpn.ipvpn_name %></td> 
     12  <td><%= link_to device.hostname, { :controller => 'device_admin', :action => 'edit', :device_id => device.id } %><br /><small><%=h device.description %></small></td> 
     13  <td><%= device.site.nil? ? "" : device.site.description %></td> 
    1414 </tr> 
    1515<% end %>