Permalink
Browse files

New release 1.6.1 : UI bugfix in consul-ui - do not display port if n…

…ot set
  • Loading branch information...
pierresouchay committed Dec 4, 2018
1 parent dc4eb3b commit 9fbd22c00d08e6ed294edc1227f05e4031c12fd0
Showing with 14 additions and 3 deletions.
  1. +6 −0 CHANGELOG.md
  2. +1 −1 lib/consul/async/version.rb
  3. +7 −2 samples/consul-ui/js/utils.js
@@ -2,6 +2,12 @@
## (UNRELEASED)
## 1.6.1 (December 4, 2018)
BUG FIXES:
* In consul-ui, display the port only when port is set
## 1.6.0 (November 23, 2018)
BUG FIXES:
@@ -1,5 +1,5 @@
module Consul
module Async
VERSION = '1.6.0'.freeze
VERSION = '1.6.1'.freeze
end
end
@@ -40,11 +40,16 @@ function serviceTitleGenerator(instance) {
var instanceLink = document.createElement('a');
instanceLink.setAttribute('class', 'instance-name');
var appendPort = "";
if (instance.port > 0) {
appendPort = ':' + instance.port;
}
if (protocol != null) {
instanceLink.setAttribute('href', protocol + instance.addr + ':' + instance.port);
instanceLink.setAttribute('href', protocol + instance.addr + appendPort);
instanceLink.setAttribute('target', '_blank');
}
instanceLink.appendChild(document.createTextNode(instance.name + ':' + instance.port));
instanceLink.appendChild(document.createTextNode(instance.name + appendPort));
htmlTitle.appendChild(instanceLink);
return htmlTitle;

0 comments on commit 9fbd22c

Please sign in to comment.