CLOUDSTACK-4024: UI > (1) detailView widget - add action handler for prepareObjectStoreMigration.

(2) Infrastructure > Secondary Storage > add new action prepareObjectStoreMigration and show it when provider is NFS.
This commit is contained in:
Jessica Wang 2013-10-23 11:46:30 -07:00
parent 1f0dd7cc36
commit 7edb4d377f
2 changed files with 43 additions and 1 deletions

View File

@ -14677,7 +14677,38 @@
detailView: {
name: 'Secondary storage details',
isMaximized: true,
actions: {
actions: {
prepareObjectStoreMigration: {
label: 'Prepare Object Store Migration',
messages: {
confirm: function(args) {
return 'Please confirm you want to prepare migration of secondary storage to object store.';
},
notification: function(args) {
return 'Prepare Object Store Migration';
}
},
action: function(args) {
$.ajax({
url: createURL('prepareSecondaryStorageForMigration'),
data: {
id: args.context.secondaryStorage[0].id
},
success: function(json) {
var jid = json.preparesecondarystorageformigrationresponse.jobid;
args.response.success({
_custom: {
jobId: jid
}
});
}
});
},
notification: {
poll: pollAsyncJobResult
}
},
remove: {
label: 'label.action.delete.secondary.storage',
messages: {
@ -16147,6 +16178,11 @@
var jsonObj = args.context.item;
var allowedActions = [];
allowedActions.push("remove");
if (jsonObj.providername == 'NFS') {
allowedActions.push("prepareObjectStoreMigration");
}
return allowedActions;
}

View File

@ -369,6 +369,12 @@
});
},
prepareObjectStoreMigration: function($detailView, args) {
var tab = args.tabs[args.activeTab];
var isMultiple = tab.multiple;
uiActions.remove($detailView, args);
},
/**
* Convert editable fields to text boxes; clicking again saves data
*