consul-templaterb 1.1.2 → 1.1.3

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: feb7928f78cdbbfae6a96b7b6150c569addb523d94db80024c4493989cf1df4c
4
- data.tar.gz: 93be5f37da47ebfefdfe40e836e28d0f5f440a5481da2db38c708c245d64769a
3
+ metadata.gz: de191ca431027f8633f4e50b3fe479ca6a4db001ce40b1d28460498d9d9a9987
4
+ data.tar.gz: 0a996fa6e6c69e108ea0c5adb335954496d57b3755fd68e5a95c025f9370147c
5
5
  SHA512:
6
- metadata.gz: d475a88889816f29899ec899c13614af8841bc984fb86ff864f6a6a8f9d50f31507244b2954a7e2c374b40d75412c39a90b218b9d11355e9af51d0258ea7975d
7
- data.tar.gz: 0f52de542d465e7a962a81025c226111df1725f4bafdc53f591827607a08bc5345e8160e2b791517135b2fbaad27b23309c71acb91ac406cb480fa8c3ab9d8df
6
+ metadata.gz: 9b2f17384a48bc613a3e8a9088c4e68035e49a6ba0d25881cf1b1653d123c3e73ff8bbf45abbae877079a4d0b8333f69abab0dd003ef4162490125bebef17362
7
+ data.tar.gz: d8223b6902df1790ab897631d95ec5556c0cda6fa0b2168865ed0ad461d255ee0168b84531a39a24405bf5af36be3d2cef3a197d003e52a4238347fba2fe4b23
data/.gitignore CHANGED
@@ -15,6 +15,7 @@
15
15
  /samples/*.cfg
16
16
  samples/consul-ui/*.html
17
17
  samples/consul-ui/*.json
18
+ samples/consul-ui/common/*.html
18
19
  /samples/criteo/haproxy.cfg
19
20
  /samples/consul_template
20
21
  /samples/find_blocked_choregraphies
data/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@
4
4
 
5
5
  IMPROVEMENTS:
6
6
 
7
+ ## 1.1.3 (May 17, 2018)
8
+
9
+ IMPROVEMENTS:
10
+
11
+ * Cleaner consul-ui with ability to filterr using tags and statuses
12
+
7
13
  ## 1.1.2 (May 17, 2018)
8
14
 
9
15
  IMPROVEMENTS:
@@ -1,5 +1,5 @@
1
1
  module Consul
2
2
  module Async
3
- VERSION = '1.1.2'.freeze
3
+ VERSION = '1.1.3'.freeze
4
4
  end
5
5
  end
@@ -21,6 +21,9 @@
21
21
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
22
22
  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.11/css/all.css" integrity="sha384-p2jx59pefphTFIpeqCcISO9MdVfIm4pNnsL08A6v5vaQc4owkQqxMV8kg4Yvhaw/" crossorigin="anonymous">
23
23
  <link rel="stylesheet" href="css/style.css">
24
+ <style id="css-states">
25
+ .service-tags { display: none; }
26
+ </style>
24
27
  </head>
25
28
  <body>
26
29
  <nav class="navbar navbar-expand-md navbar-dark bg-secondary">
@@ -1,13 +1,17 @@
1
1
  <% datasource = ENV['SERVICE_DATASOURCE'] || 'consul-template.json'
2
2
  # Time to wait before reloading configuration again in seconds (0 = never)
3
- refresh = ENV['REFRESH'] || '600' %>
4
-
5
- <%= render_file('common/header.html.erb', title: 'Services') %>
3
+ refresh = ENV['REFRESH'] || '600' %><%= render_file('common/header.html.erb', title: 'Services') %>
6
4
  <div class="main">
7
5
  <div class="row mx-0">
8
6
  <div id="filter-menu" class="col-4 col-m-3 px-4 pt-4">
9
7
  <div class="form-group">
10
- <input id="service-filter" type="text" placeholder="filter by name or tags" class="form-control" >
8
+ <div class="form-check">
9
+ <label class="form-check-label">
10
+ <input id="showTagsInList" type="checkbox" title="show tags" onclick="consulService.showTags(this.checked)" class="form-check-input" />
11
+ Show Tags
12
+ </label>
13
+ </div>
14
+ <input id="service-filter" type="text" placeholder="filter by name or tags" class="form-control" />
11
15
  </div>
12
16
  <div id="service-wrapper" >
13
17
  <ul id="service-list" class="list-group">
@@ -12,11 +12,6 @@
12
12
  border-color: rgba(0,0,0,.125);
13
13
  }
14
14
 
15
- .service-tags {
16
- overflow: scroll;
17
- max-height: 2.2em !important;
18
- }
19
-
20
15
  .service-tags .badge {
21
16
  max-width: 8em;
22
17
  text-overflow: ellipsis;
@@ -7,6 +7,12 @@ class ConsulService {
7
7
  this.serviceFilter.keyup(this.filterService);
8
8
  this.refresh = parseInt(refresh);
9
9
  this.filterStatus = null;
10
+ this.showTags($('#showTagsInList').checked)
11
+ }
12
+
13
+ showTags(showTags) {
14
+ var stylesheet = document.getElementById('css-states');
15
+ stylesheet.textContent = '.service-tags { display: ' + (showTags? 'block':'none') + ';}';
10
16
  }
11
17
 
12
18
  fetchRessource() {
@@ -46,22 +52,17 @@ class ConsulService {
46
52
  var serviceStatus = buildServiceStatus(service);
47
53
  var listItem = '<button type="button" onfocus="consulService.onClickServiceName(this)" onclick="consulService.onClickServiceName(this)" value="' + serviceName + '" class="list-group-item list-group-item-action">';
48
54
  listItem += '<div class="statuses" style="float:right">'
49
- var globalStatus = 'dark'
50
55
  if (!!serviceStatus['passing']) {
51
- listItem += '<span class="badge badge-pill badge-success" style="margin-right:10px;">' + serviceStatus['passing'] + '</span>';
56
+ listItem += '<span class="badge badge-pill badge-success passing" style="margin-right:10px;">' + serviceStatus['passing'] + '</span>';
52
57
  }
53
58
  if (!!serviceStatus['warning']) {
54
- listItem += '<span class="badge badge-pill badge-warning" style="margin-right:10px;">' + serviceStatus['warning'] + '</span>';
55
- if (globalStatus == 'dark') {
56
- globalStatus = 'warning'
57
- }
59
+ listItem += '<span class="badge badge-pill badge-warning warning" style="margin-right:10px;">' + serviceStatus['warning'] + '</span>';
58
60
  }
59
61
  if (!!serviceStatus['critical']) {
60
- listItem += '<span class="badge badge-pill badge-danger" style="margin-right:10px;">' + serviceStatus['critical'] + '</span>';
61
- globalStatus = 'critical'
62
+ listItem += '<span class="badge badge-pill badge-danger critical" style="margin-right:10px;">' + serviceStatus['critical'] + '</span>';
62
63
  }
63
64
  listItem+= ' / <span class="badge badge-pill badge-dark">' + (serviceStatus['total'] || 0) + '</span></div>';
64
- listItem += '<div class="service-name text-' + globalStatus + '">' + serviceName + '</div>';
65
+ listItem += '<div class="service-name">' + serviceName + '</div>';
65
66
  listItem += '<div class="service-tags">'
66
67
  for (var i = 0; i < service.tags.length; i++) {
67
68
  listItem += '<span title="' + service.tags[i] + '" class="badge badge-pill badge-' + (i%2?'secondary':'info') + '" style="float:right;">' + (service.tags[i]) + '</span> ';
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.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - SRE Core Services