mirror of https://github.com/rancher/ui.git
New endpoint API
This commit is contained in:
parent
97cec78068
commit
0be9aca5ff
|
|
@ -44,18 +44,19 @@ var PublicEndpoint = Resource.extend({
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// ip:port
|
// ip:port
|
||||||
endpoint: computed('port', 'address', function() {
|
endpoint: computed('port', 'addresses', 'allNodes', function() {
|
||||||
const address = get(this, 'address');
|
const addresses = get(this, 'addresses');
|
||||||
|
const allNodes = get(this, 'allNodes');
|
||||||
|
|
||||||
let out = '';
|
let out = '';
|
||||||
if ( address && address !== 'NodePort' ) {
|
if ( allNodes ) {
|
||||||
out = address;
|
|
||||||
} else {
|
|
||||||
const globalStore = get(this, 'globalStore');
|
const globalStore = get(this, 'globalStore');
|
||||||
const node = globalStore.all('node').findBy('clusterId', get(this,'scope.currentCluster.id'));
|
const node = globalStore.all('node').findBy('clusterId', get(this,'scope.currentCluster.id'));
|
||||||
if ( node ) {
|
if ( node ) {
|
||||||
out = get(node, 'ipAddress');
|
out = get(node, 'ipAddress');
|
||||||
}
|
}
|
||||||
|
} else if ( addresses && addresses.length ) {
|
||||||
|
out = addresses[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (out) {
|
if (out) {
|
||||||
|
|
@ -65,7 +66,7 @@ var PublicEndpoint = Resource.extend({
|
||||||
return out;
|
return out;
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// [ip:]port[/udp]
|
// port[/udp]
|
||||||
displayEndpoint: computed('port','protocol', function() {
|
displayEndpoint: computed('port','protocol', function() {
|
||||||
let out = '';
|
let out = '';
|
||||||
out += get(this,'port');
|
out += get(this,'port');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue