add config page for fsck, and alert with button when a fsck is running
This commit is contained in:
parent
18f4d1b400
commit
e9745f2da2
12 changed files with 74 additions and 23 deletions
|
@ -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" ]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue