mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-4649: UI > (1) detailView widget: pass $detailView property in action.action({}).
(2) Edit Template action: make 'XenServer Tools Version 6.1+' field editable and use addResourceDetail API to update it. (3) Edit Instance action: make 'XenServer Tools Version 6.1+' field editable and use addResourceDetail API to update it.
This commit is contained in:
parent
c212574b17
commit
3e962f8d29
|
|
@ -796,13 +796,11 @@
|
|||
isdynamicallyscalable: (args.data.isdynamicallyscalable == "on"),
|
||||
ostypeid: args.data.guestosid
|
||||
};
|
||||
|
||||
if (args.data.displayname != args.context.instances[0].displayname) {
|
||||
$.extend(data, {
|
||||
displayName: args.data.displayname
|
||||
});
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: createURL('updateVirtualMachine'),
|
||||
data: data,
|
||||
|
|
@ -813,6 +811,26 @@
|
|||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//***** addResourceDetail *****
|
||||
//XenServer only (starts here)
|
||||
if(args.$detailView.find('form').find('div .detail-group').find('.xenserverToolsVersion61plus').length > 0) {
|
||||
$.ajax({
|
||||
url: createURL('addResourceDetail'),
|
||||
data: {
|
||||
resourceType: 'uservm',
|
||||
resourceId: 3,
|
||||
'details[0].key': 'hypervisortoolsversion',
|
||||
'details[0].value': (args.data.xenserverToolsVersion61plus == "on") ? 'xenserver61' : 'xenserver56'
|
||||
},
|
||||
success: function(json) {
|
||||
//do nothing
|
||||
}
|
||||
});
|
||||
}
|
||||
//XenServer only (ends here)
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -657,6 +657,25 @@
|
|||
}
|
||||
});
|
||||
|
||||
|
||||
//***** addResourceDetail *****
|
||||
//XenServer only (starts here)
|
||||
if(args.$detailView.find('form').find('div .detail-group').find('.xenserverToolsVersion61plus').length > 0) {
|
||||
$.ajax({
|
||||
url: createURL('addResourceDetail'),
|
||||
data: {
|
||||
resourceType: 'template',
|
||||
resourceId: 1,
|
||||
'details[0].key': 'hypervisortoolsversion',
|
||||
'details[0].value': (args.data.xenserverToolsVersion61plus == "on") ? 'xenserver61' : 'xenserver56'
|
||||
},
|
||||
success: function(json) {
|
||||
//do nothing
|
||||
}
|
||||
});
|
||||
}
|
||||
//XenServer only (ends here)
|
||||
|
||||
|
||||
//***** listTemplates *****
|
||||
//So, we call listTemplates API to get a complete template object
|
||||
|
|
|
|||
|
|
@ -490,6 +490,7 @@
|
|||
action.action({
|
||||
data: data,
|
||||
_custom: $detailView.data('_custom'),
|
||||
$detailView: $detailView,
|
||||
context: $detailView.data('view-args').context,
|
||||
response: {
|
||||
success: function(args) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue