75d8abd562
* ui: Add forking based on service instance id existence Proxies come in 2 flavours, 'normal' and sidecar. We know when a proxy is a sidecar proxy based on whether a DestinationServiceID is set. LocalServiceAddress and LocalServicePort are only relevant for sidecar proxies. This adds template logic to show different text depending on this information. Additionally adds test around connect proxies (#5418) 1. Adds page object for the instance detail page 2. Adds further scenario steps used in the tests 3. Adds acceptance testing around the instance detail page. Services with proxies and the sidecar proxies and proxies themselves 4. Adds datacenter column for upstreams 5. Fixes bug routing bug for decision as to whether to request proxy information or not
38 lines
1.1 KiB
JavaScript
38 lines
1.1 KiB
JavaScript
import RepositoryService from 'consul-ui/services/repository';
|
|
import { PRIMARY_KEY } from 'consul-ui/models/proxy';
|
|
import { get } from '@ember/object';
|
|
const modelName = 'proxy';
|
|
export default RepositoryService.extend({
|
|
getModelName: function() {
|
|
return modelName;
|
|
},
|
|
getPrimaryKey: function() {
|
|
return PRIMARY_KEY;
|
|
},
|
|
findAllBySlug: function(slug, dc, configuration = {}) {
|
|
const query = {
|
|
id: slug,
|
|
dc: dc,
|
|
};
|
|
if (typeof configuration.cursor !== 'undefined') {
|
|
query.index = configuration.cursor;
|
|
}
|
|
return this.get('store').query(this.getModelName(), query);
|
|
},
|
|
findInstanceBySlug: function(id, slug, dc, configuration) {
|
|
return this.findAllBySlug(slug, dc, configuration).then(function(items) {
|
|
if (get(items, 'length') > 0) {
|
|
let instance = items.findBy('ServiceProxy.DestinationServiceID', id);
|
|
if (instance) {
|
|
return instance;
|
|
}
|
|
instance = items.findBy('ServiceProxy.DestinationServiceName', slug);
|
|
if (instance) {
|
|
return instance;
|
|
}
|
|
}
|
|
return;
|
|
});
|
|
},
|
|
});
|