grafana/public/app/features/logs/components/panel/LogList.tsx

398 lines
12 KiB
TypeScript
Raw Normal View History

import { css } from '@emotion/css';
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
import { debounce } from 'lodash';
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
import { Grammar } from 'prismjs';
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
import { VariableSizeList } from 'react-window';
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
import {
AbsoluteTimeRange,
CoreApp,
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
DataFrame,
EventBus,
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
EventBusSrv,
LogLevel,
LogRowModel,
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
LogsDedupStrategy,
LogsMetaItem,
LogsSortOrder,
store,
TimeRange,
} from '@grafana/data';
import { PopoverContent, useTheme2 } from '@grafana/ui';
import { GetFieldLinksFn } from 'app/plugins/panel/logs/types';
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
import { InfiniteScroll } from './InfiniteScroll';
import { getGridTemplateColumns } from './LogLine';
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
import { LogLineDetails } from './LogLineDetails';
import { GetRowContextQueryFn } from './LogLineMenu';
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
import { LogListContextProvider, LogListState, useLogListContext } from './LogListContext';
import { LogListControls } from './LogListControls';
import { preProcessLogs, LogListModel } from './processing';
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
import {
calculateFieldDimensions,
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
getLogLineSize,
init as initVirtualization,
LogFieldDimension,
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
resetLogLineSizes,
ScrollToLogsEvent,
storeLogLineSize,
} from './virtualization';
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
export interface Props {
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
app: CoreApp;
containerElement: HTMLDivElement;
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
dedupStrategy: LogsDedupStrategy;
displayedFields: string[];
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
enableLogDetails: boolean;
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
eventBus?: EventBus;
filterLevels?: LogLevel[];
getFieldLinks?: GetFieldLinksFn;
getRowContextQuery?: GetRowContextQueryFn;
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
grammar?: Grammar;
initialScrollPosition?: 'top' | 'bottom';
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
isLabelFilterActive?: (key: string, value: string, refId?: string) => Promise<boolean>;
loading?: boolean;
loadMore?: (range: AbsoluteTimeRange) => void;
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
logOptionsStorageKey?: string;
logs: LogRowModel[];
logsMeta?: LogsMetaItem[];
logSupportsContext?: (row: LogRowModel) => boolean;
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
onClickFilterLabel?: (key: string, value: string, frame?: DataFrame) => void;
onClickFilterOutLabel?: (key: string, value: string, frame?: DataFrame) => void;
onClickFilterString?: (value: string, refId?: string) => void;
onClickFilterOutString?: (value: string, refId?: string) => void;
onClickShowField?: (key: string) => void;
onClickHideField?: (key: string) => void;
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
onLogOptionsChange?: (option: keyof LogListControlOptions, value: string | boolean | string[]) => void;
onLogLineHover?: (row?: LogRowModel) => void;
onPermalinkClick?: (row: LogRowModel) => Promise<void>;
onPinLine?: (row: LogRowModel) => void;
onOpenContext?: (row: LogRowModel, onClose: () => void) => void;
onUnpinLine?: (row: LogRowModel) => void;
pinLineButtonTooltipTitle?: PopoverContent;
pinnedLogs?: string[];
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
showControls: boolean;
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
showTime: boolean;
sortOrder: LogsSortOrder;
timeRange: TimeRange;
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
timeZone: string;
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
syntaxHighlighting?: boolean;
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
wrapLogMessage: boolean;
}
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
export type LogListControlOptions = LogListState;
type LogListComponentProps = Omit<
Props,
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
| 'app'
| 'dedupStrategy'
| 'displayedFields'
| 'enableLogDetails'
| 'showTime'
| 'sortOrder'
| 'syntaxHighlighting'
| 'wrapLogMessage'
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
>;
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
export const LogList = ({
app,
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
displayedFields,
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
containerElement,
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
dedupStrategy,
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
enableLogDetails,
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
eventBus,
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
filterLevels,
getFieldLinks,
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
getRowContextQuery,
grammar,
initialScrollPosition = 'top',
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
isLabelFilterActive,
loading,
loadMore,
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
logOptionsStorageKey,
logs,
logsMeta,
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
logSupportsContext,
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
onClickFilterLabel,
onClickFilterOutLabel,
onClickFilterString,
onClickFilterOutString,
onClickShowField,
onClickHideField,
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
onLogOptionsChange,
onLogLineHover,
onPermalinkClick,
onPinLine,
onOpenContext,
onUnpinLine,
pinLineButtonTooltipTitle,
pinnedLogs,
showControls,
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
showTime,
sortOrder,
syntaxHighlighting = logOptionsStorageKey ? store.getBool(`${logOptionsStorageKey}.syntaxHighlighting`, true) : true,
timeRange,
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
timeZone,
wrapLogMessage,
}: Props) => {
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
return (
<LogListContextProvider
app={app}
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
containerElement={containerElement}
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
dedupStrategy={dedupStrategy}
displayedFields={displayedFields}
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
enableLogDetails={enableLogDetails}
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
filterLevels={filterLevels}
getRowContextQuery={getRowContextQuery}
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
isLabelFilterActive={isLabelFilterActive}
logs={logs}
logsMeta={logsMeta}
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
logOptionsStorageKey={logOptionsStorageKey}
logSupportsContext={logSupportsContext}
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
onClickFilterLabel={onClickFilterLabel}
onClickFilterOutLabel={onClickFilterOutLabel}
onClickFilterString={onClickFilterString}
onClickFilterOutString={onClickFilterOutString}
onClickShowField={onClickShowField}
onClickHideField={onClickHideField}
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
onLogOptionsChange={onLogOptionsChange}
onLogLineHover={onLogLineHover}
onPermalinkClick={onPermalinkClick}
onPinLine={onPinLine}
onOpenContext={onOpenContext}
onUnpinLine={onUnpinLine}
pinLineButtonTooltipTitle={pinLineButtonTooltipTitle}
pinnedLogs={pinnedLogs}
showControls={showControls}
showTime={showTime}
sortOrder={sortOrder}
syntaxHighlighting={syntaxHighlighting}
wrapLogMessage={wrapLogMessage}
>
<LogListComponent
containerElement={containerElement}
eventBus={eventBus}
getFieldLinks={getFieldLinks}
grammar={grammar}
initialScrollPosition={initialScrollPosition}
loading={loading}
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
loadMore={loadMore}
logs={logs}
showControls={showControls}
timeRange={timeRange}
timeZone={timeZone}
/>
</LogListContextProvider>
);
};
const LogListComponent = ({
containerElement,
eventBus = new EventBusSrv(),
getFieldLinks,
grammar,
initialScrollPosition = 'top',
loading,
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
loadMore,
logs,
showControls,
timeRange,
timeZone,
}: LogListComponentProps) => {
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
const {
app,
displayedFields,
dedupStrategy,
filterLevels,
forceEscape,
showDetails,
showTime,
sortOrder,
toggleDetails,
wrapLogMessage,
} = useLogListContext();
const [processedLogs, setProcessedLogs] = useState<LogListModel[]>([]);
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
const [listHeight, setListHeight] = useState(
app === CoreApp.Explore ? window.innerHeight * 0.75 : containerElement.clientHeight
);
const theme = useTheme2();
const listRef = useRef<VariableSizeList | null>(null);
const widthRef = useRef(containerElement.clientWidth);
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
const wrapperRef = useRef<HTMLDivElement | null>(null);
const scrollRef = useRef<HTMLDivElement | null>(null);
const dimensions = useMemo(
() => (wrapLogMessage ? [] : calculateFieldDimensions(processedLogs, displayedFields)),
[displayedFields, processedLogs, wrapLogMessage]
);
const styles = getStyles(dimensions, { showTime });
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
const widthContainer = wrapperRef.current ?? containerElement;
const debouncedResetAfterIndex = useMemo(() => {
return debounce((index: number) => {
listRef.current?.resetAfterIndex(index);
overflowIndexRef.current = Infinity;
}, 25);
}, []);
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
useEffect(() => {
initVirtualization(theme);
}, [theme]);
useEffect(() => {
const subscription = eventBus.subscribe(ScrollToLogsEvent, (e: ScrollToLogsEvent) =>
handleScrollToEvent(e, logs.length, listRef.current)
);
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
return () => subscription.unsubscribe();
}, [eventBus, logs.length]);
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
useEffect(() => {
if (loading) {
return;
}
setProcessedLogs(
preProcessLogs(logs, { getFieldLinks, escape: forceEscape ?? false, order: sortOrder, timeZone }, grammar)
);
resetLogLineSizes();
listRef.current?.resetAfterIndex(0);
}, [forceEscape, getFieldLinks, grammar, loading, logs, sortOrder, timeZone]);
useEffect(() => {
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
listRef.current?.resetAfterIndex(0);
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
}, [wrapLogMessage, showDetails, displayedFields]);
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
useEffect(() => {
const handleResize = debounce(() => {
setListHeight(app === CoreApp.Explore ? window.innerHeight * 0.75 : containerElement.clientHeight);
}, 50);
window.addEventListener('resize', handleResize);
handleResize();
return () => {
window.removeEventListener('resize', handleResize);
};
}, [app, containerElement.clientHeight]);
useLayoutEffect(() => {
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
if (widthRef.current === widthContainer.clientWidth) {
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
return;
}
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
widthRef.current = widthContainer.clientWidth;
debouncedResetAfterIndex(0);
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
});
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
const overflowIndexRef = useRef(Infinity);
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
const handleOverflow = useCallback(
(index: number, id: string, height?: number) => {
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
if (height !== undefined) {
storeLogLineSize(id, widthContainer, height);
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
}
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
overflowIndexRef.current = index < overflowIndexRef.current ? index : overflowIndexRef.current;
debouncedResetAfterIndex(overflowIndexRef.current);
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
},
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
[debouncedResetAfterIndex, widthContainer]
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
);
const handleScrollPosition = useCallback(() => {
listRef.current?.scrollToItem(initialScrollPosition === 'top' ? 0 : logs.length - 1);
}, [initialScrollPosition, logs.length]);
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
if (!containerElement || listHeight == null) {
// Wait for container to be rendered
return null;
}
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
const handleLogLineClick = useCallback(
(log: LogListModel) => {
toggleDetails(log);
},
[toggleDetails]
);
const handleLogDetailsResize = useCallback(() => {
debouncedResetAfterIndex(0);
}, [debouncedResetAfterIndex]);
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
const filteredLogs = useMemo(
() =>
filterLevels.length === 0 ? processedLogs : processedLogs.filter((log) => filterLevels.includes(log.logLevel)),
[filterLevels, processedLogs]
);
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
return (
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
<div className={styles.logListContainer}>
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
<div className={styles.logListWrapper} ref={wrapperRef}>
<InfiniteScroll
displayedFields={displayedFields}
handleOverflow={handleOverflow}
logs={filteredLogs}
loadMore={loadMore}
onClick={handleLogLineClick}
scrollElement={scrollRef.current}
showTime={showTime}
sortOrder={sortOrder}
timeRange={timeRange}
timeZone={timeZone}
setInitialScrollPosition={handleScrollPosition}
wrapLogMessage={wrapLogMessage}
>
{({ getItemKey, itemCount, onItemsRendered, Renderer }) => (
<VariableSizeList
className={styles.logList}
height={listHeight}
itemCount={itemCount}
itemSize={getLogLineSize.bind(null, filteredLogs, widthContainer, displayedFields, {
showDuplicates: dedupStrategy !== LogsDedupStrategy.none,
showTime,
wrap: wrapLogMessage,
})}
itemKey={getItemKey}
layout="vertical"
onItemsRendered={onItemsRendered}
outerRef={scrollRef}
ref={listRef}
style={{ overflowY: 'scroll' }}
width="100%"
>
{Renderer}
</VariableSizeList>
)}
</InfiniteScroll>
</div>
{showDetails.length > 0 && (
<LogLineDetails
containerElement={containerElement}
getFieldLinks={getFieldLinks}
logs={filteredLogs}
onResize={handleLogDetailsResize}
/>
)}
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
{showControls && <LogListControls eventBus={eventBus} />}
</div>
Logs Panel: Base elements for the new visualization (#99084) * Create base components * Create measurement service * Add container for list * Use measurement to render virtualized log lines * Match rendered styles in 2d context for measuring * Improve virtualization initialization and handle resize * Introduce log line processing * Virtualization: fix measurement of lines with line endings * Virtualization: include scrollbar width in calculation * Remove logs * Virtualization: optimize text measurement * Add support for forceEscape * Log line: properly style wrapped/unwrapped lines * Virtualization: handle possible overflows * Improve overflow handling * LogList: remove scroll position ref * Remove logs * Remove log * Add top/bottom navigation buttons * Add timestamp to pre-processing * Add showtime support * Fix imports * Chore: simplify dedup * Show level * Refactor measurement and measure level and timestamp * Virtualization: skip unnecessary measurements * Improve measurements to minimize overflow chance * Introduce logline colors * Update palette * Remove pretiffying * Add comment * Remove unused variable * Add color for info level * Fix dependencies * Refactor overflow to account for smaller estimations * Debounce resizing * Fix imports * Further optimize height calculation * Remove outline * Unused import * Use less under/overflow method * Respond to height changes * Refactor size adjustment to account for layout changes * Add Logs Panel support * Add margin bottom to log lines * Remove unused option * LogList: container div should never be null Bad API design * Log List: make app not undefined and update containerElement usages * New Logs Panel: Create as new visualization (#99427) * Logs Panel: clean up old panel * Logs Panel New: create as new visualization * Plugin: mark as alpha * Logs panel new: hold container in a state variable * Logs panel: fix no data state * Create newLogsPanel feature flag * Logs: use new feature flag * Prettier * Add new panel to code owners * Logs Navigation: add translations * Address betterer issues * Fix import * Extract translations * Update virtualization.ts * Virtualization: add DOM fallback for text measurement * Run gen-cue * plugins_integration_test: add logs-new to expected plugins
2025-02-05 01:40:17 +08:00
);
};
function getStyles(dimensions: LogFieldDimension[], { showTime }: { showTime: boolean }) {
const columns = showTime ? dimensions : dimensions.filter((_, index) => index > 0);
return {
logList: css({
'& .unwrapped-log-line': {
display: 'grid',
gridTemplateColumns: getGridTemplateColumns(columns),
},
}),
New Logs Panel: Add LogListControl component (#102359) * LogListNavigation: create component * LogListNavigation: make it optional * Refactor Navigation into Controls * Explore Logs: hide old panel options * LogListControls: add more controls and apply new styles * LogListControls: update width * Remove console log * LogList: wrap component in context * LogListContext: make it stateful * LogListControls: connect with context * LogListContext: sync displayed fields * LogListContext: add syntax highlighting control * LogLine: improve color with highlighting off * LogListControls: improve button styles * LogListControls: add sort order option * LogListControls: add dedup strategy * LogListContext: sync prop changes with state * LogList: add option change callback * LogListContext: sync external changes only when showControls is disabled * LogListContext: unify sync effect * LogListControls: improve buttons active css * LogListContext: add optional storage support * LogList: make syntaxHighlighting and read from store or default to true * LogsPanel: add support for new options * Generated file * Update tests * New Logs Panel: add showControls option * LogList: make eventBus optional * LogsPanel: expose syntaxHighlighting * LogsPanel: expose grammar to plugins * Remove incorrect legacy file * LogListControls: allow options change with controls enabled in panel editor * LogLine: apply no-highlighting class to ansi wrapper * LogListControls: add frontend level filtering * LogList: filter by filterLevels * LogListControls: allow filterLevels in dashboards * LogLine: update unit tests * LogLineMenu: update unit test * LogListControls: add unit test * Revert * LogList: add unit test * LogList: add onLogRowHover support * LogList: test hover events * LogsPanel: add unit test * LogLine: use theme color for errors * LogLine: minor tweak to hover state * Chore: fix test case name * LogListControls: add border * LogListControls: prevent default on wrap toggle click * LogLine: switch info and debug colors * ContentOutline + LogControls: sync displayed levels and minor outline improvements * LogListContext: sync with external filterLevel changes * Logs: work with arrays of LogLevel and not plain strings * Fix type * LogListControl: increase controls size
2025-04-04 20:53:12 +08:00
logListContainer: css({
display: 'flex',
}),
New Logs Panel: Add Log Details support (#105609) * Log list: add onclick listener * LogListContext: add basic details support * LogLineDetails: create component * Address lint issues * Log Details: make resizable and store size * LogListModel: add sampled and error support * LogDetails: pass more required props * LogLineContext: add interactive callbacks support * LogLineDetails: pass interactive callbacks * LogList: pass displayedFields callbacks * LogLine: move click listener * LogLineMenu: support showing details * LogLine: move onclick listener * LogListContext: remove displayedFields intermediation * i18n * LogListContext: abstract details shown function * LogLine: visually show expanded lines * LogDetails: remove min width for labels * LogLineDetails: add close button * LogList: add extra wrapper to get width * LogLineDetails: update logs size on resize * virtualization: update to new width reference * LogLine: check overflow on every re-render * LogList: debug virtualization when resizing * LogLineDetails: make it scrollable * LogListContext: make detailsWidth not undefined * Update tests with new attributes * LogLine: update collapsed state with container changes * LogLine: move cursor property to clickable styles * LogList: fix height recalculation when display options change * Logs: fix feature toggles support * Logs: more feature toggles adjustments * Lint * LogLine: support duplicates, hasError, and isSampled * Logs: debug feature flag combinations * i18n * Prettier * New Logs Panel: generate storage key for dashboards * Explore Logs: fix filtered levels * Logs Sample: integrate new panel * LogLine: fix unwrapped logs * Fix test * Update test * Logs panel: update test * Prettier * LogLine: update tests * LogLineMenu: update test * LogList: update unit test * processing: update test * virtualization: update unit test
2025-05-21 01:28:35 +08:00
logListWrapper: css({
width: '100%',
}),
};
}
function handleScrollToEvent(event: ScrollToLogsEvent, logsCount: number, list: VariableSizeList | null) {
if (event.payload.scrollTo === 'top') {
list?.scrollTo(0);
} else {
list?.scrollToItem(logsCount - 1);
}
}