health-monitor-rails 11.0.0 → 11.2.0

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: ebb626c2a794dc6f2b1a0e657fb126179155ad88ec12b8d67bb356519517204d
4
- data.tar.gz: 45beac4910b662ca499ce4017a53a0bf5671b6b5791a11fa357b432c31ee130e
3
+ metadata.gz: b00f406302fd6e63bb7e6455af60d3334d26fd189b1402f5936cc395facf4661
4
+ data.tar.gz: 4bb3e0ed9c5e1532e5c088ddddaa0e55aa27d5cd48e1f7b75ebb19e6f4cc11e0
5
5
  SHA512:
6
- metadata.gz: 368decd1adde6046ec5561573afe27f1423bde4a37ed8c4dee7a99a93bcbde1f2752ff1370ff09f1a807815ebe012f73b514a44ba23231ac5442e99b9d885869
7
- data.tar.gz: 4d413a6fdce8c28ce49279867f39ca208274f1c6a226c7ae68a1b2b2b4c80f8ed7dd7a7331be30bae2f7eac0eff81f8e2298cfc76b44b61aa205df789b667c28
6
+ metadata.gz: 8360a21440827414697452c9cb2d82de435c7a21241f1073c00e3098d2c859e080f6d0a852476843f325236d3e5e70928c710fd71cc0586f3e85fe2dce7ac633
7
+ data.tar.gz: a42042a7cda14a27b07e4da46d5b0311553354c9f1245a92ed7bb98ef58406c1c8003c07078525e1a1cd8fe03d553e28c052d742239e5a5bb2609d9fe873373a
data/README.md CHANGED
@@ -332,7 +332,7 @@ end
332
332
 
333
333
  ```ruby
334
334
  HealthMonitor.configure do |config|
335
- config.add_custom_provider(CustomProvider)
335
+ config.add_custom_provider(CustomProvider.new)
336
336
  end
337
337
  ```
338
338
 
@@ -4,74 +4,196 @@
4
4
  <title>Status</title>
5
5
  <meta charset="utf-8">
6
6
  <meta name="viewport" content="width=device-width">
7
- <script src="https://cdn.tailwindcss.com"></script>
7
+
8
+ <style>
9
+ /* Reset */
10
+ html {
11
+ box-sizing: border-box;
12
+ font-size: 16px;
13
+ }
14
+
15
+ *, *:before, *:after {
16
+ box-sizing: inherit;
17
+ }
18
+
19
+ body {
20
+ line-height: 1.5;
21
+ -webkit-font-smoothing: antialiased;
22
+ }
23
+
24
+ body, h1, h2, h3, h4, h5, h6, p, ol, ul {
25
+ margin: 0;
26
+ padding: 0;
27
+ font-weight: normal;
28
+ overflow-wrap: break-word;
29
+ }
30
+
31
+ /* Custom CSS*/
32
+ body {
33
+ background-color: rgb(243 244 246);
34
+ color: rgb(17 24 39);
35
+ font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
36
+ Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
37
+ "Noto Color Emoji";
38
+ }
39
+
40
+ header {
41
+ background-color: white;
42
+ box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
43
+ padding: 1.5rem 1rem;
44
+ }
45
+
46
+ main {
47
+ padding-top: 3rem;
48
+ padding-bottom: 3rem;
49
+ width: 100vw;
50
+ }
51
+
52
+ footer {
53
+ font-weight: 300;
54
+ color: rgb(100 116 139);
55
+ font-size: 0.75rem;
56
+ line-height: 1rem;
57
+ padding-left: 1.25rem;
58
+ padding-right: 1.25rem;
59
+ }
60
+
61
+ h1 {
62
+ font-weight: 700;
63
+ font-size: 1.875rem;
64
+ line-height: 2.25rem;
65
+ }
66
+
67
+ h2 {
68
+ font-weight: 500;
69
+ font-size: 1.125rem;
70
+ line-height: 1.5rem;
71
+ padding: 1.25rem 1rem;
72
+ }
73
+
74
+ .text-center {
75
+ text-align: center;
76
+ }
77
+
78
+ .services, .env-variables {
79
+ display: block;
80
+ background-color: white;
81
+ box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
82
+ overflow: hidden;
83
+ border-radius: 0.5rem;
84
+ max-width: 56rem;
85
+ margin: 0 auto 1.5rem auto;
86
+ }
87
+
88
+ .border {
89
+ border-top-width: 1px;
90
+ border-color: rgb(229 231 235);
91
+ }
92
+
93
+ .red {
94
+ color: red;
95
+ }
96
+
97
+ .item {
98
+ display: grid;
99
+ grid-template-columns: max-content auto;
100
+ padding: 1.25rem 1rem;
101
+ }
102
+
103
+ .bg-gray {
104
+ background-color: rgb(249 250 251);
105
+ }
106
+
107
+ .bg-white {
108
+ background-color: white;
109
+ }
110
+
111
+ .state {
112
+ font-weight: 700;
113
+ }
114
+
115
+ .message {
116
+ color: rgb(71 85 105);
117
+ }
118
+
119
+ dt {
120
+ min-width: 10vw;
121
+ font-size: 0.875rem;
122
+ line-height: 1.25rem;
123
+ font-weight: 500;
124
+ color: rgb(107 114 128);
125
+ grid-column-start: 1;
126
+ }
127
+
128
+ dd {
129
+ font-size: 0.875rem;
130
+ line-height: 1.25rem;
131
+ grid-column-start: 2;
132
+ }
133
+ </style>
8
134
  </head>
9
- <body class="antialiased font-sans bg-gray-100">
10
- <header class="bg-white shadow">
11
- <div class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">
12
- <h1 class="text-3xl font-bold text-gray-900 text-center">
13
- Status Page
14
- </h1>
15
- </div>
135
+
136
+ <body>
137
+ <header>
138
+ <h1 class="text-center">
139
+ Status Page
140
+ </h1>
16
141
  </header>
142
+
17
143
  <main>
18
- <div class="max-w-7xl mx-auto py-12 sm:px-6 lg:px-8">
19
- <div class="max-w-4xl mx-auto">
20
- <div class="services bg-white shadow overflow-hidden sm:rounded-lg">
21
- <div class="px-4 py-5 sm:px-6">
22
- <h3 class="text-lg leading-6 font-medium text-gray-900">
23
- Services
24
- </h3>
25
- </div>
26
- <div class="border-t border-gray-200">
27
- <dl>
28
- <% @statuses[:results].each_with_index do |status, index| %>
29
- <div class="<%= index.odd? ? 'bg-gray-50' : 'bg-white' %> px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
30
- <dt class="name text-sm font-medium text-gray-500">
31
- <%= status[:name] %>
32
- </dt>
33
- <dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
34
- <div class="state <%= 'text-red-600' if status[:status].downcase == 'error' %> font-bold">
35
- <%= status[:status] %>
36
- </div>
37
- <% if !status[:message].empty? %>
38
- <div class="message text-slate-600"><%= status[:message] %></div>
39
- <% end %>
40
- </dd>
144
+ <div class="services">
145
+ <h2>
146
+ Services
147
+ </h2>
148
+ <div class="border">
149
+ <dl>
150
+ <% @statuses[:results].each_with_index do |status, index| %>
151
+ <div class="<%= index.odd? ? 'bg-gray' : 'bg-white' %> item">
152
+ <dt class="name">
153
+ <%= status[:name] %>
154
+ </dt>
155
+
156
+ <dd>
157
+ <div class="state <%= 'red' if status[:status].downcase == 'error' %> font-bold">
158
+ <%= status[:status] %>
41
159
  </div>
42
- <% end %>
43
- </dl>
44
- </div>
45
- </div>
46
- <% if @statuses[:environment_variables].present? %>
47
- <div class="env-variables bg-white shadow overflow-hidden sm:rounded-lg my-6">
48
- <div class="px-4 py-5 sm:px-6">
49
- <h3 class="text-lg leading-6 font-medium text-gray-900">
50
- Environment Variables
51
- </h3>
52
- </div>
53
- <div class="border-t border-gray-200">
54
- <dl>
55
- <% @statuses[:environment_variables].each_with_index do |env_var, index| %>
56
- <div class="<%= index.odd? ? 'bg-gray-50' : 'bg-white' %> px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
57
- <dt class="text-sm font-medium text-gray-500">
58
- <%= env_var[0] %>
59
- </dt>
60
- <dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
61
- <%= env_var[1] %>
62
- </dd>
63
- </div>
160
+ <% if !status[:message].empty? %>
161
+ <div class="message"><%= status[:message] %></div>
64
162
  <% end %>
65
- </dl>
163
+ </dd>
66
164
  </div>
67
- </div>
68
- <% end %>
165
+ <% end %>
166
+ </dl>
69
167
  </div>
70
168
  </div>
169
+
170
+ <% if @statuses[:environment_variables].present? %>
171
+ <div class="env-variables">
172
+ <h2>
173
+ Environment Variables
174
+ </h2>
175
+
176
+ <div class="border">
177
+ <dl>
178
+ <% @statuses[:environment_variables].each_with_index do |env_var, index| %>
179
+ <div class="<%= index.odd? ? 'bg-gray' : 'bg-white' %> item">
180
+ <dt>
181
+ <%= env_var[0] %>
182
+ </dt>
183
+ <dd>
184
+ <%= env_var[1] %>
185
+ </dd>
186
+ </div>
187
+ <% end %>
188
+ </dl>
189
+ </div>
190
+ </div>
191
+ <% end %>
71
192
  </main>
193
+
72
194
  <% if !@hide_footer %>
73
195
  <footer>
74
- <div class="font-light text-center text-slate-500 text-xs px-5">
196
+ <div class="text-center">
75
197
  Powered by <a href="https://github.com/lbeder/health-monitor-rails" target="_blank">health-monitor-rails</a>
76
198
  </div>
77
199
  </footer>
@@ -35,7 +35,7 @@ module HealthMonitor
35
35
  raise ArgumentError.new 'custom provider class must implement HealthMonitor::Providers::Base'
36
36
  end
37
37
 
38
- add_provider(custom_provider_class)
38
+ add_provider(custom_provider_class.new)
39
39
  end
40
40
 
41
41
  private
@@ -10,7 +10,7 @@ module HealthMonitor
10
10
  def check!
11
11
  failed_databases = []
12
12
 
13
- ActiveRecord::Base.connection_handler.all_connection_pools.each do |cp|
13
+ ActiveRecord::Base.connection_handler.connection_pool_list(:all).each do |cp|
14
14
  cp.connection.check_version
15
15
  rescue Exception
16
16
  failed_databases << cp.db_config.name
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HealthMonitor
4
- VERSION = '11.0.0'
4
+ VERSION = '11.2.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: health-monitor-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 11.0.0
4
+ version: 11.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leonid Beder
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-14 00:00:00.000000000 Z
11
+ date: 2023-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties