app/controllers/ops_controller/db.rb
# Show list of VMDB tables or settings
Show list of VMDB tables or settings
Show list of VMDB tables or settings
def db_list(exp = nil)
    @lastaction = "db_list"
    @force_no_grid_xml = true
    model = case @sb[:active_tab] 
            when "db_connections" then VmdbDatabaseConnection
            when "db_details"     then VmdbTableEvm
            when "db_indexes"     then VmdbIndex
            when "db_settings"    then VmdbDatabaseSetting
            end
    if model == VmdbIndex
      exp = MiqExpression.new(
        "and" => [
          {
            "=" => {
              "value" => "VmdbTableEvm",
              "field" => "VmdbIndex.vmdb_table-type"
            }
          }
        ]
      )
    elsif model == VmdbDatabaseConnection
      @zones = Zone.visible.order(:name).collect { |z| [z.name, z.name] }
    end
    @view, @pages = get_view(model, :filter => exp ? exp : nil) 
    @no_checkboxes = true
    @showlinks = true 
    @current_page = @pages[:current] unless @pages.nil? 
    if @show_list
      update_gtl_div('db_list') if params[:action] == "list_view_filter" || pagination_or_gtl_request?
    end
  end
def db_list ( exp = nil ) @lastaction = "db_list" @force_no_grid_xml = true model = case @sb [ :active_tab ] when "db_connections" then VmdbDatabaseConnection when "db_details" then VmdbTableEvm when "db_indexes" then VmdbIndex when "db_settings" then VmdbDatabaseSetting end if model == VmdbIndex exp = MiqExpression . new ( "and" => [ { "=" => { "value" => "VmdbTableEvm" , "field" => "VmdbIndex.vmdb_table-type" } } ] ) elsif model == VmdbDatabaseConnection @zones = Zone . visible . order ( :name ) . collect { | z | [ z . name , z . name ] } end @view , @pages = get_view ( model , :filter => exp ? exp : nil ) @no_checkboxes = true @showlinks = true @current_page = @pages [ :current ] unless @pages . nil? if @show_list update_gtl_div ( 'db_list' ) if params [ :action ] == "list_view_filter" || pagination_or_gtl_request? end end
Show list of VMDB tables or settings
Show list of VMDB tables or settings
# Build view based on tab selected # building a filter with expression to show VmdbTableEvm tables only # for now we dont need this pulldown, need to get a method that gives us a list of workers for filter pulldown # @workers = MiqWorker.all.sort_by(&:type).collect { |w| [w.friendly_name, w.id] } # Get the records (into a view) and the paginator # Need to set @showlinks if @no_checkboxes is set to true # save the current page number
exp
<not_specific>