diff --git a/ui/packages/consul-ui/app/models/topology.js b/ui/packages/consul-ui/app/models/topology.js index 63c2d9e08b..5f8d3f3b08 100644 --- a/ui/packages/consul-ui/app/models/topology.js +++ b/ui/packages/consul-ui/app/models/topology.js @@ -1,6 +1,5 @@ import Model from 'ember-data/model'; import attr from 'ember-data/attr'; -import { computed } from '@ember/object'; export const PRIMARY_KEY = 'uid'; export const SLUG_KEY = 'ServiceName'; @@ -13,7 +12,4 @@ export default Model.extend({ Downstreams: attr(), Protocol: attr(), meta: attr(), - Exists: computed(function() { - return true; - }), }); diff --git a/ui/packages/consul-ui/app/routes/dc/services/show/index.js b/ui/packages/consul-ui/app/routes/dc/services/show/index.js index 5b9171d8e7..6d1e6c381f 100644 --- a/ui/packages/consul-ui/app/routes/dc/services/show/index.js +++ b/ui/packages/consul-ui/app/routes/dc/services/show/index.js @@ -11,25 +11,29 @@ export default Route.extend({ // so check the length here. let to = 'topology'; const parentModel = this.modelFor(parent); - + const hasProxy = get(parentModel, 'proxies'); const kind = get(parentModel, 'items.firstObject.Service.Kind'); - switch (kind) { - case 'ingress-gateway': - if (!get(parentModel, 'topology.Exists')) { - to = 'upstreams'; - } - break; - case 'terminating-gateway': - to = 'services'; - break; - case 'mesh-gateway': - to = 'instances'; - break; - default: - if (!get(parentModel, 'topology.Exists')) { + if (hasProxy.length === 0) { + to = 'instances'; + } else { + switch (kind) { + case 'ingress-gateway': + if (!get(parentModel, 'topology.Datacenter')) { + to = 'upstreams'; + } + break; + case 'terminating-gateway': + to = 'services'; + break; + case 'mesh-gateway': to = 'instances'; - } + break; + default: + if (!get(parentModel, 'topology.Datacenter')) { + to = 'instances'; + } + } } this.replaceWith(`${parent}.${to}`, parentModel); diff --git a/ui/packages/consul-ui/app/templates/dc/services/show.hbs b/ui/packages/consul-ui/app/templates/dc/services/show.hbs index e3c11aa323..0eb0aacb1f 100644 --- a/ui/packages/consul-ui/app/templates/dc/services/show.hbs +++ b/ui/packages/consul-ui/app/templates/dc/services/show.hbs @@ -29,7 +29,7 @@