consul-templaterb 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +6 -0
- data/lib/consul/async/version.rb +1 -1
- data/samples/consul-ui/common/header.html.erb +3 -0
- data/samples/consul-ui/consul-services-ui.html.erb +8 -4
- data/samples/consul-ui/css/style.css +0 -5
- data/samples/consul-ui/js/service.js +10 -9
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de191ca431027f8633f4e50b3fe479ca6a4db001ce40b1d28460498d9d9a9987
|
4
|
+
data.tar.gz: 0a996fa6e6c69e108ea0c5adb335954496d57b3755fd68e5a95c025f9370147c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b2f17384a48bc613a3e8a9088c4e68035e49a6ba0d25881cf1b1653d123c3e73ff8bbf45abbae877079a4d0b8333f69abab0dd003ef4162490125bebef17362
|
7
|
+
data.tar.gz: d8223b6902df1790ab897631d95ec5556c0cda6fa0b2168865ed0ad461d255ee0168b84531a39a24405bf5af36be3d2cef3a197d003e52a4238347fba2fe4b23
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
data/lib/consul/async/version.rb
CHANGED
@@ -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
|
-
<
|
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">
|
@@ -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
|
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> ';
|