mirror of
https://github.com/status-im/consul.git
synced 2025-01-17 17:22:17 +00:00
355f034822
This gives more prominence to 'Service Instances' as opposed to 'Services'. It also begins to surface Connect related 'nouns' such as 'Proxies' and 'Upstreams' and begins to interconnect them giving more visibility to operators. Various smaller changes: 1. Move healthcheck-status component to healthcheck-output 2. Create a new healthcheck-status component for showing the number of checks plus its icon 3. Create a new healthcheck-info component to group multiple statuses plus a different view if there are no checks 4. Componentize tag-list
34 lines
973 B
JavaScript
34 lines
973 B
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) {
|
|
const instance = items.findBy('ServiceProxyDestination', id);
|
|
if (instance) {
|
|
return instance;
|
|
}
|
|
}
|
|
return;
|
|
});
|
|
},
|
|
});
|