webapp: fix display of paused local repo

This commit is contained in:
Joey Hess 2013-03-03 14:55:25 -04:00
parent dc706d1eb0
commit 53318d6ef1

View file

@ -24,6 +24,7 @@ import Types.StandardGroups
import qualified Git import qualified Git
import qualified Git.Command import qualified Git.Command
import qualified Git.Config import qualified Git.Config
import qualified Annex
import Git.Remote import Git.Remote
import qualified Data.Text as T import qualified Data.Text as T
@ -46,13 +47,16 @@ getRepoConfig uuid mremote = RepoConfig
<$> pure (T.pack $ maybe "here" Remote.name mremote) <$> pure (T.pack $ maybe "here" Remote.name mremote)
<*> (maybe Nothing (Just . T.pack) . M.lookup uuid <$> uuidMap) <*> (maybe Nothing (Just . T.pack) . M.lookup uuid <$> uuidMap)
<*> getrepogroup <*> getrepogroup
<*> pure (maybe True (remoteAnnexSync . Remote.gitconfig) mremote) <*> getsyncing
where where
getrepogroup = do getrepogroup = do
groups <- lookupGroups uuid groups <- lookupGroups uuid
return $ return $
maybe (RepoGroupCustom $ unwords $ S.toList groups) RepoGroupStandard maybe (RepoGroupCustom $ unwords $ S.toList groups) RepoGroupStandard
(getStandardGroup groups) (getStandardGroup groups)
getsyncing = case mremote of
Just r -> return $ remoteAnnexSync $ Remote.gitconfig r
Nothing -> annexAutoCommit <$> Annex.getGitConfig
setRepoConfig :: UUID -> Maybe Remote -> RepoConfig -> RepoConfig -> Handler () setRepoConfig :: UUID -> Maybe Remote -> RepoConfig -> RepoConfig -> Handler ()
setRepoConfig uuid mremote oldc newc = do setRepoConfig uuid mremote oldc newc = do