app/controllers/host_controller.rb
# Build the tree object to display the host network info
Build the tree object to display the host network info
Build the tree object to display the host network info
def build_network_tree
    @tree_vms = []                   
    host_node = TreeNodeBuilder.generic_tree_node(
      "h_#{@host.id}",
      @host.name,
      "host.png",
      _("Host: %{name}") % {:name => @host.name},
      :expand => true
    )
    host_node[:children] = add_host_branch if @host.switches.length > 0
    @network_tree = [host_node].to_json
    session[:tree_name]  = "network_tree"
  end
def build_network_tree @tree_vms = [ ] host_node = TreeNodeBuilder . generic_tree_node ( "h_#{@host.id}" , @host . name , "host.png" , _ ( "Host: %{name}" ) % { :name => @host . name } , :expand => true ) host_node [ :children ] = add_host_branch if @host . switches . length > 0 @network_tree = [ host_node ] . to_json session [ :tree_name ] = "network_tree" end
Build the tree object to display the host network info
Build the tree object to display the host network info
# Capture all VM ids in the tree