chore(health): add more info to health

This commit is contained in:
Steffen Jost 2023-07-12 08:21:31 +00:00
parent 9b93c00301
commit c596491e49
2 changed files with 9 additions and 20 deletions

View File

@ -247,7 +247,6 @@ mkMessageVariant ''UniWorX ''PWHashMessage "messages/auth/pw-hash" "de"
mkMessageVariant ''UniWorX ''ButtonMessage "messages/button" "de"
mkMessageVariant ''UniWorX ''FrontendMessage "messages/frontend" "de-de-formal"
embedRenderMessage ''UniWorX ''HealthCheck id -- not possible here
embedRenderMessage ''UniWorX ''AvsLicence id -- required by UniWorXAvsMessages
mkMessageAddition ''UniWorX "Qualification" "messages/uniworx/categories/qualification" "de-de-formal"
mkMessageAddition ''UniWorX "Avs" "messages/uniworx/categories/avs" "de-de-formal"
@ -317,6 +316,7 @@ appLanguagesOpts = do
langOptions = map mkOption $ toList appLanguages
return $ mkOptionList langOptions
embedRenderMessage ''UniWorX ''HealthCheck id
embedRenderMessage ''UniWorX ''MessageStatus ("Message" <>)
embedRenderMessage ''UniWorX ''NotificationTrigger $ ("NotificationTrigger" <>) . concat . drop 1 . splitCamel
embedRenderMessage ''UniWorX ''StudyFieldType id

View File

@ -6,7 +6,7 @@ module Handler.Health where
import Import
-- import Handler.Utils
import Handler.Utils.DateTime (formatTimeW)
import qualified Data.Aeson.Encode.Pretty as Aeson
import qualified Data.Text.Lazy.Builder as Builder
@ -65,33 +65,22 @@ getHealthR = do
_{MsgMessageError}
<hr>
<dl .deflist>
$forall (_, report) <- healthReports'
$with hcclass = classifyHealthReport report
$with hcstatus = HealthSuccess == healthReportStatus report
$forall (lUp, report) <- healthReports'
$with hcclass <- classifyHealthReport report
$with hcstatus <- HealthSuccess == healthReportStatus report
$case report
$of HealthMatchingClusterConfig passed
<dt .deflist__dt>_{MsgHealthCheckMatchingClusterConfig}
<dd .deflist__dd>#{boolSymbol passed}
$of HealthHTTPReachable (Just passed)
<dt .deflist__dt>_{MsgHealthCheckHTTPReachable}
<dd .deflist__dd>#{boolSymbol passed}
$of HealthLDAPAdmins (Just found)
<dt .deflist__dt>_{MsgHealthCheckLDAPAdmins}
<dd .deflist__dd>#{textPercent found 1}
$of HealthSMTPConnect (Just passed)
<dt .deflist__dt>_{MsgHealthCheckSMTPConnect}
<dd .deflist__dd>#{boolSymbol passed}
$of HealthWidgetMemcached (Just passed)
<dt .deflist__dt>_{MsgHealthCheckWidgetMemcached}
<dd .deflist__dd>#{boolSymbol passed}
\ ^{formatTimeW SelFormatDateTime lUp}
$of HealthActiveJobExecutors (Just active)
<dt .deflist__dt>_{MsgHealthCheckActiveJobExecutors}
<dd .deflist__dd>#{textPercent active 1}
$of HealthDoesFlush mProp
\ ^{formatTimeW SelFormatDateTime lUp}
$of _
<dt .deflist__dt>_{hcclass}
<dd .deflist__dd>#{boolSymbol hcstatus}
$of _
\ ^{formatTimeW SelFormatDateTime lUp}
|]
provideJson healthReports
provideRep . return . Builder.toLazyText $ Aeson.encodePrettyToTextBuilder healthReports