mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-10129: Allow navigation from VRs to account, network, instances (#2306)
Supports following viewing and navigation/filtering: - Networks -> view instances (instances that have nics on this network) - Infra-> VRs -> view instances (attached to the VR's guest network id), view owner account (if not system, or project), view instances - Infra -> VRs -> list of VPC redundant VRs will have redundant state in parenthesis in the list Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
137d6a8940
commit
ee7dcf78f1
@ -137,6 +137,19 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ("routers" in args.context) {
|
||||||
|
if ("account" in args.context.routers[0]) {
|
||||||
|
$.extend(data, {
|
||||||
|
name: args.context.routers[0].account
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if ("domainid" in args.context.routers[0]) {
|
||||||
|
$.extend(data, {
|
||||||
|
domainid: args.context.routers[0].domainid
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('listAccounts'),
|
url: createURL('listAccounts'),
|
||||||
data: data,
|
data: data,
|
||||||
|
|||||||
@ -379,6 +379,31 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ("routers" in args.context) {
|
||||||
|
if ("vpcid" in args.context.routers[0]) {
|
||||||
|
$.extend(data, {
|
||||||
|
vpcid: args.context.routers[0].vpcid
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
if ("guestnetworkid" in args.context.routers[0]) {
|
||||||
|
$.extend(data, {
|
||||||
|
networkid: args.context.routers[0].guestnetworkid
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ("projectid" in args.context.routers[0]) {
|
||||||
|
$.extend(data, {
|
||||||
|
projectid: args.context.routers[0].projectid
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ("networks" in args.context) {
|
||||||
|
$.extend(data, {
|
||||||
|
networkid: args.context.networks[0].id
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if ("templates" in args.context) {
|
if ("templates" in args.context) {
|
||||||
$.extend(data, {
|
$.extend(data, {
|
||||||
templateid: args.context.templates[0].id
|
templateid: args.context.templates[0].id
|
||||||
|
|||||||
@ -914,6 +914,25 @@
|
|||||||
var data = {};
|
var data = {};
|
||||||
listViewDataProvider(args, data);
|
listViewDataProvider(args, data);
|
||||||
|
|
||||||
|
if ("routers" in args.context) {
|
||||||
|
if ("vpcid" in args.context.routers[0]) {
|
||||||
|
$.extend(data, {
|
||||||
|
vpcid: args.context.routers[0].vpcid
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
if ("guestnetworkid" in args.context.routers[0]) {
|
||||||
|
$.extend(data, {
|
||||||
|
id: args.context.routers[0].guestnetworkid
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ("projectid" in args.context.routers[0]) {
|
||||||
|
$.extend(data, {
|
||||||
|
projectid: args.context.routers[0].projectid
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('listNetworks'),
|
url: createURL('listNetworks'),
|
||||||
data: data,
|
data: data,
|
||||||
@ -931,7 +950,7 @@
|
|||||||
|
|
||||||
detailView: {
|
detailView: {
|
||||||
name: 'label.guest.network.details',
|
name: 'label.guest.network.details',
|
||||||
viewAll: {
|
viewAll: [{
|
||||||
path: 'network.ipAddresses',
|
path: 'network.ipAddresses',
|
||||||
label: 'label.menu.ipaddresses',
|
label: 'label.menu.ipaddresses',
|
||||||
preFilter: function(args) {
|
preFilter: function(args) {
|
||||||
@ -940,7 +959,10 @@
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
},
|
}, {
|
||||||
|
label: 'label.instances',
|
||||||
|
path: 'instances'
|
||||||
|
}],
|
||||||
actions: {
|
actions: {
|
||||||
edit: {
|
edit: {
|
||||||
label: 'label.edit',
|
label: 'label.edit',
|
||||||
@ -6334,7 +6356,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
action: function(args) {
|
action: function(args) {
|
||||||
console.log(args.context);
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('removeVpnUser'),
|
url: createURL('removeVpnUser'),
|
||||||
data: {
|
data: {
|
||||||
|
|||||||
@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
if (router.projectid) routerType = _l('label.project');
|
if (router.projectid) routerType = _l('label.project');
|
||||||
if (router.vpcid) routerType = _l('label.vpc');
|
if (router.vpcid) routerType = _l('label.vpc');
|
||||||
|
if ("isredundantrouter" in router && router.isredundantrouter) routerType = routerType + " (" + router.redundantstate + ")";
|
||||||
|
|
||||||
return $.extend(router, {
|
return $.extend(router, {
|
||||||
routerType: routerType
|
routerType: routerType
|
||||||
@ -9599,6 +9600,23 @@
|
|||||||
},
|
},
|
||||||
detailView: {
|
detailView: {
|
||||||
name: 'label.virtual.appliance.details',
|
name: 'label.virtual.appliance.details',
|
||||||
|
viewAll: [{
|
||||||
|
label: 'label.account',
|
||||||
|
path: 'accounts',
|
||||||
|
preFilter: function(args) {
|
||||||
|
if (args.context.routers[0].projectid)
|
||||||
|
return false;
|
||||||
|
if (args.context.routers[0].account == 'system')
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
label: 'label.networks',
|
||||||
|
path: 'network',
|
||||||
|
}, {
|
||||||
|
label: 'label.instances',
|
||||||
|
path: 'instances'
|
||||||
|
}],
|
||||||
actions: {
|
actions: {
|
||||||
start: {
|
start: {
|
||||||
label: 'label.action.start.router',
|
label: 'label.action.start.router',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user