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 +4 -4
- data/CHANGELOG.md +7 -1
- data/lib/consul/async/version.rb +1 -1
- data/samples/consul-ui/css/style.css +4 -0
- data/samples/consul-ui/js/nodes.js +1 -1
- data/samples/consul-ui/js/utils.js +45 -20
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a67e2df58bcd5c322789984815ff60bd95e50fc047cb20c929a67ca29c07f553
|
4
|
+
data.tar.gz: c4df4357ae2852ad487eb90336a0d2d7d380767d51d05e02e7b452d29acda9c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 723beb9fca614d1675e50cc1516f37c4aad93815a1725abcdecb33c8bf0aa5e399449f8c3826a14eac8705aa8cb354aa1034796cf68b46304624f958c1b2ba90
|
7
|
+
data.tar.gz: 379cb1ca86d8edc44c68694f70b6bd7c1373b8b707f26bef3459379554f94fa12f27653354dc52647eadbd2cf5b0df7cec7f01bcb457e7ed159b7396709ce00d
|
data/CHANGELOG.md
CHANGED
data/lib/consul/async/version.rb
CHANGED
@@ -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
|
221
|
-
|
222
|
-
|
223
|
-
|
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
|
-
|
226
|
-
|
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
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
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
|
-
|
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.
|
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-
|
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
|