Changeset 219

Show
Ignore:
Timestamp:
08/07/08 22:58:26 (4 months ago)
Author:
pwh
Message:
  • Display information on a Spanning Tree group (bridge group)
Files:

Legend:

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

    r210 r219  
    2727 
    2828class BridgeManagementController < ApplicationController 
     29 
    2930 
    3031  # Display a list of bridges that may be managed 
     
    152153  end 
    153154 
     155 
     156  # Show information about this bridge group 
     157   
     158  def show_bridge_group 
     159   
     160   
     161    # Check that we've been given a valid root bridge ID 
     162 
     163    if !params[:root_bridge] 
     164      flash[:notice] = "No root bridge was specified." 
     165      redirect_to :back and return 
     166    end 
     167     
     168     
     169    # Retrieve all the bridges in this bridge group 
     170     
     171    begin 
     172      @bridges = Bridge.find(:all, :conditions => { :dot1d_stp_designated_root => params[:root_bridge] }) 
     173    rescue ActiveRecord::RecordNotFound 
     174      flash[:notice] = "The bridge specified was not found, or you are not allowed to view its information." 
     175      redirect_to :back and return 
     176    end 
     177     
     178     
     179    # Retrieve the root bridge 
     180     
     181    begin 
     182      @root_bridge = Bridge.find(:first, :conditions => { :dot1d_base_bridge_address => parse_stp_root_bridge_address(params[:root_bridge])[2] }) 
     183    end     
     184 
     185  end 
     186 
    154187end 
  • nethorus/app/views/bridge_management/_all_bridges.html.erb

    r212 r219  
    1717   </td> 
    1818   <td> 
    19     <%= link_to bridge.dot1d_stp_designated_root, :controller => 'bridge_management', :action => 'show_spanning_tree', :stp_root => bridge.dot1d_stp_designated_root  %> 
     19    <%= link_to bridge.dot1d_stp_designated_root, :controller => 'bridge_management', :action => 'show_bridge_group', :root_bridge => bridge.dot1d_stp_designated_root  %> 
    2020   </td> 
    2121  </tr>