consul-templaterb 1.26.2 → 1.26.3

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: fc35b5803af2e05001323f77e18be90ec85baa05dd621030a83127cf1b5fd9f1
4
- data.tar.gz: f7d3e25054dcd6c1b022e5c4bf58ea902c5c95676aafa936512659eaec3de9a1
3
+ metadata.gz: eca26ee1958aac8a862d3c1c96b35446ac7a7775f3209095f64d8cd01200fee9
4
+ data.tar.gz: 15292c1651add5460162cf629814c37aeb9c965daaae0a5bfcb9a083e0c40758
5
5
  SHA512:
6
- metadata.gz: e1e053e41716e64177917ef8a3ef1360ba82995758bb7dacfafd3bc7fb7a8f5774f107c62cbb7c4340189ea59cab15db936fc27854f6fab1ba487466ad0add3f
7
- data.tar.gz: 95c0584f456239478395ceb0d2678e2ec1c7165f2148371f272ab23780148ed6498f419bc8104933d14cd155fcf20403c2b66521e604a3d2f4232bb8373f69c2
6
+ metadata.gz: a7e04120d50851589cb0e90e45327768b81c2c9954634ca7b1d80d51b88de5e6186402c4f3be0bbc7a67ef220c8950c4117730bf50abaf2c080c5cd3e007d18b
7
+ data.tar.gz: 9b434745e5e8fb44c955350d38c68a469dc08b249b331800c38e112952757f85713e7ee2e924a3bd62883115443467329774177b98a0193badce3f2dfbb9a4d1
@@ -4,6 +4,12 @@
4
4
 
5
5
  NEW FEATURES:
6
6
 
7
+ ## 1.26.3 (April 15, 2020)
8
+
9
+ BUGFIX:
10
+
11
+ * Removed all Criteo specific decorators from Consul-UI
12
+
7
13
  ## 1.26.2 (April 15, 2020)
8
14
 
9
15
  BUGFIX:
@@ -1,5 +1,5 @@
1
1
  module Consul
2
2
  module Async
3
- VERSION = '1.26.2'.freeze
3
+ VERSION = '1.26.3'.freeze
4
4
  end
5
5
  end
@@ -1,18 +1,5 @@
1
- // Utilities
1
+ // Use this file to configure custom decorators for your Consul-UI
2
2
  var httpRegexp = new RegExp('^http[s]?://[^ ]+$');
3
- var dc = "<%= ENV['CRITEO_DC'] || 'par'%>";
4
- var env = "<%= ENV['CRITEO_ENV'] || 'preprod'%>";
5
-
6
- var availability_url = 'https://grafana.crto.in/d/xFX5gCnWz/service-availability?var-datacenter=' + dc + '&var-service=';
7
- if (env == 'preprod') {
8
- availability_url = 'https://grafana.preprod.crto.in/d/E0ANGjnZz/service-availability?var-datacenter=' + dc + '&var-service=';
9
- }
10
- var swagger_url = 'https://swaggercatalogapp.' + dc + '.' + env + '.crto.in/explore/swagger?key=';
11
- var slack_url = 'https://criteo.slack.com/app_redirect?channel=';
12
-
13
- var rackguru_url = 'https://rackguru.' + env + '.crto.in/serial/';
14
-
15
- var asapi_url = 'https://idm.' + env + '.crto.in/tool/multiGroupInfo/'
16
3
 
17
4
  function url_decorator(key, value) {
18
5
  var e = document.createElement('a');
@@ -26,27 +13,7 @@ function usefullLinksGenerator(instance, serviceName, node_meta_info) {
26
13
  top.className = 'instance-links';
27
14
 
28
15
  var usefullLinks = [
29
- {
30
- title: "Trigger security scan",
31
- iconClassName: "fas fa-shield-alt",
32
- href: "https://security.crto.in/#/scan/?ip=" + instance.addr
33
- },
34
- {
35
- title: "Availability Graph",
36
- iconClassName: "fas fa-chart-area",
37
- href: availability_url + serviceName
38
- },
39
16
  ];
40
- if (node_meta_info!= null) {
41
- var serial = node_meta_info['serial_number'];
42
- if (serial != null) {
43
- usefullLinks.push({
44
- title: "RackGuru",
45
- iconClassName: "fas fa-server",
46
- href: rackguru_url + serial
47
- });
48
- }
49
- }
50
17
  var first = true;
51
18
  for (let usefullLink of usefullLinks) {
52
19
  link = document.createElement('a');
@@ -134,19 +101,6 @@ function groups_decorator(instance, key, value, serviceName) {
134
101
  return span;
135
102
  }
136
103
 
137
- /**
138
- * Decorates with a slack channel link
139
- */
140
- function slack_channel(instance, key, value, serviceName) {
141
- var sName = value;
142
- if (sName.startsWith('#')) {
143
- sName = sName.substring(1);
144
- }
145
- return build_link(slack_url + encodeURIComponent(sName), '#'+ sName);
146
- }
147
-
148
- const start_regexp = /(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})Z/
149
-
150
104
  function decorateIsoDate(value, formated) {
151
105
  const parsed = Date.parse(formated);
152
106
  if (isNaN(parsed)) {
@@ -163,55 +117,6 @@ function decorateIsoDate(value, formated) {
163
117
  // This is the list of function called
164
118
  // When a service meta is found
165
119
  var registered_decorators = {
166
- alert_availability_slack_channel: slack_channel,
167
- gerrit_repository: function(instance, key, value, serviceName) {
168
- return build_link('https://review.crto.in/#/q/' + value, value);
169
- },
170
- version: function(instance, key, value, serviceName) {
171
- var asInt = parseInt(value);
172
- if (asInt < 10000) {
173
- return document.createTextNode(value);
174
- }
175
- if (instance.sMeta['CRITEO_APP_POOL'] != null) {
176
- return build_link("https://devtools.crto.in/log.html?moab=cs&im=nb-to&range=100%2C" + asInt, value);
177
- } else {
178
- var tUrl = "https://devtools.crto.in/log.html?moab=j&im=nb-to&range=100%2C" + asInt;
179
- if (instance.sMeta['jvm_artifact'] != null) {
180
- tUrl += '&with-dependencies=true&artifacts=' + encodeURIComponent(instance.sMeta['jvm_artifact']);
181
- }
182
- return build_link(tUrl, value);
183
- }
184
- },
185
- MESOS_TERM_DEBUG_GRANTED_TO: groups_decorator,
186
- OWNERS: groups_decorator,
187
- marathon_app_id: function(instance, key, value, serviceName) {
188
- var app_name = value;
189
- if (app_name[0] != '/') {
190
- app_name = '/' + app_name;
191
- }
192
- if (instance.sMeta && instance.sMeta['marathon_ui']) {
193
- return build_link(instance.sMeta['marathon_ui'] + '/#/apps/' + encodeURIComponent(app_name), value);
194
- } else {
195
- // non decorated value
196
- return document.createTextNode(value);
197
- }
198
- },
199
- marathon_app_version: function(instance, key, value, serviceName) {
200
- return decorateIsoDate(value, value);
201
- },
202
- slack_channel: slack_channel,
203
- start: function(instance, key, value, serviceName) {
204
- const reg = start_regexp.exec(value);
205
- if (reg != null) {
206
- var formated = reg[1] + '-' + reg[2] + '-' + reg[3] + 'T' + reg[4] + ':' + reg[5] + ':' + reg[6] + 'Z';
207
- return decorateIsoDate(value, formated);
208
- } else {
209
- return document.createTextNode(value);
210
- }
211
- },
212
- swagger_key: function(instance, key, value, serviceName) {
213
- return build_link(swagger_url + encodeURIComponent(value), value);
214
- },
215
120
  }
216
121
 
217
122
  function service_meta_semantics_decorator(instance, key, value, serviceName) {
@@ -286,85 +191,11 @@ function nodeMetaGenerator(nodeMetaTags, serviceMetaIfAny) {
286
191
  * it does not have to return anything.
287
192
  */
288
193
  function navBarDecorator(navbar) {
289
- if (typeof consulManager === 'undefined') {
290
- // Timepicker is not supported on this page
291
- return;
292
- }
293
- var timepicker_container = document.createElement('div');
294
- timepicker_container.innerHTML = `
295
- <div class="row">
296
- <button type="button" disabled class="btn btn-secondary" data-toggle="tooltip" data-html="true" title="Data returned is the closest available to request" id="currently-displayed-data-date">
297
- Pick a date to see data from the past
298
- </button>
299
- <div class="col-sm-14">
300
- <div class="form-group">
301
- <div class="input-group date" id="datetimepicker1" data-target-input="nearest">
302
- <input type="text" class="form-control datetimepicker-input" data-target="#datetimepicker1"/>
303
- <div class="input-group-append" data-target="#datetimepicker1" data-toggle="datetimepicker">
304
- <div class="input-group-text"><i class="fa fa-calendar"></i></div>
305
- </div>
306
- </div>
307
- </div>
308
- </div>
309
- </div>
310
- `;
311
-
312
- navbar.appendChild(timepicker_container);
313
- var script= document.createElement('script');
314
- script.type='text/javascript';
315
- // TODO(g.seux): extract code to another file and set "source" on script element
316
- script.innerHTML = `
317
- $('#datetimepicker1').datetimepicker({
318
- format: 'DD/MM/YYYY HH:mm:ss Z', // default format does not allow to select seconds
319
- sideBySide: true, // display date+time on the same widget
320
- useCurrent: true // by default, select current date
321
- });
322
- $("#datetimepicker1").on("change.datetimepicker", function (e) {
323
- console.log("Will fetch data from date " + e.date);
324
- console.log("will clean existing data");
325
- consulManager.clean().then(function(result) {
326
- switch(consulManager.constructor.name) {
327
- case "ConsulServiceManager":
328
- backup_type = 'consul_services';
329
- break;
330
- case "ConsulKeysManager":
331
- backup_type = 'consul_keys'
332
- break;
333
- case "ConsulNodesManager":
334
- backup_type = 'consul_nodes'
335
- break;
336
- default:
337
- console.log("Unknown " + consulManager.constructor.name + " type");
338
- }
339
- if (e.date) {
340
- console.log("Will replace data by closest snapshot to " + e.date);
341
- var target_url = "https://consul-info-timeline-history.<%= ENV['CRITEO_DC'] %>.<%= ENV['CRITEO_ENV']%>.crto.in/backup/" + backup_type + "/" + e.date / 1000;
342
- } else {
343
- console.log("Will restore to local version");
344
- var target_url = defaultConsulManager.resourceURL;
345
- }
346
- if (typeof(defaultConsulManager) == 'undefined') {
347
- // store first manager to be able to restore it
348
- defaultConsulManager = consulManager
349
- }
350
- consulManager = new consulManager.constructor(target_url);
351
- });
352
- });
353
- `;
354
- navbar.appendChild(script);
355
194
  }
356
195
 
357
-
358
196
  /**
359
197
  * fetchedResponseDecorator is called with http response when a resource is fetched by any instance of ConsulUIManager
360
198
  * it does not have to return anything.
361
199
  */
362
200
  async function fetchedResponseDecorator(httpResponse) {
363
- const data_date = await httpResponse.headers.get('X-Consul-Snapshot-Timestamp');
364
- current_date_display = $('#currently-displayed-data-date');
365
- if (data_date > 0) {
366
- current_date_display.html("Data is a snapshot from: " + moment.unix(data_date).format('DD/MM/YYYY HH:mm:ss Z'));
367
- } else {
368
- current_date_display.html("Pick a date to see data from the past");
369
- }
370
- }
201
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: consul-templaterb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.26.2
4
+ version: 1.26.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - SRE Core Services