Module: Yast::IsnsDialogsInclude

Defined in:
../../src/include/isns/dialogs.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) initialize_isns_dialogs(include_target)



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
# File '../../src/include/isns/dialogs.rb', line 13

def initialize_isns_dialogs(include_target)
  textdomain "isns"

  Yast.import "Label"
  Yast.import "Wizard"
  Yast.import "IsnsServer"
  Yast.import "CWMTab"
  Yast.import "CWM"
  Yast.import "CWMServiceStart"
  Yast.import "CWMFirewallInterfaces"
  Yast.import "TablePopup"

  Yast.include include_target, "isns/helps.rb"
  Yast.include include_target, "isns/widgets.rb"

  # store current here
  @current_tab = "service"

  @tabs_descr = {
    # first tab - service status and firewall
    "service"             => {
      "header"       => _("Service"),
      "contents"     => VBox(
        VStretch(),
        HBox(
          HStretch(),
          HSpacing(1),
          VBox(
            "ipaddress",
            VSpacing(2),
            "auto_start_up",
            VSpacing(2),
            "firewall",
            VSpacing(2)
          ),
          HSpacing(1),
          HStretch()
        ),
        VStretch()
      ),
      "widget_names" => ["ipaddress", "auto_start_up", "firewall"]
    },
    # second tab - iSCSI Nodes
    "members"             => {
      "header"       => _("iSCSI Nodes"),
      "contents"     => VBox(
        VSpacing(1),
        HBox(HSpacing(5), VBox("iscsi_nodes_display"), HSpacing(5)),
        VSpacing(1)
      ),
      "widget_names" => ["iscsi_nodes_display"]
    },
    # third tab - Discovery Domains
    "discoverydomains"    => {
      "header"       => _("Discovery Domains"),
      "contents"     => VBox(
        HBox(HStretch(), VBox("dd_display"), HStretch()),
        VStretch(),
        HBox(HStretch(), VBox("dd_display_members"), HStretch())
      ),
      "widget_names" => ["dd_display", "dd_display_members"]
    },
    # fourth tab - discovery domain sets
    "discoverydomainsets" => {
      "header"       => _("Discovery Domains Sets"),
      "contents"     => VBox(
        HBox(HStretch(), VBox("dds_display"), HStretch()),
        VStretch(),
        HBox(HStretch(), VBox("dds_display_members"), HStretch())
      ),
      "widget_names" => ["dds_display", "dds_display_members"]
    }
  }


  @widgets = {
    "auto_start_up"       => CWMServiceStart.CreateAutoStartWidget(
      {
        "get_service_auto_start" => fun_ref(
          IsnsServer.method(:GetStartService),
          "boolean ()"
        ),
        "set_service_auto_start" => fun_ref(
          IsnsServer.method(:SetStartService),
          "void (boolean)"
        ),
        "start_auto_button"      => _("When &Booting"),
        "start_manual_button"    => _("&Manually"),
        "help"                   => Builtins.sformat(
          CWMServiceStart.AutoStartHelpTemplate,
          _("When Booting"),
          _("Manually")
        )
      }
    ),
    "ipaddress"           => {
      "widget"        => :custom,
      "custom_widget" => VBox(
        HBox(
          InputField(
            Id(:isnsaddress),
            Opt(:hstretch),
            _("Address of iSNS Server")
          )
        )
      ),
      "init"          => fun_ref(method(:initAddress), "void (string)"),
      "handle"        => fun_ref(
        method(:handleAddress),
        "symbol (string, map)"
      ),
      "help"          => Ops.get_string(@HELPS, "ipaddress", "")
    },
    "firewall"            => CWMFirewallInterfaces.CreateOpenFirewallWidget(
      { "services" => ["isns-server"], "display_details" => true }
    ),
    "iscsi_nodes_display" => {
      "widget"        => :custom,
      "custom_widget" => VBox(
        Heading(_("iSCSI Nodes")),
        Table(
          Id(:members_table),
          Header(_("iSCSI Node Name"), _("Node Type")),
          []
        ),
        Left(HBox(PushButton(Id(:delete), _("Delete"))))
      ),
      "init"          => fun_ref(method(:initISCSI), "void (string)"),
      "handle"        => fun_ref(
        method(:handleISCSI),
        "symbol (string, map)"
      ),
      "help"          => Ops.get_string(@HELPS, "iscsi_display", "")
    },
    "dd_display"          => {
      "widget"        => :custom,
      "custom_widget" => VBox(
        Heading(_("Discovery Domains")),
        HBox(
          VSpacing(5),
          Table(
            Id(:dd_table),
            Opt(:notify, :immediate),
            Header(_("Discovery Domain Name")),
            []
          )
        ),
        Left(
          HBox(
            PushButton(Id(:add), _("Create Discovery Domain")),
            PushButton(Id(:delete), _("Delete")),
            HSpacing(25)
          )
        )
      ),
      "init"          => fun_ref(
        method(:initDiscoveryDomain),
        "void (string)"
      ),
      "handle"        => fun_ref(
        method(:handleDiscoveryDomain),
        "symbol (string, map)"
      ),
      "help"          => Ops.get_string(@HELPS, "dd_display", "")
    },
    "dd_display_members"  => {
      "widget"        => :custom,
      "custom_widget" => VBox(
        Heading(_("Discovery Domain Members")),
        HBox(
          VSpacing(10),
          Table(
            Id(:dd_members_table),
            Header(_("iSCSI Node Name"), _("Node Type")),
            []
          )
        ),
        Left(
          HBox(
            PushButton(Id(:addiscsinode), _("Add Existing iSCSI Node")),
            PushButton(Id(:createmember), _("Create iSCSI Node Member")),
            PushButton(Id(:remove), _("Remove"))
          )
        )
      ),
      "init"          => fun_ref(
        method(:initDDISCSIMembers),
        "void (string)"
      ),
      "handle"        => fun_ref(
        method(:handleDiscoveryDomainMembers),
        "symbol (string, map)"
      ),
      "help"          => Ops.get_string(@HELPS, "dd_display_members", "")
    },
    "dds_display"         => {
      "widget"        => :custom,
      "custom_widget" => VBox(
        Heading(_("Discovery Domains Sets")),
        HBox(
          VSpacing(5),
          Table(
            Id(:dds_table),
            Opt(:notify, :immediate),
            Header(_("Discovery Domain Set Name")),
            []
          )
        ),
        Left(
          HBox(
            PushButton(Id(:add), _("Create Discovery Domain Set")),
            PushButton(Id(:delete), _("Delete")),
            HSpacing(25)
          )
        )
      ),
      "init"          => fun_ref(
        method(:initDiscoveryDomainSet),
        "void (string)"
      ),
      "handle"        => fun_ref(
        method(:handleDiscoveryDomainSet),
        "symbol (string, map)"
      ),
      "help"          => Ops.get_string(@HELPS, "dds_display", "")
    },
    "dds_display_members" => {
      "widget"        => :custom,
      "custom_widget" => VBox(
        Heading(_("Discovery Domain Set Members")),
        HBox(
          VSpacing(10),
          Table(
            Id(:dds_members_table),
            Header(_("Discovery Domain Name")),
            []
          )
        ),
        Left(
          HBox(
            PushButton(Id(:adddd), _("Add Discovery Domain")),
            PushButton(Id(:remove), _("Remove"))
          )
        )
      ),
      "init"          => fun_ref(
        method(:initDiscoveryDomainSetMembers),
        "void (string)"
      ),
      "handle"        => fun_ref(
        method(:handleDiscoveryDomainSetMembers),
        "symbol (string, map)"
      ),
      "help"          => Ops.get_string(@HELPS, "dds_display_members", "")
    }
  }
end

- (Object) SummaryDialog

Summary dialog Main dialog - tabbed

Returns:

  • dialog result



274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
# File '../../src/include/isns/dialogs.rb', line 274

def SummaryDialog
  caption = _("iSNS Service")
  #curr_target = "";
  widget_descr = {
    "tab" => CWMTab.CreateWidget(
      {
        "tab_order"    => [
          "service",
          "members",
          "discoverydomains",
          "discoverydomainsets"
        ],
        "tabs"         => @tabs_descr,
        "widget_descr" => @widgets,
        "initial_tab"  => @current_tab,
        "tab_help"     => _("<h1>iSNS Service</h1>")
      }
    )
  }
  contents = VBox("tab")
  w = CWM.CreateWidgets(
    ["tab"],
    Convert.convert(
      widget_descr,
      :from => "map",
      :to   => "map <string, map <string, any>>"
    )
  )
  help = CWM.MergeHelps(w)
  contents = CWM.PrepareDialog(contents, w)

  Wizard.SetContentsButtons(
    caption,
    contents,
    help,
    Label.BackButton,
    Label.OKButton
  )
  Wizard.SetNextButton(:next, Label.OKButton)
  Wizard.SetAbortButton(:abort, Label.CancelButton)
  Wizard.HideBackButton
  #    Wizard::SetContentsButtons(caption, contents, help, Label::NextButton (), Label::FinishButton ());
  #    Wizard::HideBackButton();

  ret = CWM.Run(
    w,
    { :abort => fun_ref(method(:ReallyAbort), "boolean ()") }
  )
  ret
end