Changeset 278

Show
Ignore:
Timestamp:
10/16/08 21:41:07 (3 months ago)
Author:
pwh
Message:

Fixed the 'Interfaces' view in Device Management and simplified the page layout to remove the unlinked "Delete inventory" and "Draw diagram" tags for a device without inventory.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • nethorus/app/views/common/_all_interfaces.html.erb

    r247 r278  
    1 <p> 
    2  <%= link_to('Update interface inventory', { :controller => 'manage', :action => 'update_interfaces_and_return' } ) %> |  
    3  <%= link_to_if(!@device.l2_interfaces.blank?, 'Delete interface inventory', { :controller => 'manage', :action => 'delete_interface_inventory_and_return' } ) %> |  
    4  <%= link_to_if(!@device.l2_interfaces.blank?, 'Draw diagram', { :controller => 'diagram', :action => 'draw_ifstack' } ) %> 
    5 </p> 
     1<% if @device.has_inventory? %> 
     2  <p> 
     3   <%= link_to('Update interface inventory', { :controller => 'manage', :action => 'update_interfaces_and_return' }) %> |  
     4   <%= link_to('Delete interface inventory', { :controller => 'manage', :action => 'delete_interface_inventory_and_return' }) %> |  
     5   <%= link_to('Draw diagram', { :controller => 'diagram', :action => 'draw_ifstack' }) %> 
     6  </p> 
    67 
    7 <% unless @device.l2_interfaces.blank? %> 
    88  <table class="vert"> 
    99   <tr> 
     
    5353 
    5454  </table> 
     55<% else %> 
     56  <p>This device has no interface inventory recorded.   Please <%= link_to('poll the device', { :controller => 'manage', :action => 'update_interfaces_and_return' }) %> to build up a list of interfaces.</p> 
    5557<% end %> 
  • nethorus/app/views/manage_device/device.html.erb

    r246 r278  
    11<h1>Device Management</h1> 
    22 
    3 <% tabs = [ [ 'Overview', 'manage_device', 'show_overview'], [ 'Interfaces', 'manage_device', 'show_interfaces' ], [ 'Event Log', 'manage_device', 'show_event_log'], [ 'Hardware', 'manage_device', 'show_hardware' ], [ 'Features', 'manage_device', 'show_features' ], [ 'Functions', 'manage_device', 'show_functions' ] ] %> 
     3<% tabs = [ [ 'Overview', 'manage_device', 'show_overview'], [ 'Interfaces', 'manage_interface', 'index' ], [ 'Event Log', 'manage_device', 'show_event_log'], [ 'Hardware', 'manage_device', 'show_hardware' ], [ 'Features', 'manage_device', 'show_features' ], [ 'Functions', 'manage_device', 'show_functions' ] ] %> 
    44 
    55<ul class="tabbed"> 
  • nethorus/config/routes.rb

    r252 r278  
    3030  map.connect 'manage/device/:device_id', :controller => 'manage_device', :action => 'device' 
    3131  map.connect 'manage/device/:device_id/overview', :controller => 'manage_device', :action => 'show_overview' 
    32   map.connect 'manage/device/:device_id/interfaces', :controller => 'manage_device', :action => 'show_interfaces
     32  map.connect 'manage/device/:device_id/interfaces', :controller => 'manage_interface', :action => 'index
    3333  map.connect 'manage/device/:device_id/interface/:interface_id', :controller => 'manage_interface', :action => 'interface' 
    3434  map.connect 'manage/device/:device_id/event_log', :controller => 'manage_device', :action => 'show_event_log'