consul-templaterb 1.15.0 → 1.15.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 +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/consul/async/consul_template.rb +3 -2
- data/lib/consul/async/version.rb +1 -1
- data/samples/consul-ui/js/service.js +63 -62
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b78e19b82cfe21d36bd7985cfb3676bf6eb4adf
|
4
|
+
data.tar.gz: 03fc0513a55921094d962be1f6ec9ae730058244
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9991598e1ca634be45e4239b5a279e37dce68413d293a64d68d7b028e103ff0a68895721e92c96adb742bdf623c2184b83fbd2852f44bffb0934fd198be562c2
|
7
|
+
data.tar.gz: c4f9c73248c2c3fcfe170f5dd2a183585400a2ac2bf6f8ee4bdf57a9b5dfcd42d5059eba20af88fbf682706aced1d3fd284da1441f1f6b6d422669665ae63549
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,15 @@
|
|
2
2
|
|
3
3
|
## (UNRELEASED)
|
4
4
|
|
5
|
+
## 1.15.1 (May 14, 2019)
|
6
|
+
|
7
|
+
IMPROVEMENTS
|
8
|
+
|
9
|
+
Will converge faster if some templates are not always requesting the same paths.
|
10
|
+
Intead of relying on key being garbage collected, we now rely whether the key is
|
11
|
+
available within the current rendering only.
|
12
|
+
It avoid templates never rendering fully when keys appear/disappear.
|
13
|
+
|
5
14
|
## 1.15.0 (May 14, 2019)
|
6
15
|
|
7
16
|
NEW FEATURES
|
@@ -209,16 +209,17 @@ module Consul
|
|
209
209
|
end
|
210
210
|
|
211
211
|
def write(file, tpl, last_result, tpl_file_path, params = {}, current_template_info: {})
|
212
|
+
@iteration = Time.now.utc - @start_time
|
212
213
|
data = render(tpl, tpl_file_path, params, current_template_info: current_template_info)
|
213
214
|
not_ready = []
|
214
215
|
ready = 0
|
215
|
-
@iteration = Time.now.utc - @start_time
|
216
216
|
to_cleanup = []
|
217
217
|
@endpoints.each_pair do |endpoint_key, endpt|
|
218
218
|
if endpt.ready?
|
219
219
|
ready += 1
|
220
220
|
else
|
221
|
-
|
221
|
+
# We consider only the endpoints usefull with current iteration
|
222
|
+
not_ready << endpoint_key unless endpt.seen_at < @iteration
|
222
223
|
end
|
223
224
|
to_cleanup << endpoint_key if (@iteration - endpt.seen_at) > 60
|
224
225
|
end
|
data/lib/consul/async/version.rb
CHANGED
@@ -79,84 +79,85 @@ class ConsulService {
|
|
79
79
|
}
|
80
80
|
|
81
81
|
reloadServiceList() {
|
82
|
-
if (!this.data || !this.data.services) {
|
83
|
-
console.log("No data to display");
|
84
|
-
}
|
85
82
|
this.serviceList.html('');
|
86
83
|
this.serviceFilterCount = 0;
|
87
84
|
|
88
85
|
let idx = 0;
|
89
86
|
let lastFav = null;
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
statuses.
|
107
|
-
|
108
|
-
|
87
|
+
if (!this.data || !this.data.services) {
|
88
|
+
console.log("No data to display");
|
89
|
+
} else {
|
90
|
+
for (var serviceName in this.data.services) {
|
91
|
+
var service = this.data.services[serviceName];
|
92
|
+
var serviceStatus = buildServiceStatus(service);
|
93
|
+
|
94
|
+
var listItem = document.createElement('li');
|
95
|
+
listItem.setAttribute('onfocus','consulService.onClickServiceName(this)');
|
96
|
+
listItem.setAttribute('onclick','consulService.onClickServiceName(this)');
|
97
|
+
listItem.setAttribute('value',serviceName);
|
98
|
+
listItem.setAttribute('data-fav', this.favorites[serviceName] ? 1 : 0);
|
99
|
+
listItem.setAttribute('data-index', idx);
|
100
|
+
var listItemClass = 'serviceListItem list-group-item list-group-item-action';
|
101
|
+
|
102
|
+
var statuses = document.createElement('div');
|
103
|
+
statuses.setAttribute('class','statuses float-right');
|
104
|
+
|
105
|
+
if (!!serviceStatus['passing']) {
|
106
|
+
statuses.appendChild(createBadge('badge-success passing', serviceStatus['passing']));
|
107
|
+
listItem.setAttribute('status', 'passing');
|
108
|
+
}
|
109
109
|
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
110
|
+
if (!!serviceStatus['warning']) {
|
111
|
+
statuses.appendChild(createBadge('badge-warning warning', serviceStatus['warning']));
|
112
|
+
listItem.setAttribute('status', 'warning');
|
113
|
+
}
|
114
114
|
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
115
|
+
if (!!serviceStatus['critical']) {
|
116
|
+
statuses.appendChild(createBadge('badge-danger critical', serviceStatus['critical']));
|
117
|
+
listItem.setAttribute('status', 'critical');
|
118
|
+
}
|
119
119
|
|
120
|
-
|
120
|
+
statuses.appendChild(createBadge('badge-dark', (serviceStatus['total'] || 0)));
|
121
121
|
|
122
|
-
|
122
|
+
statuses.append(this.buildFavButton(serviceName));
|
123
123
|
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
124
|
+
listItem.appendChild(statuses);
|
125
|
+
if (!!service['kind']) {
|
126
|
+
var kind = document.createElement('div');
|
127
|
+
kind.setAttribute('class','kind float-right');
|
128
|
+
kind.appendChild(createBadge('badge-info kind', service['kind']));
|
129
|
+
listItem.appendChild(kind);
|
130
|
+
listItemClass+= " kind-" + service['kind'];
|
131
|
+
}
|
132
|
+
listItem.setAttribute('class', listItemClass);
|
133
133
|
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
134
|
+
var serviceNameItem = document.createElement('div');
|
135
|
+
serviceNameItem.setAttribute('class', 'service-name');
|
136
|
+
serviceNameItem.appendChild(document.createTextNode(serviceName));
|
137
|
+
listItem.appendChild(serviceNameItem);
|
138
138
|
|
139
|
-
|
140
|
-
|
139
|
+
var serviceTagsItem = document.createElement('div');
|
140
|
+
serviceTagsItem.setAttribute('class', 'service-tags');
|
141
141
|
|
142
|
-
|
143
|
-
|
144
|
-
|
142
|
+
for (var i = 0; i < service.tags.length; i++) {
|
143
|
+
serviceTagsItem.appendChild(createBadge('float-right badge-' + (i%2?'secondary':'info') , service.tags[i]));
|
144
|
+
}
|
145
145
|
|
146
|
-
|
147
|
-
|
146
|
+
listItem.appendChild(serviceTagsItem);
|
147
|
+
this.serviceFilterCount += 1;
|
148
148
|
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
149
|
+
if (this.favorites[serviceName] && lastFav) {
|
150
|
+
lastFav.after(listItem);
|
151
|
+
lastFav = listItem;
|
152
|
+
} else if (this.favorites[serviceName] && !lastFav) {
|
153
|
+
this.serviceList.prepend(listItem);
|
154
|
+
lastFav = listItem;
|
155
|
+
} else {
|
156
|
+
this.serviceList.append(listItem);
|
157
|
+
}
|
158
158
|
|
159
|
-
|
159
|
+
idx++;
|
160
|
+
}
|
160
161
|
}
|
161
162
|
this.serviceFilterCounter.html(this.serviceFilterCount);
|
162
163
|
resizeWrapper('service-wrapper', 'service-list');
|
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.15.
|
4
|
+
version: 1.15.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: 2019-05-
|
11
|
+
date: 2019-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: em-http-request
|