From e41d1a5b4566de973f3c62a742031c36f2462087 Mon Sep 17 00:00:00 2001 From: Tony Air Date: Sat, 25 Mar 2023 01:25:23 +0200 Subject: [PATCH] Better Env check interface --- .../EnvironmentCheck/EnvironmentChecker.ss | 96 +++++++++++++++++++ composer.json | 2 +- 2 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 app/templates/SilverStripe/EnvironmentCheck/EnvironmentChecker.ss diff --git a/app/templates/SilverStripe/EnvironmentCheck/EnvironmentChecker.ss b/app/templates/SilverStripe/EnvironmentCheck/EnvironmentChecker.ss new file mode 100644 index 0000000..3d38ffa --- /dev/null +++ b/app/templates/SilverStripe/EnvironmentCheck/EnvironmentChecker.ss @@ -0,0 +1,96 @@ + + + Site health: $Status + + + + + +

$Title: $Status

+

Site: $URL

+ + + + <% if $IncludeDetails %> + + + <% loop $Details %> + + <% end_loop %> +
Check Status Message
$Check $Status $Message.XML
+ <% end_if %> + + <% if $ShouldPass %> +

Site is available

+

(you may check for the presence of the text 'Site is available' rather than an HTTP $ErrorCode error on this page, if you prefer.<% if not $IncludeDetails %> Full details are available for logged in users at dev/check<% end_if %>)

+ <% else %> + <% if $Name == "check" %> +

A subsystem of the site is unavailable, but the site remains operational

+ <% else %> +

Site is not available

+ <% end_if %> + <% end_if %> + + diff --git a/composer.json b/composer.json index 59de95a..183588b 100755 --- a/composer.json +++ b/composer.json @@ -39,7 +39,7 @@ "a2nt/silverstripe-progressivewebapp": "dev-master", "a2nt/silverstripe-elemental-basics": "*", "a2nt/cms-niceties": "dev-main", - "a2nt/silverstripe-live-checks": "*", + "a2nt/silverstripe-live-checks": "*", "bummzack/sortablefile": "*", "ezyang/htmlpurifier": "^4.13", "endroid/qr-code": "^3.9",