Dashboard updates

This commit is contained in:
eikek
2022-01-26 21:24:03 +01:00
parent 3ff7e255b4
commit e6477a04b6
11 changed files with 62 additions and 34 deletions

View File

@ -107,7 +107,7 @@ update flags msg model =
Comp.ItemColumnDropdown.update lm model.columnModel
selection =
Comp.ItemColumnDropdown.getSelected model.columnModel
Comp.ItemColumnDropdown.getSelected cm
data =
model.data

View File

@ -107,19 +107,23 @@ viewItems texts settings meta list =
items =
Data.Items.flatten list
in
table [ class "w-full divide-y dark:divide-slate-500" ]
(viewItemHead texts meta ++ [ tbody [] <| List.map (viewItemRow texts settings meta) items ])
table [ class "w-full divide-y divide-y-2 dark:divide-slate-500" ]
(viewItemHead texts meta ++ [ tbody [ class "divide-y divide-dotted dark:divide-slate-500" ] <| List.map (viewItemRow texts settings meta) items ])
viewItemHead : Texts -> QueryData -> List (Html Msg)
viewItemHead texts meta =
if not meta.showHeaders || meta.columns == [] then
let
( col1, cols ) =
getColumns meta
in
if not meta.showHeaders then
[]
else
[ thead []
[ tr []
(List.map texts.itemColumn.header meta.columns
(List.map texts.itemColumn.header (col1 :: cols)
|> List.map (\n -> th [ class "text-left text-sm" ] [ text n ])
)
]

View File

@ -128,10 +128,10 @@ viewGeneral texts stats =
List.length stats.concEquipStats
mklabel name =
div [ class "py-1 text-lg" ] [ text name ]
div [ class "py-0.5 text-lg" ] [ text name ]
value num =
div [ class "py-1 font-mono text-lg" ] [ text <| String.fromInt num ]
div [ class "py-0.5 font-mono text-lg" ] [ text <| String.fromInt num ]
in
div [ class "opacity-90" ]
[ div [ class "flex flex-row" ]

View File

@ -17,6 +17,7 @@ import Html.Events exposing (onCheck, onClick, onInput)
import Html5.DragDrop as DD
import Messages.Comp.DashboardEdit exposing (Texts)
import Styles as S
import Util.Maybe
type alias Model =
@ -145,7 +146,12 @@ update flags msg model =
db_ =
{ db | columns = Maybe.withDefault db.columns value }
in
unit { model | columnsValue = value, columnsModel = cm, dashboard = db_ }
unit
{ model
| columnsValue = Util.Maybe.or [ value, model.columnsValue ]
, columnsModel = cm
, dashboard = db_
}
GapMsg lm ->
let
@ -158,7 +164,12 @@ update flags msg model =
db_ =
{ db | gap = Maybe.withDefault db.gap value }
in
unit { model | gapModel = gm, gapValue = value, dashboard = db_ }
unit
{ model
| gapModel = gm
, gapValue = Util.Maybe.or [ value, model.gapValue ]
, dashboard = db_
}
ToggleNewBoxMenu ->
unit { model | newBoxMenuOpen = not model.newBoxMenuOpen }