mirror of https://github.com/rancher/ui.git
PublicEndpoints
This commit is contained in:
parent
4ab13d4385
commit
cebfde7338
|
|
@ -77,14 +77,12 @@ var PublicEndpoint = Resource.extend({
|
|||
let out = '';
|
||||
out += get(this,'port');
|
||||
let proto = get(this,'protocol').toLowerCase();
|
||||
if (proto !== 'tcp') {
|
||||
out += '/' + proto;
|
||||
}
|
||||
out += '/' + proto;
|
||||
return out;
|
||||
}),
|
||||
|
||||
linkEndpoint: computed('isTcp', 'isMaybeSecure', 'displayEndpoint', function() {
|
||||
if (get(this,'isTcp')) {
|
||||
linkEndpoint: computed('isTcpish', 'isMaybeSecure', 'displayEndpoint', 'port', function() {
|
||||
if (get(this,'isTcpish') && get(this, 'port') > 0 ) {
|
||||
let out = get(this,'endpoint');
|
||||
|
||||
if (get(this,'isMaybeSecure')) {
|
||||
|
|
@ -97,8 +95,9 @@ var PublicEndpoint = Resource.extend({
|
|||
}
|
||||
}),
|
||||
|
||||
isTcp: computed('protocol', function() {
|
||||
return get(this,'protocol').toLowerCase() === 'tcp';
|
||||
isTcpish: computed('protocol', function() {
|
||||
const proto = get(this, 'protocol').toLowerCase();
|
||||
return ( ['tcp','http','https'].includes(proto) );
|
||||
}),
|
||||
|
||||
isMaybeSecure: computed('port', function() {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ export default Mixin.create({
|
|||
const endpoints = (get(this, 'publicEndpoints') || []);
|
||||
|
||||
endpoints.forEach((endpoint) => {
|
||||
if (get(endpoint, 'isTcp')) {
|
||||
if (get(endpoint, 'isTcpish')) {
|
||||
parts.push('<span>' +
|
||||
'<a target="_blank" rel="noreferrer nofollow noopener" href="' + Util.escapeHtml(get(endpoint, 'linkEndpoint')) + '">' +
|
||||
Util.escapeHtml(get(endpoint, 'displayEndpoint')) +
|
||||
|
|
@ -20,7 +20,7 @@ export default Mixin.create({
|
|||
}
|
||||
});
|
||||
|
||||
let pub = parts.join(" / ");
|
||||
let pub = parts.join(', ');
|
||||
|
||||
if (pub) {
|
||||
return pub.htmlSafe();
|
||||
|
|
|
|||
Loading…
Reference in New Issue