diff --git a/Assistant/Threads/WebApp.hs b/Assistant/Threads/WebApp.hs index daddbc28cb..40f8300e53 100644 --- a/Assistant/Threads/WebApp.hs +++ b/Assistant/Threads/WebApp.hs @@ -27,6 +27,7 @@ import Utility.DataUnits import Types.Key import qualified Remote import Logs.Web (webUUID) +import Annex.UUID (getUUID) import Yesod import Yesod.Static @@ -169,11 +170,11 @@ introDisplay :: Text -> Widget introDisplay ident = do webapp <- lift getYesod let reldir = relDir webapp - remotelist <- liftIO $ runThreadState (threadState webapp) $ - Remote.prettyListUUIDs - =<< filter (/= webUUID) . nub . map Remote.uuid - <$> Remote.remoteList - let n = (length remotelist) + 1 -- plus this one + remotelist <- liftIO $ runThreadState (threadState webapp) $ do + u <- getUUID + rs <- map Remote.uuid <$> Remote.remoteList + Remote.prettyListUUIDs $ filter (/= webUUID) $ nub $ u:rs + let n = length remotelist let numrepos = show n let notenough = n < 2 let barelyenough = n == 2 diff --git a/Remote.hs b/Remote.hs index bb582778fd..ac9da05365 100644 --- a/Remote.hs +++ b/Remote.hs @@ -129,14 +129,19 @@ prettyPrintUUIDs desc uuids = do , ("here", toJSON $ hereu == u) ] -{- List of remote names and/or descriptions, for human display. - - Omits the current repisitory. -} +{- List of remote names and/or descriptions, for human display. -} prettyListUUIDs :: [UUID] -> Annex [String] prettyListUUIDs uuids = do hereu <- getUUID m <- uuidDescriptions - return $ map (\u -> M.findWithDefault "" u m) $ - filter (/= hereu) uuids + return $ map (\u -> prettify m hereu u) uuids + where + finddescription m u = M.findWithDefault "" u m + prettify m hereu u + | u == hereu = addName n "here" + | otherwise = n + where + n = finddescription m u {- Filters a list of remotes to ones that have the listed uuids. -} remotesWithUUID :: [Remote] -> [UUID] -> [Remote] diff --git a/templates/intro.hamlet b/templates/intro.hamlet index d62bfda9ab..6660b6a039 100644 --- a/templates/intro.hamlet +++ b/templates/intro.hamlet @@ -15,9 +15,8 @@ #{numrepos} \ repositories and devices: