consul-templaterb 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 875f33bec50159a51a9fb9e59b07fbe37a78a0587cb3a496cc42a1806b5c8c9d
4
- data.tar.gz: 08f091608892658b875d716c6935c9fe24f19b72b0c37dcde07eee4bcbdea838
3
+ metadata.gz: 481677a9cb87417e3667a7a282186ad05e0580521a96b68f8c22370371e20abc
4
+ data.tar.gz: b70a75f66188749d2b0a0a38a51dcc8629b8fbc6554165b4241802a47864db40
5
5
  SHA512:
6
- metadata.gz: 481afae4f8b4df204897584ebc0ad4559c54ea5cbdd4a693977c33a573acc67e3e726df8b55a6ed3d2506b01c82f3092d98d27208e0de51c1c2367df01447cb3
7
- data.tar.gz: 361f0786469ff9c305f047824b42a8c801109ffe6c7283e0a4325c2f89c3d8dcfa989b3a52bbef982e8cc78bbad17505b2c5c2b57223b67ba0343c0c9722143a
6
+ metadata.gz: 3aeffc5f5fd88c284f8deeaa9b178151761a9b7e49bb79d1f352e2cd2d221b9cdb4011611009c0a24930afe190f285d25d9fc227384c33151cee8c29904fa578
7
+ data.tar.gz: d1831577b1359473dc0fb07702f438729c6e312c0bd29cf7f4fdcac369f896f9462ac9a7147324cf648a526615d491c219334f2bc0c1a8f52f9b3529e4e9bab1
data/CHANGELOG.md CHANGED
@@ -2,15 +2,19 @@
2
2
 
3
3
  ## (UNRELEASED)
4
4
 
5
+ ## 1.3.1 (June 19, 2018)
6
+
7
+ * samples/consul-ui/ now displays Service Meta information (new in Consul 1.1)
8
+
5
9
  ## 1.3.0 (June 7, 2018)
6
10
 
7
11
  IMPROVEMENTS:
8
12
 
9
- * samples/consul-ui/ now supports keys as well as nodes thans to [@geobeau](https://github.com/geobeau)
13
+ * samples/consul-ui/ now supports keys as well as nodes thanks to [@geobeau](https://github.com/geobeau)
10
14
 
11
15
  NEW FEATURES
12
16
 
13
- * EXPERIMENTAL Vault support thanks to [@uepock](https://github.com/uepoch)
17
+ * EXPERIMENTAL Vault support thanks to [@uepoch](https://github.com/uepoch)
14
18
 
15
19
  BUG FIXES:
16
20
 
@@ -1,5 +1,5 @@
1
1
  module Consul
2
2
  module Async
3
- VERSION = '1.3.0'.freeze
3
+ VERSION = '1.3.1'.freeze
4
4
  end
5
5
  end
@@ -69,14 +69,17 @@ class ConsulService {
69
69
 
70
70
  if (!!serviceStatus['passing']) {
71
71
  statuses.appendChild(createBadge('badge-success passing', serviceStatus['passing']));
72
+ listItem.setAttribute('status', 'passing');
72
73
  }
73
74
 
74
75
  if (!!serviceStatus['warning']) {
75
76
  statuses.appendChild(createBadge('badge-warning warning', serviceStatus['warning']));
77
+ listItem.setAttribute('status', 'warning');
76
78
  }
77
79
 
78
80
  if (!!serviceStatus['critical']) {
79
81
  statuses.appendChild(createBadge('badge-danger critical', serviceStatus['critical']));
82
+ listItem.setAttribute('status', 'critical');
80
83
  }
81
84
 
82
85
  statuses.appendChild(createBadge('badge-dark', (serviceStatus['total'] || 0)));
@@ -186,6 +189,7 @@ class ConsulService {
186
189
 
187
190
  serviceHtml.appendChild(serviceTitleGenerator(instance));
188
191
  serviceHtml.appendChild(tagsGenerator(instance.tags));
192
+ serviceHtml.appendChild(serviceMetaGenerator(instance.sMeta));
189
193
  serviceHtml.appendChild(checksStatusGenerator(instance.checks));
190
194
  var state = nodeState(instance.checks);
191
195
  serviceHtml.setAttribute('status', state);
@@ -104,6 +104,27 @@ function tagsGenerator(instanceTags) {
104
104
  return tags;
105
105
  }
106
106
 
107
+ function serviceMetaGenerator(instanceMeta) {
108
+ var top = document.createElement('div');
109
+ top.className = 'instance-meta';
110
+ if (instanceMeta) {
111
+ var container = document.createElement('dl');
112
+ top.appendChild(container);
113
+ container.className = 'row';
114
+ for (var meta in instanceMeta) {
115
+ var metaH = document.createElement('dt');
116
+ metaH.className = 'col-sm-4';
117
+ metaH.appendChild(document.createTextNode(meta));
118
+ container.appendChild(metaH);
119
+ var metaVH = document.createElement('dd');
120
+ metaVH.className = 'col-sm-8';
121
+ metaVH.appendChild(document.createTextNode(instanceMeta[meta]));
122
+ container.appendChild(metaVH);
123
+ }
124
+ }
125
+ return top;
126
+ }
127
+
107
128
  function servicesGenerator(instanceServices) {
108
129
  var services = document.createElement('div');
109
130
  services.className = 'instance-services';
@@ -238,6 +259,12 @@ function serviceMatcher(service, regex) {
238
259
  return true;
239
260
  }
240
261
  }
262
+
263
+ var sstatus = service.getAttribute('status')
264
+ if(sstatus && sstatus.match(regex)) {
265
+ return true;
266
+ }
267
+
241
268
  return false;
242
269
  }
243
270
 
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.3.0
4
+ version: 1.3.1
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: 2018-06-07 00:00:00.000000000 Z
11
+ date: 2018-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: em-http-request
@@ -171,7 +171,6 @@ files:
171
171
  - lib/consul/async/utilities.rb
172
172
  - lib/consul/async/vault_endpoint.rb
173
173
  - lib/consul/async/version.rb
174
- - null/ruby-type-inference/ruby-type-inference.mv.db
175
174
  - samples/checks.html.erb
176
175
  - samples/common/footer.html.erb
177
176
  - samples/common/header.html.erb