]>
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 var 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');
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
+ "'",
117 defaults
: { statusStore
: me
.statusStore
},
118 tbar
: [ restartBtn
, shutdownBtn
, shellBtn
, actionBtn
]
121 if (caps
.nodes
['Sys.Audit']) {
124 title
: gettext('Summary'),
125 iconCls
: 'fa fa-book',
127 xtype
: 'pveNodeSummary'
130 title
: gettext('Notes'),
131 iconCls
: 'fa fa-sticky-note-o',
133 xtype
: 'pveNotesView'
138 if (caps
.nodes
['Sys.Console']) {
141 title
: gettext('Shell'),
142 iconCls
: 'fa fa-terminal',
144 xtype
: 'pveNoVncConsole',
145 consoleType
: 'shell',
152 if (caps
.nodes
['Sys.Audit']) {
155 title
: gettext('System'),
156 iconCls
: 'fa fa-cogs',
158 expandedOnInit
: true,
165 onlineHelp
: 'pve_service_daemons',
166 xtype
: 'proxmoxNodeServiceView'
169 title
: gettext('Network'),
170 iconCls
: 'fa fa-exchange',
172 groups
: ['services'],
174 onlineHelp
: 'sysadmin_network_configuration',
175 xtype
: 'proxmoxNodeNetworkView'
178 title
: gettext('Certificates'),
179 iconCls
: 'fa fa-certificate',
180 itemId
: 'certificates',
181 groups
: ['services'],
183 xtype
: 'pveCertificatesView'
186 title
: gettext('DNS'),
187 iconCls
: 'fa fa-globe',
188 groups
: ['services'],
191 onlineHelp
: 'sysadmin_network_configuration',
192 xtype
: 'proxmoxNodeDNSView'
195 title
: gettext('Hosts'),
196 iconCls
: 'fa fa-globe',
197 groups
: ['services'],
200 onlineHelp
: 'sysadmin_network_configuration',
201 xtype
: 'proxmoxNodeHostsView'
204 title
: gettext('Time'),
206 groups
: ['services'],
208 xtype
: 'proxmoxNodeTimeView',
209 iconCls
: 'fa fa-clock-o'
213 if (caps
.nodes
['Sys.Syslog']) {
216 iconCls
: 'fa fa-list',
217 groups
: ['services'],
218 disabled
: !caps
.nodes
['Sys.Syslog'],
220 xtype
: 'proxmoxLogView',
221 url
: "/api2/extjs/nodes/" + nodename
+ "/syslog",
222 log_select_timespan
: 1
225 if (caps
.nodes
['Sys.Modify']) {
227 title
: gettext('Updates'),
228 iconCls
: 'fa fa-refresh',
229 disabled
: !caps
.nodes
['Sys.Console'],
230 // do we want to link to system updates instead?
232 xtype
: 'proxmoxNodeAPT',
234 xtype
: 'pveConsoleButton',
235 disabled
: Proxmox
.UserName
!== 'root@pam',
236 text
: gettext('Upgrade'),
237 consoleType
: 'upgrade',
245 if (caps
.nodes
['Sys.Audit']) {
248 xtype
: 'pveFirewallRules',
249 iconCls
: 'fa fa-shield',
250 title
: gettext('Firewall'),
252 base_url
: '/nodes/' + nodename
+ '/firewall/rules',
253 list_refs_url
: '/cluster/firewall/refs',
257 xtype
: 'pveFirewallOptions',
258 title
: gettext('Options'),
259 iconCls
: 'fa fa-gear',
260 onlineHelp
: 'pve_firewall_host_specific_configuration',
261 groups
: ['firewall'],
262 base_url
: '/nodes/' + nodename
+ '/firewall/options',
264 itemId
: 'firewall-options'
269 if (caps
.nodes
['Sys.Audit']) {
272 title
: gettext('Disks'),
274 expandedOnInit
: true,
275 iconCls
: 'fa fa-hdd-o',
276 xtype
: 'pveNodeDiskList'
281 onlineHelp
: 'chapter_lvm',
282 iconCls
: 'fa fa-square',
289 onlineHelp
: 'chapter_lvm',
290 iconCls
: 'fa fa-square-o',
292 xtype
: 'pveLVMThinList'
295 title
: Proxmox
.Utils
.directoryText
,
297 onlineHelp
: 'chapter_storage',
298 iconCls
: 'fa fa-folder',
300 xtype
: 'pveDirectoryList'
305 onlineHelp
: 'chapter_zfs',
306 iconCls
: 'fa fa-th-large',
313 iconCls
: 'fa fa-ceph',
314 xtype
: 'pveNodeCephStatus'
317 xtype
: 'pveReplicaView',
318 iconCls
: 'fa fa-retweet',
319 title
: gettext('Replication'),
320 itemId
: 'replication'
323 xtype
: 'pveNodeCephConfigCrush',
324 title
: gettext('Configuration'),
325 iconCls
: 'fa fa-gear',
327 itemId
: 'ceph-config'
330 xtype
: 'pveNodeCephMonList',
331 title
: gettext('Monitor'),
334 itemId
: 'ceph-monlist'
337 xtype
: 'pveNodeCephOsdTree',
339 iconCls
: 'fa fa-hdd-o',
341 itemId
: 'ceph-osdtree'
344 xtype
: 'pveNodeCephFSPanel',
346 iconCls
: 'fa fa-folder',
349 itemId
: 'ceph-cephfspanel'
352 xtype
: 'pveNodeCephPoolList',
354 iconCls
: 'fa fa-sitemap',
361 if (caps
.nodes
['Sys.Syslog']) {
364 xtype
: 'proxmoxLogView',
365 title
: gettext('Log'),
366 iconCls
: 'fa fa-list',
367 groups
: ['firewall'],
368 onlineHelp
: 'chapter_pve_firewall',
369 url
: '/api2/extjs/nodes/' + nodename
+ '/firewall/log',
370 itemId
: 'firewall-fwlog'
373 title
: gettext('Log'),
375 iconCls
: 'fa fa-list',
377 onlineHelp
: 'chapter_pveceph',
378 xtype
: 'cephLogView',
379 url
: "/api2/extjs/nodes/" + nodename
+ "/ceph/log",
386 title
: gettext('Task History'),
387 iconCls
: 'fa fa-list',
390 xtype
: 'proxmoxNodeTasks'
393 title
: gettext('Subscription'),
394 iconCls
: 'fa fa-support',
396 xtype
: 'pveNodeSubscription',
403 me
.mon(me
.statusStore
, 'load', function(s
, records
, success
) {
404 var uptimerec
= s
.data
.get('uptime');
405 var powermgmt
= uptimerec
? uptimerec
.data
.value
: false;
406 if (!caps
.nodes
['Sys.PowerMgmt']) {
409 restartBtn
.setDisabled(!powermgmt
);
410 shutdownBtn
.setDisabled(!powermgmt
);
411 shellBtn
.setDisabled(!powermgmt
);
414 me
.on('afterrender', function() {
415 me
.statusStore
.startUpdate();
418 me
.on('destroy', function() {
419 me
.statusStore
.stopUpdate();