ui: streamline top status info
This commit is contained in:
parent
08cc807e49
commit
e6392b3d46
@ -173,19 +173,12 @@ asDraw UIState{aopts=uopts@UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}}
|
|||||||
|
|
||||||
toplabel =
|
toplabel =
|
||||||
withAttr ("border" <> "filename") files
|
withAttr ("border" <> "filename") files
|
||||||
-- <+> withAttr ("border" <> "query") (str (if flat_ ropts then " flat" else ""))
|
<+> toggles
|
||||||
<+> nonzero
|
<+> str (" account " ++ if ishistorical then "balances" else "changes")
|
||||||
<+> str (if ishistorical then " accounts" else " account changes")
|
|
||||||
-- <+> str (if ishistorical then " balances" else " changes")
|
|
||||||
<+> borderPeriodStr (if ishistorical then "at end of" else "in") (period_ ropts)
|
<+> borderPeriodStr (if ishistorical then "at end of" else "in") (period_ ropts)
|
||||||
<+> borderQueryStr querystr
|
<+> borderQueryStr querystr
|
||||||
<+> togglefilters
|
|
||||||
<+> borderDepthStr mdepth
|
<+> borderDepthStr mdepth
|
||||||
<+> str " ("
|
<+> str (" ("++curidx++"/"++totidx++")")
|
||||||
<+> cur
|
|
||||||
<+> str "/"
|
|
||||||
<+> total
|
|
||||||
<+> str ")"
|
|
||||||
<+> (if ignore_assertions_ $ inputopts_ copts
|
<+> (if ignore_assertions_ $ inputopts_ copts
|
||||||
then withAttr ("border" <> "query") (str " ignoring balance assertions")
|
then withAttr ("border" <> "query") (str " ignoring balance assertions")
|
||||||
else str "")
|
else str "")
|
||||||
@ -195,21 +188,19 @@ asDraw UIState{aopts=uopts@UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}}
|
|||||||
f:_ -> str $ takeFileName f
|
f:_ -> str $ takeFileName f
|
||||||
-- [f,_:[]] -> (withAttr ("border" <> "bold") $ str $ takeFileName f) <+> str " (& 1 included file)"
|
-- [f,_:[]] -> (withAttr ("border" <> "bold") $ str $ takeFileName f) <+> str " (& 1 included file)"
|
||||||
-- f:fs -> (withAttr ("border" <> "bold") $ str $ takeFileName f) <+> str (" (& " ++ show (length fs) ++ " included files)")
|
-- f:fs -> (withAttr ("border" <> "bold") $ str $ takeFileName f) <+> str (" (& " ++ show (length fs) ++ " included files)")
|
||||||
|
toggles = withAttr ("border" <> "query") $ str $ unwords $ concat [
|
||||||
|
[""]
|
||||||
|
,if empty_ ropts then [] else ["nonzero"]
|
||||||
|
,uiShowStatus copts $ statuses_ ropts
|
||||||
|
,if real_ ropts then ["real"] else []
|
||||||
|
]
|
||||||
querystr = query_ ropts
|
querystr = query_ ropts
|
||||||
mdepth = depth_ ropts
|
mdepth = depth_ ropts
|
||||||
togglefilters =
|
curidx = case _asList s ^. listSelectedL of
|
||||||
case concat [
|
|
||||||
uiShowStatus copts $ statuses_ ropts
|
|
||||||
,if real_ ropts then ["real"] else []
|
|
||||||
] of
|
|
||||||
[] -> str ""
|
|
||||||
fs -> str " from " <+> withAttr ("border" <> "query") (str $ intercalate ", " fs) <+> str " txns"
|
|
||||||
nonzero | empty_ ropts = str ""
|
|
||||||
| otherwise = withAttr ("border" <> "query") (str " nonzero")
|
|
||||||
cur = str (case _asList s ^. listSelectedL of
|
|
||||||
Nothing -> "-"
|
Nothing -> "-"
|
||||||
Just i -> show (i + 1))
|
Just i -> show (i + 1)
|
||||||
total = str $ show $ V.length nonblanks
|
totidx = show $ V.length nonblanks
|
||||||
|
where
|
||||||
nonblanks = V.takeWhile (not . T.null . asItemAccountName) $ s ^. asList . listElementsL
|
nonblanks = V.takeWhile (not . T.null . asItemAccountName) $ s ^. asList . listElementsL
|
||||||
|
|
||||||
bottomlabel = case mode of
|
bottomlabel = case mode of
|
||||||
|
|||||||
@ -165,7 +165,7 @@ borderQueryStr qry = str " matching " <+> withAttr ("border" <> "query") (str qr
|
|||||||
|
|
||||||
borderDepthStr :: Maybe Int -> Widget Name
|
borderDepthStr :: Maybe Int -> Widget Name
|
||||||
borderDepthStr Nothing = str ""
|
borderDepthStr Nothing = str ""
|
||||||
borderDepthStr (Just d) = str " to " <+> withAttr ("border" <> "query") (str $ "depth "++show d)
|
borderDepthStr (Just d) = str " to depth " <+> withAttr ("border" <> "query") (str $ show d)
|
||||||
|
|
||||||
borderPeriodStr :: String -> Period -> Widget Name
|
borderPeriodStr :: String -> Period -> Widget Name
|
||||||
borderPeriodStr _ PeriodAll = str ""
|
borderPeriodStr _ PeriodAll = str ""
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user