diff --git a/app/controllers/application_controller/performance.rb b/app/controllers/application_controller/performance.rb index 95e4870425e..911ba755f00 100644 --- a/app/controllers/application_controller/performance.rb +++ b/app/controllers/application_controller/performance.rb @@ -645,33 +645,18 @@ def perf_gen_data_before_wait end # Get the report definition (yaml) and set the where clause based on the record type - if @perf_record.kind_of?(VmdbDatabase) - rpt = perf_get_chart_rpt(@perf_options[:model].underscore) - rpt.where_clause = ["vmdb_database_id = ? and timestamp >= ? and timestamp <= ? and capture_interval_name = ?", - @perf_record.id, - from_dt, - to_dt, - interval_type] - elsif @perf_record.kind_of?(VmdbTable) - rpt = perf_get_chart_rpt(@perf_options[:model].underscore) - rpt.where_clause = ["resource_type = ? and resource_id = ? and timestamp >= ? and timestamp <= ? and capture_interval_name = ?", - @perf_options[:model], - @perf_record.id, - from_dt, - to_dt, - interval_type] - else # Doing VIM performance on a normal CI - suffix = @perf_record.kind_of?(AvailabilityZone) || @perf_record.kind_of?(HostAggregate) ? "_cloud" : "" # Get special cloud version with 'Instances' headers - rpt = perf_get_chart_rpt("vim_perf_#{interval_type}#{suffix}") - rpt.where_clause = [ - "resource_type = ? and resource_id = ? and timestamp >= ? and timestamp <= ? and capture_interval_name = ?", - @perf_options[:model], - @perf_record.id, - from_dt, - to_dt, - interval_type - ] - end + # Doing VIM performance on a normal CI + suffix = @perf_record.kind_of?(AvailabilityZone) || @perf_record.kind_of?(HostAggregate) ? "_cloud" : "" # Get special cloud version with 'Instances' headers + rpt = perf_get_chart_rpt("vim_perf_#{interval_type}#{suffix}") + rpt.where_clause = [ + "resource_type = ? and resource_id = ? and timestamp >= ? and timestamp <= ? and capture_interval_name = ?", + @perf_options[:model], + @perf_record.id, + from_dt, + to_dt, + interval_type + ] + rpt.tz = @perf_options[:tz] rpt.time_profile_id = @perf_options[:time_profile] diff --git a/app/controllers/mixins/sandbox.rb b/app/controllers/mixins/sandbox.rb index 1bb08b9a454..7c1ac1b89a9 100644 --- a/app/controllers/mixins/sandbox.rb +++ b/app/controllers/mixins/sandbox.rb @@ -98,7 +98,6 @@ def x_active_tree utilization_tree vandt_tree vat_tree - vmdb_tree vms_filter_tree vms_instances_filter_tree widgets_tree diff --git a/app/controllers/ops_controller.rb b/app/controllers/ops_controller.rb index b95c385510c..d78d6415ecc 100644 --- a/app/controllers/ops_controller.rb +++ b/app/controllers/ops_controller.rb @@ -1,6 +1,5 @@ class OpsController < ApplicationController # Methods for accordions - include_concern 'Db' include_concern 'Diagnostics' include_concern 'OpsRbac' include_concern 'Settings' @@ -63,7 +62,6 @@ def display_ae_namespaces 'collect_logs' => :logs_collect, 'collect_current_logs' => :collect_current_logs, 'custom_button' => :custom_buttons, - 'db_refresh' => :db_refresh, 'delete_server' => :delete_server, 'demote_server' => :demote_server, 'fetch_audit_log' => :fetch_audit_log, @@ -214,7 +212,7 @@ def tree_select tree_selected_model set_active_tab(params[:id]) session[:changed] = false - self.x_node = params[:id] # if x_active_tree == :vmdb_tree #params[:action] == "x_show" + self.x_node = params[:id] #params[:action] == "x_show" get_node_info(params[:id]) replace_right_cell(:nodetype => @nodetype) end @@ -251,9 +249,6 @@ def change_tab(new_tab_id = nil) if x_active_tree == :settings_tree settings_get_info replace_right_cell(:nodetype => "root") - elsif x_active_tree == :vmdb_tree - db_get_info - replace_right_cell(:nodetype => "root") elsif x_active_tree == :diagnostics_tree diagnostics_get_info case @sb[:active_tab] @@ -321,8 +316,6 @@ def features } ] - features.push(:role => "ops_db", :name => :vmdb, :title => _("Database")) if ::Settings.ui.display_ops_database - features.map { |hsh| ApplicationController::Feature.new_with_hash(hsh) } end @@ -367,11 +360,6 @@ def set_active_tab_and_node @sb[:active_tab] ||= "diagnostics_summary" end - if x_active_tree == :vmdb_tree - x_node_set("root", :vmdb_tree) unless x_node(:vmdb_tree) - @sb[:active_tab] ||= "db_summary" - end - @sb[:active_node] ||= {} if MiqServer.my_server(true).logon_status != :ready @@ -447,9 +435,6 @@ def set_active_tab(nodetype) when "svr" @sb[:active_tab] = "diagnostics_summary" end - when :vmdb_tree - nodes = x_node.split('-') - @sb[:active_tab] = %w[ti xx].include?(nodes[0]) ? "db_indexes" : "db_summary" end end @@ -562,7 +547,6 @@ def get_node_info(treenodeid, show_list = true) when :diagnostics_tree then diagnostics_get_info when :rbac_tree then rbac_get_info when :settings_tree then settings_get_info - when :vmdb_tree then db_get_info end region_text = _("[Region: %{description} [%{region}]]") % {:description => MiqRegion.my_region.description, @@ -571,30 +555,10 @@ def get_node_info(treenodeid, show_list = true) when :diagnostics_tree then _("Diagnostics %{text}") % {:text => region_text} when :settings_tree then _("Settings %{text}") % {:text => region_text} when :rbac_tree then _("Access Control %{text}") % {:text => region_text} - when :vmdb_tree then _("Database []") end {:view => @view, :pages => @pages} end - def open_parent_nodes - existing_node = nil # Init var - - parent_rec = VmdbTableEvm.find(@record.vmdb_table_id) - parents = [parent_rec, {:id => @record.vmdb_table_id.to_s}] - # Go up thru the parents and find the highest level unopened, mark all as opened along the way - # Skip if no parents or parent already open - unless parents.empty? || x_tree[:open_nodes].include?(x_build_node_id(parents.last)) - parents.reverse_each do |p| - p_node = x_build_node_id(p) - unless x_tree[:open_nodes].include?(p_node) - x_tree[:open_nodes].push(p_node) - existing_node = p_node - end - end - tree_add_child_nodes(existing_node) # Build the new nodes hash - end - end - # replace_trees can be an array of tree symbols to be replaced def replace_right_cell(options = {}) nodetype, replace_trees = options.values_at(:nodetype, :replace_trees) @@ -608,15 +572,10 @@ def replace_right_cell(options = {}) @explorer = true tree_selected_model if @tree_selected_model.nil? - # Clicked on right cell record, open the tree enough to show the node, - # if not already showing a record - # Not in a form - add_nodes = open_parent_nodes if params[:action] == "x_show" && @record && !@in_a_form locals = set_form_locals if @in_a_form build_supported_depots_for_select presenter = ExplorerPresenter.new(:active_tree => x_active_tree) - presenter[:add_nodes] = add_nodes if add_nodes replace_explorer_trees(replace_trees, presenter) rebuild_toolbars(presenter) @@ -638,9 +597,6 @@ def x_active_tree_replace_cell(nodetype, presenter) settings_replace_right_cell(nodetype, presenter) when :diagnostics_tree diagnostics_replace_right_cell(nodetype, presenter) - when :vmdb_tree # "root","tb", "ti","xx" # Check if vmdb root or table is selected - # Need to replace all_tabs to show table name as tab label - presenter.replace(:ops_tabs, r[:partial => "all_tabs"]) end end diff --git a/app/controllers/ops_controller/db.rb b/app/controllers/ops_controller/db.rb deleted file mode 100644 index 2a4dc1c59d8..00000000000 --- a/app/controllers/ops_controller/db.rb +++ /dev/null @@ -1,152 +0,0 @@ -# Database Accordion methods included in OpsController.rb -module OpsController::Db - extend ActiveSupport::Concern - - # 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] # Build view based on tab selected - when "db_connections" then VmdbDatabaseConnection - when "db_details" then VmdbTableEvm - when "db_indexes" then VmdbIndex - when "db_settings" then VmdbDatabaseSetting - end - - if model == VmdbIndex - # building a filter with expression to show VmdbTableEvm tables only - 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] } - # 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] } - end - - @view, @pages = get_view(model, :filter => exp || nil) # Get the records (into a view) and the paginator - - @no_checkboxes = true - @showlinks = true # Need to set @showlinks if @no_checkboxes is set to true - @current_page = @pages[:current] unless @pages.nil? # save the current page number - - if @show_list - update_gtl_div('db_list') if params[:action] == "list_view_filter" || pagination_or_gtl_request? - end - end - - def list_view_filter - @sb[:condition] = [] - @sb[:zone_name] = params[:zone_name] if params[:zone_name] - @sb[:filter_text] = params[:filter][:text] if params[:filter] && params[:filter][:text] - - if params[:zone_name] && params[:zone_name] != "all" - @sb[:zone_name] = params[:zone_name] - cond_hash = {} - cond_hash["="] = {"value" => params[:zone_name], "field" => "VmdbDatabaseConnection-zone.name"} - @sb[:condition].push(cond_hash) - end - if params[:filter] && params[:filter][:text] != "" - # @sb[:cond] = ["vmdb_database_connection.address like ?", params[:filter][:text]] - cond_hash = {} - cond_hash["like"] = {"value" => params[:filter][:text], "field" => "VmdbDatabaseConnection-address"} - @sb[:condition].push(cond_hash) - end - condition = {} - condition["and"] = [] - @sb[:condition].each do |c| - condition["and"].push(c) - end - exp = MiqExpression.new(condition) - # forcing to refresh the view when filtering results - @_params[:refresh] = "y" - db_list(exp) - end - - # VM clicked on in the explorer right cell - def x_show - # @explorer = true - @record = VmdbIndex.find(params[:id]) - params[:id] = x_build_node_id(@record) # Get the tree node id - tree_select - end - - private ####################### - - # Get information for a DB tree node - def db_get_info - if x_node == "root" - # If root node is selected - 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 # Initialize perf chart options, charts will be generated async - @sb[:record_class] = @record.class.base_class.name # Hang on to record class/id for async trans - @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" # if table is selected - 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 # Initialize perf chart options, charts will be generated async - @sb[:record_class] = @record.class.base_class.name # Hang on to record class/id for async trans - @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 get_indexes(tb) - return [] unless tb.kind_of?(VmdbTableEvm) - - tb.vmdb_indexes.sort_by(&:name) - end - - def db_refresh - assert_privileges("db_refresh") - db_get_info - render :update do |page| - page << javascript_prologue - page.replace_html(@sb[:active_tab], :partial => "db_details_tab") - page << "miqSparkle(false);" # Need to turn off sparkle in case original ajax element gets replaced - end - end -end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index a3be2b998ea..a5281550a93 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -257,11 +257,6 @@ def view_to_url(view, parent = nil) action = 'show' return url_for_only_path(:action => action, :id => params[:id]) + "?display=generic_objects&generic_object_id=" end - # If we do not want to use redirect or any kind of click action - if %w[Job VmdbDatabaseSetting VmdbDatabaseConnection VmdbIndex].include?(view.db) && - %w[ops].include?(params[:controller]) - return false - end if %w[MiqTask].include?(view.db) && %w[miq_task].include?(params[:controller]) return true end @@ -298,7 +293,7 @@ def view_to_url(view, parent = nil) else return "/" + request.parameters[:controller] + "/tree_select/?id=" + x_node.split("-")[1] end - elsif %w[VmdbTableEvm MiqServer].include?(view.db) && + elsif view.db == "MiqServer" && %w[ops report].include?(request.parameters[:controller]) return "/" + request.parameters[:controller] + "/tree_select/?id=" + TREE_WITH_TAB[active_tab] elsif %w[MiqAction diff --git a/app/helpers/application_helper/button/db_refresh.rb b/app/helpers/application_helper/button/db_refresh.rb deleted file mode 100644 index 550e71cdaf3..00000000000 --- a/app/helpers/application_helper/button/db_refresh.rb +++ /dev/null @@ -1,7 +0,0 @@ -class ApplicationHelper::Button::DbRefresh < ApplicationHelper::Button::Basic - include ApplicationHelper::Button::Mixins::ActiveContextMixin - - def visible? - active_tab?(%w[db_connections db_details db_indexes db_settings]) - end -end diff --git a/app/helpers/application_helper/toolbar/vmdb_table_center.rb b/app/helpers/application_helper/toolbar/vmdb_table_center.rb deleted file mode 100644 index 7c6522f6fd7..00000000000 --- a/app/helpers/application_helper/toolbar/vmdb_table_center.rb +++ /dev/null @@ -1,10 +0,0 @@ -class ApplicationHelper::Toolbar::VmdbTableCenter < ApplicationHelper::Toolbar::Basic - button_group('support_reloading', [ - button( - :db_refresh, - 'fa fa-refresh fa-lg', - N_('Refresh this page'), - nil, - :klass => ApplicationHelper::Button::DbRefresh), - ]) -end diff --git a/app/helpers/application_helper/toolbar/vmdb_tables_center.rb b/app/helpers/application_helper/toolbar/vmdb_tables_center.rb deleted file mode 100644 index 1f9b5b6cfd5..00000000000 --- a/app/helpers/application_helper/toolbar/vmdb_tables_center.rb +++ /dev/null @@ -1,10 +0,0 @@ -class ApplicationHelper::Toolbar::VmdbTablesCenter < ApplicationHelper::Toolbar::Basic - button_group('support_reloading', [ - button( - :db_refresh, - 'fa fa-refresh fa-lg', - N_('Refresh this page'), - nil, - :klass => ApplicationHelper::Button::DbRefresh), - ]) -end diff --git a/app/helpers/application_helper/toolbar_chooser.rb b/app/helpers/application_helper/toolbar_chooser.rb index 2c35b535f64..82d72582b7c 100644 --- a/app/helpers/application_helper/toolbar_chooser.rb +++ b/app/helpers/application_helper/toolbar_chooser.rb @@ -293,12 +293,6 @@ def center_toolbar_filename_ops elsif node.first == "tn" && @record return "tenant_center_tb" end - elsif x_active_tree == :vmdb_tree - if x_node - return "vmdb_tables_center_tb" - else - return "vmdb_table_center_tb" - end end nil end diff --git a/app/helpers/ops_helper/textual_summary.rb b/app/helpers/ops_helper/textual_summary.rb index 8c7c4c53cc0..01c71142660 100644 --- a/app/helpers/ops_helper/textual_summary.rb +++ b/app/helpers/ops_helper/textual_summary.rb @@ -5,18 +5,6 @@ module OpsHelper::TextualSummary TOP_TABLES_BY_COUNT = 5 - def textual_group_vmdb_connection_properties - return if @record.nil? - - TextualGroup.new( - _("Properties"), - %i[ - vmdb_connection_name vmdb_connection_ipaddress vmdb_connection_vendor vmdb_connection_version - vmdb_connection_data_directory vmdb_connection_data_disk vmdb_connection_last_start_time - ] - ) - end - def textual_group_properties TextualTags.new(_('Properties'), %i[description parent groups subtenant project]) end @@ -47,112 +35,9 @@ def textual_group_vmdb_tables_most_wasted_space TextualListview.new_from_hash(textual_vmdb_tables_most_wasted_space) end - def textual_group_vmdb_connection_capacity_data - return if @record.nil? - - TextualGroup.new( - _("Capacity Data"), - %i[ - vmdb_connection_timestamp vmdb_connection_total_space vmdb_connection_used_space vmdb_connection_free_space - vmdb_connection_total_index_nodes vmdb_connection_used_index_nodes vmdb_connection_free_index_nodes - ] - ) - end - # # Items # - - def textual_vmdb_connection_name - {:label => _("Name"), :value => @record.name} - end - - def textual_vmdb_connection_ipaddress - {:label => _("IP Address"), :value => @record.ipaddress} - end - - def textual_vmdb_connection_vendor - {:label => _("Vendor"), :value => @record.vendor} - end - - def textual_vmdb_connection_version - {:label => _("Version"), :value => @record.version} - end - - def textual_vmdb_connection_data_directory - {:label => _("Data Directory"), :value => @record.data_directory} - end - - def textual_vmdb_connection_data_disk - {:label => _("Data Disk"), :value => @record.data_disk} - end - - def textual_vmdb_connection_last_start_time - {:label => _("Last Start Time"), :value => format_timezone(@record.last_start_time)} - end - - def textual_vmdb_connection_timestamp - metrics = VmdbDatabase.my_database.latest_hourly_metric - {:label => _("Last Collection"), :value => metrics && format_timezone(metrics.timestamp)} - end - - def textual_vmdb_connection_total_space - metrics = VmdbDatabase.my_database.latest_hourly_metric - {:label => _("Total Space on Volume"), :value => metrics && number_to_human_size(metrics.disk_total_bytes)} - end - - def textual_vmdb_connection_free_space - metrics = VmdbDatabase.my_database.latest_hourly_metric - {:label => _("Free Space on Volume"), :value => metrics && number_to_human_size(metrics.disk_free_bytes)} - end - - def textual_vmdb_connection_used_space - metrics = VmdbDatabase.my_database.latest_hourly_metric - {:label => _("Used Space on Volume"), :value => metrics && number_to_human_size(metrics.disk_used_bytes)} - end - - def textual_vmdb_connection_total_index_nodes - metrics = VmdbDatabase.my_database.latest_hourly_metric - {:label => _("Total Index Nodes"), :value => metrics && number_with_delimiter(metrics.disk_total_inodes)} - end - - def textual_vmdb_connection_used_index_nodes - metrics = VmdbDatabase.my_database.latest_hourly_metric - {:label => _("Used Index Nodes"), :value => metrics && number_with_delimiter(metrics.disk_used_inodes)} - end - - def textual_vmdb_connection_free_index_nodes - metrics = VmdbDatabase.my_database.latest_hourly_metric - {:label => _("Free Index Nodes"), :value => metrics && number_with_delimiter(metrics.disk_free_inodes)} - end - - def textual_vmdb_tables_most_rows - { - :title => _("Tables with the Most Rows"), - :headers => [_("Name"), _("Rows")], - :col_order => %w[name value], - :value => vmdb_table_top_rows(:rows, TOP_TABLES_BY_COUNT) - } - end - - def textual_vmdb_tables_largest_size - { - :title => _("Largest Tables"), - :headers => [_("Name"), _("Size")], - :col_order => %w[name value], - :value => vmdb_table_top_rows(:size, TOP_TABLES_BY_COUNT) - } - end - - def textual_vmdb_tables_most_wasted_space - { - :title => _("Tables with Most Wasted Space"), - :headers => [_("Name"), _("Wasted")], - :col_order => %w[name value], - :value => vmdb_table_top_rows(:wasted_bytes, TOP_TABLES_BY_COUNT) - } - end - def textual_description {:label => _('Description'), :value => @record.description} end @@ -276,20 +161,6 @@ def subprojects_from_record subprojects end - def vmdb_table_top_rows(typ, limit) - rows = VmdbDatabase.my_database.top_tables_by(typ, limit) - rows.collect do |row| - { - :title => row.name, - :name => row.name, - :value => typ == :rows ? number_with_delimiter(row.latest_hourly_metric.send(typ.to_s), :delimeter => ',') : - number_to_human_size(row.latest_hourly_metric.send(typ.to_s), :precision => 1), - :explorer => true, - :link => "tb-#{row.id}" - } - end - end - def textual_tenant_quota_allocations h = {:title => _("Tenant Quota"), :headers => [_("Name"), _("Total Quota"), _("In Use"), _("Allocated"), _("Available")], diff --git a/app/presenters/tree_builder.rb b/app/presenters/tree_builder.rb index 0094671e229..6b256f29b65 100644 --- a/app/presenters/tree_builder.rb +++ b/app/presenters/tree_builder.rb @@ -436,8 +436,6 @@ def prefixed_title(prefix, title) :rbac => "TreeBuilderOpsRbac", ## Diagnostics :diagnostics => "TreeBuilderOpsDiagnostics", - ## Database - :vmdb => "TreeBuilderOpsVmdb", }.freeze # Tree node prefixes for generic explorers @@ -515,8 +513,6 @@ def prefixed_title(prefix, title) "sr" => "ServiceResource", "sw" => "Switch", "t" => "MiqTemplate", - "tb" => "VmdbTable", - "ti" => "VmdbIndex", "tn" => "Tenant", "u" => "User", "v" => "Vm", diff --git a/app/presenters/tree_builder_ops_vmdb.rb b/app/presenters/tree_builder_ops_vmdb.rb deleted file mode 100644 index 03b1f27e2d9..00000000000 --- a/app/presenters/tree_builder_ops_vmdb.rb +++ /dev/null @@ -1,44 +0,0 @@ -class TreeBuilderOpsVmdb < TreeBuilder - has_kids_for VmdbTableEvm, %i[x_get_tree_vmdb_table_kids] - - private - - def tree_init_options - {:lazy => true} - end - - def root_options - { - :text => t = _("VMDB"), - :tooltip => t, - :icon => 'fa fa-database' - } - end - - # Get root nodes count/array for explorer tree - def x_get_tree_roots - objects = Rbac.filtered(VmdbDatabase.my_database.try(:evm_tables).to_a).to_a - count_only_or_objects(false, objects, "name") - end - - # Handle custom tree nodes (object is a Hash) - def x_get_tree_custom_kids(object, count_only) - vmdb_table_id = object[:id].split("|").last.split('-').last - vmdb_indexes = VmdbIndex.includes(:vmdb_table).where(:vmdb_tables => {:type => 'VmdbTableEvm', :id => vmdb_table_id}) - count_only_or_objects(count_only, vmdb_indexes, "name") - end - - def x_get_tree_vmdb_table_kids(object, count_only) - return 1 if count_only # each table has one indexes subdir - - [ - { - :id => object.id.to_s, - :text => _("Indexes"), - :icon => "pficon pficon-folder-close", - :tip => _("Indexes"), - :expanded => true # load this node expanded with its children - } - ] - end -end diff --git a/app/presenters/tree_node/vmdb_index.rb b/app/presenters/tree_node/vmdb_index.rb deleted file mode 100644 index 417f442264c..00000000000 --- a/app/presenters/tree_node/vmdb_index.rb +++ /dev/null @@ -1,4 +0,0 @@ -module TreeNode - class VmdbIndex < Node - end -end diff --git a/app/presenters/tree_node/vmdb_table.rb b/app/presenters/tree_node/vmdb_table.rb deleted file mode 100644 index 633c22835f7..00000000000 --- a/app/presenters/tree_node/vmdb_table.rb +++ /dev/null @@ -1,4 +0,0 @@ -module TreeNode - class VmdbTable < Node - end -end diff --git a/app/views/ops/_all_tabs.html.haml b/app/views/ops/_all_tabs.html.haml index dde562377f6..fdddf44fa62 100644 --- a/app/views/ops/_all_tabs.html.haml +++ b/app/views/ops/_all_tabs.html.haml @@ -208,46 +208,5 @@ - when :rbac_tree #rbac_details = render :partial => "rbac_details_tab" - - when :vmdb_tree - %ul.nav.nav-tabs - - tree_node = x_node - - if tree_node == "root" - = miq_tab_header("db_summary", @sb[:active_tab]) do - = _("Summary") - - if tree_node == "root" || tree_node.split("-").first == TreeBuilder.get_prefix_for_model("VmdbTable") - = miq_tab_header("db_details", @sb[:active_tab]) do - = @tab_text - - if tree_node == "root" - = miq_tab_header("db_indexes", @sb[:active_tab]) do - = _("Indexes") - = miq_tab_header("db_settings", @sb[:active_tab]) do - = _("Settings") - = miq_tab_header("db_connections", @sb[:active_tab]) do - = _("Client Connections") - - if tree_node == "root" || tree_node.split("-").first == TreeBuilder.get_prefix_for_model("VmdbTable") - = miq_tab_header("db_utilization", @sb[:active_tab]) do - = _("Utilization") - .tab-content - - if tree_node == "root" - = miq_tab_content("db_summary", @sb[:active_tab]) do - - if @sb[:active_tab] == "db_summary" - = render :partial => "db_summary" - = miq_tab_content("db_details", "db_details") do - - if @sb[:active_tab] == "db_details" || (@sb[:active_tab] == "db_indexes" && (@vmdb_index) || @indexes) - = render :partial => "db_details_tab" - - if tree_node == "root" - = miq_tab_content("db_indexes", @sb[:active_tab]) do - - if @sb[:active_tab] == "db_indexes" - = render :partial => "db_details_tab" - = miq_tab_content("db_settings", @sb[:active_tab]) do - - if @sb[:active_tab] == "db_settings" - = render :partial => "db_details_tab" - = miq_tab_content("db_connections", @sb[:active_tab]) do - - if @sb[:active_tab] == "db_connections" - = render :partial => "db_details_tab" - - if tree_node == "root" || tree_node.split("-").first == TreeBuilder.get_prefix_for_model("VmdbTable") - = miq_tab_content("db_utilization", @sb[:active_tab]) do - - if @sb[:active_tab] == "db_utilization" && @record - = render(:partial => "layouts/performance") :javascript miq_tabs_init("#ops_tabs", "/ops/change_tab"); diff --git a/app/views/ops/_db_details_tab.html.haml b/app/views/ops/_db_details_tab.html.haml deleted file mode 100644 index 241740a0adc..00000000000 --- a/app/views/ops/_db_details_tab.html.haml +++ /dev/null @@ -1,4 +0,0 @@ -- if x_node == "root" - = render :partial => "db_list" -- else - = render :partial => "db_info" diff --git a/app/views/ops/_db_info.html.haml b/app/views/ops/_db_info.html.haml deleted file mode 100644 index d2fde39332b..00000000000 --- a/app/views/ops/_db_info.html.haml +++ /dev/null @@ -1,106 +0,0 @@ -= render :partial => "layouts/flash_msg" -- if @vmdb_index - %h3 - #{_("Index")}: #{h(@vmdb_index.name)} - .form-horizontal - .form-group - %label.col-md-2.control-label - = _("Name") - .col-md-8 - %p.form-control-static - = h(@vmdb_index.name) - %hr - - metrics = @vmdb_index.latest_hourly_metric - - if metrics - %h3 - = _("Metrics") - .form-horizontal - .form-group - %label.col-md-2.control-label - = _("Rows") - .col-md-8 - %p.form-control-static - = h(metrics.rows) - .form-group - %label.col-md-2.control-label - = _("Size") - .col-md-8 - %p.form-control-static - = number_to_human_size(metrics.size) - .form-group - %label.col-md-2.control-label - = _("Wasted") - .col-md-8 - %p.form-control-static - = number_to_human_size(metrics.wasted_bytes) - .form-group - %label.col-md-2.control-label - = _("Percent Bloat") - .col-md-8 - %p.form-control-static - = h(metrics.percent_bloat) - %hr -- elsif @table - %h3 - #{_("Table")}: #{h(@table.name)} - .form-horizontal - .form-group - %label.col-md-2.control-label - = _("Name") - .col-md-8 - %p.form-control-static - = h(@table.name) - - metrics = @table.latest_hourly_metric - - if metrics - .form-group - %label.col-md-2.control-label - = _("Rows") - .col-md-8 - %p.form-control-static - = h(metrics.rows) - .form-group - %label.col-md-2.control-label - = _("Size") - .col-md-8 - %p.form-control-static - = number_to_human_size(metrics.size) - .form-group - %label.col-md-2.control-label - = _("Wasted") - .col-md-8 - %p.form-control-static - = number_to_human_size(metrics.wasted_bytes) - .form-group - %label.col-md-2.control-label - = _("Percent Bloat") - .col-md-8 - %p.form-control-static - = h(metrics.percent_bloat) - %hr -- if @indexes - %h3 - = _("Indexes") - - if @indexes.blank? - = _("No Indexes found for this table.") - - else - %table.table.table-striped.table-bordered.table-hover - %thead - %th.table-view-pf-select - %th= _("Name") - %th= _("Rows") - %th= _("Size") - %th= _("Wasted") - %th= _("Percent Bloat") - %tbody - - @indexes.each_with_index do |ind, _| - %tr{:onclick => "#{remote_function(:url => "/ops/x_show/#{ind.id}")}", - :title => _("Click to view index")} - %td.table-view-pf-select - %i.fa.fa-table - %td= ind.name - - metrics = ind.latest_hourly_metric - - if metrics - %td{:align => "right"}= h(metrics.rows) - %td{:align => "right"}= number_to_human_size(metrics.size) - %td{:align => "right"}= number_to_human_size(metrics.wasted_bytes) - %td{:align => "right"}= h(metrics.percent_bloat) diff --git a/app/views/ops/_db_list.html.haml b/app/views/ops/_db_list.html.haml deleted file mode 100644 index a0b431284ac..00000000000 --- a/app/views/ops/_db_list.html.haml +++ /dev/null @@ -1,2 +0,0 @@ -%div{:style => "padding-top: 10px"} -= render :partial => 'layouts/x_gtl', :locals => {:action_url => "db_list"} diff --git a/app/views/ops/_db_summary.html.haml b/app/views/ops/_db_summary.html.haml deleted file mode 100644 index af470cb5936..00000000000 --- a/app/views/ops/_db_summary.html.haml +++ /dev/null @@ -1,13 +0,0 @@ -- groups = [%i(vmdb_connection_properties vmdb_connection_capacity_data), %i(vmdb_tables_most_rows vmdb_tables_largest_size vmdb_tables_most_wasted_space)] -#textual_summary - -:javascript - var summary_props = { - summary: #{process_textual_info(groups, @record).to_json}, - onClick: function(item, event) { - event.preventDefault(); - if (!item.link) return; - miqTreeActivateNode('vmdb_tree', item.link); - } - }; - ManageIQ.component.componentFactory('TextualSummaryWrapper', '#textual_summary', summary_props); diff --git a/config/routes.rb b/config/routes.rb index 89648d3a49e..f9453b358c3 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -2546,7 +2546,6 @@ db_backup db_backup_form_field_changed db_gc_collection - db_list diagnostics_server_list diagnostics_tree_select edit_rhn diff --git a/product/views/VmdbDatabaseConnection.yaml b/product/views/VmdbDatabaseConnection.yaml deleted file mode 100644 index 3b11970d6e6..00000000000 --- a/product/views/VmdbDatabaseConnection.yaml +++ /dev/null @@ -1,116 +0,0 @@ -# -# This is an MIQ Report configuration file -# Single value parameters are specified as: -# single_value_parm: value -# Multiple value parameters are specified as: -# multi_value_parm: -# - value 1 -# - value 2 -# - -# Report title -title: VmdbDatabaseConnection - -# Menu name -name: VmdbDatabaseConnection - -# Main DB table report is based on -db: VmdbDatabaseConnection - -# Columns to fetch from the main table -cols: -- pid -- address -- spid -- blocked_by -- wait_event -- wait_event_type -- wait_resource -- wait_time -- command - -# Included tables (joined, has_one, has_many) and columns -include: - zone: - columns: - - name - miq_server: - columns: - - name - miq_worker: - columns: - - type - -# Order of columns (from all tables) -col_order: -- zone.name -- miq_server.name -- miq_worker.type -- pid -- address -- spid -- blocked_by -- wait_event -- wait_event_type -- wait_resource -- wait_time -- command - -col_formats: -- -- -- -- -- -- -- -- -- -- -- -- :string_truncate_50 - -# Column titles, in order -headers: -- Zone -- Server -- Worker -- PID -- Address -- SPID -- Blocked By -- Wait Event -- Wait Event Type -- Waiting Resource -- Wait Time -- Command - -# Condition(s) string for the SQL query -conditions: - -# Order string for the SQL query -order: Ascending - -# Columns to sort the report on, in order -sortby: -- zone.name - -# Group rows (y=yes,n=no,c=count) -group: n - -# Graph type -# Bar -# Column -# ColumnThreed -# ParallelThreedColumn -# Pie -# PieThreed -# StackedBar -# StackedColumn -# StackedThreedColumn - -graph: - -# Dimensions of graph (1 or 2) -# Note: specifying 2 for a single dimension graph may not return expected results -dims: diff --git a/product/views/VmdbDatabaseSetting.yaml b/product/views/VmdbDatabaseSetting.yaml deleted file mode 100644 index 33ab555b359..00000000000 --- a/product/views/VmdbDatabaseSetting.yaml +++ /dev/null @@ -1,86 +0,0 @@ -# -# This is an MIQ Report configuration file -# Single value parameters are specified as: -# single_value_parm: value -# Multiple value parameters are specified as: -# multi_value_parm: -# - value 1 -# - value 2 -# - -# Report title -title: VmdbDatabaseSetting - -# Menu name -name: VmdbDatabaseSetting - -# Main DB table report is based on -db: VmdbDatabaseSetting - -# Columns to fetch from the main table -cols: -- name -- description -- value -- minimum_value -- maximum_value -- unit - -# Included tables (joined, has_one, has_many) and columns -include: - -# Order of columns (from all tables) -col_order: -- name -- description -- value -- minimum_value -- maximum_value -- unit - -col_formats: -- -- :string_truncate_50 -- :string_truncate_50 -- -- :large_number_to_exponential_form -- - -# Column titles, in order -headers: -- Name -- Description -- Value -- Minimum -- Maximum -- Unit - -# Condition(s) string for the SQL query -conditions: - -# Order string for the SQL query -order: Ascending - -# Columns to sort the report on, in order -sortby: -- name - -# Group rows (y=yes,n=no,c=count) -group: n - -# Graph type -# Bar -# Column -# ColumnThreed -# ParallelThreedColumn -# Pie -# PieThreed -# StackedBar -# StackedColumn -# StackedThreedColumn - -graph: - -# Dimensions of graph (1 or 2) -# Note: specifying 2 for a single dimension graph may not return expected results -dims: diff --git a/product/views/VmdbIndex.yaml b/product/views/VmdbIndex.yaml deleted file mode 100644 index f8b7e6f8960..00000000000 --- a/product/views/VmdbIndex.yaml +++ /dev/null @@ -1,89 +0,0 @@ -# -# This is an MIQ Report configuration file -# Single value parameters are specified as: -# single_value_parm: value -# Multiple value parameters are specified as: -# multi_value_parm: -# - value 1 -# - value 2 -# - -# Report title -title: VmdbIndex - -# Menu name -name: VmdbIndex - -# Main DB table report is based on -db: VmdbIndex - -# Columns to fetch from the main table -cols: -- name - - -# Included tables (joined, has_one, has_many) and columns -include: - vmdb_table: - columns: - - type - latest_hourly_metric: - columns: - - rows - - size - - wasted_bytes - - percent_bloat - -# Order of columns (from all tables) -col_order: -- name -- latest_hourly_metric.rows -- latest_hourly_metric.size -- latest_hourly_metric.wasted_bytes -- latest_hourly_metric.percent_bloat - -col_formats: -- -- -- :bytes_human -- :bytes_human -- - -# Column titles, in order -headers: -- Name -- Rows -- Size -- Wasted -- Percent Bloat - -# Condition(s) string for the SQL query -conditions: - - -# Order string for the SQL query -order: Ascending - -# Columns to sort the report on, in order -sortby: -- name - -# Group rows (y=yes,n=no,c=count) -group: n - -# Graph type -# Bar -# Column -# ColumnThreed -# ParallelThreedColumn -# Pie -# PieThreed -# StackedBar -# StackedColumn -# StackedThreedColumn - -graph: - -# Dimensions of graph (1 or 2) -# Note: specifying 2 for a single dimension graph may not return expected results -dims: diff --git a/product/views/VmdbTableEvm.yaml b/product/views/VmdbTableEvm.yaml deleted file mode 100644 index 78a5adc3311..00000000000 --- a/product/views/VmdbTableEvm.yaml +++ /dev/null @@ -1,85 +0,0 @@ -# -# This is an MIQ Report configuration file -# Single value parameters are specified as: -# single_value_parm: value -# Multiple value parameters are specified as: -# multi_value_parm: -# - value 1 -# - value 2 -# - -# Report title -title: VmdbTableEvm - -# Menu name -name: VmdbTableEvm - -# Main DB table report is based on -db: VmdbTableEvm - -# Columns to fetch from the main table -cols: -- name -- type - -# Included tables (joined, has_one, has_many) and columns -include: - latest_hourly_metric: - columns: - - rows - - size - - wasted_bytes - - percent_bloat - -# Order of columns (from all tables) -col_order: -- name -- latest_hourly_metric.rows -- latest_hourly_metric.size -- latest_hourly_metric.wasted_bytes -- latest_hourly_metric.percent_bloat - -col_formats: -- -- -- :bytes_human -- :bytes_human -- - -# Column titles, in order -headers: -- Name -- Rows -- Size -- Wasted -- Percent Bloat - -# Condition(s) string for the SQL query -conditions: - -# Order string for the SQL query -order: Ascending - -# Columns to sort the report on, in order -sortby: -- name - -# Group rows (y=yes,n=no,c=count) -group: n - -# Graph type -# Bar -# Column -# ColumnThreed -# ParallelThreedColumn -# Pie -# PieThreed -# StackedBar -# StackedColumn -# StackedThreedColumn - -graph: - -# Dimensions of graph (1 or 2) -# Note: specifying 2 for a single dimension graph may not return expected results -dims: diff --git a/spec/controllers/ops_controller_spec.rb b/spec/controllers/ops_controller_spec.rb index 9615bf0fc9e..578c0ddc05f 100644 --- a/spec/controllers/ops_controller_spec.rb +++ b/spec/controllers/ops_controller_spec.rb @@ -56,26 +56,6 @@ end end - it 'can view the db_settings tab' do - ApplicationController.handle_exceptions = true - - session[:sandboxes] = {"ops" => {:active_tree => :vmdb_tree, - :active_tab => 'db_settings', - :trees => {:vmdb_tree => {:active_node => 'root'}}}} - post :change_tab, :params => {:tab_id => 'db_settings', :format => :json} - end - - it 'can view the db_connections tab' do - ApplicationController.handle_exceptions = true - - session[:sandboxes] = {"ops" => {:active_tree => :vmdb_tree, - :active_tab => 'db_connections', - :trees => {:vmdb_tree => {:active_node => 'root'}}}} - expect(controller).to receive(:head) - post :change_tab, :params => {:tab_id => 'db_connections', :format => :json} - expect(response.status).to eq(200) - end - describe 'rbac_user_edit' do let(:group) { user.miq_groups.first } before do @@ -308,7 +288,6 @@ it "build trees that are passed in and met other conditions" do controller.instance_variable_set(:@sb, {}) allow(controller).to receive(:x_build_dyna_tree) - allow(VmdbDatabase).to receive_message_chain(:my_database, :evm_tables) { [] } replace_trees = %i(settings diagnostics rbac vmdb) presenter = ExplorerPresenter.new expect(controller).to receive(:reload_trees_by_presenter).with( diff --git a/spec/controllers/sandbox_spec.rb b/spec/controllers/sandbox_spec.rb index f5790255411..47b1f8d919a 100644 --- a/spec/controllers/sandbox_spec.rb +++ b/spec/controllers/sandbox_spec.rb @@ -9,8 +9,8 @@ end it "converts known trees to symbols and returns them when asked" do - sb.x_active_tree = 'vmdb_tree' - expect(sb.x_active_tree).to be(:vmdb_tree) + sb.x_active_tree = 'settings_tree' + expect(sb.x_active_tree).to be(:settings_tree) end it "accepts nil tree and returns it when asked" do diff --git a/spec/helpers/application_helper/buttons/db_refresh_spec.rb b/spec/helpers/application_helper/buttons/db_refresh_spec.rb deleted file mode 100644 index 60e29b5549c..00000000000 --- a/spec/helpers/application_helper/buttons/db_refresh_spec.rb +++ /dev/null @@ -1,18 +0,0 @@ -describe ApplicationHelper::Button::DbRefresh do - let(:view_context) { setup_view_context_with_sandbox(:active_tab => tab) } - let(:button) { described_class.new(view_context, {}, {}, {}) } - - describe '#visible?' do - subject { button.visible? } - %w(db_details db_indexes db_settings db_connections).each do |tree| - context "when active_tree == #{tree}" do - let(:tab) { tree } - it { expect(subject).to be_truthy } - end - end - context 'when !active_tree.in?(%w(db_details db_indexes db_settings db_connections))' do - let(:tab) { 'something_else' } - it { expect(subject).to be_falsey } - end - end -end diff --git a/spec/helpers/ops_helper/textual_summary_spec.rb b/spec/helpers/ops_helper/textual_summary_spec.rb index 7d26b0e3b88..648140a968e 100644 --- a/spec/helpers/ops_helper/textual_summary_spec.rb +++ b/spec/helpers/ops_helper/textual_summary_spec.rb @@ -3,26 +3,6 @@ before { instance_variable_set(:@record, record) } - include_examples "textual_group", "Properties", %i( - vmdb_connection_name - vmdb_connection_ipaddress - vmdb_connection_vendor - vmdb_connection_version - vmdb_connection_data_directory - vmdb_connection_data_disk - vmdb_connection_last_start_time - ), "vmdb_connection_properties" - - include_examples "textual_group", "Capacity Data", %i( - vmdb_connection_timestamp - vmdb_connection_total_space - vmdb_connection_used_space - vmdb_connection_free_space - vmdb_connection_total_index_nodes - vmdb_connection_used_index_nodes - vmdb_connection_free_index_nodes - ), "vmdb_connection_capacity_data" - context 'Tenant Textual Summary' do let(:record) { FactoryBot.create(:tenant) } diff --git a/spec/presenters/tree_node/vmdb_index_spec.rb b/spec/presenters/tree_node/vmdb_index_spec.rb deleted file mode 100644 index c2adc77c4a5..00000000000 --- a/spec/presenters/tree_node/vmdb_index_spec.rb +++ /dev/null @@ -1,7 +0,0 @@ -describe TreeNode::VmdbIndex do - let(:object) { FactoryBot.create(:vmdb_index, :name => 'foo') } - subject { described_class.new(object, nil, nil) } - - include_examples 'TreeNode::Node#key prefix', 'ti-' - include_examples 'TreeNode::Node#icon', 'fa fa-table' -end diff --git a/spec/presenters/tree_node/vmdb_table_spec.rb b/spec/presenters/tree_node/vmdb_table_spec.rb deleted file mode 100644 index 4afa2df2b4b..00000000000 --- a/spec/presenters/tree_node/vmdb_table_spec.rb +++ /dev/null @@ -1,7 +0,0 @@ -describe TreeNode::VmdbTable do - let(:object) { FactoryBot.create(:vmdb_table_evm, :name => 'foo') } - subject { described_class.new(object, nil, nil) } - - include_examples 'TreeNode::Node#key prefix', 'tb-' - include_examples 'TreeNode::Node#icon', 'fa fa-table' -end diff --git a/spec/routing/ops_routing_spec.rb b/spec/routing/ops_routing_spec.rb index fe648180c9e..f55269ef12d 100644 --- a/spec/routing/ops_routing_spec.rb +++ b/spec/routing/ops_routing_spec.rb @@ -47,7 +47,6 @@ db_backup db_backup_form_field_changed db_gc_collection - db_list diagnostics_server_list diagnostics_tree_select edit_rhn