]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/window/BulkAction.js
0429d96d614d840fcf2a95ffb31f27d8cddca8ba
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
) {
22 Proxmox
.Utils
.API2Request({
24 url
: '/nodes/' + me
.nodename
+ '/' + me
.action
,
27 failure: function(response
, opts
) {
28 Ext
.Msg
.alert('Error', response
.htmlStatus
);
30 success: function(response
, options
) {
31 var upid
= response
.result
.data
;
33 var win
= Ext
.create('Proxmox.window.TaskViewer', {
38 win
.on('destroy', function() {
45 initComponent : function() {
49 throw "no node name specified";
53 throw "no action specified";
57 throw "no button text specified";
61 throw "no title specified";
66 if (me
.action
=== 'migrateall') {
67 /*jslint confusion: true*/
68 /*value is string and number*/
71 xtype
: 'pveNodeSelector',
73 disallowedNodes
: [me
.nodename
],
74 fieldLabel
: gettext('Target node'),
79 xtype
: 'proxmoxintegerfield',
84 fieldLabel
: gettext('Parallel jobs'),
88 xtype
: 'proxmoxcheckbox',
89 name
: 'with-local-disks',
92 fieldLabel
: gettext('Migrate VMs with local disks'),
94 change: function(cb
, val
) {
95 me
.down('#localdiskwarning').setVisible(val
);
101 itemId
: 'localdiskwarning',
102 xtype
: 'displayfield',
104 value
: 'Warning: Migration with local disks might take long.',
108 itemId
: 'lxcwarning',
109 xtype
: 'displayfield',
111 value
: 'Warning: Running CTs will be migrated in Restart Mode.',
112 hidden
: true // only visible if running container chosen
115 /*jslint confusion: false*/
116 } else if (me
.action
=== 'startall') {
118 xtype
: 'hiddenfield',
132 nodename
: me
.nodename
,
135 selectionchange: function(vmselector
, records
) {
136 if (me
.action
== 'migrateall') {
137 var showWarning
= records
.some(function(item
) {
138 return (item
.data
.type
== 'lxc' &&
139 item
.data
.status
== 'running');
141 me
.down('#lxcwarning').setVisible(showWarning
);
147 me
.formPanel
= Ext
.create('Ext.form.Panel', {
161 var form
= me
.formPanel
.getForm();
163 var submitBtn
= Ext
.create('Ext.Button', {
165 handler: function() {
167 me
.submit(form
.getValues());
172 items
: [ me
.formPanel
],
173 buttons
: [ submitBtn
]
178 form
.on('validitychange', function() {
179 var valid
= form
.isValid();
180 submitBtn
.setDisabled(!valid
);