ui: Add and use ProxyFor to get the `connected with proxy` boolean (#7820)

* Add and use ProxyFor to get the `connected with proxy` boolean

* Fix up page-navigation test

* Upgrade to @hashicorp/consul-api-double@2.14.7
This commit is contained in:
Kenia 2020-05-12 08:06:08 -04:00 committed by John Cowen
parent c4c06c2dab
commit e2ef864b1e
4 changed files with 12 additions and 5 deletions

View File

@ -32,7 +32,13 @@ export default Controller.extend(WithEventSource, WithSearching, {
return item.Kind === 'connect-proxy'; return item.Kind === 'connect-proxy';
}) })
.forEach(item => { .forEach(item => {
proxies[item.Name.replace('-proxy', '')] = true; // Iterating to cover the usecase of a proxy being
// used by more than one service
if (item.ProxyFor) {
item.ProxyFor.forEach(service => {
proxies[service] = true;
});
}
}); });
return proxies; return proxies;

View File

@ -14,6 +14,7 @@ export default Model.extend({
}, },
}), }),
InstanceCount: attr('number'), InstanceCount: attr('number'),
ProxyFor: attr(),
Kind: attr('string'), Kind: attr('string'),
ExternalSources: attr(), ExternalSources: attr(),
Meta: attr(), Meta: attr(),

View File

@ -42,7 +42,7 @@ Feature: page-navigation
Where: Where:
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| Item | Model | URL | Endpoint | Back | | Item | Model | URL | Endpoint | Back |
| service | services | /dc-1/services/service-0-terminating-gateway/instances | /v1/discovery-chain/service-0-terminating-gateway?dc=dc-1&ns=@namespace | /dc-1/services | | service | services | /dc-1/services/service-0/instances | /v1/discovery-chain/service-0?dc=dc-1&ns=@namespace | /dc-1/services |
| node | nodes | /dc-1/nodes/node-0/health-checks | /v1/session/node/node-0?dc=dc-1&ns=@namespace | /dc-1/nodes | | node | nodes | /dc-1/nodes/node-0/health-checks | /v1/session/node/node-0?dc=dc-1&ns=@namespace | /dc-1/nodes |
| kv | kvs | /dc-1/kv/0-key-value/edit | /v1/session/info/ee52203d-989f-4f7a-ab5a-2bef004164ca?dc=dc-1&ns=@namespace | /dc-1/kv | | kv | kvs | /dc-1/kv/0-key-value/edit | /v1/session/info/ee52203d-989f-4f7a-ab5a-2bef004164ca?dc=dc-1&ns=@namespace | /dc-1/kv |
# | acl | acls | /dc-1/acls/anonymous | /v1/acl/info/anonymous?dc=dc-1 | /dc-1/acls | # | acl | acls | /dc-1/acls/anonymous | /v1/acl/info/anonymous?dc=dc-1 | /dc-1/acls |

View File

@ -1211,9 +1211,9 @@
js-yaml "^3.13.1" js-yaml "^3.13.1"
"@hashicorp/consul-api-double@^2.6.2": "@hashicorp/consul-api-double@^2.6.2":
version "2.14.4" version "2.14.7"
resolved "https://registry.yarnpkg.com/@hashicorp/consul-api-double/-/consul-api-double-2.14.4.tgz#cc68c500f934d9ac76292797f845e78b9e3c4fcb" resolved "https://registry.yarnpkg.com/@hashicorp/consul-api-double/-/consul-api-double-2.14.7.tgz#80cd19461a3f3716bf76ba28bcabff842bcd9aef"
integrity sha512-6GXHlSKr822CPuAz7jWBDZE4KAxKNSFt/2RA0Z7q6HAHu0O3NTd14vZweO30hS1yusyVEI9RLd9OvgMbv5WXhA== integrity sha512-QjpwvrraUswn/hFh+9lIKuA9keCGOkh1yr/cT3I6fDiw4JKLyDLaRN8bF/JNGtgoA/SsQh10L1YI3feZ7M3VKw==
"@hashicorp/ember-cli-api-double@^3.0.2": "@hashicorp/ember-cli-api-double@^3.0.2":
version "3.0.2" version "3.0.2"