ManageIQ/manageiq-ui-classic

View on GitHub
app/helpers/application_helper/button/vm_native_console.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
class ApplicationHelper::Button::VmNativeConsole < ApplicationHelper::Button::Basic
  needs :@record

  def visible?
    @record.vendor == 'redhat'
  end

  def disabled?
    begin
      @record.validate_native_console_support
    rescue MiqException::RemoteConsoleNotSupportedError => err
      @error_message = _('VM Native Console error: %{error}') % {:error => err}
    end
    @error_message.present?
  end
end