summaryrefslogtreecommitdiff
path: root/Assistant/Alert.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-07-29 09:35:01 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-07-29 09:35:50 -0400
commit5271d699d22f9addb35f2374a2a70da59897bb1d (patch)
tree832944f9d96e718234168dcbb00b679e4491a14c /Assistant/Alert.hs
parent57203e39811e4e769a6feb576a8779707664c40d (diff)
add alerts to DaemonStatus
Diffstat (limited to 'Assistant/Alert.hs')
-rw-r--r--Assistant/Alert.hs25
1 files changed, 25 insertions, 0 deletions
diff --git a/Assistant/Alert.hs b/Assistant/Alert.hs
new file mode 100644
index 000000000..c8bfa48fd
--- /dev/null
+++ b/Assistant/Alert.hs
@@ -0,0 +1,25 @@
+{- git-annex assistant alerts
+ -
+ - Copyright 2012 Joey Hess <joey@kitenet.net>
+ -
+ - Licensed under the GNU GPL version 3 or higher.
+ -}
+
+{-# LANGUAGE RankNTypes #-}
+
+module Assistant.Alert where
+
+import Yesod
+
+type Widget = forall sub master. GWidget sub master ()
+
+{- Different classes of alerts are displayed differently. -}
+data AlertClass = Activity | Warning | Error | Message
+
+{- An alert can be a simple message, or a Yesod Widget -}
+data AlertMessage = StringAlert String | WidgetAlert Widget
+
+data Alert = Alert
+ { alertClass :: AlertClass
+ , alertMessage :: AlertMessage
+ }