chore(health): add option to mark certain interface health checks to remain indefinitely

This commit is contained in:
Steffen Jost 2024-07-08 15:34:19 +02:00
parent 3def8ca916
commit 2caa5aec5b
2 changed files with 2 additions and 2 deletions

View File

@ -26,7 +26,7 @@ InterfaceHealth
interface Text
subtype Text Maybe
write Bool Maybe
hours Int
hours Int -- negative number: never expires, i.e. if the last entry is a success, this remains indefinitely
UniqueInterfaceHealth interface subtype write !force -- Note that nullable fields must be either empty or unique
deriving Eq Read Show Generic

View File

@ -157,7 +157,7 @@ mkInterfaceLogTable flagError interfs@(reqIfs, banIfs) = do
logtime = row ^. resultILog . _interfaceLogTime
success = row ^. resultILog . _interfaceLogSuccess
iface = row ^. resultILog . _interfaceLogInterface
status = success && now <= addHours hours logtime
status = success && (hours < 0 || now <= addHours hours logtime)
in tellCell [(iface,status)] $
wgtCell $ flagError status
, sortable (Just "interface") (i18nCell MsgInterfaceName ) $ \(view (resultILog . _interfaceLogInterface) -> n) -> textCell n