]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/window/BulkAction.js
ba27eef13a07ecd3f42a415db04cdd88f4491eec
1 Ext
.define('PVE.window.BulkAction', {
2 extend
: 'Ext.window.Window',
12 // the action to be set
13 // currently there are
19 submit: function(params
) {
21 Proxmox
.Utils
.API2Request({
23 url
: '/nodes/' + me
.nodename
+ '/' + me
.action
,
26 failure: function(response
, opts
) {
27 Ext
.Msg
.alert('Error', response
.htmlStatus
);
29 success: function(response
, options
) {
30 var upid
= response
.result
.data
;
32 var win
= Ext
.create('Proxmox.window.TaskViewer', {
37 win
.on('destroy', function() {
44 initComponent : function() {
48 throw "no node name specified";
52 throw "no action specified";
56 throw "no button text specified";
60 throw "no title specified";
65 if (me
.action
=== 'migrateall') {
66 /*jslint confusion: true*/
67 /*value is string and number*/
70 xtype
: 'pveNodeSelector',
72 disallowedNodes
: [me
.nodename
],
73 fieldLabel
: gettext('Target node'),
78 xtype
: 'proxmoxintegerfield',
83 fieldLabel
: gettext('Parallel jobs'),
88 xtype
: 'displayfield',
90 value
: 'Warning: Running CTs will be migrated in Restart Mode.',
91 hidden
: true // only visible if running container chosen
94 /*jslint confusion: false*/
95 } else if (me
.action
=== 'startall') {
111 nodename
: me
.nodename
,
114 selectionchange: function(vmselector
, records
) {
115 if (me
.action
== 'migrateall') {
116 var showWarning
= records
.some(function(item
) {
117 return (item
.data
.type
== 'lxc' &&
118 item
.data
.status
== 'running');
120 me
.down('#lxcwarning').setVisible(showWarning
);
126 me
.formPanel
= Ext
.create('Ext.form.Panel', {
140 var form
= me
.formPanel
.getForm();
142 var submitBtn
= Ext
.create('Ext.Button', {
144 handler: function() {
146 me
.submit(form
.getValues());
151 items
: [ me
.formPanel
],
152 buttons
: [ submitBtn
]
157 form
.on('validitychange', function() {
158 var valid
= form
.isValid();
159 submitBtn
.setDisabled(!valid
);