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