Module: Yast::DhcpServerWizardsInclude

Defined in:
../../src/include/dhcp-server/wizards.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) DhcpAutoSequence

Whole configuration of dns-server in AI mode

Returns:

  • sequence result



139
140
141
142
143
144
145
146
147
148
149
150
151
152
# File '../../src/include/dhcp-server/wizards.rb', line 139

def DhcpAutoSequence
  Wizard.CreateDialog
  Wizard.SetDesktopTitleAndIcon("dhcp-server")
  Wizard.SetContentsButtons(
    "",
    VBox(),
    "",
    Label.BackButton,
    Label.NextButton
  )
  ret = MainSequence()
  UI.CloseDialog
  ret
end

- (Object) DhcpSequence

Whole configuration of dns-server

Returns:

  • sequence result



156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# File '../../src/include/dhcp-server/wizards.rb', line 156

def DhcpSequence
  aliases = {
    "read"   => [lambda { ReadDialog() }, true],
    "wizard" => lambda { FirstRunSequence() },
    "main"   => lambda { MainSequence() },
    "write"  => [lambda { WriteDialog() }, true]
  }

  sequence = {
    "ws_start" => "read",
    "read"     => { :abort => :abort, :next => "main", :wizard => "wizard" },
    "main"     => { :abort => :abort, :next => "write" },
    "wizard"   => { :abort => :abort, :next => "write", :main => "main" },
    "write"    => { :abort => :abort, :next => :next }
  }

  Wizard.CreateDialog
  Wizard.SetDesktopTitleAndIcon("dhcp-server")
  ret = Sequencer.Run(aliases, sequence)

  UI.CloseDialog

  if ret == :next
    SCR.Execute(
      path(".target.bash"),
      Ops.add(Ops.add("touch ", Directory.vardir), "/dhcp_server_done_once")
    )
  end

  ret
end

- (Object) FirstRunSequence



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File '../../src/include/dhcp-server/wizards.rb', line 23

def FirstRunSequence
  aliases = {
    "cardselection"  => lambda { FirstRunDialog("card_selection", 1) },
    "globalsettings" => lambda { FirstRunDialog("global_settings", 2) },
    "dynamicdhcp"    => lambda { FirstRunDialog("dynamic_dhcp", 3) },
    "inst_summary"   => lambda { FirstRunDialog("inst_summary", 4) }
  }

  sequence = {
    "ws_start"       => "cardselection",
    "cardselection"  => { :abort => :abort, :next => "globalsettings" },
    "globalsettings" => { :abort => :abort, :next => "dynamicdhcp" },
    "dynamicdhcp"    => { :abort => :abort, :next => "inst_summary" },
    "inst_summary"   => { :abort => :abort, :next => :next, :main => :main }
  }

  ret = Sequencer.Run(aliases, sequence)

  deep_copy(ret)
end

- (Object) initialize_dhcp_server_wizards(include_target)



15
16
17
18
19
20
21
# File '../../src/include/dhcp-server/wizards.rb', line 15

def initialize_dhcp_server_wizards(include_target)
  textdomain "dhcp-server"

  Yast.import "Directory"
  Yast.import "Wizard"
  Yast.import "Sequencer"
end

- (Object) MainSequence

Run wizard sequencer

Returns:

  • next,back or `abort



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# File '../../src/include/dhcp-server/wizards.rb', line 46

def MainSequence
  aliases = {
    "configtype_switch"   => [lambda { ConfigTypeSwitch() }, true],
    "commonsetup"         => lambda { CommonConfigDialog() },
    "ifaces_switch"       => [lambda { CheckConfiguredInterfaces() }, true],
    "main"                => lambda { OldMainDialog() },
    "globals"             => lambda { GlobalsDialog() },
    "subnet"              => lambda { SubnetDialog() },
    "host"                => lambda { HostDialog() },
    "shared-network"      => lambda { SharedNetworkDialog() },
    "pool"                => lambda { PoolDialog() },
    "group"               => lambda { Groupdialog() },
    "class"               => lambda { ClassDialog() },
    "section_type_choose" => lambda { SectionTypeChoose() },
    "interfaces"          => lambda { IfacesDialog(false) },
    "interfaces_initial"  => lambda { IfacesDialog(true) },
    "dyn_dns"             => lambda { DynDnsDialog() },
    "section_type_select" => [lambda { SelectEditationDialog() }, true],
    "store"               => [lambda { SectionStore() }, true],
    "tsig_keys"           => lambda { RunTsigKeysDialog(false) },
    "tsig_keys_1"         => lambda { RunTsigKeysDialog(true) },
    "commonsetup"         => lambda { CommonConfigDialog() }
  }

  sequence = {
    "ws_start"            => "configtype_switch",
    "configtype_switch"   => { :simple => "commonsetup", :expert => "main" },
    "commonsetup"         => {
      :abort  => :abort,
      :next   => :next,
      :cancel => :cancel,
      :expert => "ifaces_switch"
    },
    "ifaces_switch"       => {
      :main   => "main",
      :ifaces => "interfaces_initial"
    },
    "interfaces_initial"  => { :abort => :abort, :next => "main" },
    "main"                => {
      :next       => :next,
      :abort      => :abort,
      :edit       => "section_type_select",
      :add        => "section_type_choose",
      :interfaces => "interfaces",
      :tsig_keys  => "tsig_keys"
    },
    "tsig_keys"           => { :next => "main", :abort => :abort },
    "section_type_choose" => {
      :abort => :abort,
      :next  => "section_type_select"
    },
    "section_type_select" => {
      :abort          => :abort,
      :global         => "globals",
      :subnet         => "subnet",
      :host           => "host",
      :group          => "group",
      :pool           => "pool",
      :shared_network => "shared-network",
      :class          => "class"
    },
    "globals"             => { :next => "store", :abort => :abort },
    "subnet"              => {
      :next      => "store",
      :abort     => :abort,
      :dyn_dns   => "dyn_dns",
      :tsig_keys => "tsig_keys_1"
    },
    "host"                => { :next => "store", :abort => :abort },
    "group"               => { :next => "store", :abort => :abort },
    "pool"                => { :next => "store", :abort => :abort },
    "shared-network"      => { :next => "store", :abort => :abort },
    "class"               => { :next => "store", :abort => :abort },
    "store"               => { :abort => :abort, :next => "main" },
    "interfaces"          => { :abort => :abort, :next => "main" },
    "dyn_dns"             => {
      :abort     => :abort,
      :next      => "subnet",
      :tsig_keys => "tsig_keys_1"
    },
    "tsig_keys_1"         => {
      :abort  => :abort,
      :next   => "dyn_dns",
      :subnet => "subnet"
    }
  }

  # run wizard sequencer
  Sequencer.Run(aliases, sequence)
end