pg_rails 7.0.8.pre.alpha.91 → 7.0.8.pre.alpha.93
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/pg_engine/app/controllers/pg_engine/health_controller.rb +42 -0
- data/pg_engine/app/mailers/pg_engine/base_mailer.rb +0 -1
- data/pg_engine/config/routes.rb +1 -0
- data/pg_engine/spec/components/previews/alert_component_preview/colours.html.slim +3 -0
- data/pg_engine/spec/components/previews/alert_component_preview.rb +2 -0
- data/pg_layout/app/views/layouts/pg_layout/mailer.html.slim +2 -2
- data/pg_rails/lib/version.rb +1 -1
- data/pg_rails/scss/bootstrap_overrides.scss +0 -2
- data/pg_rails/scss/pg_rails.scss +21 -5
- metadata +7 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bdf7d3d8c84262ae3dbb580c76a11f33d9cb91a6168ec187dfd0f760a080fde6
|
4
|
+
data.tar.gz: ebb7a5b8d8680a82f71574c04efe8f517b04134c628e6cd10103828d34d78727
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82cc777c32238b7c5430a95c6ebf701b188cb94b885373e43d1b20976e4081f3c6fa7ce0366cd8c5ed455cd9375fac70b2e7c5fdff3ea1d258f6cb546f6709ec
|
7
|
+
data.tar.gz: 84c40fd802a3681eeb76c11e0de4e5280bc41d9e97cf88a5a74a71b396c02dd7e68af0985a541325a1be9b26e692d0d35e893c37d16849b53a114fc4cebdf522
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module PgEngine
|
2
|
+
class HealthController < ApplicationController
|
3
|
+
rescue_from(Exception) do |error|
|
4
|
+
pg_err error
|
5
|
+
render_down
|
6
|
+
end
|
7
|
+
|
8
|
+
def show
|
9
|
+
check_redis
|
10
|
+
check_postgres
|
11
|
+
render_up
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def check_postgres
|
17
|
+
return if User.count.is_a? Integer
|
18
|
+
|
19
|
+
raise PgEngine::Error, 'postgres is down'
|
20
|
+
end
|
21
|
+
|
22
|
+
def check_redis
|
23
|
+
return if Kredis.counter('healthcheck').increment.is_a? Integer
|
24
|
+
|
25
|
+
raise PgEngine::Error, 'redis is down'
|
26
|
+
end
|
27
|
+
|
28
|
+
def render_up
|
29
|
+
render html: html_status(color: '#005500')
|
30
|
+
end
|
31
|
+
|
32
|
+
def render_down
|
33
|
+
render html: html_status(color: '#990000'), status: :internal_server_error
|
34
|
+
end
|
35
|
+
|
36
|
+
def html_status(color:)
|
37
|
+
# rubocop:disable Rails/OutputSafety
|
38
|
+
%(<!DOCTYPE html><html><body style="background-color: #{color}"></body></html>).html_safe
|
39
|
+
# rubocop:enable Rails/OutputSafety
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
data/pg_engine/config/routes.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
include PgEngine::RouteHelpers
|
2
2
|
|
3
3
|
Rails.application.routes.draw do
|
4
|
+
get "pg_engine/health" => "pg_engine/health#show", as: :pg_engine_health_check
|
4
5
|
namespace :public, path: '' do
|
5
6
|
pg_resource(:mensaje_contactos, only: [:new, :create], path: 'contacto')
|
6
7
|
post 'webhook/mailgun', to: 'webhooks#mailgun'
|
@@ -2,8 +2,8 @@ html
|
|
2
2
|
body style="font-family: sans-serif"
|
3
3
|
= yield
|
4
4
|
|
5
|
-
|
6
|
-
-
|
5
|
+
- if @footer_href.present?
|
6
|
+
footer style="margin-top: 2em;"
|
7
7
|
= link_to @footer_href, rel: 'noreferrer', target: :_blank do
|
8
8
|
- if @footer_image_src.present?
|
9
9
|
= image_tag @footer_image_src, alt: @footer_image_alt
|
data/pg_rails/lib/version.rb
CHANGED
data/pg_rails/scss/pg_rails.scss
CHANGED
@@ -1,9 +1,25 @@
|
|
1
|
-
|
2
|
-
$
|
3
|
-
$
|
1
|
+
// Default bootstrap colours
|
2
|
+
$blue: #0d6efd !default;
|
3
|
+
$indigo: #6610f2 !default;
|
4
|
+
$purple: #6f42c1 !default;
|
5
|
+
$pink: #d63384 !default;
|
6
|
+
$red: #dc3545 !default;
|
7
|
+
$orange: #fd7e14 !default;
|
8
|
+
$yellow: #ffc107 !default;
|
9
|
+
$green: #198754 !default;
|
10
|
+
$teal: #20c997 !default;
|
11
|
+
$cyan: #0dcaf0 !default;
|
12
|
+
|
13
|
+
// Overriding some of the default colours
|
14
|
+
$orange: #e35b17;
|
15
|
+
$red: #a70101;
|
4
16
|
|
5
|
-
$
|
6
|
-
$
|
17
|
+
$warning: $orange;
|
18
|
+
$info: #87accc;
|
19
|
+
|
20
|
+
$font-size-base: 0.9rem;
|
21
|
+
$enable-validation-icons: false;
|
22
|
+
$focus-ring-width: .05rem;
|
7
23
|
$alert-padding-y: 0.5rem;
|
8
24
|
$alert-margin-bottom: 0.5rem;
|
9
25
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pg_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.0.8.pre.alpha.
|
4
|
+
version: 7.0.8.pre.alpha.93
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martín Rosso
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-06-
|
11
|
+
date: 2024-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -983,6 +983,7 @@ files:
|
|
983
983
|
- pg_engine/app/controllers/concerns/pg_engine/resource.rb
|
984
984
|
- pg_engine/app/controllers/pg_engine/base_controller.rb
|
985
985
|
- pg_engine/app/controllers/pg_engine/devise_controller.rb
|
986
|
+
- pg_engine/app/controllers/pg_engine/health_controller.rb
|
986
987
|
- pg_engine/app/controllers/pg_engine/require_sign_in.rb
|
987
988
|
- pg_engine/app/controllers/public/mensaje_contactos_controller.rb
|
988
989
|
- pg_engine/app/controllers/public/webhooks_controller.rb
|
@@ -1096,6 +1097,7 @@ files:
|
|
1096
1097
|
- pg_engine/spec/components/alert_component_spec.rb
|
1097
1098
|
- pg_engine/spec/components/internal_error_component_spec.rb
|
1098
1099
|
- pg_engine/spec/components/previews/alert_component_preview.rb
|
1100
|
+
- pg_engine/spec/components/previews/alert_component_preview/colours.html.slim
|
1099
1101
|
- pg_engine/spec/components/previews/alert_component_preview/default.html.slim
|
1100
1102
|
- pg_engine/spec/components/previews/alert_component_preview/dismisible.html.slim
|
1101
1103
|
- pg_engine/spec/components/previews/internal_error_preview.rb
|
@@ -1278,11 +1280,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
1278
1280
|
version: '3.0'
|
1279
1281
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
1280
1282
|
requirements:
|
1281
|
-
- - "
|
1283
|
+
- - ">="
|
1282
1284
|
- !ruby/object:Gem::Version
|
1283
|
-
version:
|
1285
|
+
version: '0'
|
1284
1286
|
requirements: []
|
1285
|
-
rubygems_version: 3.
|
1287
|
+
rubygems_version: 3.5.11
|
1286
1288
|
signing_key:
|
1287
1289
|
specification_version: 4
|
1288
1290
|
summary: Rails goodies
|