mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Using new <LogList/>
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
d51c327370
commit
6f91071af4
@ -1,6 +1,7 @@
|
||||
import { useVirtualizer } from '@tanstack/react-virtual';
|
||||
import AnsiUp from 'ansi_up';
|
||||
import DOMPurify from 'dompurify';
|
||||
import { observer } from 'mobx-react';
|
||||
import React, { useRef } from 'react';
|
||||
import { SearchStore } from '../../../search-store/search-store';
|
||||
import { cssNames } from '../../../utils';
|
||||
@ -10,7 +11,7 @@ export interface LogListProps {
|
||||
model: LogTabViewModel;
|
||||
}
|
||||
|
||||
export const LogList = ({ model }: LogListProps) => {
|
||||
export const LogList = observer(({ model }: LogListProps) => {
|
||||
const { logs } = model;
|
||||
const parentRef = useRef<HTMLDivElement>(null)
|
||||
const rowVirtualizer = useVirtualizer({
|
||||
@ -24,7 +25,7 @@ export const LogList = ({ model }: LogListProps) => {
|
||||
<div
|
||||
ref={parentRef}
|
||||
style={{
|
||||
height: `400px`,
|
||||
flexGrow: 1,
|
||||
overflow: 'auto', // Make it scroll!
|
||||
}}
|
||||
>
|
||||
@ -56,7 +57,7 @@ export const LogList = ({ model }: LogListProps) => {
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
});
|
||||
|
||||
const colorConverter = new AnsiUp();
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ import { observer } from "mobx-react";
|
||||
import { InfoPanel } from "../info-panel";
|
||||
import { LogResourceSelector } from "./resource-selector";
|
||||
import type { LogListRef } from "./list";
|
||||
import { LogList } from "./list";
|
||||
// import { LogList } from "./list";
|
||||
import { LogSearch } from "./search";
|
||||
import { LogControls } from "./controls";
|
||||
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||
@ -20,6 +20,8 @@ import type { SubscribeStores } from "../../../kube-watch-api/kube-watch-api";
|
||||
import subscribeStoresInjectable from "../../../kube-watch-api/subscribe-stores.injectable";
|
||||
import type { PodStore } from "../../+workloads-pods/store";
|
||||
import podStoreInjectable from "../../+workloads-pods/store.injectable";
|
||||
import { noop } from "lodash";
|
||||
import { LogList } from "./log-list";
|
||||
|
||||
export interface LogsDockTabProps {
|
||||
className?: string;
|
||||
@ -83,7 +85,7 @@ const NonInjectedLogsDockTab = observer(({
|
||||
<LogResourceSelector model={model} />
|
||||
<LogSearch
|
||||
model={model}
|
||||
scrollToOverlay={scrollToOverlay}
|
||||
scrollToOverlay={noop}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
@ -91,7 +93,8 @@ const NonInjectedLogsDockTab = observer(({
|
||||
showButtons={false}
|
||||
showStatusPanel={false}
|
||||
/>
|
||||
<LogList model={model} ref={logListElement} />
|
||||
{/* <LogList model={model} ref={logListElement} /> */}
|
||||
<LogList model={model} />
|
||||
<LogControls model={model} />
|
||||
</div>
|
||||
);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user