mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-16 10:32:34 +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() {
|
virtualRouters: function() {
|
||||||
var listView = $.extend(true, {}, cloudStack.sections.system.subsections.virtualRouters.listView, {
|
var listView = $.extend(true, {}, cloudStack.sections.system.subsections.virtualRouters.listView, {
|
||||||
|
|
||||||
//???
|
|
||||||
actions: {
|
actions: {
|
||||||
upgradeRouterToUseNewerTemplate: {
|
upgradeRouterToUseNewerTemplate: {
|
||||||
isHeader: true,
|
isHeader: true,
|
||||||
@ -7411,7 +7409,10 @@
|
|||||||
zoneid: {
|
zoneid: {
|
||||||
label: 'label.zone',
|
label: 'label.zone',
|
||||||
select: function (args) {
|
select: function (args) {
|
||||||
var items = [{ id: '', description: '' }];
|
var items = [{
|
||||||
|
id: '',
|
||||||
|
description: ''
|
||||||
|
}];
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('listZones'),
|
url: createURL('listZones'),
|
||||||
data: {
|
data: {
|
||||||
@ -7421,7 +7422,10 @@
|
|||||||
var objs = json.listzonesresponse.zone;
|
var objs = json.listzonesresponse.zone;
|
||||||
if (objs != null) {
|
if (objs != null) {
|
||||||
for (var i = 0; i < objs.length; i++) {
|
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({
|
args.response.success({
|
||||||
@ -7435,7 +7439,10 @@
|
|||||||
label: 'Pod',
|
label: 'Pod',
|
||||||
dependsOn: 'zoneid',
|
dependsOn: 'zoneid',
|
||||||
select: function (args) {
|
select: function (args) {
|
||||||
var items = [{ id: '', description: '' }];
|
var items = [{
|
||||||
|
id: '',
|
||||||
|
description: ''
|
||||||
|
}];
|
||||||
if (args.zoneid.length > 0) {
|
if (args.zoneid.length > 0) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('listPods'),
|
url: createURL('listPods'),
|
||||||
@ -7446,7 +7453,10 @@
|
|||||||
var objs = json.listpodsresponse.pod;
|
var objs = json.listpodsresponse.pod;
|
||||||
if (objs != null) {
|
if (objs != null) {
|
||||||
for (var i = 0; i < objs.length; i++) {
|
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({
|
args.response.success({
|
||||||
@ -7465,7 +7475,10 @@
|
|||||||
label: 'label.cluster',
|
label: 'label.cluster',
|
||||||
dependsOn: 'podid',
|
dependsOn: 'podid',
|
||||||
select: function (args) {
|
select: function (args) {
|
||||||
var items = [{ id: '', description: '' }];
|
var items = [{
|
||||||
|
id: '',
|
||||||
|
description: ''
|
||||||
|
}];
|
||||||
if (args.podid.length > 0) {
|
if (args.podid.length > 0) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('listClusters'),
|
url: createURL('listClusters'),
|
||||||
@ -7476,7 +7489,10 @@
|
|||||||
var objs = json.listclustersresponse.cluster;
|
var objs = json.listclustersresponse.cluster;
|
||||||
if (objs != null) {
|
if (objs != null) {
|
||||||
for (var i = 0; i < objs.length; i++) {
|
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({
|
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': {
|
'remove': {
|
||||||
label: 'label.destroy.router',
|
label: 'label.destroy.router',
|
||||||
messages: {
|
messages: {
|
||||||
@ -17491,6 +17540,8 @@
|
|||||||
var jsonObj = args.context.item;
|
var jsonObj = args.context.item;
|
||||||
var allowedActions = [];
|
var allowedActions = [];
|
||||||
|
|
||||||
|
allowedActions.push('upgradeRouterToUseNewerTemplate');
|
||||||
|
|
||||||
if (jsonObj.state == 'Running') {
|
if (jsonObj.state == 'Running') {
|
||||||
allowedActions.push("stop");
|
allowedActions.push("stop");
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user