Module: SSHTunnel::UI::Helpers::TunnelWindowHelper

Includes:
Common::FormHelper::InstanceMethods, Common::ModalHelper, Common::TranslationHelper
Included in:
Windows::Tunnels::EditWindow, Windows::Tunnels::NewWindow
Defined in:
lib/ssh-hull/ui/helpers/tunnel_window_helper.rb

Defined Under Namespace

Modules: ClassMethods

Constant Summary collapse

FORM_BUTTONS =
i[submit cancel].freeze
FORM_FIELDS =
{
  name: {
    type: :text,
  },
  type: {
    type: :select,
  },
  local_host: {
    type: :text,
  },
  local_port: {
    type: :text,
  },
  remote_host: {
    type: :text,
  },
  remote_port: {
    type: :text,
  },
  auto_start: {
    type: :checkbox,
  },
}.freeze

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Common::FormHelper::InstanceMethods

#bind_submit_button, #getter_for, #params, #red, #render_form_errors, #restore_form_value, #restore_form_values, #set_input_labels, #setter_for, #submit_form, #white

Class Method Details

.included(base) ⇒ Object



12
13
14
15
# File 'lib/ssh-hull/ui/helpers/tunnel_window_helper.rb', line 12

def self.included(base)
  base.extend(ClassMethods)
  base.extend(SSHTunnel::UI::Helpers::Common::FormHelper::ClassMethods)
end

Instance Method Details

#initialize(application, window, tunnel) ⇒ Object



53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/ssh-hull/ui/helpers/tunnel_window_helper.rb', line 53

def initialize(application, window, tunnel)
  super

  # Set instance variables
  @tunnel = tunnel
  @host   = tunnel.parent

  # Bind listeners
  set_input_labels(scope: :tunnel)

  # Load tunnels combobox
  load_tunnels_combobox
end