]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/node/Config.js
4d9062f382a6694c6542eb58fe13dde1fc62eac4
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 Suspend'),
70 iconCls
: 'fa fa-fw fa-download',
71 disabled
: !caps
.vms
['VM.PowerMgmt'],
73 Ext
.create('PVE.window.BulkAction', {
76 title
: gettext('Bulk Suspend'),
77 btnText
: gettext('Suspend'),
83 text
: gettext('Bulk Migrate'),
84 iconCls
: 'fa fa-fw fa-send-o',
85 disabled
: !caps
.vms
['VM.Migrate'],
86 hidden
: PVE
.Utils
.isStandaloneNode(),
88 Ext
.create('PVE.window.BulkAction', {
91 title
: gettext('Bulk Migrate'),
92 btnText
: gettext('Migrate'),
101 let restartBtn
= Ext
.create('Proxmox.button.Button', {
102 text
: gettext('Reboot'),
103 disabled
: !caps
.nodes
['Sys.PowerMgmt'],
105 confirmMsg
: Ext
.String
.format(gettext("Reboot node '{0}'?"), nodename
),
106 handler: function() {
107 node_command('reboot');
109 iconCls
: 'fa fa-undo',
112 var shutdownBtn
= Ext
.create('Proxmox.button.Button', {
113 text
: gettext('Shutdown'),
114 disabled
: !caps
.nodes
['Sys.PowerMgmt'],
116 confirmMsg
: Ext
.String
.format(gettext("Shutdown node '{0}'?"), nodename
),
117 handler: function() {
118 node_command('shutdown');
120 iconCls
: 'fa fa-power-off',
123 var shellBtn
= Ext
.create('PVE.button.ConsoleButton', {
124 disabled
: !caps
.nodes
['Sys.Console'],
125 text
: gettext('Shell'),
126 consoleType
: 'shell',
133 title
: gettext('Node') + " '" + nodename
+ "'",
136 statusStore
: me
.statusStore
,
138 tbar
: [restartBtn
, shutdownBtn
, shellBtn
, actionBtn
],
141 if (caps
.nodes
['Sys.Audit']) {
144 xtype
: 'pveNodeSummary',
145 title
: gettext('Summary'),
146 iconCls
: 'fa fa-book',
150 xtype
: 'pmxNotesView',
151 title
: gettext('Notes'),
152 iconCls
: 'fa fa-sticky-note-o',
158 if (caps
.nodes
['Sys.Console']) {
161 xtype
: 'pveNoVncConsole',
162 title
: gettext('Shell'),
163 iconCls
: 'fa fa-terminal',
165 consoleType
: 'shell',
172 if (caps
.nodes
['Sys.Audit']) {
175 xtype
: 'proxmoxNodeServiceView',
176 title
: gettext('System'),
177 iconCls
: 'fa fa-cogs',
179 expandedOnInit
: true,
180 restartCommand
: 'reload', // avoid disruptions
187 onlineHelp
: 'pve_service_daemons',
190 xtype
: 'proxmoxNodeNetworkView',
191 title
: gettext('Network'),
192 iconCls
: 'fa fa-exchange',
195 groups
: ['services'],
197 onlineHelp
: 'sysadmin_network_configuration',
200 xtype
: 'pveCertificatesView',
201 title
: gettext('Certificates'),
202 iconCls
: 'fa fa-certificate',
203 itemId
: 'certificates',
204 groups
: ['services'],
208 xtype
: 'proxmoxNodeDNSView',
209 title
: gettext('DNS'),
210 iconCls
: 'fa fa-globe',
211 groups
: ['services'],
214 onlineHelp
: 'sysadmin_network_configuration',
217 xtype
: 'proxmoxNodeHostsView',
218 title
: gettext('Hosts'),
219 iconCls
: 'fa fa-globe',
220 groups
: ['services'],
223 onlineHelp
: 'sysadmin_network_configuration',
226 xtype
: 'proxmoxNodeOptionsView',
227 title
: gettext('Options'),
228 iconCls
: 'fa fa-gear',
229 groups
: ['services'],
232 onlineHelp
: 'proxmox_node_management',
235 xtype
: 'proxmoxNodeTimeView',
236 title
: gettext('Time'),
238 groups
: ['services'],
240 iconCls
: 'fa fa-clock-o',
244 if (caps
.nodes
['Sys.Syslog']) {
246 xtype
: 'proxmoxJournalView',
248 iconCls
: 'fa fa-list',
249 groups
: ['services'],
250 disabled
: !caps
.nodes
['Sys.Syslog'],
252 url
: "/api2/extjs/nodes/" + nodename
+ "/journal",
255 if (caps
.nodes
['Sys.Modify']) {
257 xtype
: 'proxmoxNodeAPT',
258 title
: gettext('Updates'),
259 iconCls
: 'fa fa-refresh',
260 expandedOnInit
: true,
261 disabled
: !caps
.nodes
['Sys.Console'],
262 // do we want to link to system updates instead?
265 xtype
: 'pveConsoleButton',
266 disabled
: Proxmox
.UserName
!== 'root@pam',
267 text
: gettext('Upgrade'),
268 consoleType
: 'upgrade',
275 xtype
: 'proxmoxNodeAPTRepositories',
276 title
: gettext('Repositories'),
277 iconCls
: 'fa fa-files-o',
278 itemId
: 'aptrepositories',
280 onlineHelp
: 'sysadmin_package_repositories',
286 if (caps
.nodes
['Sys.Audit']) {
289 xtype
: 'pveFirewallRules',
290 iconCls
: 'fa fa-shield',
291 title
: gettext('Firewall'),
293 base_url
: '/nodes/' + nodename
+ '/firewall/rules',
294 list_refs_url
: '/cluster/firewall/refs',
298 xtype
: 'pveFirewallOptions',
299 title
: gettext('Options'),
300 iconCls
: 'fa fa-gear',
301 onlineHelp
: 'pve_firewall_host_specific_configuration',
302 groups
: ['firewall'],
303 base_url
: '/nodes/' + nodename
+ '/firewall/options',
305 itemId
: 'firewall-options',
310 if (caps
.nodes
['Sys.Audit']) {
313 xtype
: 'pmxDiskList',
314 title
: gettext('Disks'),
316 expandedOnInit
: true,
317 iconCls
: 'fa fa-hdd-o',
319 includePartitions
: true,
320 supportsWipeDisk
: true,
326 onlineHelp
: 'chapter_lvm',
327 iconCls
: 'fa fa-square',
331 xtype
: 'pveLVMThinList',
334 onlineHelp
: 'chapter_lvm',
335 iconCls
: 'fa fa-square-o',
339 xtype
: 'pveDirectoryList',
340 title
: Proxmox
.Utils
.directoryText
,
342 onlineHelp
: 'chapter_storage',
343 iconCls
: 'fa fa-folder',
349 onlineHelp
: 'chapter_zfs',
350 iconCls
: 'fa fa-th-large',
355 xtype
: 'pveNodeCephStatus',
358 iconCls
: 'fa fa-ceph',
361 xtype
: 'pveNodeCephConfigCrush',
362 title
: gettext('Configuration'),
363 iconCls
: 'fa fa-gear',
365 itemId
: 'ceph-config',
368 xtype
: 'pveNodeCephMonMgr',
369 title
: gettext('Monitor'),
372 itemId
: 'ceph-monlist',
375 xtype
: 'pveNodeCephOsdTree',
377 iconCls
: 'fa fa-hdd-o',
379 itemId
: 'ceph-osdtree',
382 xtype
: 'pveNodeCephFSPanel',
384 iconCls
: 'fa fa-folder',
387 itemId
: 'ceph-cephfspanel',
390 xtype
: 'pveNodeCephPoolList',
391 title
: gettext('Pools'),
392 iconCls
: 'fa fa-sitemap',
394 itemId
: 'ceph-pools',
397 xtype
: 'pveReplicaView',
398 iconCls
: 'fa fa-retweet',
399 title
: gettext('Replication'),
400 itemId
: 'replication',
405 if (caps
.nodes
['Sys.Syslog']) {
408 xtype
: 'proxmoxLogView',
409 title
: gettext('Log'),
410 iconCls
: 'fa fa-list',
411 groups
: ['firewall'],
412 onlineHelp
: 'chapter_pve_firewall',
413 url
: '/api2/extjs/nodes/' + nodename
+ '/firewall/log',
414 itemId
: 'firewall-fwlog',
415 log_select_timespan
: true,
419 xtype
: 'cephLogView',
420 title
: gettext('Log'),
422 iconCls
: 'fa fa-list',
424 onlineHelp
: 'chapter_pveceph',
425 url
: "/api2/extjs/nodes/" + nodename
+ "/ceph/log",
432 title
: gettext('Task History'),
433 iconCls
: 'fa fa-list-alt',
436 xtype
: 'proxmoxNodeTasks',
439 xtype
: 'pveGuestIDSelector',
447 title
: gettext('Subscription'),
448 iconCls
: 'fa fa-support',
450 xtype
: 'pveNodeSubscription',
457 me
.mon(me
.statusStore
, 'load', function(store
, records
, success
) {
458 let uptimerec
= store
.data
.get('uptime');
459 let powermgmt
= caps
.nodes
['Sys.PowerMgmt'] && uptimerec
&& uptimerec
.data
.value
;
461 restartBtn
.setDisabled(!powermgmt
);
462 shutdownBtn
.setDisabled(!powermgmt
);
463 shellBtn
.setDisabled(!powermgmt
);
466 me
.on('afterrender', function() {
467 me
.statusStore
.startUpdate();
470 me
.on('destroy', function() {
471 me
.statusStore
.stopUpdate();