consul-templaterb 1.2.0 → 1.2.1

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: 74b7cce156473c1c3cba5d028f352aef6a9463fc24b328f51585cd80c2b42e0d
4
- data.tar.gz: 6fb08ec94eddac3b5e051359039ce1ec0a87593ecb32a91ab8b3b38fbf5f687f
3
+ metadata.gz: 9ecbf300312175e355f65232450dc9303db8bbb1d2d2af473480a2fde3997112
4
+ data.tar.gz: 08abe3b2ef2e812810e88d29db8a44c1191af395a3e5b94c91a9d2a54b0c5906
5
5
  SHA512:
6
- metadata.gz: 8a0ce21b647df4eaf71b3d1a6b5c791213cc5b9e0e224719aa27c49522e8a462f1a2ebfdc714af9ebd5d0d134d30662d1893c9dd7dd109a4fb1cabbde630a039
7
- data.tar.gz: cad4a025f9df51b3f4544efd1a560d64b226f334056e5015e4aea5c9b38eb87d9a1265a5a755dacd1f902a338ef27a3441b472e68d672da29ea641b0ad81c2ee
6
+ metadata.gz: 8042decc8b615eff3080f06330347f6596f7fbdb5b8e732eaf9afc00b79a7b2ddffb161d3c9c63d986f7eed2d54a467cca0d39d9ee247af65edad71453fcbaf5
7
+ data.tar.gz: b88e62b6884d6dfc3e0dad669943124e6ec0c28af3da482c6a9614f2b23325bd9d57fe9afeb0ebd08c57808a62003ab3a4dd4cb4da1b008043ec865bf49e054f
data/.gitignore CHANGED
@@ -27,3 +27,12 @@ samples/consul-ui/common/*.html
27
27
  .rspec_status
28
28
  # Mac OS
29
29
  .DS_Store
30
+
31
+ # IntelliJ project files
32
+ *.iml
33
+ *.iws
34
+ *.ipr
35
+ .idea/
36
+
37
+ # Misc
38
+ *.swp
data/CHANGELOG.md CHANGED
@@ -4,7 +4,18 @@
4
4
 
5
5
  IMPROVEMENTS:
6
6
 
7
- ## 1.2.0 (May 17, 2018)
7
+ ## 1.2.1 (May 28, 2018)
8
+
9
+ BUG FIXES:
10
+
11
+ * cache for service was not properly taken into account
12
+
13
+ IMPROVEMENTS:
14
+
15
+ * consul-ui now shows the number of service filetered
16
+ * service.Meta is an object not an array when null (Consul < 1.1)
17
+
18
+ ## 1.2.0 (May 25, 2018)
8
19
 
9
20
  IMPROVEMENTS:
10
21
 
@@ -296,6 +296,7 @@ module Consul
296
296
  new_res << ServiceInstance.new(v)
297
297
  end
298
298
  @cached_result = new_res
299
+ @cached_json = result.json
299
300
  new_res
300
301
  end
301
302
  end
@@ -1,5 +1,5 @@
1
1
  module Consul
2
2
  module Async
3
- VERSION = '1.2.0'.freeze
3
+ VERSION = '1.2.1'.freeze
4
4
  end
5
5
  end
@@ -11,7 +11,12 @@
11
11
  Show Tags
12
12
  </label>
13
13
  </div>
14
+ <div class="input-group">
14
15
  <input id="service-filter" type="text" placeholder="filter by name or tags" class="form-control" />
16
+ <div class="input-group-append">
17
+ <span class="input-group-text" id="service-counter"></span>
18
+ </div>
19
+ </div>
15
20
  </div>
16
21
  <div id="service-wrapper" >
17
22
  <ul id="service-list" class="list-group">
@@ -81,7 +81,7 @@
81
81
  server = { frontend_id: "backend_http__#{service_name}",
82
82
  id: snode['Service']['ID'],
83
83
  name: snode['Node']['Node'],
84
- sMeta: meta ? meta : [],
84
+ sMeta: meta ? meta : {},
85
85
  addr: snode.service_address,
86
86
  port: snode['Service']['Port'],
87
87
  tags: snode['Service']['Tags'],
@@ -67,7 +67,7 @@ h2 .fas:hover {
67
67
  }
68
68
 
69
69
  .progress-status {
70
- transition: background-color .16s linear;
70
+ transition: background-color .16s linear, width .16s linear;
71
71
  cursor: pointer;
72
72
  }
73
73
 
@@ -7,6 +7,8 @@ class ConsulService {
7
7
  this.serviceFilter.keyup(this.filterService);
8
8
  this.refresh = parseInt(refresh);
9
9
  this.filterStatus = null;
10
+ this.serviceFilterCounter = $("#service-counter");
11
+ this.serviceFilterCount = 0;
10
12
  this.showTags($('#showTagsInList').checked)
11
13
  }
12
14
 
@@ -47,6 +49,8 @@ class ConsulService {
47
49
  }
48
50
 
49
51
  reloadServiceList() {
52
+ this.serviceList.html('');
53
+ this.serviceFilterCount = 0;
50
54
  for (var serviceName in this.data.services) {
51
55
  var service = this.data.services[serviceName];
52
56
  var serviceStatus = buildServiceStatus(service);
@@ -69,18 +73,24 @@ class ConsulService {
69
73
  }
70
74
  listItem += '</div>'
71
75
  listItem += '</button>';
76
+ this.serviceFilterCount += 1;
72
77
  this.serviceList.append(listItem);
73
78
  }
79
+ this.serviceFilterCounter.html(this.serviceFilterCount);
74
80
  resizeWrapper('service-wrapper', 'service-list');
81
+ this.filterService();
75
82
  }
76
83
 
77
- filterService(e) {
78
- var filter = new RegExp(e.target.value);
84
+ filterService() {
85
+ var filter = new RegExp(consulService.serviceFilter.val());
86
+ consulService.serviceFilterCount = 0;
79
87
  consulService.serviceList.children('button').each(function (){
80
88
  if($(this).html().match(filter)) {
81
89
  var ui = $(this).closest( "button" )
82
90
  ui.removeClass('d-none');
83
91
  ui.addClass('d-block');
92
+ consulService.serviceFilterCount += 1;
93
+ consulService.serviceFilterCounter.html(consulService.serviceFilterCount);
84
94
  } else {
85
95
  var ui = $(this).closest( "button" )
86
96
  ui.removeClass('d-block');
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.2.0
4
+ version: 1.2.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-05-25 00:00:00.000000000 Z
11
+ date: 2018-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: em-http-request