]> git.proxmox.com Git - pve-manager.git/blob - www/manager6/dc/Config.js
7d01da5fbbeb6487186e7f3437ba0a7fa898e0e7
[pve-manager.git] / www / manager6 / dc / Config.js
1 /*
2 * Datacenter config panel, located in the center of the ViewPort after the Datacenter view is selected
3 */
4
5 Ext.define('PVE.dc.Config', {
6 extend: 'PVE.panel.Config',
7 alias: 'widget.PVE.dc.Config',
8
9 onlineHelp: 'pve_admin_guide',
10
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"),
20 hstateid: 'dctab',
21 });
22
23 if (caps.dc['Sys.Audit']) {
24 me.items.push({
25 title: gettext('Summary'),
26 xtype: 'pveDcSummary',
27 iconCls: 'fa fa-book',
28 itemId: 'summary',
29 },
30 {
31 xtype: 'pmxNotesView',
32 title: gettext('Notes'),
33 iconCls: 'fa fa-sticky-note-o',
34 itemId: 'notes',
35 },
36 {
37 title: gettext('Cluster'),
38 xtype: 'pveClusterAdministration',
39 iconCls: 'fa fa-server',
40 itemId: 'cluster',
41 },
42 {
43 title: 'Ceph',
44 itemId: 'ceph',
45 iconCls: 'fa fa-ceph',
46 xtype: 'pveNodeCephStatus',
47 },
48 {
49 xtype: 'pveDcOptionView',
50 title: gettext('Options'),
51 iconCls: 'fa fa-gear',
52 itemId: 'options',
53 });
54 }
55
56 if (caps.storage['Datastore.Allocate'] || caps.dc['Sys.Audit']) {
57 me.items.push({
58 xtype: 'pveStorageView',
59 title: gettext('Storage'),
60 iconCls: 'fa fa-database',
61 itemId: 'storage',
62 });
63 }
64
65
66 if (caps.dc['Sys.Audit']) {
67 me.items.push({
68 xtype: 'pveDcBackupView',
69 iconCls: 'fa fa-floppy-o',
70 title: gettext('Backup'),
71 itemId: 'backup',
72 },
73 {
74 xtype: 'pveReplicaView',
75 iconCls: 'fa fa-retweet',
76 title: gettext('Replication'),
77 itemId: 'replication',
78 },
79 {
80 xtype: 'pveACLView',
81 title: gettext('Permissions'),
82 iconCls: 'fa fa-unlock',
83 itemId: 'permissions',
84 expandedOnInit: true,
85 });
86 }
87
88 me.items.push({
89 xtype: 'pveUserView',
90 groups: ['permissions'],
91 iconCls: 'fa fa-user',
92 title: gettext('Users'),
93 itemId: 'users',
94 });
95
96 me.items.push({
97 xtype: 'pveTokenView',
98 groups: ['permissions'],
99 iconCls: 'fa fa-user-o',
100 title: gettext('API Tokens'),
101 itemId: 'apitokens',
102 });
103
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,
111 issuerName: `Proxmox VE - ${PVE.ClusterName || Proxmox.NodeName}`,
112 });
113
114 if (caps.dc['Sys.Audit']) {
115 me.items.push({
116 xtype: 'pveGroupView',
117 title: gettext('Groups'),
118 iconCls: 'fa fa-users',
119 groups: ['permissions'],
120 itemId: 'groups',
121 },
122 {
123 xtype: 'pvePoolView',
124 title: gettext('Pools'),
125 iconCls: 'fa fa-tags',
126 groups: ['permissions'],
127 itemId: 'pools',
128 },
129 {
130 xtype: 'pveRoleView',
131 title: gettext('Roles'),
132 iconCls: 'fa fa-male',
133 groups: ['permissions'],
134 itemId: 'roles',
135 },
136 {
137 title: gettext('Realms'),
138 xtype: 'panel',
139 layout: {
140 type: 'border',
141 },
142 groups: ['permissions'],
143 iconCls: 'fa fa-address-book-o',
144 itemId: 'domains',
145 items: [
146 {
147 xtype: 'pveAuthView',
148 region: 'center',
149 border: false,
150 },
151 {
152 xtype: 'pveRealmSyncJobView',
153 title: gettext('Realm Sync Jobs'),
154 region: 'south',
155 collapsible: true,
156 animCollapse: false,
157 border: false,
158 height: '50%',
159 },
160 ],
161 },
162 {
163 xtype: 'pveHAStatus',
164 title: 'HA',
165 iconCls: 'fa fa-heartbeat',
166 itemId: 'ha',
167 },
168 {
169 title: gettext('Groups'),
170 groups: ['ha'],
171 xtype: 'pveHAGroupsView',
172 iconCls: 'fa fa-object-group',
173 itemId: 'ha-groups',
174 },
175 {
176 title: gettext('Fencing'),
177 groups: ['ha'],
178 iconCls: 'fa fa-bolt',
179 xtype: 'pveFencingView',
180 itemId: 'ha-fencing',
181 });
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
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',
191 expandedOnInit: true,
192 },
193 {
194 xtype: 'pveSDNZoneView',
195 groups: ['sdn'],
196 title: gettext('Zones'),
197 hidden: true,
198 iconCls: 'fa fa-th',
199 itemId: 'sdnzone',
200 },
201 {
202 xtype: 'pveSDNVnet',
203 groups: ['sdn'],
204 title: 'VNets',
205 hidden: true,
206 iconCls: 'fa fa-network-wired',
207 itemId: 'sdnvnet',
208 },
209 {
210 xtype: 'pveSDNOptions',
211 groups: ['sdn'],
212 title: gettext('Options'),
213 hidden: true,
214 iconCls: 'fa fa-gear',
215 itemId: 'sdnoptions',
216 });
217 }
218
219 if (Proxmox.UserName === 'root@pam') {
220 me.items.push({
221 xtype: 'pveACMEClusterView',
222 title: 'ACME',
223 iconCls: 'fa fa-certificate',
224 itemId: 'acme',
225 });
226 }
227
228 me.items.push({
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',
235 itemId: 'firewall',
236 },
237 {
238 xtype: 'pveFirewallOptions',
239 title: gettext('Options'),
240 groups: ['firewall'],
241 iconCls: 'fa fa-gear',
242 base_url: '/cluster/firewall/options',
243 onlineHelp: 'pve_firewall_cluster_wide_setup',
244 fwtype: 'dc',
245 itemId: 'firewall-options',
246 },
247 {
248 xtype: 'pveSecurityGroups',
249 title: gettext('Security Group'),
250 groups: ['firewall'],
251 iconCls: 'fa fa-group',
252 itemId: 'firewall-sg',
253 },
254 {
255 xtype: 'pveFirewallAliases',
256 title: gettext('Alias'),
257 groups: ['firewall'],
258 iconCls: 'fa fa-external-link',
259 base_url: '/cluster/firewall/aliases',
260 itemId: 'firewall-aliases',
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',
269 itemId: 'firewall-ipset',
270 },
271 {
272 xtype: 'pveMetricServerView',
273 title: gettext('Metric Server'),
274 iconCls: 'fa fa-bar-chart',
275 itemId: 'metricservers',
276 onlineHelp: 'external_metric_server',
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: {
297 border: false,
298 },
299 items: [
300 {
301 xtype: 'pveDcPCIMapView',
302 title: gettext('PCI Devices'),
303 flex: 1,
304 },
305 {
306 xtype: 'splitter',
307 collapsible: false,
308 performCollapse: false,
309 },
310 {
311 xtype: 'pveDcUSBMapView',
312 title: gettext('USB Devices'),
313 flex: 1,
314 },
315 ],
316 },
317 );
318 }
319
320 // this is being reworked, but we need to release newer manager versions already..
321 let notification_enabled = false;
322 if (notification_enabled && caps.dc['Sys.Audit']) {
323 me.items.push(
324 {
325 xtype: 'pveNotificationEvents',
326 title: gettext('Notifications'),
327 onlineHelp: 'notification_events',
328 iconCls: 'fa fa-bell-o',
329 itemId: 'notifications',
330 },
331 );
332 }
333
334 if (notification_enabled && (
335 caps.mapping['Mapping.Audit'] ||
336 caps.mapping['Mapping.Use'] ||
337 caps.mapping['Mapping.Modify']
338 )
339 ) {
340 me.items.push(
341 {
342 xtype: 'pmxNotificationConfigView',
343 title: gettext('Notification Targets'),
344 onlineHelp: 'notification_targets',
345 itemId: 'notification-targets',
346 iconCls: 'fa fa-dot-circle-o',
347 baseUrl: '/cluster/notifications',
348 groups: ['notifications'],
349 },
350 );
351 }
352
353 if (caps.dc['Sys.Audit']) {
354 me.items.push({
355 xtype: 'pveDcSupport',
356 title: gettext('Support'),
357 itemId: 'support',
358 iconCls: 'fa fa-comments-o',
359 });
360 }
361
362 me.callParent();
363 },
364 });