chore(health): add option to mark certain interface health checks to remain indefinitely
This commit is contained in:
parent
3def8ca916
commit
2caa5aec5b
@ -26,7 +26,7 @@ InterfaceHealth
|
|||||||
interface Text
|
interface Text
|
||||||
subtype Text Maybe
|
subtype Text Maybe
|
||||||
write Bool 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
|
UniqueInterfaceHealth interface subtype write !force -- Note that nullable fields must be either empty or unique
|
||||||
deriving Eq Read Show Generic
|
deriving Eq Read Show Generic
|
||||||
|
|
||||||
|
|||||||
@ -157,7 +157,7 @@ mkInterfaceLogTable flagError interfs@(reqIfs, banIfs) = do
|
|||||||
logtime = row ^. resultILog . _interfaceLogTime
|
logtime = row ^. resultILog . _interfaceLogTime
|
||||||
success = row ^. resultILog . _interfaceLogSuccess
|
success = row ^. resultILog . _interfaceLogSuccess
|
||||||
iface = row ^. resultILog . _interfaceLogInterface
|
iface = row ^. resultILog . _interfaceLogInterface
|
||||||
status = success && now <= addHours hours logtime
|
status = success && (hours < 0 || now <= addHours hours logtime)
|
||||||
in tellCell [(iface,status)] $
|
in tellCell [(iface,status)] $
|
||||||
wgtCell $ flagError status
|
wgtCell $ flagError status
|
||||||
, sortable (Just "interface") (i18nCell MsgInterfaceName ) $ \(view (resultILog . _interfaceLogInterface) -> n) -> textCell n
|
, sortable (Just "interface") (i18nCell MsgInterfaceName ) $ \(view (resultILog . _interfaceLogInterface) -> n) -> textCell n
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user