mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-16 02:22:52 +01:00
CLOUDSTACK-4793: UI > Virtual Routers > add new action "Upgrade Router to Newer Template" in detailView.
This commit is contained in:
parent
d6a38c238a
commit
829f1db6e8
@ -7391,8 +7391,6 @@
|
||||
},
|
||||
virtualRouters: function() {
|
||||
var listView = $.extend(true, {}, cloudStack.sections.system.subsections.virtualRouters.listView, {
|
||||
|
||||
//???
|
||||
actions: {
|
||||
upgradeRouterToUseNewerTemplate: {
|
||||
isHeader: true,
|
||||
@ -7411,7 +7409,10 @@
|
||||
zoneid: {
|
||||
label: 'label.zone',
|
||||
select: function (args) {
|
||||
var items = [{ id: '', description: '' }];
|
||||
var items = [{
|
||||
id: '',
|
||||
description: ''
|
||||
}];
|
||||
$.ajax({
|
||||
url: createURL('listZones'),
|
||||
data: {
|
||||
@ -7421,7 +7422,10 @@
|
||||
var objs = json.listzonesresponse.zone;
|
||||
if (objs != null) {
|
||||
for (var i = 0; i < objs.length; i++) {
|
||||
items.push({ id: objs[i].id, description: objs[i].name });
|
||||
items.push({
|
||||
id: objs[i].id,
|
||||
description: objs[i].name
|
||||
});
|
||||
}
|
||||
}
|
||||
args.response.success({
|
||||
@ -7435,7 +7439,10 @@
|
||||
label: 'Pod',
|
||||
dependsOn: 'zoneid',
|
||||
select: function (args) {
|
||||
var items = [{ id: '', description: '' }];
|
||||
var items = [{
|
||||
id: '',
|
||||
description: ''
|
||||
}];
|
||||
if (args.zoneid.length > 0) {
|
||||
$.ajax({
|
||||
url: createURL('listPods'),
|
||||
@ -7446,7 +7453,10 @@
|
||||
var objs = json.listpodsresponse.pod;
|
||||
if (objs != null) {
|
||||
for (var i = 0; i < objs.length; i++) {
|
||||
items.push({ id: objs[i].id, description: objs[i].name });
|
||||
items.push({
|
||||
id: objs[i].id,
|
||||
description: objs[i].name
|
||||
});
|
||||
}
|
||||
}
|
||||
args.response.success({
|
||||
@ -7465,7 +7475,10 @@
|
||||
label: 'label.cluster',
|
||||
dependsOn: 'podid',
|
||||
select: function (args) {
|
||||
var items = [{ id: '', description: '' }];
|
||||
var items = [{
|
||||
id: '',
|
||||
description: ''
|
||||
}];
|
||||
if (args.podid.length > 0) {
|
||||
$.ajax({
|
||||
url: createURL('listClusters'),
|
||||
@ -7476,7 +7489,10 @@
|
||||
var objs = json.listclustersresponse.cluster;
|
||||
if (objs != null) {
|
||||
for (var i = 0; i < objs.length; i++) {
|
||||
items.push({ id: objs[i].id, description: objs[i].name });
|
||||
items.push({
|
||||
id: objs[i].id,
|
||||
description: objs[i].name
|
||||
});
|
||||
}
|
||||
}
|
||||
args.response.success({
|
||||
@ -8149,6 +8165,39 @@
|
||||
}
|
||||
},
|
||||
|
||||
upgradeRouterToUseNewerTemplate: {
|
||||
label: 'Upgrade Router to Use Newer Template',
|
||||
messages: {
|
||||
confirm: function(args) {
|
||||
return 'Please confirm that you want to upgrade router to use newer template';
|
||||
},
|
||||
notification: function (args) {
|
||||
return 'Upgrade Router to Use Newer Template';
|
||||
}
|
||||
},
|
||||
action: function (args) {
|
||||
$.ajax({
|
||||
url: createURL('upgradeRouterTemplate'),
|
||||
data: {
|
||||
id: args.context.routers[0].id
|
||||
},
|
||||
success: function (json) {
|
||||
var jobs = json.upgraderoutertemplateresponse.asyncjobs;
|
||||
if (jobs != undefined) {
|
||||
args.response.success({
|
||||
_custom: {
|
||||
jobId: jobs[0].jobid
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
notification: {
|
||||
poll: pollAsyncJobResult
|
||||
}
|
||||
},
|
||||
|
||||
'remove': {
|
||||
label: 'label.destroy.router',
|
||||
messages: {
|
||||
@ -17491,6 +17540,8 @@
|
||||
var jsonObj = args.context.item;
|
||||
var allowedActions = [];
|
||||
|
||||
allowedActions.push('upgradeRouterToUseNewerTemplate');
|
||||
|
||||
if (jsonObj.state == 'Running') {
|
||||
allowedActions.push("stop");
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user