Merge pull request #1416 from eikek/dashboard-tables

Dashboard tables
This commit is contained in:
mergify[bot]
2022-02-23 22:37:43 +00:00
committed by GitHub
8 changed files with 47 additions and 19 deletions

View File

@ -22,7 +22,7 @@ docspell.joex {
logging { logging {
# The format for the log messages. Can be one of: # The format for the log messages. Can be one of:
# Json, Logfmt, Fancy or Plain # Json, Logfmt, Fancy or Plain
format = "Plain" format = "Fancy"
# The minimum level to log. From lowest to highest: # The minimum level to log. From lowest to highest:
# Trace, Debug, Info, Warn, Error # Trace, Debug, Info, Warn, Error

View File

@ -44,16 +44,18 @@ object ScribeConfigure {
_.clearHandlers(), _.clearHandlers(),
_.withMinimumLevel(ScribeWrapper.convertLevel(cfg.minimumLevel)), _.withMinimumLevel(ScribeWrapper.convertLevel(cfg.minimumLevel)),
l => l =>
cfg.format match { if (logger.id == scribe.Logger.RootId) {
case Format.Fancy => cfg.format match {
l.withHandler(formatter = Formatter.enhanced, writer = SystemOutWriter) case Format.Fancy =>
case Format.Plain => l.withHandler(formatter = Formatter.default, writer = SystemOutWriter)
l.withHandler(formatter = Formatter.classic, writer = SystemOutWriter) case Format.Plain =>
case Format.Json => l.withHandler(formatter = Formatter.classic, writer = SystemOutWriter)
l.withHandler(writer = JsonWriter(SystemOutWriter)) case Format.Json =>
case Format.Logfmt => l.withHandler(writer = JsonWriter(SystemOutWriter))
l.withHandler(writer = LogfmtWriter(SystemOutWriter)) case Format.Logfmt =>
}, l.withHandler(writer = LogfmtWriter(SystemOutWriter))
}
} else l,
_.replace() _.replace()
) )

View File

@ -25,7 +25,7 @@ docspell.server {
logging { logging {
# The format for the log messages. Can be one of: # The format for the log messages. Can be one of:
# Json, Logfmt, Fancy or Plain # Json, Logfmt, Fancy or Plain
format = "Plain" format = "Fancy"
# The minimum level to log. From lowest to highest: # The minimum level to log. From lowest to highest:
# Trace, Debug, Info, Warn, Error # Trace, Debug, Info, Warn, Error

View File

@ -123,6 +123,12 @@ viewItemHead texts meta =
let let
( col1, cols ) = ( col1, cols ) =
getColumns meta getColumns meta
isSecond n =
n == 1
isNotLast n =
n > 1 && n < List.length cols
in in
if not meta.showHeaders then if not meta.showHeaders then
[] []
@ -131,7 +137,18 @@ viewItemHead texts meta =
[ thead [] [ thead []
[ tr [] [ tr []
(List.map texts.itemColumn.header (col1 :: cols) (List.map texts.itemColumn.header (col1 :: cols)
|> List.map (\n -> th [ class "text-left text-sm" ] [ text n ]) |> List.indexedMap
(\index ->
\n ->
th
[ class "text-left text-sm"
, classList
[ ( "hidden sm:table-cell", isSecond index )
, ( "hidden md:table-cell", isNotLast index )
]
]
[ text n ]
)
) )
] ]
] ]
@ -143,12 +160,18 @@ viewItemRow texts settings meta item =
( col1, cols ) = ( col1, cols ) =
getColumns meta getColumns meta
isSecond n =
n == 0
isNotLast n =
n > 0 && n < (List.length cols - 1)
render col = render col =
Comp.ItemColumnView.renderDiv Comp.ItemColumnView.renderDiv
texts.templateCtx texts.templateCtx
settings settings
col col
[ class "flex flex-row flex-wrap space-x-1 space-y-1" ] [ class "flex flex-row break-all flex-wrap space-x-1" ]
item item
td1 = td1 =
@ -164,7 +187,10 @@ viewItemRow texts settings meta item =
tdRem index col = tdRem index col =
td td
[ class "py-1 px-1" [ class "py-1 px-1"
, classList [ ( "hidden md:table-cell", index > 1 ) ] , classList
[ ( "hidden sm:table-cell", isSecond index )
, ( "hidden md:table-cell", isNotLast index )
]
] ]
[ render col [ render col
] ]

View File

@ -29,7 +29,7 @@ renderDiv ctx settings col attr item =
(List.map (List.map
(\t -> (\t ->
div div
[ class "label text-sm" [ class "label text-sm mt-1"
, class <| Data.UiSettings.tagColorString2 t settings , class <| Data.UiSettings.tagColorString2 t settings
] ]
[ text t.name ] [ text t.name ]

View File

@ -18,7 +18,7 @@ let
}; };
logging = { logging = {
minimum-level = "Info"; minimum-level = "Info";
format = "Plain"; format = "Fancy";
}; };
mail-debug = false; mail-debug = false;
jdbc = { jdbc = {

View File

@ -23,7 +23,7 @@ let
}; };
logging = { logging = {
minimum-level = "Info"; minimum-level = "Info";
format = "Plain"; format = "Fancy";
}; };
integration-endpoint = { integration-endpoint = {
enabled = false; enabled = false;

View File

@ -30,7 +30,7 @@ object TestSettingsPlugin extends AutoPlugin {
val testSettings = Seq( val testSettings = Seq(
libraryDependencies ++= inTest(Dependencies.munit, Dependencies.scribe), libraryDependencies ++= inTest(Dependencies.munit, Dependencies.scribe),
testFrameworks += new TestFramework("munit.Framework") testFrameworks += TestFrameworks.MUnit
) )
} }