Skip to content

Instantly share code, notes, and snippets.

@amitaibu
Created July 10, 2018 11:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amitaibu/41c7ca37406efe655fe3cbc4bffd9797 to your computer and use it in GitHub Desktop.
Save amitaibu/41c7ca37406efe655fe3cbc4bffd9797 to your computer and use it in GitHub Desktop.
type alias Site =
{ label : String
, machineName : String
, statusCount : EveryDict Status Int
-- For UI puropses
, showStatus : EveryDict Status Bool
}
type Status
= Critical
| Warning
| Ok
getCount : Status -> EveryDict Status Int -> Int
getCount status dict =
EveryDict.get status dict
|> Maybe.withDefault 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment