diff --git a/ui/scripts/system.js b/ui/scripts/system.js index dea495b5084..7fb807d4c89 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -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; } diff --git a/ui/scripts/ui/widgets/detailView.js b/ui/scripts/ui/widgets/detailView.js index 0e975e41706..7cbed22c27f 100644 --- a/ui/scripts/ui/widgets/detailView.js +++ b/ui/scripts/ui/widgets/detailView.js @@ -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 *