<commit_before>module VmCloudHelper::TextualSummary
  # TODO: Determine if DoNav + url_for + :title is the right way to do links, or should it be link_to with :title

  #
  # Groups
  #

  def textual_group_properties
    %i(name region server description ipaddress custom_1 container tools_status osinfo architecture advanced_settings resources guid virtualization_type root_device_type)
  end

  def textual_group_vm_cloud_relationships
    %i(ems ems_infra cluster host availability_zone cloud_tenant flavor vm_template drift scan_history service
       cloud_network cloud_subnet orchestration_stack cloud_networks cloud_subnets network_routers security_groups
       floating_ips network_ports)
  end

  def textual_group_template_cloud_relationships
    %i(ems parent_vm drift scan_history)
  end

  def textual_group_security
    %i(users groups patches key_pairs)
  end

  def textual_group_configuration
    %i(guest_applications init_processes win32_services kernel_drivers filesystem_drivers filesystems registry_items)
  end

  def textual_group_diagnostics
    %i(processes event_logs)
  end

  def textual_group_vmsafe
    %i(vmsafe_enable vmsafe_agent_address vmsafe_agent_port vmsafe_fail_open vmsafe_immutable_vm vmsafe_timeout)
  end

  def textual_group_miq_custom_attributes
    textual_miq_custom_attributes
  end

  def textual_group_ems_custom_attributes
    textual_ems_custom_attributes
  end

  def textual_group_compliance
    %i(compliance_status compliance_history)
  end

  def textual_group_power_management
    %i(power_state boot_time state_changed_on)
  end

  def textual_group_tags
    %i(tags)
  end

  #
  # Items
  #

  def textual_region
    return nil if @record.region_number == MiqRegion.my_region_number
    h = {:label => _("Region")}
    reg = @record.miq_region
    url = reg.remote_ui_url
    h[:value] = if url
                  # TODO: Why is this link different than the others?
                  link_to(reg.description, url_for(:host   => url,
                                                   :action => 'show',
                                                   :id     => @record),
                          :title   => _("Connect to this VM in its Region"),
                          :onclick => "return miqClickAndPop(this);")
                else
                  reg.description
                end
    h
  end

  def textual_name
    @record.name
  end

  def textual_server
    @record.miq_server && "#{@record.miq_server.name} [#{@record.miq_server.id}]"
  end

  def textual_description
    @record.description
  end

  def textual_ipaddress
    return nil if @record.template?
    ips = @record.ipaddresses
    {:label => n_("IP Address", "IP Addresses", ips.size), :value => ips.join(", ")}
  end

  def textual_custom_1
    return nil if @record.custom_1.blank?
    {:label => _("Custom Identifier"), :value => @record.custom_1}
  end

  def textual_tools_status
    {:label => _("Platform Tools"), :value => (@record.tools_status.nil? ? _("N/A") : @record.tools_status)}<commit_msg>Show mac_address in vm_cloud summary<commit_after>module VmCloudHelper::TextualSummary
  # TODO: Determine if DoNav + url_for + :title is the right way to do links, or should it be link_to with :title

  #
  # Groups
  #

  def textual_group_properties
    %i(name region server description ipaddress mac_address custom_1 container tools_status osinfo architecture advanced_settings resources guid virtualization_type root_device_type)
  end

  def textual_group_vm_cloud_relationships
    %i(ems ems_infra cluster host availability_zone cloud_tenant flavor vm_template drift scan_history service
       cloud_network cloud_subnet orchestration_stack cloud_networks cloud_subnets network_routers security_groups
       floating_ips network_ports)
  end

  def textual_group_template_cloud_relationships
    %i(ems parent_vm drift scan_history)
  end

  def textual_group_security
    %i(users groups patches key_pairs)
  end

  def textual_group_configuration
    %i(guest_applications init_processes win32_services kernel_drivers filesystem_drivers filesystems registry_items)
  end

  def textual_group_diagnostics
    %i(processes event_logs)
  end

  def textual_group_vmsafe
    %i(vmsafe_enable vmsafe_agent_address vmsafe_agent_port vmsafe_fail_open vmsafe_immutable_vm vmsafe_timeout)
  end

  def textual_group_miq_custom_attributes
    textual_miq_custom_attributes
  end

  def textual_group_ems_custom_attributes
    textual_ems_custom_attributes
  end

  def textual_group_compliance
    %i(compliance_status compliance_history)
  end

  def textual_group_power_management
    %i(power_state boot_time state_changed_on)
  end

  def textual_group_tags
    %i(tags)
  end

  #
  # Items
  #

  def textual_region
    return nil if @record.region_number == MiqRegion.my_region_number
    h = {:label => _("Region")}
    reg = @record.miq_region
    url = reg.remote_ui_url
    h[:value] = if url
                  # TODO: Why is this link different than the others?
                  link_to(reg.description, url_for(:host   => url,
                                                   :action => 'show',
                                                   :id     => @record),
                          :title   => _("Connect to this VM in its Region"),
                          :onclick => "return miqClickAndPop(this);")
                else
                  reg.description
                end
    h
  end

  def textual_name
    @record.name
  end

  def textual_server
    @record.miq_server && "#{@record.miq_server.name} [#{@record.miq_server.id}]"
  end

  def textual_description
    @record.description
  end

  def textual_ipaddress
    return nil if @record.template?
    ips = @record.ipaddresses
    {:label => n_("IP Address", "IP Addresses", ips.size), :value => ips.join(", ")}
  end

  def textual_mac_address
    return nil if @record.template?
    macs = @record.mac_addresses
    {:label => n_("MAC Address", "MAC Addresses", macs.size), :value => macs.join(", ")}
  end

  def textual_custom_1
    return nil if @record.custom_1.blank?
    {:label => _("Custom Identifier"), :value => @record.custom_1}
  end

  def textual_tools_status
    {:label => _("Platform Tools"), :value => (@record.tools_status.nil? ? _("N/A") : @record.tools_status)}
{'fraction_non_alphanumeric': 0.07235387045813586, 'fraction_numerical': 0.0018957345971563982, 'mean_word_length': 3.032484076433121, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2265248', 'n_tokens_mistral': 2015, 'n_tokens_neox': 1877, 'n_words': 475}