add syncing enabled/disabled to repo list with icon, and toggle link

The toggle link doesn't work yet.

Also lots of refactoring and type improvements
This commit is contained in:
Joey Hess 2012-10-12 01:09:28 -04:00
parent c835374040
commit a7642b3b6e
8 changed files with 242 additions and 194 deletions

View file

@ -13,7 +13,7 @@ import Assistant.Common
import Assistant.WebApp
import Assistant.WebApp.Types
import Assistant.WebApp.SideBar
import Assistant.Sync
import Assistant.WebApp.Utility
import Assistant.MakeRemote
import Utility.Yesod
import Init
@ -227,16 +227,6 @@ getEnableDirectoryR uuid = bootstrap (Just Config) $ do
T.pack . concat <$> prettyListUUIDs [uuid]
$(widgetFile "configurators/enabledirectory")
{- Start syncing a newly added remote, using a background thread. -}
syncRemote :: Remote -> Handler ()
syncRemote remote = do
webapp <- getYesod
liftIO $ syncNewRemote
(fromJust $ threadState webapp)
(daemonStatus webapp)
(scanRemotes webapp)
remote
{- List of removable drives. -}
driveList :: IO [RemovableDrive]
driveList = mapM (gen . mnt_dir) =<< filter sane <$> getMounts