2013-10-22 20:02:52 +00:00
|
|
|
{- git-annex assistant repository repair
|
|
|
|
-
|
2015-01-21 16:50:09 +00:00
|
|
|
- Copyright 2013 Joey Hess <id@joeyh.name>
|
2013-10-22 20:02:52 +00:00
|
|
|
-
|
|
|
|
- Licensed under the GNU AGPL version 3 or higher.
|
|
|
|
-}
|
|
|
|
|
|
|
|
{-# LANGUAGE QuasiQuotes, TemplateHaskell, OverloadedStrings #-}
|
|
|
|
|
|
|
|
module Assistant.WebApp.Repair where
|
|
|
|
|
|
|
|
import Assistant.WebApp.Common
|
2013-10-23 18:43:58 +00:00
|
|
|
import Assistant.WebApp.RepoList
|
2013-10-27 19:38:59 +00:00
|
|
|
import Remote (prettyUUID, remoteFromUUID)
|
|
|
|
import Annex.UUID (getUUID)
|
2013-10-26 20:54:49 +00:00
|
|
|
import Assistant.Repair
|
2013-10-22 20:02:52 +00:00
|
|
|
|
|
|
|
getRepairRepositoryR :: UUID -> Handler Html
|
|
|
|
getRepairRepositoryR = postRepairRepositoryR
|
|
|
|
postRepairRepositoryR :: UUID -> Handler Html
|
|
|
|
postRepairRepositoryR u = page "Repair repository" Nothing $ do
|
|
|
|
repodesc <- liftAnnex $ prettyUUID u
|
2013-10-27 19:38:59 +00:00
|
|
|
repairingmainrepo <- (==) u <$> liftAnnex getUUID
|
2013-10-22 20:02:52 +00:00
|
|
|
$(widgetFile "control/repairrepository")
|
|
|
|
|
|
|
|
getRepairRepositoryRunR :: UUID -> Handler Html
|
2013-10-23 18:43:58 +00:00
|
|
|
getRepairRepositoryRunR = postRepairRepositoryRunR
|
2013-10-22 20:02:52 +00:00
|
|
|
postRepairRepositoryRunR :: UUID -> Handler Html
|
2013-10-23 18:43:58 +00:00
|
|
|
postRepairRepositoryRunR u = do
|
2013-10-27 19:38:59 +00:00
|
|
|
r <- liftAnnex $ remoteFromUUID u
|
|
|
|
void $ liftAssistant $ runRepair u r True
|
2013-10-23 18:43:58 +00:00
|
|
|
page "Repair repository" Nothing $ do
|
|
|
|
let repolist = repoListDisplay $
|
|
|
|
mainRepoSelector { nudgeAddMore = True }
|
|
|
|
$(widgetFile "control/repairrepository/done")
|