consul-templaterb 1.21.3 → 1.21.4

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: fbae8bd11b6dc743e577da583a6f47679c83fe9c1e5043ade563f90b044d5031
4
- data.tar.gz: d112258989cf088ed7fe488119e088d51e9bf6be91952835f2a3af274dadb1e4
3
+ metadata.gz: e21590daefa93a69c9c00cd3acc6ebf0444a1a84d6bd9f1504c76484b4b97f0a
4
+ data.tar.gz: 290cbbdd8d86978a93b0c698d75d1c4822b8a2b521e32d7f93df96caac756d31
5
5
  SHA512:
6
- metadata.gz: 1bc2a16ac0b6b933198db9bae94a3fd9e26b8045554b5de6c7dd06beb948f2036d1a069a3b12c61834e847dd48cb17d0698bb600b45cead5a6f7507c12e463e9
7
- data.tar.gz: 59858e0a22f2a93cb866cdc0ea90289ed2dc2d8345dc22b97898815f025497843637f3c650025227b08211244770c241c501fb5409b904bec4b37d12cd377f6d
6
+ metadata.gz: 41ceec7b88410c5533cc073ec65f396cd6cf44de4a0c373465d3ae2931f024b2e65c1b88673b83c976d80fca5c53a0e28201a752681f21673fb87bcfdba1dfa9
7
+ data.tar.gz: 256c721efaa834afcfde8d3d7aadd042a2b73dc1d4894f8d657fc02e4883cbbb0a0a6d12f8a8c5c082d7207b704dd5a8214546955ae8058c9fb9e0db02722d1c
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## (UNRELEASED)
4
4
 
5
+ ## 1.21.4 (November 28, 2019)
6
+
7
+ * added 2 decorators `navBarDecorator` and `fetchedResponseDecorator`
8
+
5
9
  ## 1.21.3 (November 23, 2019)
6
10
 
7
11
  * added serviceName information for all decorators of services
@@ -1,5 +1,5 @@
1
1
  module Consul
2
2
  module Async
3
- VERSION = '1.21.3'.freeze
3
+ VERSION = '1.21.4'.freeze
4
4
  end
5
5
  end
@@ -0,0 +1,5 @@
1
+ <script type="text/javascript">
2
+ $("#navbar").ready(function() { navBarDecorator($("#navbar")[0]) });
3
+ </script>
4
+ </body>
5
+ </html>
@@ -36,10 +36,14 @@
36
36
  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.11/css/all.css" integrity="sha384-p2jx59pefphTFIpeqCcISO9MdVfIm4pNnsL08A6v5vaQc4owkQqxMV8kg4Yvhaw/" crossorigin="anonymous">
37
37
  <link rel="stylesheet" href="css/style.css">
38
38
  <link rel="stylesheet" href="vendors/highlight/atom-one-dark.css">
39
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tempusdominus-bootstrap-4/5.0.0-alpha14/css/tempusdominus-bootstrap-4.min.css" />
39
40
  </head>
40
41
  <body>
42
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
43
+ <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script>
44
+ <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/tempusdominus-bootstrap-4/5.0.0-alpha14/js/tempusdominus-bootstrap-4.min.js"></script>
41
45
  <nav class="navbar navbar-expand-md navbar-dark bg-secondary">
42
- <div class="collapse navbar-collapse">
46
+ <div class="collapse navbar-collapse" id="navbar">
43
47
  <ul class="navbar-nav mr-auto">
44
48
  <li class="nav-item dropdown">
45
49
  <a class="navbar-brand dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
@@ -27,14 +27,13 @@
27
27
  </div>
28
28
  <!-- Optional JavaScript -->
29
29
  <!-- JavaScript Dependencies: jQuery, Popper.js, Bootstrap JS, Shards JS -->
30
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
31
30
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
32
31
  <script src="js/utils.js"></script>
33
32
  <script src="js/types.js"></script>
34
33
  <script src="js/keys.js"></script>
34
+ <script src="decorators.js"></script>
35
35
  <script src="vendors/highlight/highlight.pack.js"></script>
36
36
  <script type="text/javascript">
37
- consulKeysManager = new ConsulKeysManager('<%= datasource %>');
37
+ consulManager = new ConsulKeysManager('<%= datasource %>');
38
38
  </script>
39
- </body>
40
- </html>
39
+ <%= render_file('common/footer.html.erb') %>
@@ -30,13 +30,12 @@
30
30
  </div>
31
31
  <!-- Optional JavaScript -->
32
32
  <!-- JavaScript Dependencies: jQuery, Popper.js, Bootstrap JS, Shards JS -->
33
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
34
33
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
35
34
  <script src="js/utils.js"></script>
36
35
  <script src="js/types.js"></script>
37
36
  <script src="js/nodes.js"></script>
37
+ <script src="decorators.js"></script>
38
38
  <script type="text/javascript">
39
- consulNodesManager = new ConsulNodesManager('<%= datasource %>');
39
+ consulManager = new ConsulNodesManager('<%= datasource %>');
40
40
  </script>
41
- </body>
42
- </html>
41
+ <%= render_file('common/footer.html.erb') %>
@@ -17,6 +17,7 @@
17
17
  Show Connect Proxies
18
18
  </label>
19
19
  </div>
20
+
20
21
  <div class="input-group">
21
22
  <input id="service-filter" type="text" placeholder="filter services by name or tags" class="form-control" />
22
23
  <div class="input-group-append">
@@ -61,15 +62,13 @@
61
62
  </div>
62
63
  <!-- Optional JavaScript -->
63
64
  <!-- JavaScript Dependencies: jQuery, Popper.js, Bootstrap JS, Shards JS -->
64
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
65
65
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
66
- <script src="js/utils.js"></script>
67
66
  <script src="decorators.js"></script>
67
+ <script src="js/utils.js"></script>
68
68
  <script src="js/types.js"></script>
69
69
  <script src="js/service.js"></script>
70
70
  <script type="text/javascript">
71
- consulServiceManager = new ConsulServiceManager('<%= datasource %>');
71
+ consulManager = new ConsulServiceManager('<%= datasource %>');
72
72
  </script>
73
73
  <script src="vendors/highlight/highlight.pack.js"></script>
74
- </body>
75
- </html>
74
+ <%= render_file('common/footer.html.erb') %>
@@ -57,13 +57,12 @@
57
57
  </div>
58
58
  <!-- Optional JavaScript -->
59
59
  <!-- JavaScript Dependencies: jQuery, Popper.js, Bootstrap JS, Shards JS -->
60
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
61
60
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
62
61
  <script src="js/utils.js"></script>
63
62
  <script src="js/timeline.js"></script>
63
+ <script src="decorators.js"></script>
64
64
  <script type="text/javascript">
65
65
  serviceTimeline = new ServiceTimeline('<%= datasource %>','<%= refresh %>');
66
66
  </script>
67
67
  <script src="vendors/highlight/highlight.pack.js"></script>
68
- </body>
69
- </html>
68
+ <%= render_file('common/footer.html.erb') %>
@@ -29,3 +29,17 @@ function serviceMetaDecorator(instance, key, value, serviceName) {
29
29
  return document.createTextNode(value);
30
30
  }
31
31
  }
32
+
33
+ /**
34
+ * navBarDecorator is called to modify to modify naviguation bar of all UI pages.
35
+ * it receives the nav bar div
36
+ * it does not have to return anything.
37
+ */
38
+ function navBarDecorator(navbar) { }
39
+
40
+
41
+ /**
42
+ * fetchedResponseDecorator is called with http response when a resource is fetched by any instance of ConsulUIManager
43
+ * it does not have to return anything.
44
+ */
45
+ async function fetchedResponseDecorator(httpResponse) { }
@@ -21,6 +21,10 @@ class ConsulKeysManager extends ConsulUIManager {
21
21
  this.sideSelector.prepareData();
22
22
  this.sideSelector.refreshList();
23
23
  }
24
+
25
+ async clean() {
26
+ this.sideSelector.data = {};
27
+ }
24
28
  }
25
29
 
26
30
  class KeySideSelector extends SideSelector {
@@ -85,4 +89,4 @@ class KeySideSelector extends SideSelector {
85
89
 
86
90
 
87
91
  $(window).resize(resizeData);
88
- resizeData();
92
+ resizeData();
@@ -248,4 +248,4 @@ class NodeMainSelector extends MainSelector {
248
248
  }
249
249
 
250
250
  $(window).resize(resizeInstances);
251
- resizeInstances();
251
+ resizeInstances();
@@ -43,6 +43,13 @@ class ConsulServiceManager extends ConsulUIManager {
43
43
  this.sideSelector.prepareData();
44
44
  this.sideSelector.refreshList();
45
45
  }
46
+
47
+ async clean() {
48
+ this.mainSelector.nodes = {};
49
+ this.sideSelector.data = {};
50
+ this.sideSelector.prepareData();
51
+ this.sideSelector.refreshList();
52
+ }
46
53
  }
47
54
 
48
55
  class ServiceSideSelector extends SideSelector {
@@ -360,4 +367,4 @@ class ServiceMainSelector extends MainSelector {
360
367
  }
361
368
 
362
369
  $(window).resize(resizeAll);
363
- resizeAll();
370
+ resizeAll();
@@ -6,7 +6,9 @@ class ConsulUIManager {
6
6
  async fetchResource() {
7
7
  const response = await fetch(this.resourceURL);
8
8
  const result = await response.json();
9
+
9
10
  this.data = result;
11
+ fetchedResponseDecorator(response);
10
12
  await this.initResource(result);
11
13
  }
12
14
 
@@ -314,4 +316,4 @@ class Favorites {
314
316
  }
315
317
  this.saveFavorites();
316
318
  }
317
- }
319
+ }
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.21.3
4
+ version: 1.21.4
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-11-23 00:00:00.000000000 Z
11
+ date: 2019-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: em-http-request
@@ -194,6 +194,7 @@ files:
194
194
  - samples/all_services.txt.erb
195
195
  - samples/all_templates.erb
196
196
  - samples/consul-ui/README.md
197
+ - samples/consul-ui/common/footer.html.erb
197
198
  - samples/consul-ui/common/header.html.erb
198
199
  - samples/consul-ui/consul-keys-ui.html.erb
199
200
  - samples/consul-ui/consul-nodes-ui.html.erb