]>
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('Restart'),
85 disabled
: !caps
.nodes
['Sys.PowerMgmt'],
87 confirmMsg
: gettext('Node') + " '" + nodename
+ "' - " + gettext('Restart'),
89 node_command('reboot');
94 var shutdownBtn
= Ext
.create('Proxmox.button.Button', {
95 text
: gettext('Shutdown'),
96 disabled
: !caps
.nodes
['Sys.PowerMgmt'],
98 confirmMsg
: gettext('Node') + " '" + nodename
+ "' - " + gettext('Shutdown'),
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'
132 if (caps
.nodes
['Sys.Console']) {
135 title
: gettext('Shell'),
136 iconCls
: 'fa fa-terminal',
138 xtype
: 'pveNoVncConsole',
139 consoleType
: 'shell',
143 title
: gettext('Shell (JS)'),
144 iconCls
: 'fa fa-terminal',
146 xtype
: 'pveNoVncConsole',
147 consoleType
: 'shell',
154 if (caps
.nodes
['Sys.Audit']) {
157 title
: gettext('System'),
158 iconCls
: 'fa fa-cogs',
160 expandedOnInit
: true,
167 onlineHelp
: 'pve_service_daemons',
168 xtype
: 'proxmoxNodeServiceView'
171 title
: gettext('Network'),
172 iconCls
: 'fa fa-exchange',
174 groups
: ['services'],
176 onlineHelp
: 'sysadmin_network_configuration',
177 xtype
: 'proxmoxNodeNetworkView'
180 title
: gettext('DNS'),
181 iconCls
: 'fa fa-globe',
182 groups
: ['services'],
185 onlineHelp
: 'sysadmin_network_configuration',
186 xtype
: 'proxmoxNodeDNSView'
189 title
: gettext('Time'),
191 groups
: ['services'],
193 xtype
: 'proxmoxNodeTimeView',
194 iconCls
: 'fa fa-clock-o'
198 if (caps
.nodes
['Sys.Syslog']) {
201 iconCls
: 'fa fa-list',
202 groups
: ['services'],
203 disabled
: !caps
.nodes
['Sys.Syslog'],
206 url
: "/api2/extjs/nodes/" + nodename
+ "/syslog",
207 log_select_timespan
: 1
210 if (caps
.nodes
['Sys.Modify']) {
212 title
: gettext('Updates'),
213 iconCls
: 'fa fa-refresh',
214 disabled
: !caps
.nodes
['Sys.Console'],
215 // do we want to link to system updates instead?
217 xtype
: 'proxmoxNodeAPT',
219 xtype
: 'pveConsoleButton',
220 disabled
: PVE
.UserName
!== 'root@pam',
221 text
: gettext('Upgrade'),
222 consoleType
: 'upgrade',
230 if (caps
.nodes
['Sys.Audit']) {
233 xtype
: 'pveFirewallRules',
234 iconCls
: 'fa fa-shield',
235 title
: gettext('Firewall'),
237 base_url
: '/nodes/' + nodename
+ '/firewall/rules',
238 list_refs_url
: '/cluster/firewall/refs',
242 xtype
: 'pveFirewallOptions',
243 title
: gettext('Options'),
244 iconCls
: 'fa fa-gear',
245 onlineHelp
: 'pve_firewall_host_specific_configuration',
246 groups
: ['firewall'],
247 base_url
: '/nodes/' + nodename
+ '/firewall/options',
249 itemId
: 'firewall-options'
254 if (caps
.nodes
['Sys.Audit']) {
257 title
: gettext('Disks'),
259 expandedOnInit
: true,
260 iconCls
: 'fa fa-hdd-o',
261 xtype
: 'pveNodeDiskList'
266 iconCls
: 'fa fa-ceph',
267 xtype
: 'pveNodeCephStatus'
270 xtype
: 'pveReplicaView',
271 iconCls
: 'fa fa-retweet',
272 title
: gettext('Replication'),
273 itemId
: 'replication'
276 xtype
: 'pveNodeCephConfigCrush',
277 title
: gettext('Configuration'),
278 iconCls
: 'fa fa-gear',
280 itemId
: 'ceph-config'
283 xtype
: 'pveNodeCephMonList',
284 title
: gettext('Monitor'),
287 itemId
: 'ceph-monlist'
290 xtype
: 'pveNodeCephOsdTree',
292 iconCls
: 'fa fa-hdd-o',
294 itemId
: 'ceph-osdtree'
297 xtype
: 'pveNodeCephPoolList',
299 iconCls
: 'fa fa-sitemap',
306 if (caps
.nodes
['Sys.Syslog']) {
310 title
: gettext('Log'),
311 iconCls
: 'fa fa-list',
312 groups
: ['firewall'],
313 onlineHelp
: 'chapter_pve_firewall',
314 url
: '/api2/extjs/nodes/' + nodename
+ '/firewall/log',
315 itemId
: 'firewall-fwlog'
318 title
: gettext('Log'),
320 iconCls
: 'fa fa-list',
322 onlineHelp
: 'chapter_pveceph',
324 url
: "/api2/extjs/nodes/" + nodename
+ "/ceph/log"
330 title
: gettext('Task History'),
331 iconCls
: 'fa fa-list',
334 xtype
: 'proxmoxNodeTasks'
337 title
: gettext('Subscription'),
338 iconCls
: 'fa fa-support',
340 xtype
: 'pveNodeSubscription',
347 me
.mon(me
.statusStore
, 'load', function(s
, records
, success
) {
348 var uptimerec
= s
.data
.get('uptime');
349 var powermgmt
= uptimerec
? uptimerec
.data
.value
: false;
350 if (!caps
.nodes
['Sys.PowerMgmt']) {
353 restartBtn
.setDisabled(!powermgmt
);
354 shutdownBtn
.setDisabled(!powermgmt
);
355 shellBtn
.setDisabled(!powermgmt
);
358 me
.on('afterrender', function() {
359 me
.statusStore
.startUpdate();
362 me
.on('destroy', function() {
363 me
.statusStore
.stopUpdate();