Changeset 188

Show
Ignore:
Timestamp:
07/30/08 16:03:26 (4 months ago)
Author:
pwh
Message:
  • Reworked the Manage page to include tabs for Bridges and Inventory
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • nethorus/app/controllers/manage_controller.rb

    r181 r188  
    2929 
    3030 
     31  # Display a list of entity types that can be managed 
     32 
     33  def index 
     34  end 
     35 
     36 
    3137  # Display a list of devices to the user that may be managed. 
    3238 
    33   def index 
     39  def device_index 
     40 
     41    @partial = "common/device_search" 
    3442 
    3543    if params[:site_id] && !params[:site_id].blank? && params[:site_id].to_i != 0 
     
    4351    @sites = Site.find(:all) 
    4452 
    45     respond_to do |format| 
    46       format.html 
    47       format.xml 
    48     end 
    49  
     53    render :action => 'index' 
     54 
     55  end 
     56 
     57 
     58  # Display a list of re-inventory options 
     59   
     60  def inventory_index 
     61 
     62    @partial = "manage/inventory" 
     63     
    5064  end 
    5165 
     
    10821096 
    10831097    bridge = device.create_bridge 
     1098    logger.debug "Creating a new bridge for device id=#{device.id}" 
    10841099 
    10851100    bridge.dot1d_base_bridge_address = purify_mac_address(base_settings['dot1dBaseBridgeAddress']) 
     
    11021117    bridge.dot1d_stp_bridge_forward_delay = stp_settings['dot1dStpBridgeForwardDelay'] 
    11031118 
    1104     bridge.save 
     1119    logger.debug "Saving new bridge for device id=#{device.id}" 
     1120 
     1121    unless bridge.save 
     1122      bridge.errors.each_full do |error| 
     1123        logger.debug error 
     1124      end 
     1125    end 
    11051126 
    11061127 
  • nethorus/app/views/manage/index.html.erb

    r130 r188  
    11<h1>Manage</h1> 
    22 
    3 <p>Choose an element to manage.  Elements that appear without a hyperlink for the hostname are not manageable and require an SNMP community string set.</p
     3<% tabs = [ [ 'Devices', 'manage', 'device' ], [ 'Bridges', 'manage', 'bridge' ], [ 'Inventory', 'manage', 'inventory' ] ] %
    44 
    5 <%= render :partial => 'common/device_search' %> 
     5<ul class="tabbed"> 
     6 <% tabs.each do |tab| %> 
     7  <% if params[:action] == tab[2] %> 
     8 <li id="selected"><%= link_to tab[0], :controller => tab[1], :action => tab[2] %></li> 
     9  <% else %> 
     10 <li><%= link_to tab[0], :controller => tab[1], :action => tab[2] %></li> 
     11  <% end %> 
     12 <% end %> 
     13</ul> 
    614 
    7 <br /> 
    8  
    9 <%= render :partial => 'common/all_devices' %> 
     15<div id="content"> 
     16 <% if @partial %> 
     17  <%= render :partial => @partial %> 
     18 <% else %> 
     19  <p>Select one of the links above to search for an element.</p> 
     20  <ul> 
     21   <li><strong>Devices</strong> will allow management of an individual device.</li> 
     22   <li><strong>Bridges</strong> will display a list of Ethernet bridges.</li> 
     23  </ul> 
     24 <% end %> 
     25</div>