Commit 34d8e0f2 authored by Alexandre Derumier's avatar Alexandre Derumier Committed by Dietmar Maurer

add migrate_all form

Signed-off-by: 's avatarAlexandre Derumier <aderumier@odiso.com>
parent 4cda3858
...@@ -114,6 +114,7 @@ JSSRC= \ ...@@ -114,6 +114,7 @@ JSSRC= \
node/Config.js \ node/Config.js \
qemu/StatusView.js \ qemu/StatusView.js \
window/Migrate.js \ window/Migrate.js \
window/MigrateAll.js \
qemu/Monitor.js \ qemu/Monitor.js \
qemu/Summary.js \ qemu/Summary.js \
qemu/OSTypeEdit.js \ qemu/OSTypeEdit.js \
......
Ext.define('PVE.window.MigrateAll', {
extend: 'Ext.window.Window',
resizable: false,
migrate: function(target, maxworkers) {
var me = this;
PVE.Utils.API2Request({
params: { target: target, maxworkers: maxworkers},
url: '/nodes/' + me.nodename + '/' + "/migrateall",
waitMsgTarget: me,
method: 'POST',
failure: function(response, opts) {
Ext.Msg.alert('Error', response.htmlStatus);
},
success: function(response, options) {
var upid = response.result.data;
var win = Ext.create('PVE.window.TaskViewer', {
upid: upid
});
win.show();
me.close();
}
});
},
initComponent : function() {
var me = this;
if (!me.nodename) {
throw "no node name specified";
}
me.formPanel = Ext.create('Ext.form.Panel', {
bodyPadding: 10,
border: false,
fieldDefaults: {
labelWidth: 100,
anchor: '100%'
},
items: [
{
xtype: 'PVE.form.NodeSelector',
name: 'target',
fieldLabel: 'Target node',
allowBlank: false,
onlineValidator: true
},
{
xtype: 'numberfield',
name: 'maxworkers',
minValue: 1,
maxValue: 100,
value: 1,
fieldLabel: 'Parallel jobs',
allowBlank: false
},
]
});
var form = me.formPanel.getForm();
var submitBtn = Ext.create('Ext.Button', {
text: 'Migrate',
handler: function() {
var values = form.getValues();
me.migrate(values.target, values.maxworkers);
}
});
Ext.apply(me, {
title: "Migrate All VMs",
width: 350,
modal: true,
layout: 'auto',
border: false,
items: [ me.formPanel ],
buttons: [ submitBtn ]
});
me.callParent();
}
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment