app/controllers/ops_controller/db.rb
# Get information for a DB tree node
Get information for a DB tree node
Get information for a DB tree node
def db_get_info
    if x_node == "root"
      if @sb[:active_tab] == "db_summary"
        @record = VmdbDatabase.my_database
        @right_cell_text = _("VMDB Summary")
      elsif @sb[:active_tab] == "db_utilization"
        @record = VmdbDatabase.my_database
        if @record
          perf_gen_init_options 
          @sb[:record_class] = @record.class.base_class.name 
          @sb[:record_id] = @record.id
        end
        @right_cell_text = _("VMDB Utilization")
      else
        @right_cell_text = case @sb[:active_tab]
                           when "db_connections" then _("VMDB Client Connections")
                           when "db_details"     then _("All VMDB Tables")
                           when "db_indexes"     then _("All VMDB Indexes")
                           else                       _("VMDB Settings")
                           end
        @force_no_grid_xml = true
        db_list
      end
      @tab_text = _("Tables")
    elsif @sb[:active_tab] == "db_indexes" || params[:action] == "x_show" 
      nodes = x_node.split('-')
      if nodes.first == "xx"
        tb = VmdbTableEvm.find(nodes.last)
        @indexes = get_indexes(tb)
        @right_cell_text = _("Indexes for VMDB Table \"%{name}\"") % {:name => tb.name}
        @tab_text = "%{table_name} Indexes" % {:table_name => tb.name}
      else
        @vmdb_index = VmdbIndex.find(nodes.last)
        @right_cell_text = _("VMDB Index \"%{name}\"") % {:name => @vmdb_index.name}
        @tab_text = @vmdb_index.name
      end
    elsif @sb[:active_tab] == "db_utilization"
      @record = VmdbTable.find(x_node.split('-').last)
      perf_gen_init_options 
      @sb[:record_class] = @record.class.base_class.name 
      @sb[:record_id] = @record.id
      @right_cell_text = _("VMDB \"%{name}\" Table Utilization") % {:name => @record.name}
      @tab_text = @record.name
    else
      @sb[:active_tab] = "db_details"
      @table = VmdbTable.find(x_node.split('-').last)
      @indexes = get_indexes(@table)
      @right_cell_text = _("VMDB Table \"%{name}\"") % {:name => @table.name}
      @tab_text = @table.name
    end
  end
def db_get_info if x_node == "root" if @sb [ :active_tab ] == "db_summary" @record = VmdbDatabase . my_database @right_cell_text = _ ( "VMDB Summary" ) elsif @sb [ :active_tab ] == "db_utilization" @record = VmdbDatabase . my_database if @record perf_gen_init_options @sb [ :record_class ] = @record . class . base_class . name @sb [ :record_id ] = @record . id end @right_cell_text = _ ( "VMDB Utilization" ) else @right_cell_text = case @sb [ :active_tab ] when "db_connections" then _ ( "VMDB Client Connections" ) when "db_details" then _ ( "All VMDB Tables" ) when "db_indexes" then _ ( "All VMDB Indexes" ) else _ ( "VMDB Settings" ) end @force_no_grid_xml = true db_list end @tab_text = _ ( "Tables" ) elsif @sb [ :active_tab ] == "db_indexes" || params [ :action ] == "x_show" nodes = x_node . split ( '-' ) if nodes . first == "xx" tb = VmdbTableEvm . find ( nodes . last ) @indexes = get_indexes ( tb ) @right_cell_text = _ ( "Indexes for VMDB Table \"%{name}\"" ) % { :name => tb . name } @tab_text = "%{table_name} Indexes" % { :table_name => tb . name } else @vmdb_index = VmdbIndex . find ( nodes . last ) @right_cell_text = _ ( "VMDB Index \"%{name}\"" ) % { :name => @vmdb_index . name } @tab_text = @vmdb_index . name end elsif @sb [ :active_tab ] == "db_utilization" @record = VmdbTable . find ( x_node . split ( '-' ) . last ) perf_gen_init_options @sb [ :record_class ] = @record . class . base_class . name @sb [ :record_id ] = @record . id @right_cell_text = _ ( "VMDB \"%{name}\" Table Utilization" ) % { :name => @record . name } @tab_text = @record . name else @sb [ :active_tab ] = "db_details" @table = VmdbTable . find ( x_node . split ( '-' ) . last ) @indexes = get_indexes ( @table ) @right_cell_text = _ ( "VMDB Table \"%{name}\"" ) % { :name => @table . name } @tab_text = @table . name end end
Get information for a DB tree node
Get information for a DB tree node
# If root node is selected # Initialize perf chart options, charts will be generated async # Hang on to record class/id for async trans # if table is selected # Initialize perf chart options, charts will be generated async # Hang on to record class/id for async trans