1.0.4 • Published 8 months ago

@savorui/logview v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

@savorui/logview

A high-performance UI log component with virtual scrolling, search functionality, and collapsible log sections, capable of handling large-scale datasets efficiently.

Install

npm install --save @savorui/logview

Usage

import Logview from '@savorui/logview';

const logs = ['hello world'];

<Logview logs={logs} theme='dark' />

Dev

tnpm i
npm run dev

API

NameTypeDescriptionRequired
logsstring[]An array of log strings to be displayed.Yes
themeThemeThe theme to be applied to the log view.No
widthnumber | stringThe width of the log view component. Can be a number or a string (e.g., "100%", "500px").No
heightnumber | stringThe height of the log view component. Can be a number or a string (e.g., "100%", "500px").No
currentLogIndexnumberThe index of the currently selected log entry.No
groupingGroupingParamsParameters for grouping logs.No
toolbarRenderContainerElement | undefined | nullA custom container element for rendering the toolbar.No
oversizebooleanIndicates whether the log view should handle oversize content.No
downloadUrlstringThe URL for downloading logs.No
externalUrlstringAn external URL related to the logs.No
styleCSSPropertiesCustom CSS styles to be applied to the log view component.No
lang'zh' | 'en' | 'fr' | 'de' | 'es' | 'ja' | 'ko'The language for the log view component. Supported languages include Chinese, English, French, German, Spanish, Japanese, and Korean.No
advicesLogAdvice[]An array of log advice objects.No
loadingbooleanIndicates whether the log view is in a loading state.No
lineLogParser(log: string) => stringA function to parse each log line.No
onTextSelectionChange(text: string | undefined) => voidA callback function that is triggered when the text selection changes.No
renderTextSelectionBubble(text: string | undefined) => ReactNodeA function to render a custom bubble for text selection.No
renderRightPanelContent() => ReactNodeA function to render custom content in the right panel.No
renderGroupName(log: string) => stringA function to render a custom group name for each log entry.No
onDownload() => voidA callback function that is triggered when the download button is clicked.No