]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/node/Config.js
1 Ext
.define('PVE.node.Config', {
2 extend
: 'PVE.panel.Config',
3 alias
: 'widget.PVE.node.Config',
5 onlineHelp
: 'chapter_system_administration',
7 initComponent: function() {
10 var nodename
= me
.pveSelNode
.data
.node
;
12 throw "no node name specified";
15 var caps
= Ext
.state
.Manager
.get('GuiCap');
17 me
.statusStore
= Ext
.create('Proxmox.data.ObjectStore', {
18 url
: "/api2/json/nodes/" + nodename
+ "/status",
22 var node_command = function(cmd
) {
23 Proxmox
.Utils
.API2Request({
24 params
: { command
: cmd
},
25 url
: '/nodes/' + nodename
+ '/status',
28 failure: function(response
, opts
) {
29 Ext
.Msg
.alert(gettext('Error'), response
.htmlStatus
);
34 var actionBtn
= Ext
.create('Ext.Button', {
35 text
: gettext('Bulk Actions'),
36 iconCls
: 'fa fa-fw fa-ellipsis-v',
37 disabled
: !caps
.vms
['VM.PowerMgmt'] && !caps
.vms
['VM.Migrate'],
38 menu
: new Ext
.menu
.Menu({
41 text
: gettext('Bulk Start'),
42 iconCls
: 'fa fa-fw fa-play',
43 disabled
: !caps
.vms
['VM.PowerMgmt'],
45 Ext
.create('PVE.window.BulkAction', {
48 title
: gettext('Bulk Start'),
49 btnText
: gettext('Start'),
55 text
: gettext('Bulk Shutdown'),
56 iconCls
: 'fa fa-fw fa-stop',
57 disabled
: !caps
.vms
['VM.PowerMgmt'],
59 Ext
.create('PVE.window.BulkAction', {
62 title
: gettext('Bulk Shutdown'),
63 btnText
: gettext('Shutdown'),
69 text
: gettext('Bulk Migrate'),
70 iconCls
: 'fa fa-fw fa-send-o',
71 disabled
: !caps
.vms
['VM.Migrate'],
73 Ext
.create('PVE.window.BulkAction', {
76 title
: gettext('Bulk Migrate'),
77 btnText
: gettext('Migrate'),
86 let restartBtn
= Ext
.create('Proxmox.button.Button', {
87 text
: gettext('Reboot'),
88 disabled
: !caps
.nodes
['Sys.PowerMgmt'],
90 confirmMsg
: Ext
.String
.format(gettext("Reboot node '{0}'?"), nodename
),
92 node_command('reboot');
94 iconCls
: 'fa fa-undo',
97 var shutdownBtn
= Ext
.create('Proxmox.button.Button', {
98 text
: gettext('Shutdown'),
99 disabled
: !caps
.nodes
['Sys.PowerMgmt'],
101 confirmMsg
: Ext
.String
.format(gettext("Shutdown node '{0}'?"), nodename
),
102 handler: function() {
103 node_command('shutdown');
105 iconCls
: 'fa fa-power-off',
108 var shellBtn
= Ext
.create('PVE.button.ConsoleButton', {
109 disabled
: !caps
.nodes
['Sys.Console'],
110 text
: gettext('Shell'),
111 consoleType
: 'shell',
118 title
: gettext('Node') + " '" + nodename
+ "'",
121 statusStore
: me
.statusStore
,
123 tbar
: [restartBtn
, shutdownBtn
, shellBtn
, actionBtn
],
126 if (caps
.nodes
['Sys.Audit']) {
129 xtype
: 'pveNodeSummary',
130 title
: gettext('Summary'),
131 iconCls
: 'fa fa-book',
135 xtype
: 'pmxNotesView',
136 title
: gettext('Notes'),
137 iconCls
: 'fa fa-sticky-note-o',
143 if (caps
.nodes
['Sys.Console']) {
146 xtype
: 'pveNoVncConsole',
147 title
: gettext('Shell'),
148 iconCls
: 'fa fa-terminal',
150 consoleType
: 'shell',
157 if (caps
.nodes
['Sys.Audit']) {
160 xtype
: 'proxmoxNodeServiceView',
161 title
: gettext('System'),
162 iconCls
: 'fa fa-cogs',
164 expandedOnInit
: true,
165 restartCommand
: 'reload', // avoid disruptions
172 onlineHelp
: 'pve_service_daemons',
175 xtype
: 'proxmoxNodeNetworkView',
176 title
: gettext('Network'),
177 iconCls
: 'fa fa-exchange',
180 groups
: ['services'],
182 onlineHelp
: 'sysadmin_network_configuration',
185 xtype
: 'pveCertificatesView',
186 title
: gettext('Certificates'),
187 iconCls
: 'fa fa-certificate',
188 itemId
: 'certificates',
189 groups
: ['services'],
193 xtype
: 'proxmoxNodeDNSView',
194 title
: gettext('DNS'),
195 iconCls
: 'fa fa-globe',
196 groups
: ['services'],
199 onlineHelp
: 'sysadmin_network_configuration',
202 xtype
: 'proxmoxNodeHostsView',
203 title
: gettext('Hosts'),
204 iconCls
: 'fa fa-globe',
205 groups
: ['services'],
208 onlineHelp
: 'sysadmin_network_configuration',
211 xtype
: 'proxmoxNodeOptionsView',
212 title
: gettext('Options'),
213 iconCls
: 'fa fa-gear',
214 groups
: ['services'],
217 onlineHelp
: 'proxmox_node_management',
220 xtype
: 'proxmoxNodeTimeView',
221 title
: gettext('Time'),
223 groups
: ['services'],
225 iconCls
: 'fa fa-clock-o',
229 if (caps
.nodes
['Sys.Syslog']) {
231 xtype
: 'proxmoxJournalView',
233 iconCls
: 'fa fa-list',
234 groups
: ['services'],
235 disabled
: !caps
.nodes
['Sys.Syslog'],
237 url
: "/api2/extjs/nodes/" + nodename
+ "/journal",
240 if (caps
.nodes
['Sys.Modify']) {
242 xtype
: 'proxmoxNodeAPT',
243 title
: gettext('Updates'),
244 iconCls
: 'fa fa-refresh',
245 expandedOnInit
: true,
246 disabled
: !caps
.nodes
['Sys.Console'],
247 // do we want to link to system updates instead?
250 xtype
: 'pveConsoleButton',
251 disabled
: Proxmox
.UserName
!== 'root@pam',
252 text
: gettext('Upgrade'),
253 consoleType
: 'upgrade',
260 xtype
: 'proxmoxNodeAPTRepositories',
261 title
: gettext('Repositories'),
262 iconCls
: 'fa fa-files-o',
263 itemId
: 'aptrepositories',
265 onlineHelp
: 'sysadmin_package_repositories',
271 if (caps
.nodes
['Sys.Audit']) {
274 xtype
: 'pveFirewallRules',
275 iconCls
: 'fa fa-shield',
276 title
: gettext('Firewall'),
278 base_url
: '/nodes/' + nodename
+ '/firewall/rules',
279 list_refs_url
: '/cluster/firewall/refs',
283 xtype
: 'pveFirewallOptions',
284 title
: gettext('Options'),
285 iconCls
: 'fa fa-gear',
286 onlineHelp
: 'pve_firewall_host_specific_configuration',
287 groups
: ['firewall'],
288 base_url
: '/nodes/' + nodename
+ '/firewall/options',
290 itemId
: 'firewall-options',
295 if (caps
.nodes
['Sys.Audit']) {
298 xtype
: 'pmxDiskList',
299 title
: gettext('Disks'),
301 expandedOnInit
: true,
302 iconCls
: 'fa fa-hdd-o',
304 includePartitions
: true,
305 supportsWipeDisk
: true,
311 onlineHelp
: 'chapter_lvm',
312 iconCls
: 'fa fa-square',
316 xtype
: 'pveLVMThinList',
319 onlineHelp
: 'chapter_lvm',
320 iconCls
: 'fa fa-square-o',
324 xtype
: 'pveDirectoryList',
325 title
: Proxmox
.Utils
.directoryText
,
327 onlineHelp
: 'chapter_storage',
328 iconCls
: 'fa fa-folder',
334 onlineHelp
: 'chapter_zfs',
335 iconCls
: 'fa fa-th-large',
340 xtype
: 'pveNodeCephStatus',
343 iconCls
: 'fa fa-ceph',
346 xtype
: 'pveNodeCephConfigCrush',
347 title
: gettext('Configuration'),
348 iconCls
: 'fa fa-gear',
350 itemId
: 'ceph-config',
353 xtype
: 'pveNodeCephMonMgr',
354 title
: gettext('Monitor'),
357 itemId
: 'ceph-monlist',
360 xtype
: 'pveNodeCephOsdTree',
362 iconCls
: 'fa fa-hdd-o',
364 itemId
: 'ceph-osdtree',
367 xtype
: 'pveNodeCephFSPanel',
369 iconCls
: 'fa fa-folder',
372 itemId
: 'ceph-cephfspanel',
375 xtype
: 'pveNodeCephPoolList',
376 title
: gettext('Pools'),
377 iconCls
: 'fa fa-sitemap',
379 itemId
: 'ceph-pools',
382 xtype
: 'pveReplicaView',
383 iconCls
: 'fa fa-retweet',
384 title
: gettext('Replication'),
385 itemId
: 'replication',
390 if (caps
.nodes
['Sys.Syslog']) {
393 xtype
: 'proxmoxLogView',
394 title
: gettext('Log'),
395 iconCls
: 'fa fa-list',
396 groups
: ['firewall'],
397 onlineHelp
: 'chapter_pve_firewall',
398 url
: '/api2/extjs/nodes/' + nodename
+ '/firewall/log',
399 itemId
: 'firewall-fwlog',
402 xtype
: 'cephLogView',
403 title
: gettext('Log'),
405 iconCls
: 'fa fa-list',
407 onlineHelp
: 'chapter_pveceph',
408 url
: "/api2/extjs/nodes/" + nodename
+ "/ceph/log",
415 title
: gettext('Task History'),
416 iconCls
: 'fa fa-list-alt',
419 xtype
: 'proxmoxNodeTasks',
422 xtype
: 'pveGuestIDSelector',
423 fieldLabel
: gettext('VMID'),
430 title
: gettext('Subscription'),
431 iconCls
: 'fa fa-support',
433 xtype
: 'pveNodeSubscription',
440 me
.mon(me
.statusStore
, 'load', function(store
, records
, success
) {
441 let uptimerec
= store
.data
.get('uptime');
442 let powermgmt
= caps
.nodes
['Sys.PowerMgmt'] && uptimerec
&& uptimerec
.data
.value
;
444 restartBtn
.setDisabled(!powermgmt
);
445 shutdownBtn
.setDisabled(!powermgmt
);
446 shellBtn
.setDisabled(!powermgmt
);
449 me
.on('afterrender', function() {
450 me
.statusStore
.startUpdate();
453 me
.on('destroy', function() {
454 me
.statusStore
.stopUpdate();