mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-11-10 05:15:35 +08:00
fix(log): log level value not selected
This commit is contained in:
parent
d4ac016294
commit
3fbed0d694
@ -8,6 +8,7 @@ import {
|
||||
TAILWINDCSS_SIZE,
|
||||
} from '~/constants'
|
||||
import {
|
||||
logLevel,
|
||||
logMaxRows,
|
||||
logsTableSize,
|
||||
setLogLevel,
|
||||
@ -42,6 +43,7 @@ export const LogsSettingsModal = () => {
|
||||
|
||||
<select
|
||||
class="select select-bordered w-full"
|
||||
value={logLevel()}
|
||||
onChange={(e) => setLogLevel(e.target.value as LOG_LEVEL)}
|
||||
>
|
||||
<For
|
||||
|
@ -23,7 +23,6 @@ export default () => {
|
||||
const [logs, setLogs] = createSignal<LogWithSeq[]>([])
|
||||
|
||||
const logsData = useWsRequest<Log>('logs', { level: logLevel() })
|
||||
const maxRows = logMaxRows()
|
||||
|
||||
createEffect(() => {
|
||||
const data = logsData()
|
||||
@ -32,7 +31,7 @@ export default () => {
|
||||
return
|
||||
}
|
||||
|
||||
setLogs((logs) => [{ ...data, seq }, ...logs].slice(0, maxRows))
|
||||
setLogs((logs) => [{ ...data, seq }, ...logs].slice(0, logMaxRows()))
|
||||
|
||||
seq++
|
||||
})
|
||||
|
@ -58,12 +58,10 @@ export const [logsTableSize, setLogsTableSize] = makePersisted(
|
||||
createSignal<TAILWINDCSS_SIZE>(TAILWINDCSS_SIZE.XS),
|
||||
{ name: 'logsTableSize', storage: localStorage },
|
||||
)
|
||||
|
||||
export const [logLevel, setLogLevel] = makePersisted(
|
||||
createSignal<LOG_LEVEL>(LOG_LEVEL.Info),
|
||||
{ name: 'logLevel', storage: localStorage },
|
||||
)
|
||||
|
||||
export const [logMaxRows, setLogMaxRows] = makePersisted(createSignal(300), {
|
||||
name: 'logMaxRows',
|
||||
storage: localStorage,
|
||||
|
Loading…
Reference in New Issue
Block a user