Prettier human-readable health reports
This commit is contained in:
parent
347a5ace63
commit
d0b2ffe936
@ -700,6 +700,8 @@ MenuInformation: Informationen
|
|||||||
MenuImpressum: Impressum
|
MenuImpressum: Impressum
|
||||||
MenuDataProt: Datenschutz
|
MenuDataProt: Datenschutz
|
||||||
MenuVersion: Versionsgeschichte
|
MenuVersion: Versionsgeschichte
|
||||||
|
MenuInstance: Instanz-Identifikation
|
||||||
|
MenuHealth: Instanz-Zustand
|
||||||
MenuHelp: Hilfe
|
MenuHelp: Hilfe
|
||||||
MenuProfile: Anpassen
|
MenuProfile: Anpassen
|
||||||
MenuLogin: Login
|
MenuLogin: Login
|
||||||
@ -881,4 +883,10 @@ HealthReport: Instanz-Zustand
|
|||||||
InstanceIdentification: Instanz-Identifikation
|
InstanceIdentification: Instanz-Identifikation
|
||||||
|
|
||||||
InstanceId: Instanz-Nummer
|
InstanceId: Instanz-Nummer
|
||||||
ClusterId: Cluster-Nummer
|
ClusterId: Cluster-Nummer
|
||||||
|
|
||||||
|
HealthMatchingClusterConfig: Cluster-geteilte Konfiguration ist aktuell
|
||||||
|
HealthHTTPReachable: Cluster kann an der erwarteten URL über HTTP erreicht werden
|
||||||
|
HealthLDAPAdmins: Anteil der Administratoren, die im LDAP-Verzeichnis gefunden werden können
|
||||||
|
HealthSMTPConnect: SMTP-Server kann erreicht werden
|
||||||
|
HealthWidgetMemcached: Memcached-Server liefert Widgets korrekt aus
|
||||||
@ -1655,6 +1655,26 @@ pageActions (VersionR) = [
|
|||||||
, menuItemAccessCallback' = return True
|
, menuItemAccessCallback' = return True
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
pageActions HealthR = [
|
||||||
|
MenuItem
|
||||||
|
{ menuItemType = PageActionPrime
|
||||||
|
, menuItemLabel = MsgMenuInstance
|
||||||
|
, menuItemIcon = Nothing
|
||||||
|
, menuItemRoute = SomeRoute InstanceR
|
||||||
|
, menuItemModal = False
|
||||||
|
, menuItemAccessCallback' = return True
|
||||||
|
}
|
||||||
|
]
|
||||||
|
pageActions InstanceR = [
|
||||||
|
MenuItem
|
||||||
|
{ menuItemType = PageActionPrime
|
||||||
|
, menuItemLabel = MsgMenuHealth
|
||||||
|
, menuItemIcon = Nothing
|
||||||
|
, menuItemRoute = SomeRoute HealthR
|
||||||
|
, menuItemModal = False
|
||||||
|
, menuItemAccessCallback' = return True
|
||||||
|
}
|
||||||
|
]
|
||||||
pageActions (HelpR) = [
|
pageActions (HelpR) = [
|
||||||
-- MenuItem
|
-- MenuItem
|
||||||
-- { menuItemType = PageActionPrime
|
-- { menuItemType = PageActionPrime
|
||||||
|
|||||||
@ -7,6 +7,8 @@ import qualified Data.Text.Lazy.Builder as Builder
|
|||||||
|
|
||||||
import Utils.Lens
|
import Utils.Lens
|
||||||
|
|
||||||
|
import qualified Data.UUID as UUID
|
||||||
|
|
||||||
|
|
||||||
getHealthR :: Handler TypedContent
|
getHealthR :: Handler TypedContent
|
||||||
getHealthR = do
|
getHealthR = do
|
||||||
@ -24,10 +26,24 @@ getHealthR = do
|
|||||||
provideRep $
|
provideRep $
|
||||||
siteLayoutMsg MsgHealthReport $ do
|
siteLayoutMsg MsgHealthReport $ do
|
||||||
setTitleI MsgHealthReport
|
setTitleI MsgHealthReport
|
||||||
let report' = Aeson.encodePrettyToTextBuilder healthReport
|
let HealthReport{..} = healthReport
|
||||||
[whamlet|
|
[whamlet|
|
||||||
<pre style="font-family: monospace; white-space: pre-wrap">
|
$newline never
|
||||||
#{report'}
|
<dl .deflist>
|
||||||
|
<dt .deflist__dt>_{MsgHealthMatchingClusterConfig}
|
||||||
|
<dd .deflist__dd>#{boolSymbol healthMatchingClusterConfig}
|
||||||
|
$maybe httpReachable <- healthHTTPReachable
|
||||||
|
<dt .deflist__dt>_{MsgHealthHTTPReachable}
|
||||||
|
<dd .deflist__dd>#{boolSymbol httpReachable}
|
||||||
|
$maybe ldapAdmins <- healthLDAPAdmins
|
||||||
|
<dt .deflist__dt>_{MsgHealthLDAPAdmins}
|
||||||
|
<dd .deflist__dd>#{textPercent ldapAdmins}
|
||||||
|
$maybe smtpConnect <- healthSMTPConnect
|
||||||
|
<dt .deflist__dt>_{MsgHealthSMTPConnect}
|
||||||
|
<dd .deflist__dd>#{boolSymbol smtpConnect}
|
||||||
|
$maybe widgetMemcached <- healthWidgetMemcached
|
||||||
|
<dt .deflist__dt>_{MsgHealthWidgetMemcached}
|
||||||
|
<dd .deflist__dd>#{boolSymbol widgetMemcached}
|
||||||
|]
|
|]
|
||||||
provideJson healthReport
|
provideJson healthReport
|
||||||
provideRep . return . Builder.toLazyText $ Aeson.encodePrettyToTextBuilder healthReport
|
provideRep . return . Builder.toLazyText $ Aeson.encodePrettyToTextBuilder healthReport
|
||||||
@ -51,11 +67,12 @@ getInstanceR = do
|
|||||||
siteLayoutMsg MsgInstanceIdentification $ do
|
siteLayoutMsg MsgInstanceIdentification $ do
|
||||||
setTitleI MsgInstanceIdentification
|
setTitleI MsgInstanceIdentification
|
||||||
[whamlet|
|
[whamlet|
|
||||||
|
$newline never
|
||||||
<dl .deflist>
|
<dl .deflist>
|
||||||
<dt .deflist__dt>_{MsgClusterId}
|
<dt .deflist__dt>_{MsgClusterId}
|
||||||
<dd .deflist__dd style="font-family: monospace">#{tshow clusterId}
|
<dd .deflist__dd style="font-family: monospace">#{UUID.toText clusterId}
|
||||||
<dt .deflist__dt>_{MsgInstanceId}
|
<dt .deflist__dt>_{MsgInstanceId}
|
||||||
<dd .deflist__dd style="font-family: monospace">#{tshow instanceId}
|
<dd .deflist__dd style="font-family: monospace">#{UUID.toText instanceId}
|
||||||
|]
|
|]
|
||||||
provideJson instanceInfo
|
provideJson instanceInfo
|
||||||
provideRep . return $ tshow instanceInfo
|
provideRep . return $ tshow instanceInfo
|
||||||
|
|||||||
@ -152,6 +152,10 @@ isNew :: Bool -> Markup
|
|||||||
isNew True = [shamlet|<i .fas .fa-seedling>|] -- was exclamation
|
isNew True = [shamlet|<i .fas .fa-seedling>|] -- was exclamation
|
||||||
isNew False = mempty
|
isNew False = mempty
|
||||||
|
|
||||||
|
boolSymbol :: Bool -> Markup
|
||||||
|
boolSymbol True = [shamlet|<i .fas .fa-check>|]
|
||||||
|
boolSymbol False = [shamlet|<i .fas .fa-times>|]
|
||||||
|
|
||||||
|
|
||||||
---------------------
|
---------------------
|
||||||
-- Text and String --
|
-- Text and String --
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user