]>
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
: 'proxmoxJournalView',
221 url
: "/api2/extjs/nodes/" + nodename
+ "/journal"
224 if (caps
.nodes
['Sys.Modify']) {
226 title
: gettext('Updates'),
227 iconCls
: 'fa fa-refresh',
228 disabled
: !caps
.nodes
['Sys.Console'],
229 // do we want to link to system updates instead?
231 xtype
: 'proxmoxNodeAPT',
233 xtype
: 'pveConsoleButton',
234 disabled
: Proxmox
.UserName
!== 'root@pam',
235 text
: gettext('Upgrade'),
236 consoleType
: 'upgrade',
244 if (caps
.nodes
['Sys.Audit']) {
247 xtype
: 'pveFirewallRules',
248 iconCls
: 'fa fa-shield',
249 title
: gettext('Firewall'),
251 base_url
: '/nodes/' + nodename
+ '/firewall/rules',
252 list_refs_url
: '/cluster/firewall/refs',
256 xtype
: 'pveFirewallOptions',
257 title
: gettext('Options'),
258 iconCls
: 'fa fa-gear',
259 onlineHelp
: 'pve_firewall_host_specific_configuration',
260 groups
: ['firewall'],
261 base_url
: '/nodes/' + nodename
+ '/firewall/options',
263 itemId
: 'firewall-options'
268 if (caps
.nodes
['Sys.Audit']) {
271 title
: gettext('Disks'),
273 expandedOnInit
: true,
274 iconCls
: 'fa fa-hdd-o',
275 xtype
: 'pveNodeDiskList'
280 onlineHelp
: 'chapter_lvm',
281 iconCls
: 'fa fa-square',
288 onlineHelp
: 'chapter_lvm',
289 iconCls
: 'fa fa-square-o',
291 xtype
: 'pveLVMThinList'
294 title
: Proxmox
.Utils
.directoryText
,
296 onlineHelp
: 'chapter_storage',
297 iconCls
: 'fa fa-folder',
299 xtype
: 'pveDirectoryList'
304 onlineHelp
: 'chapter_zfs',
305 iconCls
: 'fa fa-th-large',
312 iconCls
: 'fa fa-ceph',
313 xtype
: 'pveNodeCephStatus'
316 xtype
: 'pveReplicaView',
317 iconCls
: 'fa fa-retweet',
318 title
: gettext('Replication'),
319 itemId
: 'replication'
322 xtype
: 'pveNodeCephConfigCrush',
323 title
: gettext('Configuration'),
324 iconCls
: 'fa fa-gear',
326 itemId
: 'ceph-config'
329 xtype
: 'pveNodeCephMonMgr',
330 title
: gettext('Monitor'),
333 itemId
: 'ceph-monlist'
336 xtype
: 'pveNodeCephOsdTree',
338 iconCls
: 'fa fa-hdd-o',
340 itemId
: 'ceph-osdtree'
343 xtype
: 'pveNodeCephFSPanel',
345 iconCls
: 'fa fa-folder',
348 itemId
: 'ceph-cephfspanel'
351 xtype
: 'pveNodeCephPoolList',
353 iconCls
: 'fa fa-sitemap',
360 if (caps
.nodes
['Sys.Syslog']) {
363 xtype
: 'proxmoxLogView',
364 title
: gettext('Log'),
365 iconCls
: 'fa fa-list',
366 groups
: ['firewall'],
367 onlineHelp
: 'chapter_pve_firewall',
368 url
: '/api2/extjs/nodes/' + nodename
+ '/firewall/log',
369 itemId
: 'firewall-fwlog'
372 title
: gettext('Log'),
374 iconCls
: 'fa fa-list',
376 onlineHelp
: 'chapter_pveceph',
377 xtype
: 'cephLogView',
378 url
: "/api2/extjs/nodes/" + nodename
+ "/ceph/log",
385 title
: gettext('Task History'),
386 iconCls
: 'fa fa-list',
389 xtype
: 'proxmoxNodeTasks'
392 title
: gettext('Subscription'),
393 iconCls
: 'fa fa-support',
395 xtype
: 'pveNodeSubscription',
402 me
.mon(me
.statusStore
, 'load', function(s
, records
, success
) {
403 var uptimerec
= s
.data
.get('uptime');
404 var powermgmt
= uptimerec
? uptimerec
.data
.value
: false;
405 if (!caps
.nodes
['Sys.PowerMgmt']) {
408 restartBtn
.setDisabled(!powermgmt
);
409 shutdownBtn
.setDisabled(!powermgmt
);
410 shellBtn
.setDisabled(!powermgmt
);
413 me
.on('afterrender', function() {
414 me
.statusStore
.startUpdate();
417 me
.on('destroy', function() {
418 me
.statusStore
.stopUpdate();