some clean up and added a all log option

This commit is contained in:
Anirban Kar 2024-12-13 20:48:33 +05:30
parent d13da30bda
commit 77b47c1ce6
4 changed files with 1343 additions and 1302 deletions

View File

@ -1 +1 @@
{ "commit": "4ba5d37fcd16414a06dbeba56c7732173e734c63" }
{ "commit": "d13da30bda2d10eb2da42113493625cd55e0d34d" }

View File

@ -9,7 +9,7 @@ import { classNames } from '~/utils/classNames';
export default function EventLogsTab() {
const {} = useSettings();
const showLogs = useStore(logStore.showLogs);
const [logLevel, setLogLevel] = useState<LogEntry['level']>('info');
const [logLevel, setLogLevel] = useState<LogEntry['level'] | 'all'>('info');
const [autoScroll, setAutoScroll] = useState(true);
const [searchQuery, setSearchQuery] = useState('');
const [, forceUpdate] = useState({});
@ -17,7 +17,7 @@ export default function EventLogsTab() {
const filteredLogs = useMemo(() => {
const logs = logStore.getLogs();
return logs.filter((log) => {
const matchesLevel = !logLevel || log.level === logLevel;
const matchesLevel = !logLevel || log.level === logLevel || logLevel === 'all';
const matchesSearch =
!searchQuery ||
log.message?.toLowerCase().includes(searchQuery.toLowerCase()) ||
@ -143,6 +143,7 @@ export default function EventLogsTab() {
onChange={(e) => setLogLevel(e.target.value as LogEntry['level'])}
className="flex-1 p-2 rounded-lg border border-bolt-elements-borderColor bg-bolt-elements-prompt-background text-bolt-elements-textPrimary focus:outline-none focus:ring-2 focus:ring-bolt-elements-focus transition-all lg:max-w-[20%] text-sm min-w-[100px]"
>
<option value="all">All</option>
<option value="info">Info</option>
<option value="warning">Warning</option>
<option value="error">Error</option>

View File

@ -86,6 +86,8 @@
"jszip": "^3.10.1",
"nanostores": "^0.10.3",
"ollama-ai-provider": "^0.15.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-hotkeys-hook": "^4.6.1",
"react-markdown": "^9.0.1",
"react-resizable-panels": "^2.1.7",
@ -106,16 +108,14 @@
"@types/dom-speech-recognition": "^0.0.4",
"@types/file-saver": "^2.0.7",
"@types/js-cookie": "^3.0.6",
"@types/react": "^18.3.16",
"@types/react-dom": "^18.3.5",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"fast-glob": "^3.3.2",
"husky": "9.1.7",
"is-ci": "^3.0.1",
"node-fetch": "^3.3.2",
"pnpm": "^9.14.4",
"prettier": "^3.0.0-alpha.6",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"prettier": "^3.4.1",
"sass-embedded": "^1.81.0",
"typescript": "^5.7.2",
"unified": "^11.0.5",
@ -132,4 +132,4 @@
"@typescript-eslint/utils": "^8.0.0-alpha.30"
},
"packageManager": "pnpm@9.4.0"
}
}

File diff suppressed because it is too large Load Diff