ManageIQ/manageiq-ui-classic

View on GitHub
app/views/utilization/_utilization_report.html.haml

Summary

Maintainability
Test Coverage
#utilization_report_div
  = render :partial => "layouts/flash_msg"
  - if @sb[:trend_rpt] && @sb[:summary]
    = render :partial => "utilization_options", :locals => {:cap_type => "report"}
    %hr
    %h3= _('Basic Information')
    %dl.dl-horizontal
      - @sb[:summary][:info].each do |si|
        %dt
          = si.first
        %dd
          = si.last
  - else
    - if x_node == ""
      - msg = _("Select a node on the left to view Utilization report.")
    - else
      - msg = _("No performance data is available for the selected item.")
    = render :partial => 'layouts/info_msg', :locals => {:message => msg}
  - if @sb[:summary]
    - {:cpu => _('CPU'), :memory => _('Memory'), :storage => _('Disk')}.each do |k, v|
      - if @sb[:summary][k] && !@sb[:summary][k].empty?
        %hr
        %table.table.table-bordered.table-striped
          %thead
            %tr
              %th{:colspan => 2, :align => "left"}
                = v
          %tbody
            - @sb[:summary][k].each do |c|
              %tr
                %td
                  = c.first
                %td
                  = c.last
  - if @sb[:trend_rpt]
    %hr
    = _('* Information shown is based on available trend data from %{start_time} to %{end_time} in the %{timezone} time zone.') % {:start_time => format_timezone(@sb[:options][:trend_start], @sb[:options][:tz], "date"), :end_time => format_timezone(@sb[:options][:trend_end], @sb[:options][:tz], "date"), :timezone => @sb[:options][:time_profile_tz] || @sb[:options][:tz]}