]>
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-sysadmin.html',
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('More'),
36 iconCls
: 'fa fa-fw fa-ellipsis-v',
37 disabled
: !caps
.nodes
['Sys.PowerMgmt'],
38 menu
: new Ext
.menu
.Menu({
41 text
: gettext('Start all VMs and Containers'),
42 iconCls
: 'fa fa-fw fa-play',
44 var msg
= gettext('Start all VMs and Containers') + ' (' + gettext('Node') + " '" + nodename
+ "')";
45 Ext
.Msg
.confirm(gettext('Confirm'), msg
, function(btn
) {
49 PVE
.Utils
.API2Request({
51 url
: '/nodes/' + nodename
+ '/startall',
54 failure: function(response
, opts
) {
55 Ext
.Msg
.alert('Error', response
.htmlStatus
);
62 text
: gettext('Stop all VMs and Containers'),
63 iconCls
: 'fa fa-fw fa-stop fa-red',
65 var msg
= gettext('Stop all VMs and Containers') + ' (' + gettext('Node') + " '" + nodename
+ "')";
66 Ext
.Msg
.confirm(gettext('Confirm'), msg
, function(btn
) {
71 PVE
.Utils
.API2Request({
72 url
: '/nodes/' + nodename
+ '/stopall',
75 failure: function(response
, opts
) {
76 Ext
.Msg
.alert('Error', response
.htmlStatus
);
83 text
: gettext('Migrate all VMs and Containers'),
84 iconCls
: 'fa fa-fw fa-send-o',
86 var win
= Ext
.create('PVE.window.MigrateAll', {
96 var restartBtn
= Ext
.create('PVE.button.Button', {
97 text
: gettext('Restart'),
98 disabled
: !caps
.nodes
['Sys.PowerMgmt'],
99 confirmMsg
: gettext('Node') + " '" + nodename
+ "' - " + gettext('Restart'),
100 handler: function() {
101 node_command('reboot');
103 iconCls
: 'fa fa-undo'
106 var shutdownBtn
= Ext
.create('PVE.button.Button', {
107 text
: gettext('Shutdown'),
108 disabled
: !caps
.nodes
['Sys.PowerMgmt'],
109 confirmMsg
: gettext('Node') + " '" + nodename
+ "' - " + gettext('Shutdown'),
110 handler: function() {
111 node_command('shutdown');
113 iconCls
: 'fa fa-power-off'
116 var shellBtn
= Ext
.create('PVE.button.ConsoleButton', {
117 disabled
: !caps
.nodes
['Sys.Console'],
118 text
: gettext('Shell'),
119 consoleType
: 'shell',
121 iconCls
: 'fa fa-terminal'
127 title
: gettext('Node') + " '" + nodename
+ "'",
129 defaults
: { statusStore
: me
.statusStore
},
130 tbar
: [ restartBtn
, shutdownBtn
, shellBtn
, actionBtn
]
133 if (caps
.nodes
['Sys.Audit']) {
136 title
: gettext('Summary'),
137 iconCls
: 'fa fa-book',
139 xtype
: 'pveNodeSummary'
144 if (caps
.nodes
['Sys.Console']) {
147 title
: gettext('Shell'),
148 iconCls
: 'fa fa-terminal',
150 xtype
: 'pveNoVncConsole',
151 consoleType
: 'shell',
157 if (caps
.nodes
['Sys.Audit']) {
160 title
: gettext('System'),
161 iconCls
: 'fa fa-cogs',
163 onlineHelp
: 'index.html#_service_daemons',
164 expandedOnInit
: true,
165 xtype
: 'pveNodeServiceView'
168 title
: gettext('Network'),
169 iconCls
: 'fa fa-exchange',
171 onlineHelp
: 'chapter-sysadmin.html#_network_configuration',
172 groups
: ['services'],
173 xtype
: 'pveNodeNetworkView'
176 title
: gettext('DNS'),
177 iconCls
: 'fa fa-globe',
178 groups
: ['services'],
180 onlineHelp
: 'chapter-sysadmin.html#_network_configuration',
181 xtype
: 'pveNodeDNSView'
184 title
: gettext('Time'),
186 groups
: ['services'],
187 xtype
: 'pveNodeTimeView',
188 iconCls
: 'fa fa-clock-o'
192 if (caps
.nodes
['Sys.Syslog']) {
195 iconCls
: 'fa fa-list',
196 groups
: ['services'],
197 disabled
: !caps
.nodes
['Sys.Syslog'],
200 url
: "/api2/extjs/nodes/" + nodename
+ "/syslog",
201 log_select_timespan
: 1
204 if (caps
.nodes
['Sys.Modify']) {
206 title
: gettext('Updates'),
207 iconCls
: 'fa fa-refresh',
208 disabled
: !caps
.nodes
['Sys.Console'],
209 // do we want to link to system updates instead?
210 onlineHelp
: 'chapter-sysadmin.html#_package_repositories',
218 if (caps
.nodes
['Sys.Audit']) {
221 xtype
: 'pveFirewallRules',
222 iconCls
: 'fa fa-shield',
223 onlineHelp
: 'chapter-pve-firewall.html',
224 title
: gettext('Firewall'),
226 base_url
: '/nodes/' + nodename
+ '/firewall/rules',
227 list_refs_url
: '/cluster/firewall/refs',
231 xtype
: 'pveFirewallOptions',
232 title
: gettext('Options'),
233 iconCls
: 'fa fa-gear',
234 onlineHelp
: 'chapter-pve-firewall.html#_host_specific_configuration',
235 groups
: ['firewall'],
236 base_url
: '/nodes/' + nodename
+ '/firewall/options',
238 itemId
: 'firewall-options'
243 if (caps
.nodes
['Sys.Audit']) {
246 title
: gettext('Disks'),
248 expandedOnInit
: true,
249 iconCls
: 'fa fa-hdd-o',
250 xtype
: 'pveNodeDiskList'
255 onlineHelp
: 'pveceph.1.html',
256 iconCls
: 'fa fa-ceph',
257 xtype
: 'pveNodeCephStatus'
260 xtype
: 'pveNodeCephConfigCrush',
261 title
: gettext('Config'),
262 iconCls
: 'fa fa-gear',
263 onlineHelp
: 'pveceph.1.html',
265 itemId
: 'ceph-config'
268 xtype
: 'pveNodeCephMonList',
269 title
: gettext('Monitor'),
271 onlineHelp
: 'pveceph.1.html',
273 itemId
: 'ceph-monlist'
276 xtype
: 'pveNodeCephOsdTree',
278 iconCls
: 'fa fa-hdd-o',
279 onlineHelp
: 'pveceph.1.html',
281 itemId
: 'ceph-osdtree'
284 xtype
: 'pveNodeCephPoolList',
285 title
: gettext('Pools'),
286 iconCls
: 'fa fa-sitemap',
287 onlineHelp
: 'pveceph.1.html',
294 if (caps
.nodes
['Sys.Syslog']) {
298 title
: gettext('Log'),
299 iconCls
: 'fa fa-list',
300 groups
: ['firewall'],
301 url
: '/api2/extjs/nodes/' + nodename
+ '/firewall/log',
302 itemId
: 'firewall-fwlog'
305 title
: gettext('Log'),
307 iconCls
: 'fa fa-list',
309 onlineHelp
: 'pveceph.1.html',
311 url
: "/api2/extjs/nodes/" + nodename
+ "/ceph/log"
317 title
: gettext('Task History'),
318 iconCls
: 'fa fa-list',
320 xtype
: 'pveNodeTasks'
323 title
: gettext('Subscription'),
324 iconCls
: 'fa fa-support',
326 onlineHelp
: 'chapter-sysadmin.html#_getting_help',
327 xtype
: 'pveNodeSubscription',
334 me
.mon(me
.statusStore
, 'load', function(s
, records
, success
) {
335 var uptimerec
= s
.data
.get('uptime');
336 var powermgmt
= uptimerec
? uptimerec
.data
.value
: false;
337 if (!caps
.nodes
['Sys.PowerMgmt']) {
340 restartBtn
.setDisabled(!powermgmt
);
341 shutdownBtn
.setDisabled(!powermgmt
);
342 shellBtn
.setDisabled(!powermgmt
);
345 me
.on('afterrender', function() {
346 me
.statusStore
.startUpdate();
349 me
.on('destroy', function() {
350 me
.statusStore
.stopUpdate();