Skip to content

Commit

Permalink
Add TLS column and changes to status column
Browse files Browse the repository at this point in the history
  • Loading branch information
brotandgames committed Aug 22, 2023
1 parent 5bd334c commit 8f21eef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/helpers/checks_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def class_for_status(status)
# @return [String] the CSS class for the corresponding tls_expires_in_days
def class_for_tls_expires_in_days(tls_expires_in_days)
case tls_expires_in_days
when 0..7
when -Float::INFINITY..7
'text-danger'
when 8..30
'text-warning'
Expand Down
6 changes: 5 additions & 1 deletion app/views/checks/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<th>Cron</th>
<th>Url</th>
<th>Status</th>
<th>TLS</th>
<th></th>
</tr>
</thead>
Expand Down Expand Up @@ -55,13 +56,16 @@
<%= truncate(check.status, :length => 37) %>
</div>
<% end %>
<div class="small text-muted"><%= "Changes: " + check.status_changes.count.to_s %></div>
</td>
<td>
<div class="small <%= class_for_tls_expires_in_days(check.tls_expires_in_days) %>">
<% if !check.active %>
Check not active
<% else %>
<% if URI.parse(check.url).scheme == 'https' %>
<% if check.tls_expires_at? %>
TLS expires in <%= check.tls_expires_in_days %> days
Expires in <%= check.tls_expires_in_days %> days
<% else %>
Waiting for TLS check
<% end %>
Expand Down

0 comments on commit 8f21eef

Please sign in to comment.