mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
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:
parent
1f0dd7cc36
commit
7edb4d377f
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
*
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user