spruce up display of the repo list
This commit is contained in:
parent
9c9db6feb8
commit
1f671ee40c
2 changed files with 13 additions and 5 deletions
|
@ -171,17 +171,20 @@ introDisplay :: Text -> Widget
|
||||||
introDisplay ident = do
|
introDisplay ident = do
|
||||||
webapp <- lift getYesod
|
webapp <- lift getYesod
|
||||||
let reldir = relDir webapp
|
let reldir = relDir webapp
|
||||||
remotelist <- liftIO $ runThreadState (threadState webapp) $ do
|
l <- liftIO $ runThreadState (threadState webapp) $ do
|
||||||
u <- getUUID
|
u <- getUUID
|
||||||
rs <- map Remote.uuid <$> Remote.remoteList
|
rs <- map Remote.uuid <$> Remote.remoteList
|
||||||
rs' <- snd <$> trustPartition DeadTrusted rs
|
rs' <- snd <$> trustPartition DeadTrusted rs
|
||||||
Remote.prettyListUUIDs $ filter (/= webUUID) $ nub $ u:rs'
|
Remote.prettyListUUIDs $ filter (/= webUUID) $ nub $ u:rs'
|
||||||
let n = length remotelist
|
let remotelist = zip counter l
|
||||||
|
let n = length l
|
||||||
let numrepos = show n
|
let numrepos = show n
|
||||||
let notenough = n < 2
|
let notenough = n < 2
|
||||||
let barelyenough = n == 2
|
let barelyenough = n == 2
|
||||||
let morethanenough = n > 2
|
let morethanenough = n > 2
|
||||||
$(widgetFile "intro")
|
$(widgetFile "intro")
|
||||||
|
where
|
||||||
|
counter = map show ([1..] :: [Int])
|
||||||
|
|
||||||
{- Called by client to get a display of currently in process transfers.
|
{- Called by client to get a display of currently in process transfers.
|
||||||
-
|
-
|
||||||
|
|
|
@ -14,9 +14,14 @@
|
||||||
$else
|
$else
|
||||||
<span .badge .badge-success>#{numrepos}</span>
|
<span .badge .badge-success>#{numrepos}</span>
|
||||||
\ repositories and devices:
|
\ repositories and devices:
|
||||||
<ul>
|
<table .table .table-striped .table-condensed>
|
||||||
$forall name <- remotelist
|
<tbody>
|
||||||
<li>#{name}
|
$forall (num, name) <- remotelist
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
#{num}
|
||||||
|
<td>
|
||||||
|
#{name}
|
||||||
<a .btn .btn-primary .btn-large href="@{AddRepositoryR}">Add another repository</a>
|
<a .btn .btn-primary .btn-large href="@{AddRepositoryR}">Add another repository</a>
|
||||||
<p>
|
<p>
|
||||||
Or just sit back, watch the magic, and get on with using your files.
|
Or just sit back, watch the magic, and get on with using your files.
|
||||||
|
|
Loading…
Add table
Reference in a new issue