Skip to content

Commit 7edb4d3

Browse files
author
Jessica Wang
committed
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.
1 parent 1f0dd7c commit 7edb4d3

2 files changed

Lines changed: 43 additions & 1 deletion

File tree

‎ui/scripts/system.js‎

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14677,7 +14677,38 @@
1467714677
detailView: {
1467814678
name: 'Secondary storage details',
1467914679
isMaximized: true,
14680-
actions: {
14680+
actions: {
14681+
prepareObjectStoreMigration: {
14682+
label: 'Prepare Object Store Migration',
14683+
messages: {
14684+
confirm: function(args) {
14685+
return 'Please confirm you want to prepare migration of secondary storage to object store.';
14686+
},
14687+
notification: function(args) {
14688+
return 'Prepare Object Store Migration';
14689+
}
14690+
},
14691+
action: function(args) {
14692+
$.ajax({
14693+
url: createURL('prepareSecondaryStorageForMigration'),
14694+
data: {
14695+
id: args.context.secondaryStorage[0].id
14696+
},
14697+
success: function(json) {
14698+
var jid = json.preparesecondarystorageformigrationresponse.jobid;
14699+
args.response.success({
14700+
_custom: {
14701+
jobId: jid
14702+
}
14703+
});
14704+
}
14705+
});
14706+
},
14707+
notification: {
14708+
poll: pollAsyncJobResult
14709+
}
14710+
},
14711+
1468114712
remove: {
1468214713
label: 'label.action.delete.secondary.storage',
1468314714
messages: {
@@ -16147,6 +16178,11 @@
1614716178
var jsonObj = args.context.item;
1614816179
var allowedActions = [];
1614916180
allowedActions.push("remove");
16181+
16182+
if (jsonObj.providername == 'NFS') {
16183+
allowedActions.push("prepareObjectStoreMigration");
16184+
}
16185+
1615016186
return allowedActions;
1615116187
}
1615216188

‎ui/scripts/ui/widgets/detailView.js‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,12 @@
369369
});
370370
},
371371

372+
prepareObjectStoreMigration: function($detailView, args) {
373+
var tab = args.tabs[args.activeTab];
374+
var isMultiple = tab.multiple;
375+
uiActions.remove($detailView, args);
376+
},
377+
372378
/**
373379
* Convert editable fields to text boxes; clicking again saves data
374380
*

0 commit comments

Comments
 (0)