summaryrefslogtreecommitdiff
path: root/Command/WebApp.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-09-08 19:57:15 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-09-08 19:57:15 -0400
commite59b0a1c884b4222162b444d0d306f67f2a6ca30 (patch)
tree78c2b8c0cfe9c6c52e31b0de2b4a730a7f080635 /Command/WebApp.hs
parente6e0877378af85293356b1c7d644a6df6cc40415 (diff)
first pass at alert buttons
They work fine. But I had to go to a lot of trouble to get Yesod to render routes in a pure function. It may instead make more sense to have each alert have an assocated IO action, and a single route that runs the IO action of a given alert id. I just wish I'd realized that before the past several hours of struggling with something Yesod really doesn't want to allow.
Diffstat (limited to 'Command/WebApp.hs')
-rw-r--r--Command/WebApp.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/Command/WebApp.hs b/Command/WebApp.hs
index 9a3be19d1..7360e1b0c 100644
--- a/Command/WebApp.hs
+++ b/Command/WebApp.hs
@@ -16,6 +16,7 @@ import Assistant.ScanRemotes
import Assistant.TransferQueue
import Assistant.TransferSlots
import Assistant.Threads.WebApp
+import Assistant.WebApp
import Utility.WebApp
import Utility.Daemon (checkDaemon, lockPidFile)
import Init
@@ -92,10 +93,12 @@ firstRun = do
scanremotes <- newScanRemoteMap
transferqueue <- newTransferQueue
transferslots <- newTransferSlots
+ urlrenderer <- newUrlRenderer
v <- newEmptyMVar
let callback a = Just $ a v
void $ runNamedThread dstatus $
- webAppThread Nothing dstatus scanremotes transferqueue transferslots
+ webAppThread Nothing dstatus scanremotes
+ transferqueue transferslots urlrenderer
(callback signaler) (callback mainthread)
where
signaler v = do