]>
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
.nodes
['Sys.PowerMgmt'],
38 menu
: new Ext
.menu
.Menu({
41 text
: gettext('Bulk Start'),
42 iconCls
: 'fa fa-fw fa-play',
44 var win
= Ext
.create('PVE.window.BulkAction', {
46 title
: gettext('Bulk Start'),
47 btnText
: gettext('Start'),
54 text
: gettext('Bulk Stop'),
55 iconCls
: 'fa fa-fw fa-stop',
57 var win
= Ext
.create('PVE.window.BulkAction', {
59 title
: gettext('Bulk Stop'),
60 btnText
: gettext('Stop'),
67 text
: gettext('Bulk Migrate'),
68 iconCls
: 'fa fa-fw fa-send-o',
70 var win
= Ext
.create('PVE.window.BulkAction', {
72 title
: gettext('Bulk Migrate'),
73 btnText
: gettext('Migrate'),
83 let restartBtn
= Ext
.create('Proxmox.button.Button', {
84 text
: gettext('Reboot'),
85 disabled
: !caps
.nodes
['Sys.PowerMgmt'],
87 confirmMsg
: Ext
.String
.format(gettext("Reboot node '{0}'?"), nodename
),
89 node_command('reboot');
91 iconCls
: 'fa fa-undo',
94 var shutdownBtn
= Ext
.create('Proxmox.button.Button', {
95 text
: gettext('Shutdown'),
96 disabled
: !caps
.nodes
['Sys.PowerMgmt'],
98 confirmMsg
: Ext
.String
.format(gettext("Shutdown node '{0}'?"), nodename
),
100 node_command('shutdown');
102 iconCls
: 'fa fa-power-off',
105 var shellBtn
= Ext
.create('PVE.button.ConsoleButton', {
106 disabled
: !caps
.nodes
['Sys.Console'],
107 text
: gettext('Shell'),
108 consoleType
: 'shell',
115 title
: gettext('Node') + " '" + nodename
+ "'",
118 statusStore
: me
.statusStore
,
120 tbar
: [restartBtn
, shutdownBtn
, shellBtn
, actionBtn
],
123 if (caps
.nodes
['Sys.Audit']) {
126 xtype
: 'pveNodeSummary',
127 title
: gettext('Summary'),
128 iconCls
: 'fa fa-book',
132 xtype
: 'pmxNotesView',
133 title
: gettext('Notes'),
134 iconCls
: 'fa fa-sticky-note-o',
140 if (caps
.nodes
['Sys.Console']) {
143 xtype
: 'pveNoVncConsole',
144 title
: gettext('Shell'),
145 iconCls
: 'fa fa-terminal',
147 consoleType
: 'shell',
154 if (caps
.nodes
['Sys.Audit']) {
157 xtype
: 'proxmoxNodeServiceView',
158 title
: gettext('System'),
159 iconCls
: 'fa fa-cogs',
161 expandedOnInit
: true,
162 restartCommand
: 'reload', // avoid disruptions
169 onlineHelp
: 'pve_service_daemons',
172 xtype
: 'proxmoxNodeNetworkView',
173 title
: gettext('Network'),
174 iconCls
: 'fa fa-exchange',
177 groups
: ['services'],
179 onlineHelp
: 'sysadmin_network_configuration',
182 xtype
: 'pveCertificatesView',
183 title
: gettext('Certificates'),
184 iconCls
: 'fa fa-certificate',
185 itemId
: 'certificates',
186 groups
: ['services'],
190 xtype
: 'proxmoxNodeDNSView',
191 title
: gettext('DNS'),
192 iconCls
: 'fa fa-globe',
193 groups
: ['services'],
196 onlineHelp
: 'sysadmin_network_configuration',
199 xtype
: 'proxmoxNodeHostsView',
200 title
: gettext('Hosts'),
201 iconCls
: 'fa fa-globe',
202 groups
: ['services'],
205 onlineHelp
: 'sysadmin_network_configuration',
208 xtype
: 'proxmoxNodeOptionsView',
209 title
: gettext('Options'),
210 iconCls
: 'fa fa-gear',
211 groups
: ['services'],
214 onlineHelp
: 'proxmox_node_management',
217 xtype
: 'proxmoxNodeTimeView',
218 title
: gettext('Time'),
220 groups
: ['services'],
222 iconCls
: 'fa fa-clock-o',
226 if (caps
.nodes
['Sys.Syslog']) {
228 xtype
: 'proxmoxJournalView',
230 iconCls
: 'fa fa-list',
231 groups
: ['services'],
232 disabled
: !caps
.nodes
['Sys.Syslog'],
234 url
: "/api2/extjs/nodes/" + nodename
+ "/journal",
237 if (caps
.nodes
['Sys.Modify']) {
239 xtype
: 'proxmoxNodeAPT',
240 title
: gettext('Updates'),
241 iconCls
: 'fa fa-refresh',
242 expandedOnInit
: true,
243 disabled
: !caps
.nodes
['Sys.Console'],
244 // do we want to link to system updates instead?
247 xtype
: 'pveConsoleButton',
248 disabled
: Proxmox
.UserName
!== 'root@pam',
249 text
: gettext('Upgrade'),
250 consoleType
: 'upgrade',
257 xtype
: 'proxmoxNodeAPTRepositories',
258 title
: gettext('Repositories'),
259 iconCls
: 'fa fa-files-o',
260 itemId
: 'aptrepositories',
262 onlineHelp
: 'sysadmin_package_repositories',
268 if (caps
.nodes
['Sys.Audit']) {
271 xtype
: 'pveFirewallRules',
272 iconCls
: 'fa fa-shield',
273 title
: gettext('Firewall'),
275 base_url
: '/nodes/' + nodename
+ '/firewall/rules',
276 list_refs_url
: '/cluster/firewall/refs',
280 xtype
: 'pveFirewallOptions',
281 title
: gettext('Options'),
282 iconCls
: 'fa fa-gear',
283 onlineHelp
: 'pve_firewall_host_specific_configuration',
284 groups
: ['firewall'],
285 base_url
: '/nodes/' + nodename
+ '/firewall/options',
287 itemId
: 'firewall-options',
292 if (caps
.nodes
['Sys.Audit']) {
295 xtype
: 'pmxDiskList',
296 title
: gettext('Disks'),
298 expandedOnInit
: true,
299 iconCls
: 'fa fa-hdd-o',
301 includePartitions
: true,
302 supportsWipeDisk
: true,
308 onlineHelp
: 'chapter_lvm',
309 iconCls
: 'fa fa-square',
313 xtype
: 'pveLVMThinList',
316 onlineHelp
: 'chapter_lvm',
317 iconCls
: 'fa fa-square-o',
321 xtype
: 'pveDirectoryList',
322 title
: Proxmox
.Utils
.directoryText
,
324 onlineHelp
: 'chapter_storage',
325 iconCls
: 'fa fa-folder',
331 onlineHelp
: 'chapter_zfs',
332 iconCls
: 'fa fa-th-large',
337 xtype
: 'pveNodeCephStatus',
340 iconCls
: 'fa fa-ceph',
343 xtype
: 'pveNodeCephConfigCrush',
344 title
: gettext('Configuration'),
345 iconCls
: 'fa fa-gear',
347 itemId
: 'ceph-config',
350 xtype
: 'pveNodeCephMonMgr',
351 title
: gettext('Monitor'),
354 itemId
: 'ceph-monlist',
357 xtype
: 'pveNodeCephOsdTree',
359 iconCls
: 'fa fa-hdd-o',
361 itemId
: 'ceph-osdtree',
364 xtype
: 'pveNodeCephFSPanel',
366 iconCls
: 'fa fa-folder',
369 itemId
: 'ceph-cephfspanel',
372 xtype
: 'pveNodeCephPoolList',
374 iconCls
: 'fa fa-sitemap',
376 itemId
: 'ceph-pools',
379 xtype
: 'pveReplicaView',
380 iconCls
: 'fa fa-retweet',
381 title
: gettext('Replication'),
382 itemId
: 'replication',
387 if (caps
.nodes
['Sys.Syslog']) {
390 xtype
: 'proxmoxLogView',
391 title
: gettext('Log'),
392 iconCls
: 'fa fa-list',
393 groups
: ['firewall'],
394 onlineHelp
: 'chapter_pve_firewall',
395 url
: '/api2/extjs/nodes/' + nodename
+ '/firewall/log',
396 itemId
: 'firewall-fwlog',
399 xtype
: 'cephLogView',
400 title
: gettext('Log'),
402 iconCls
: 'fa fa-list',
404 onlineHelp
: 'chapter_pveceph',
405 url
: "/api2/extjs/nodes/" + nodename
+ "/ceph/log",
412 title
: gettext('Task History'),
413 iconCls
: 'fa fa-list-alt',
416 xtype
: 'proxmoxNodeTasks',
419 xtype
: 'pveGuestIDSelector',
420 fieldLabel
: gettext('VMID'),
427 title
: gettext('Subscription'),
428 iconCls
: 'fa fa-support',
430 xtype
: 'pveNodeSubscription',
437 me
.mon(me
.statusStore
, 'load', function(store
, records
, success
) {
438 let uptimerec
= store
.data
.get('uptime');
439 let powermgmt
= caps
.nodes
['Sys.PowerMgmt'] && uptimerec
&& uptimerec
.data
.value
;
441 restartBtn
.setDisabled(!powermgmt
);
442 shutdownBtn
.setDisabled(!powermgmt
);
443 shellBtn
.setDisabled(!powermgmt
);
446 me
.on('afterrender', function() {
447 me
.statusStore
.startUpdate();
450 me
.on('destroy', function() {
451 me
.statusStore
.stopUpdate();