forked from ManageIQ/manageiq-ui-classic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdiagnostics_zone_center.rb
131 lines (131 loc) · 5.25 KB
/
diagnostics_zone_center.rb
1
2
3
4
5
6
7
8
9
10
11
12
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
class ApplicationHelper::Toolbar::DiagnosticsZoneCenter < ApplicationHelper::Toolbar::Basic
button_group('support_reloading', [
button(
:reload_server_tree,
'fa fa-repeat fa-lg',
N_('Reload Current Display'),
nil,
:klass => ApplicationHelper::Button::ReloadServerTree),
])
button_group('ldap_domain_vmdb', [
select(
:zone_configuration_choice,
'fa fa-cog fa-lg',
t = N_('Configuration'),
t,
:items => [
button(
:zone_delete,
'pficon pficon-delete fa-lg',
t = proc do
_('Delete Zone %{server_name} [%{server_id}]') % {:server_name => @selected_zone.name, :server_id => @selected_zone.id}
end,
t,
:confirm => proc do
_("Do you want to delete Zone %{server_name} [%{server_id}]?") % {
:server_name => @selected_zone.name,
:server_id => @selected_zone.id
}
end,
:klass => ApplicationHelper::Button::ZoneDelete
),
button(
:zone_role_start,
'fa fa-play-circle-o fa-lg',
proc do
_('Start the %{server_role_description} Role on Server %{server_name} [%{server_id}]') % {
:server_role_description => @record.server_role.description,
:server_name => @record.miq_server.name,
:server_id => @record.miq_server.id
}
end,
N_('Start Role'),
:confirm => proc do
_("Start the %{server_role_description} Role on Server %{server_name} [%{server_id}]?") % {
:server_role_description => @record.server_role.description,
:server_name => @record.miq_server.name,
:server_id => @record.miq_server.id
}
end,
:klass => ApplicationHelper::Button::RolePowerOptions
),
button(
:zone_role_suspend,
'fa fa-pause-circle-o fa-lg',
proc do
_('Suspend the %{server_role_description} Role on Server %{server_name} [%{server_id}]') % {
:server_role_description => @record.server_role.description,
:server_name => @record.miq_server.name,
:server_id => @record.miq_server.id
}
end,
N_('Suspend Role'),
:confirm => proc do
_("Suspend the %{server_role_description} Role on Server %{server_name} [%{server_id}]?") % {
:server_role_description => @record.server_role.description,
:server_name => @record.miq_server.name,
:server_id => @record.miq_server.id
}
end,
:klass => ApplicationHelper::Button::RolePowerOptions
),
button(
:zone_demote_server,
'pficon pficon-delete fa-lg',
proc do
_('Demote Server %{server_name} [%{server_id}] to secondary for the %{server_role_description} Role') % {
:server_role_description => @record.server_role.description,
:server_name => @record.miq_server.name,
:server_id => @record.miq_server.id
}
end,
N_('Demote Server'),
:confirm => N_("Do you want to demote this Server to secondary? This will leave no primary Server for this Role."),
:klass => ApplicationHelper::Button::ServerLevelOptions
),
button(
:zone_promote_server,
'product product-migrate fa-lg',
proc do
_('Promote Server %{server_name} [%{server_id}] to primary for the %{server_role_description} Role') % {
:server_role_description => @record.server_role.description,
:server_name => @record.miq_server.name,
:server_id => @record.miq_server.id
}
end,
N_('Promote Server'),
:confirm => N_("Do you want to promote this Server to primary? This will replace any existing primary Server for this Role."),
:klass => ApplicationHelper::Button::ServerLevelOptions
),
]
),
select(
:zone_collect_logs_choice,
'fa fa-filter fa-lg',
N_('Collect Logs'),
N_('Collect'),
:items => [
button(
:zone_collect_current_logs,
'fa fa-filter fa-lg',
N_('Collect the current logs from the selected Zone'),
N_('Collect current logs'),
:klass => ApplicationHelper::Button::ZoneCollectLogs
),
button(
:zone_collect_logs,
'fa fa-filter fa-lg',
N_('Collect all logs from the selected Zone'),
N_('Collect all logs'),
:klass => ApplicationHelper::Button::ZoneCollectLogs
),
]
),
button(
:zone_log_depot_edit,
'pficon pficon-edit fa-lg',
N_('Edit the Log Depot settings for the selected Zone'),
N_('Edit'),
:klass => ApplicationHelper::Button::LogDepotEdit),
])
end