diff options
author | Joey Hess <joey@kitenet.net> | 2013-10-10 18:02:33 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-10-10 18:05:53 -0400 |
commit | 2bca58ee6c6d1f9020587586dcee04dc01b1f883 (patch) | |
tree | c5b87602b03db5277dc83673ccdc1d2dc642b3ad /Assistant/Alert.hs | |
parent | 110c8f7b8e1fa484752298de5b48ea50b195066a (diff) |
add config page for fsck, and alert with button when a fsck is running
Diffstat (limited to 'Assistant/Alert.hs')
-rw-r--r-- | Assistant/Alert.hs | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/Assistant/Alert.hs b/Assistant/Alert.hs index df5ee2910..e7b731a8c 100644 --- a/Assistant/Alert.hs +++ b/Assistant/Alert.hs @@ -27,17 +27,19 @@ import Assistant.WebApp import Yesod #endif -{- Makes a button for an alert that opens a Route. The button will - - close the alert it's attached to when clicked. -} +{- Makes a button for an alert that opens a Route. + - + - If autoclose is set, the button will close the alert it's + - attached to when clicked. -} #ifdef WITH_WEBAPP -mkAlertButton :: T.Text -> UrlRenderer -> Route WebApp -> Assistant AlertButton -mkAlertButton label urlrenderer route = do +mkAlertButton :: Bool -> T.Text -> UrlRenderer -> Route WebApp -> Assistant AlertButton +mkAlertButton autoclose label urlrenderer route = do close <- asIO1 removeAlert url <- liftIO $ renderUrl urlrenderer route [] return $ AlertButton { buttonLabel = label , buttonUrl = url - , buttonAction = Just close + , buttonAction = if autoclose then Just close else Nothing } #endif @@ -147,6 +149,12 @@ sanityCheckFixAlert msg = Alert alerthead = "The daily sanity check found and fixed a problem:" alertfoot = "If these problems persist, consider filing a bug report." +fsckAlert :: AlertButton -> Alert +fsckAlert button = baseActivityAlert + { alertData = [ UnTensed "Consistency check in progress" ] + , alertButton = Just button + } + pairingAlert :: AlertButton -> Alert pairingAlert button = baseActivityAlert { alertData = [ UnTensed "Pairing in progress" ] |