silverstripe-environmentcheck/templates/SilverStripe/EnvironmentCheck/EnvironmentChecker.ss
Robbie Averill 254ed4801f SilverStripe 4.x compatibility (#38)
* Update composer constraint for 4.x compat

* 4.x compatibility: Rename "code" to "src" and add PSR-4 autoloading

* Restructure code and tests for PSR-4

* Implement namespaces

* Implement namespaced throughout

* PSR-2 formatting updates, separate Result from CheckSuite, implement PSR-3 logging, fix tests

* FIX Routes and template location

* Update readme. Allow check classes to be namespaced or not.

* Add entry to changelog

* FIX Ensure DatabaseCheckTest always has a member. Allow strings or objects for $check in the suite

* Update readme to be clearer about passing checks with or without namespaces

* Revert namespace checking and implement Injector aliases instead. Update readme.
2017-01-05 11:16:12 +13:00

86 lines
2.3 KiB
Scheme

<html>
<head>
<title>Site health: $Status</title>
<style>
* {
font-family: Helvetica, Arial;
font-size: 12px;
}
.subtext {
margin-top: -10px;
font-size: 10px;
}
h1 {
font-size: 30px;
margin-bottom: 3px;
margin-left: 8px;
}
h2 {
font-size: 16px;
margin: 2px 0 10px 8px;
}
p {
margin-left: 10px;
}
table {
border-collapse: collapse;
}
table th {
color: white;
background-color: #777;
/*border: 1px #aaa solid;*/
padding: 10px;
text-align: left;
}
table td {
background-color: #eee;
/*border: 1px #ddd solid;*/
padding: 5px 10px;
}
table tr:nth-child(odd) td {
background-color: #ddd;
}
.OK {
color: green;
}
.WARNING {
color: orange;
font-weight: bold;
}
.ERROR {
color: red;
font-weight: bold;
}
</style>
</head>
<body>
<h1 class="$Status">$Title: $Status</h1>
<h2 class="website">Site: $URL</h2>
<table>
<tr><th>Check</th> <th>Status</th> <th>Message</th></tr>
<% loop $Details %>
<tr><td>$Check</td> <td class="$Status">$Status</td> <td>$Message.XML</td></tr>
<% end_loop %>
</table>
<% if $ShouldPass %>
<p>Site is available</p>
<p class="subtext">(you may check for the presence of the text 'Site is available' rather than an HTTP $ErrorCode error on this page, if you prefer.)</p>
<% else %>
<% if $Name == "check" %>
<p><b>A subsystem of the site is unavailable, but the site remains operational</b></p>
<% else %>
<p><b>Site is not available</b></p>
<% end_if %>
<% end_if %>
</body>
</html>