Add summary for fulltext searches

This commit is contained in:
Eike Kettner
2020-12-17 00:11:33 +01:00
parent 8d7b3c7d74
commit 6346bf6a34
4 changed files with 100 additions and 20 deletions

View File

@ -201,27 +201,37 @@ viewStats _ model =
fields =
List.filter isNumField stats.fieldStats
in
if List.isEmpty fields then
[]
else
[ div [ class "ui container" ]
[ table [ class "ui very basic tiny six column table" ]
[ thead []
[ tr [ class "center aligned" ]
[ th [] []
, th [] [ text "Count" ]
, th [] [ text "Sum" ]
, th [] [ text "Avg" ]
, th [] [ text "Min" ]
, th [] [ text "Max" ]
[ div [ class "ui container" ]
[ div [ class "ui middle aligned grid" ]
[ div [ class "three wide center aligned column" ]
[ div [ class "ui small statistic" ]
[ div [ class "value" ]
[ String.fromInt stats.count |> text
]
, div [ class "label" ]
[ text "Results"
]
]
, tbody []
(List.map statValues fields)
]
, div [ class "thirteen wide column" ]
[ table [ class "ui very basic tiny six column table" ]
[ thead []
[ tr [ class "center aligned" ]
[ th [] []
, th [] [ text "Count" ]
, th [] [ text "Sum" ]
, th [] [ text "Avg" ]
, th [] [ text "Min" ]
, th [] [ text "Max" ]
]
]
, tbody []
(List.map statValues fields)
]
]
]
]
]
viewLeftMenu : Flags -> UiSettings -> Model -> List (Html Msg)