]>
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
: 'pveNotesView',
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
: 'proxmoxNodeTimeView',
209 title
: gettext('Time'),
211 groups
: ['services'],
213 iconCls
: 'fa fa-clock-o',
217 if (caps
.nodes
['Sys.Syslog']) {
219 xtype
: 'proxmoxJournalView',
221 iconCls
: 'fa fa-list',
222 groups
: ['services'],
223 disabled
: !caps
.nodes
['Sys.Syslog'],
225 url
: "/api2/extjs/nodes/" + nodename
+ "/journal",
228 if (caps
.nodes
['Sys.Modify']) {
230 xtype
: 'proxmoxNodeAPT',
231 title
: gettext('Updates'),
232 iconCls
: 'fa fa-refresh',
233 disabled
: !caps
.nodes
['Sys.Console'],
234 // do we want to link to system updates instead?
237 xtype
: 'pveConsoleButton',
238 disabled
: Proxmox
.UserName
!== 'root@pam',
239 text
: gettext('Upgrade'),
240 consoleType
: 'upgrade',
248 if (caps
.nodes
['Sys.Audit']) {
251 xtype
: 'pveFirewallRules',
252 iconCls
: 'fa fa-shield',
253 title
: gettext('Firewall'),
255 base_url
: '/nodes/' + nodename
+ '/firewall/rules',
256 list_refs_url
: '/cluster/firewall/refs',
260 xtype
: 'pveFirewallOptions',
261 title
: gettext('Options'),
262 iconCls
: 'fa fa-gear',
263 onlineHelp
: 'pve_firewall_host_specific_configuration',
264 groups
: ['firewall'],
265 base_url
: '/nodes/' + nodename
+ '/firewall/options',
267 itemId
: 'firewall-options',
272 if (caps
.nodes
['Sys.Audit']) {
275 xtype
: 'pmxDiskList',
276 title
: gettext('Disks'),
278 expandedOnInit
: true,
279 iconCls
: 'fa fa-hdd-o',
286 onlineHelp
: 'chapter_lvm',
287 iconCls
: 'fa fa-square',
291 xtype
: 'pveLVMThinList',
294 onlineHelp
: 'chapter_lvm',
295 iconCls
: 'fa fa-square-o',
299 xtype
: 'pveDirectoryList',
300 title
: Proxmox
.Utils
.directoryText
,
302 onlineHelp
: 'chapter_storage',
303 iconCls
: 'fa fa-folder',
309 onlineHelp
: 'chapter_zfs',
310 iconCls
: 'fa fa-th-large',
315 xtype
: 'pveNodeCephStatus',
318 iconCls
: 'fa fa-ceph',
321 xtype
: 'pveReplicaView',
322 iconCls
: 'fa fa-retweet',
323 title
: gettext('Replication'),
324 itemId
: 'replication',
327 xtype
: 'pveNodeCephConfigCrush',
328 title
: gettext('Configuration'),
329 iconCls
: 'fa fa-gear',
331 itemId
: 'ceph-config',
334 xtype
: 'pveNodeCephMonMgr',
335 title
: gettext('Monitor'),
338 itemId
: 'ceph-monlist',
341 xtype
: 'pveNodeCephOsdTree',
343 iconCls
: 'fa fa-hdd-o',
345 itemId
: 'ceph-osdtree',
348 xtype
: 'pveNodeCephFSPanel',
350 iconCls
: 'fa fa-folder',
353 itemId
: 'ceph-cephfspanel',
356 xtype
: 'pveNodeCephPoolList',
358 iconCls
: 'fa fa-sitemap',
360 itemId
: 'ceph-pools',
365 if (caps
.nodes
['Sys.Syslog']) {
368 xtype
: 'proxmoxLogView',
369 title
: gettext('Log'),
370 iconCls
: 'fa fa-list',
371 groups
: ['firewall'],
372 onlineHelp
: 'chapter_pve_firewall',
373 url
: '/api2/extjs/nodes/' + nodename
+ '/firewall/log',
374 itemId
: 'firewall-fwlog',
377 xtype
: 'cephLogView',
378 title
: gettext('Log'),
380 iconCls
: 'fa fa-list',
382 onlineHelp
: 'chapter_pveceph',
383 url
: "/api2/extjs/nodes/" + nodename
+ "/ceph/log",
390 title
: gettext('Task History'),
391 iconCls
: 'fa fa-list',
394 xtype
: 'proxmoxNodeTasks',
397 title
: gettext('Subscription'),
398 iconCls
: 'fa fa-support',
400 xtype
: 'pveNodeSubscription',
407 me
.mon(me
.statusStore
, 'load', function(store
, records
, success
) {
408 let uptimerec
= store
.data
.get('uptime');
409 let powermgmt
= caps
.nodes
['Sys.PowerMgmt'] && uptimerec
&& uptimerec
.data
.value
;
411 restartBtn
.setDisabled(!powermgmt
);
412 shutdownBtn
.setDisabled(!powermgmt
);
413 shellBtn
.setDisabled(!powermgmt
);
416 me
.on('afterrender', function() {
417 me
.statusStore
.startUpdate();
420 me
.on('destroy', function() {
421 me
.statusStore
.stopUpdate();