]>
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'
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('Time'),
197 groups
: ['services'],
199 xtype
: 'proxmoxNodeTimeView',
200 iconCls
: 'fa fa-clock-o'
204 if (caps
.nodes
['Sys.Syslog']) {
207 iconCls
: 'fa fa-list',
208 groups
: ['services'],
209 disabled
: !caps
.nodes
['Sys.Syslog'],
211 xtype
: 'proxmoxLogView',
212 url
: "/api2/extjs/nodes/" + nodename
+ "/syslog",
213 log_select_timespan
: 1
216 if (caps
.nodes
['Sys.Modify']) {
218 title
: gettext('Updates'),
219 iconCls
: 'fa fa-refresh',
220 disabled
: !caps
.nodes
['Sys.Console'],
221 // do we want to link to system updates instead?
223 xtype
: 'proxmoxNodeAPT',
225 xtype
: 'pveConsoleButton',
226 disabled
: Proxmox
.UserName
!== 'root@pam',
227 text
: gettext('Upgrade'),
228 consoleType
: 'upgrade',
236 if (caps
.nodes
['Sys.Audit']) {
239 xtype
: 'pveFirewallRules',
240 iconCls
: 'fa fa-shield',
241 title
: gettext('Firewall'),
243 base_url
: '/nodes/' + nodename
+ '/firewall/rules',
244 list_refs_url
: '/cluster/firewall/refs',
248 xtype
: 'pveFirewallOptions',
249 title
: gettext('Options'),
250 iconCls
: 'fa fa-gear',
251 onlineHelp
: 'pve_firewall_host_specific_configuration',
252 groups
: ['firewall'],
253 base_url
: '/nodes/' + nodename
+ '/firewall/options',
255 itemId
: 'firewall-options'
260 if (caps
.nodes
['Sys.Audit']) {
263 title
: gettext('Disks'),
265 expandedOnInit
: true,
266 iconCls
: 'fa fa-hdd-o',
267 xtype
: 'pveNodeDiskList'
272 iconCls
: 'fa fa-square',
279 iconCls
: 'fa fa-ceph',
280 xtype
: 'pveNodeCephStatus'
283 xtype
: 'pveReplicaView',
284 iconCls
: 'fa fa-retweet',
285 title
: gettext('Replication'),
286 itemId
: 'replication'
289 xtype
: 'pveNodeCephConfigCrush',
290 title
: gettext('Configuration'),
291 iconCls
: 'fa fa-gear',
293 itemId
: 'ceph-config'
296 xtype
: 'pveNodeCephMonList',
297 title
: gettext('Monitor'),
300 itemId
: 'ceph-monlist'
303 xtype
: 'pveNodeCephOsdTree',
305 iconCls
: 'fa fa-hdd-o',
307 itemId
: 'ceph-osdtree'
310 xtype
: 'pveNodeCephPoolList',
312 iconCls
: 'fa fa-sitemap',
319 if (caps
.nodes
['Sys.Syslog']) {
322 xtype
: 'proxmoxLogView',
323 title
: gettext('Log'),
324 iconCls
: 'fa fa-list',
325 groups
: ['firewall'],
326 onlineHelp
: 'chapter_pve_firewall',
327 url
: '/api2/extjs/nodes/' + nodename
+ '/firewall/log',
328 itemId
: 'firewall-fwlog'
331 title
: gettext('Log'),
333 iconCls
: 'fa fa-list',
335 onlineHelp
: 'chapter_pveceph',
336 xtype
: 'proxmoxLogView',
337 url
: "/api2/extjs/nodes/" + nodename
+ "/ceph/log"
343 title
: gettext('Task History'),
344 iconCls
: 'fa fa-list',
347 xtype
: 'proxmoxNodeTasks'
350 title
: gettext('Subscription'),
351 iconCls
: 'fa fa-support',
353 xtype
: 'pveNodeSubscription',
360 me
.mon(me
.statusStore
, 'load', function(s
, records
, success
) {
361 var uptimerec
= s
.data
.get('uptime');
362 var powermgmt
= uptimerec
? uptimerec
.data
.value
: false;
363 if (!caps
.nodes
['Sys.PowerMgmt']) {
366 restartBtn
.setDisabled(!powermgmt
);
367 shutdownBtn
.setDisabled(!powermgmt
);
368 shellBtn
.setDisabled(!powermgmt
);
371 me
.on('afterrender', function() {
372 me
.statusStore
.startUpdate();
375 me
.on('destroy', function() {
376 me
.statusStore
.stopUpdate();