]> git.proxmox.com Git - pve-manager.git/blame - www/manager6/dc/Config.js
ui: allow to configure notification event -> target mapping
[pve-manager.git] / www / manager6 / dc / Config.js
CommitLineData
5289a1b8 1/*
6d55c93e 2 * Datacenter config panel, located in the center of the ViewPort after the Datacenter view is selected
5289a1b8
EK
3 */
4
acf7653a
DM
5Ext.define('PVE.dc.Config', {
6 extend: 'PVE.panel.Config',
7 alias: 'widget.PVE.dc.Config',
8
c8802a60 9 onlineHelp: 'pve_admin_guide',
983277c9 10
acf7653a
DM
11 initComponent: function() {
12 var me = this;
13
14 var caps = Ext.state.Manager.get('GuiCap');
15
16 me.items = [];
17
18 Ext.apply(me, {
19 title: gettext("Datacenter"),
f6710aac 20 hstateid: 'dctab',
acf7653a
DM
21 });
22
23 if (caps.dc['Sys.Audit']) {
6d55c93e 24 me.items.push({
2f13e1d2 25 title: gettext('Summary'),
6d55c93e 26 xtype: 'pveDcSummary',
2af89b7b 27 iconCls: 'fa fa-book',
f6710aac 28 itemId: 'summary',
2f13e1d2 29 },
bd800443 30 {
742de03d 31 xtype: 'pmxNotesView',
bd800443
DJ
32 title: gettext('Notes'),
33 iconCls: 'fa fa-sticky-note-o',
34 itemId: 'notes',
35 },
2f13e1d2
TL
36 {
37 title: gettext('Cluster'),
38 xtype: 'pveClusterAdministration',
39 iconCls: 'fa fa-server',
f6710aac 40 itemId: 'cluster',
2f13e1d2 41 },
f3a46983
DC
42 {
43 title: 'Ceph',
44 itemId: 'ceph',
45 iconCls: 'fa fa-ceph',
f6710aac 46 xtype: 'pveNodeCephStatus',
f3a46983 47 },
2f13e1d2 48 {
ba93a9c6 49 xtype: 'pveDcOptionView',
6d55c93e 50 title: gettext('Options'),
2af89b7b 51 iconCls: 'fa fa-gear',
f6710aac 52 itemId: 'options',
2af89b7b 53 });
acf7653a
DM
54 }
55
56 if (caps.storage['Datastore.Allocate'] || caps.dc['Sys.Audit']) {
57 me.items.push({
58 xtype: 'pveStorageView',
59 title: gettext('Storage'),
2af89b7b 60 iconCls: 'fa fa-database',
f6710aac 61 itemId: 'storage',
acf7653a
DM
62 });
63 }
64
9233148b 65
acf7653a 66 if (caps.dc['Sys.Audit']) {
2af89b7b 67 me.items.push({
acf7653a 68 xtype: 'pveDcBackupView',
2af89b7b 69 iconCls: 'fa fa-floppy-o',
acf7653a 70 title: gettext('Backup'),
f6710aac 71 itemId: 'backup',
2af89b7b 72 },
56297d42
DC
73 {
74 xtype: 'pveReplicaView',
75 iconCls: 'fa fa-retweet',
76 title: gettext('Replication'),
f6710aac 77 itemId: 'replication',
56297d42 78 },
2af89b7b
DC
79 {
80 xtype: 'pveACLView',
81 title: gettext('Permissions'),
82 iconCls: 'fa fa-unlock',
83 itemId: 'permissions',
f6710aac 84 expandedOnInit: true,
acf7653a
DM
85 });
86 }
87
88 me.items.push({
89 xtype: 'pveUserView',
2af89b7b
DC
90 groups: ['permissions'],
91 iconCls: 'fa fa-user',
acf7653a 92 title: gettext('Users'),
f6710aac 93 itemId: 'users',
acf7653a
DM
94 });
95
c831fbde
FG
96 me.items.push({
97 xtype: 'pveTokenView',
98 groups: ['permissions'],
99 iconCls: 'fa fa-user-o',
100 title: gettext('API Tokens'),
f6710aac 101 itemId: 'apitokens',
c831fbde
FG
102 });
103
8ff8f435
WB
104 me.items.push({
105 xtype: 'pmxTfaView',
106 title: gettext('Two Factor'),
107 groups: ['permissions'],
108 iconCls: 'fa fa-key',
109 itemId: 'tfa',
110 yubicoEnabled: true,
411a4577 111 issuerName: `Proxmox VE - ${PVE.ClusterName || Proxmox.NodeName}`,
8ff8f435
WB
112 });
113
acf7653a 114 if (caps.dc['Sys.Audit']) {
6d55c93e 115 me.items.push({
2af89b7b
DC
116 xtype: 'pveGroupView',
117 title: gettext('Groups'),
118 iconCls: 'fa fa-users',
119 groups: ['permissions'],
f6710aac 120 itemId: 'groups',
2af89b7b
DC
121 },
122 {
123 xtype: 'pvePoolView',
124 title: gettext('Pools'),
125 iconCls: 'fa fa-tags',
126 groups: ['permissions'],
f6710aac 127 itemId: 'pools',
2af89b7b
DC
128 },
129 {
130 xtype: 'pveRoleView',
131 title: gettext('Roles'),
132 iconCls: 'fa fa-male',
133 groups: ['permissions'],
f6710aac 134 itemId: 'roles',
2af89b7b
DC
135 },
136 {
8ff8f435 137 title: gettext('Realms'),
4c8fcdd7
DC
138 xtype: 'panel',
139 layout: {
140 type: 'border',
141 },
2af89b7b 142 groups: ['permissions'],
3c025656 143 iconCls: 'fa fa-address-book-o',
f6710aac 144 itemId: 'domains',
4c8fcdd7
DC
145 items: [
146 {
147 xtype: 'pveAuthView',
148 region: 'center',
149 border: false,
150 },
151 {
152 xtype: 'pveRealmSyncJobView',
fc8f37ee 153 title: gettext('Realm Sync Jobs'),
4c8fcdd7
DC
154 region: 'south',
155 collapsible: true,
156 animCollapse: false,
157 border: false,
158 height: '50%',
159 },
160 ],
f44ce595 161 },
2af89b7b 162 {
8a58f554 163 xtype: 'pveHAStatus',
2af89b7b
DC
164 title: 'HA',
165 iconCls: 'fa fa-heartbeat',
f6710aac 166 itemId: 'ha',
2af89b7b 167 },
2af89b7b
DC
168 {
169 title: gettext('Groups'),
170 groups: ['ha'],
171 xtype: 'pveHAGroupsView',
172 iconCls: 'fa fa-object-group',
f6710aac 173 itemId: 'ha-groups',
2af89b7b
DC
174 },
175 {
176 title: gettext('Fencing'),
177 groups: ['ha'],
178 iconCls: 'fa fa-bolt',
179 xtype: 'pveFencingView',
f6710aac 180 itemId: 'ha-fencing',
35ffde01 181 });
013cd17b
TL
182 // always show on initial load, will be hiddea later if the SDN API calls don't exist,
183 // else it won't be shown at first if the user initially loads with DC selected
35ffde01
TL
184 if (PVE.SDNInfo || PVE.SDNInfo === undefined) {
185 me.items.push({
186 xtype: 'pveSDNStatus',
187 title: gettext('SDN'),
188 iconCls: 'fa fa-sdn',
189 hidden: true,
190 itemId: 'sdn',
f6710aac 191 expandedOnInit: true,
35ffde01 192 },
35ffde01
TL
193 {
194 xtype: 'pveSDNZoneView',
195 groups: ['sdn'],
196 title: gettext('Zones'),
197 hidden: true,
198 iconCls: 'fa fa-th',
f6710aac 199 itemId: 'sdnzone',
35ffde01
TL
200 },
201 {
1d9643f6 202 xtype: 'pveSDNVnet',
35ffde01 203 groups: ['sdn'],
5f936d95 204 title: 'VNets',
35ffde01
TL
205 hidden: true,
206 iconCls: 'fa fa-network-wired',
f6710aac 207 itemId: 'sdnvnet',
1d9643f6
AD
208 },
209 {
210 xtype: 'pveSDNOptions',
211 groups: ['sdn'],
212 title: gettext('Options'),
213 hidden: true,
214 iconCls: 'fa fa-gear',
8295f55e 215 itemId: 'sdnoptions',
35ffde01
TL
216 });
217 }
f9c0feeb
DC
218
219 if (Proxmox.UserName === 'root@pam') {
220 me.items.push({
221 xtype: 'pveACMEClusterView',
b37ea2a1 222 title: 'ACME',
f9c0feeb 223 iconCls: 'fa fa-certificate',
f6710aac 224 itemId: 'acme',
f9c0feeb
DC
225 });
226 }
227
35ffde01 228 me.items.push({
2af89b7b
DC
229 xtype: 'pveFirewallRules',
230 title: gettext('Firewall'),
231 allow_iface: true,
232 base_url: '/cluster/firewall/rules',
233 list_refs_url: '/cluster/firewall/refs',
234 iconCls: 'fa fa-shield',
f6710aac 235 itemId: 'firewall',
2af89b7b
DC
236 },
237 {
238 xtype: 'pveFirewallOptions',
239 title: gettext('Options'),
240 groups: ['firewall'],
241 iconCls: 'fa fa-gear',
242 base_url: '/cluster/firewall/options',
c8802a60 243 onlineHelp: 'pve_firewall_cluster_wide_setup',
2af89b7b 244 fwtype: 'dc',
f6710aac 245 itemId: 'firewall-options',
2af89b7b
DC
246 },
247 {
248 xtype: 'pveSecurityGroups',
249 title: gettext('Security Group'),
250 groups: ['firewall'],
251 iconCls: 'fa fa-group',
f6710aac 252 itemId: 'firewall-sg',
2af89b7b
DC
253 },
254 {
255 xtype: 'pveFirewallAliases',
256 title: gettext('Alias'),
257 groups: ['firewall'],
258 iconCls: 'fa fa-external-link',
259 base_url: '/cluster/firewall/aliases',
f6710aac 260 itemId: 'firewall-aliases',
2af89b7b
DC
261 },
262 {
263 xtype: 'pveIPSet',
264 title: 'IPSet',
265 groups: ['firewall'],
266 iconCls: 'fa fa-list-ol',
267 base_url: '/cluster/firewall/ipset',
268 list_refs_url: '/cluster/firewall/refs',
f6710aac 269 itemId: 'firewall-ipset',
2af89b7b 270 },
f257dcec
DC
271 {
272 xtype: 'pveMetricServerView',
273 title: gettext('Metric Server'),
274 iconCls: 'fa fa-bar-chart',
275 itemId: 'metricservers',
c63115da 276 onlineHelp: 'external_metric_server',
70eb18e8
DC
277 });
278 }
279
280 if (caps.mapping['Mapping.Audit'] ||
281 caps.mapping['Mapping.Use'] ||
282 caps.mapping['Mapping.Modify']) {
283 me.items.push(
284 {
285 xtype: 'container',
286 onlineHelp: 'resource_mapping',
287 title: gettext('Resource Mappings'),
288 itemId: 'resources',
289 iconCls: 'fa fa-folder-o',
290 layout: {
291 type: 'vbox',
292 align: 'stretch',
293 multi: true,
294 },
295 scrollable: true,
296 defaults: {
0eb03eaa 297 border: false,
70eb18e8
DC
298 },
299 items: [
300 {
70eb18e8
DC
301 xtype: 'pveDcPCIMapView',
302 title: gettext('PCI Devices'),
303 flex: 1,
304 },
305 {
0eb03eaa
DC
306 xtype: 'splitter',
307 collapsible: false,
308 performCollapse: false,
309 },
310 {
70eb18e8
DC
311 xtype: 'pveDcUSBMapView',
312 title: gettext('USB Devices'),
313 flex: 1,
314 },
315 ],
316 },
317 );
318 }
319
80c49bb5
LW
320 if (caps.dc['Sys.Audit']) {
321 me.items.push(
322 {
323 xtype: 'pveNotificationEvents',
324 title: gettext('Notifications'),
325 onlineHelp: 'notification_events',
326 iconCls: 'fa fa-bell-o',
327 itemId: 'notifications',
328 },
329 );
330 }
331
70eb18e8
DC
332 if (caps.dc['Sys.Audit']) {
333 me.items.push({
acf7653a
DM
334 xtype: 'pveDcSupport',
335 title: gettext('Support'),
2af89b7b 336 itemId: 'support',
f6710aac 337 iconCls: 'fa fa-comments-o',
acf7653a
DM
338 });
339 }
340
341 me.callParent();
f6710aac 342 },
acf7653a 343});