]>
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('PVE.data.ObjectStore', {
18 url
: "/api2/json/nodes/" + nodename
+ "/status",
22 var node_command = function(cmd
) {
23 PVE
.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('PVE.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('PVE.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'],
184 xtype
: 'pveNodeDNSView'
187 title
: gettext('Time'),
189 groups
: ['services'],
191 xtype
: 'proxmoxNodeTimeView',
192 iconCls
: 'fa fa-clock-o'
196 if (caps
.nodes
['Sys.Syslog']) {
199 iconCls
: 'fa fa-list',
200 groups
: ['services'],
201 disabled
: !caps
.nodes
['Sys.Syslog'],
204 url
: "/api2/extjs/nodes/" + nodename
+ "/syslog",
205 log_select_timespan
: 1
208 if (caps
.nodes
['Sys.Modify']) {
210 title
: gettext('Updates'),
211 iconCls
: 'fa fa-refresh',
212 disabled
: !caps
.nodes
['Sys.Console'],
213 // do we want to link to system updates instead?
215 xtype
: 'proxmoxNodeAPT',
217 xtype
: 'pveConsoleButton',
218 disabled
: PVE
.UserName
!== 'root@pam',
219 text
: gettext('Upgrade'),
220 consoleType
: 'upgrade',
228 if (caps
.nodes
['Sys.Audit']) {
231 xtype
: 'pveFirewallRules',
232 iconCls
: 'fa fa-shield',
233 title
: gettext('Firewall'),
235 base_url
: '/nodes/' + nodename
+ '/firewall/rules',
236 list_refs_url
: '/cluster/firewall/refs',
240 xtype
: 'pveFirewallOptions',
241 title
: gettext('Options'),
242 iconCls
: 'fa fa-gear',
243 onlineHelp
: 'pve_firewall_host_specific_configuration',
244 groups
: ['firewall'],
245 base_url
: '/nodes/' + nodename
+ '/firewall/options',
247 itemId
: 'firewall-options'
252 if (caps
.nodes
['Sys.Audit']) {
255 title
: gettext('Disks'),
257 expandedOnInit
: true,
258 iconCls
: 'fa fa-hdd-o',
259 xtype
: 'pveNodeDiskList'
264 iconCls
: 'fa fa-ceph',
265 xtype
: 'pveNodeCephStatus'
268 xtype
: 'pveReplicaView',
269 iconCls
: 'fa fa-retweet',
270 title
: gettext('Replication'),
271 itemId
: 'replication'
274 xtype
: 'pveNodeCephConfigCrush',
275 title
: gettext('Configuration'),
276 iconCls
: 'fa fa-gear',
278 itemId
: 'ceph-config'
281 xtype
: 'pveNodeCephMonList',
282 title
: gettext('Monitor'),
285 itemId
: 'ceph-monlist'
288 xtype
: 'pveNodeCephOsdTree',
290 iconCls
: 'fa fa-hdd-o',
292 itemId
: 'ceph-osdtree'
295 xtype
: 'pveNodeCephPoolList',
297 iconCls
: 'fa fa-sitemap',
304 if (caps
.nodes
['Sys.Syslog']) {
308 title
: gettext('Log'),
309 iconCls
: 'fa fa-list',
310 groups
: ['firewall'],
311 onlineHelp
: 'chapter_pve_firewall',
312 url
: '/api2/extjs/nodes/' + nodename
+ '/firewall/log',
313 itemId
: 'firewall-fwlog'
316 title
: gettext('Log'),
318 iconCls
: 'fa fa-list',
320 onlineHelp
: 'chapter_pveceph',
322 url
: "/api2/extjs/nodes/" + nodename
+ "/ceph/log"
328 title
: gettext('Task History'),
329 iconCls
: 'fa fa-list',
332 xtype
: 'proxmoxNodeTasks'
335 title
: gettext('Subscription'),
336 iconCls
: 'fa fa-support',
338 xtype
: 'pveNodeSubscription',
345 me
.mon(me
.statusStore
, 'load', function(s
, records
, success
) {
346 var uptimerec
= s
.data
.get('uptime');
347 var powermgmt
= uptimerec
? uptimerec
.data
.value
: false;
348 if (!caps
.nodes
['Sys.PowerMgmt']) {
351 restartBtn
.setDisabled(!powermgmt
);
352 shutdownBtn
.setDisabled(!powermgmt
);
353 shellBtn
.setDisabled(!powermgmt
);
356 me
.on('afterrender', function() {
357 me
.statusStore
.startUpdate();
360 me
.on('destroy', function() {
361 me
.statusStore
.stopUpdate();