This is an automated email from the ASF dual-hosted git repository.
bhaisaab pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/master by this push:
new ee7dcf7 CLOUDSTACK-10129: Allow navigation from VRs to account,
network, instances (#2306)
ee7dcf7 is described below
commit ee7dcf78f11bb5c7984b0fd15232003ce478bad3
Author: Rohit Yadav <[email protected]>
AuthorDate: Thu Nov 9 02:09:14 2017 +0530
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 <[email protected]>
---
ui/scripts/accounts.js | 13 +++++++++++++
ui/scripts/instances.js | 25 +++++++++++++++++++++++++
ui/scripts/network.js | 27 ++++++++++++++++++++++++---
ui/scripts/system.js | 18 ++++++++++++++++++
4 files changed, 80 insertions(+), 3 deletions(-)
diff --git a/ui/scripts/accounts.js b/ui/scripts/accounts.js
index 77c528f..a9f7381 100644
--- a/ui/scripts/accounts.js
+++ b/ui/scripts/accounts.js
@@ -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({
url: createURL('listAccounts'),
data: data,
diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js
index 252eb1a..ca77c27 100644
--- a/ui/scripts/instances.js
+++ b/ui/scripts/instances.js
@@ -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) {
$.extend(data, {
templateid: args.context.templates[0].id
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index 8370106..7ffb16d 100644
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -914,6 +914,25 @@
var 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({
url: createURL('listNetworks'),
data: data,
@@ -931,7 +950,7 @@
detailView: {
name: 'label.guest.network.details',
- viewAll: {
+ viewAll: [{
path: 'network.ipAddresses',
label: 'label.menu.ipaddresses',
preFilter: function(args) {
@@ -940,7 +959,10 @@
return true;
}
- },
+ }, {
+ label: 'label.instances',
+ path: 'instances'
+ }],
actions: {
edit: {
label: 'label.edit',
@@ -6334,7 +6356,6 @@
}
},
action: function(args) {
- console.log(args.context);
$.ajax({
url: createURL('removeVpnUser'),
data: {
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index e912f3b..9fc96ce 100755
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -31,6 +31,7 @@
if (router.projectid) routerType = _l('label.project');
if (router.vpcid) routerType = _l('label.vpc');
+ if ("isredundantrouter" in router && router.isredundantrouter)
routerType = routerType + " (" + router.redundantstate + ")";
return $.extend(router, {
routerType: routerType
@@ -9599,6 +9600,23 @@
},
detailView: {
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: {
start: {
label: 'label.action.start.router',
--
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].