consul-templaterb 1.27.1 → 1.27.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6c4d19fa22c559f4a7960529dd3960c1c741f631b1cf0b51f5d10155b2b8a131
4
- data.tar.gz: 926930e64938a40c2a2653abf9a84f0c86057201646a2f8e02fed06ed51927b8
3
+ metadata.gz: a67e2df58bcd5c322789984815ff60bd95e50fc047cb20c929a67ca29c07f553
4
+ data.tar.gz: c4df4357ae2852ad487eb90336a0d2d7d380767d51d05e02e7b452d29acda9c7
5
5
  SHA512:
6
- metadata.gz: 5126d79bcbd0d469bcb7ec5d214c979990056c3c11e1547d4819849f3fcd7fddd1534354f565722a52dbb09ba26c63dd4553f40282fcafaccd7be6a2a1d9442f
7
- data.tar.gz: 7d6345911c69a8c0622f0b88343968ff951d8243db78d41b8cfad74e26ad5c87a39ae02e3bb24d4cf1615fe329fc53642f81aaf76591d1f5be4098c576baea96
6
+ metadata.gz: 723beb9fca614d1675e50cc1516f37c4aad93815a1725abcdecb33c8bf0aa5e399449f8c3826a14eac8705aa8cb354aa1034796cf68b46304624f958c1b2ba90
7
+ data.tar.gz: 379cb1ca86d8edc44c68694f70b6bd7c1373b8b707f26bef3459379554f94fa12f27653354dc52647eadbd2cf5b0df7cec7f01bcb457e7ed159b7396709ce00d
@@ -2,7 +2,13 @@
2
2
 
3
3
  ## (UNRELEASED)
4
4
 
5
- ## 1.27.1 (July 28 2020)
5
+ ## 1.27.2 (Sept 4, 2020)
6
+
7
+ IMPROVEMENTS:
8
+
9
+ * Consul-UI now supports navigation between nodes and services in both ways
10
+
11
+ ## 1.27.1 (July 28, 2020)
6
12
 
7
13
  BUGIX:
8
14
 
@@ -1,5 +1,5 @@
1
1
  module Consul
2
2
  module Async
3
- VERSION = '1.27.1'.freeze
3
+ VERSION = '1.27.2'.freeze
4
4
  end
5
5
  end
@@ -15,6 +15,10 @@
15
15
  content: '⚠ ';
16
16
  }
17
17
 
18
+ .btn-outline-success a:hover, .btn-outline-warning a:hover, .btn-outline-danger a:hover{
19
+ color: #fff;
20
+ }
21
+
18
22
  #service-wrapper, #instances-wrapper, #keys-wrapper {
19
23
  overflow-y: scroll;
20
24
  border-top-left-radius: 0px;
@@ -111,7 +111,7 @@ class NodeMainSelector extends MainSelector {
111
111
  nodesChecks.appendChild(checksStatusGenerator(node, node['Node']['Name']));
112
112
  content.appendChild(nodesChecks);
113
113
 
114
- content.appendChild(servicesGenerator(node['Service']));
114
+ content.appendChild(servicesGenerator(node['Service'], node));
115
115
  content.appendChild(tagsGenerator(getTagsNode(node)));
116
116
 
117
117
  sidebar.setAttribute('status', state);
@@ -63,7 +63,7 @@ function nodeState(checks) {
63
63
 
64
64
  supported_protocols = ['https', 'http', 'sftp', 'ftp', 'ssh', 'telnet']
65
65
 
66
- function serviceTitleGenerator(instance) {
66
+ function serviceTitleGenerator(instance, serviceName) {
67
67
  var protocol = null;
68
68
  for (i in supported_protocols) {
69
69
  var protoc = supported_protocols[i]
@@ -74,10 +74,6 @@ function serviceTitleGenerator(instance) {
74
74
  }
75
75
 
76
76
  var htmlTitle = document.createElement('h5');
77
- htmlTitle.setAttribute('title', 'Node Name: ' + instance.name +
78
- '\nAddress: ' + instance.addr +
79
- '\nService ID: ' + instance.id +
80
- '\nService Port: ' + instance.port);
81
77
 
82
78
  htmlTitle.setAttribute('class', 'instance-name');
83
79
  var instanceLink = document.createElement('a');
@@ -91,6 +87,15 @@ function serviceTitleGenerator(instance) {
91
87
  }
92
88
 
93
89
  instanceLink.appendChild(document.createTextNode(instance.name + appendPort));
90
+ const nodeInfo = document.createElement('a');
91
+ nodeInfo.appendChild(document.createTextNode('\u24D8'));
92
+ nodeInfo.setAttribute('title', 'Click to see details of Node: ' + instance.name +
93
+ '\nAddress: ' + instance.addr +
94
+ '\nService ID: ' + instance.id +
95
+ '\nService Port: ' + instance.port);
96
+ nodeInfo.setAttribute('href', 'consul-nodes-ui.html?node_filter=^' + encodeURIComponent(instance.name) + '$');
97
+ htmlTitle.appendChild(nodeInfo);
98
+ htmlTitle.appendChild(document.createTextNode(' '));
94
99
  htmlTitle.appendChild(instanceLink);
95
100
  htmlTitle.appendChild(document.createTextNode(' '));
96
101
  htmlTitle.appendChild(document.createTextNode(instance.addr));
@@ -216,24 +221,44 @@ function toCSSClass(state) {
216
221
  return state;
217
222
  }
218
223
 
219
- function servicesGenerator(instanceServices) {
220
- var services = document.createElement('div');
221
- services.className = 'instance-services';
222
- services.appendChild(document.createTextNode("Services: "));
223
- services.appendChild(document.createElement('br'));
224
+ function servicesGenerator(instanceServices, node) {
225
+ var servicesTop = document.createElement('div');
226
+ servicesTop.className = 'instance-services';
227
+ const card = document.createElement('div');
228
+ card.setAttribute('class', 'card');
229
+ const servicesCard = document.createElement('div');
230
+ servicesCard.setAttribute('class', 'card-body');
231
+ const title = document.createElement('h5');
232
+ title.appendChild(document.createTextNode('Services'));
233
+ title.setAttribute('class', 'card-title')
234
+ servicesCard.appendChild(title);
235
+ const services = document.createElement('div');
236
+ servicesCard.appendChild(services);
224
237
  for (var serviceKey in instanceServices) {
225
- var service = document.createElement('a');
226
- var serviceName = instanceServices[serviceKey]['Service']['Service'];
238
+ const serviceGrp = document.createElement('span');
239
+ serviceGrp.setAttribute('class', 'btn btn-sm');
240
+ serviceGrp.classList.add('btn-outline-' + toCSSClass(nodeState(instanceServices[serviceKey]['Checks'])))
241
+ const service = document.createElement('a');
242
+ serviceGrp.appendChild(service);
243
+ const serviceName = instanceServices[serviceKey]['Service']['Service'];
244
+ service.setAttribute('class', 'serviceLink');
245
+ service.setAttribute('href', 'consul-services-ui.html?service=' + encodeURIComponent(serviceName) + '&node_filter=^' + encodeURIComponent(node['Node']['Name'])+'$');
246
+ service.appendChild(document.createTextNode(serviceName));
227
247
  var servicePort = instanceServices[serviceKey]['Service']['Port'];
228
- service.setAttribute('class', 'btn btn-sm m-1 lookup');
229
- service.setAttribute('target', '_blank');
230
- nodeAddr = instanceServices[serviceKey]['Service']['Address'];
231
- service.setAttribute('href', 'http://' + nodeAddr + ':' + servicePort);
232
- service.classList.add('btn-outline-' + toCSSClass(nodeState(instanceServices[serviceKey]['Checks'])))
233
- service.appendChild(document.createTextNode(serviceName + ':' + servicePort));
234
- services.appendChild(service);
248
+ if (servicePort) {
249
+ // Add unbreakable space
250
+ serviceGrp.appendChild(document.createTextNode('\u00A0'));
251
+ const servicePortElem = document.createElement('a');
252
+ servicePortElem.setAttribute('class', 'serviceTargetPort');
253
+ const nodeAddr = instanceServices[serviceKey]['Service']['Address'];
254
+ servicePortElem.setAttribute('href', 'http://' + nodeAddr + ':' + servicePort);
255
+ servicePortElem.appendChild(document.createTextNode(':' + servicePort));
256
+ serviceGrp.appendChild(servicePortElem);
257
+ }
258
+ services.appendChild(serviceGrp);
235
259
  }
236
- return services;
260
+ servicesTop.appendChild(servicesCard);
261
+ return servicesTop;
237
262
  }
238
263
 
239
264
  function checksStatusGenerator(instance, prefix) {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: consul-templaterb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.27.1
4
+ version: 1.27.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - SRE Core Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-28 00:00:00.000000000 Z
11
+ date: 2020-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: em-http-request