From 2cf83223f6d4b551998e8cd8f74fcec5e7ffd8ae Mon Sep 17 00:00:00 2001 From: Larvan2 <78135608+Larvan2@users.noreply.github.com> Date: Sat, 18 Apr 2026 14:18:28 +0800 Subject: fix(logs): improve log fetching and add log level selection --- src/components/Logs.module.scss | 14 ++++++++++++-- src/components/Logs.tsx | 9 +++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) (limited to 'src/components') diff --git a/src/components/Logs.module.scss b/src/components/Logs.module.scss index 87492c7..c90071d 100644 --- a/src/components/Logs.module.scss +++ b/src/components/Logs.module.scss @@ -25,6 +25,12 @@ } } +.levelSelect { + flex-shrink: 0; + width: auto; + min-width: 90px; +} + .clearBtn { background: none; border: none; @@ -35,7 +41,9 @@ display: flex; align-items: center; justify-content: center; - transition: background-color 0.2s, color 0.2s; + transition: + background-color 0.2s, + color 0.2s; &:hover { background-color: var(--bg-near-transparent); @@ -119,7 +127,9 @@ border-radius: 8px; color: var(--color-text); overflow-y: auto; - box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + box-shadow: + 0 4px 6px -1px rgba(0, 0, 0, 0.1), + 0 2px 4px -1px rgba(0, 0, 0, 0.06); @media (max-width: 768px) { margin: 10px 15px; diff --git a/src/components/Logs.tsx b/src/components/Logs.tsx index 59abced..9baf3fa 100644 --- a/src/components/Logs.tsx +++ b/src/components/Logs.tsx @@ -4,11 +4,14 @@ import { useTranslation } from 'react-i18next'; import ContentHeader from '~/components/ContentHeader'; import LogSearch from '~/components/LogSearch'; +import Select from '~/components/shared/Select'; import { useStoreActions } from '~/components/StateProvider'; import SvgYacd from '~/components/SvgYacd'; import useRemainingViewPortHeight from '~/hooks/useRemainingViewPortHeight'; import { useLogsPage } from '~/modules/logs/hooks'; +import { LOG_LEVEL_OPTIONS } from '~/modules/config/utils'; import { LOG_TYPES, LOGS_HEIGHT_RATIO } from '~/modules/logs/utils'; +import { updateConfigs } from '~/store/configs'; import { clearLogs } from '~/store/logs'; import { DispatchFn, Log } from '~/store/types'; import { ClashAPIConfig } from '~/types'; @@ -58,6 +61,12 @@ export default function Logs({ dispatch, logLevel, apiConfig, logs, logStreaming
+