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 { useVirtualizer } from '@tanstack/react-virtual';
|
||||||
import AnsiUp from 'ansi_up';
|
import AnsiUp from 'ansi_up';
|
||||||
import DOMPurify from 'dompurify';
|
import DOMPurify from 'dompurify';
|
||||||
|
import { observer } from 'mobx-react';
|
||||||
import React, { useRef } from 'react';
|
import React, { useRef } from 'react';
|
||||||
import { SearchStore } from '../../../search-store/search-store';
|
import { SearchStore } from '../../../search-store/search-store';
|
||||||
import { cssNames } from '../../../utils';
|
import { cssNames } from '../../../utils';
|
||||||
@ -10,7 +11,7 @@ export interface LogListProps {
|
|||||||
model: LogTabViewModel;
|
model: LogTabViewModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const LogList = ({ model }: LogListProps) => {
|
export const LogList = observer(({ model }: LogListProps) => {
|
||||||
const { logs } = model;
|
const { logs } = model;
|
||||||
const parentRef = useRef<HTMLDivElement>(null)
|
const parentRef = useRef<HTMLDivElement>(null)
|
||||||
const rowVirtualizer = useVirtualizer({
|
const rowVirtualizer = useVirtualizer({
|
||||||
@ -24,7 +25,7 @@ export const LogList = ({ model }: LogListProps) => {
|
|||||||
<div
|
<div
|
||||||
ref={parentRef}
|
ref={parentRef}
|
||||||
style={{
|
style={{
|
||||||
height: `400px`,
|
flexGrow: 1,
|
||||||
overflow: 'auto', // Make it scroll!
|
overflow: 'auto', // Make it scroll!
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@ -56,7 +57,7 @@ export const LogList = ({ model }: LogListProps) => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
});
|
||||||
|
|
||||||
const colorConverter = new AnsiUp();
|
const colorConverter = new AnsiUp();
|
||||||
|
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import { observer } from "mobx-react";
|
|||||||
import { InfoPanel } from "../info-panel";
|
import { InfoPanel } from "../info-panel";
|
||||||
import { LogResourceSelector } from "./resource-selector";
|
import { LogResourceSelector } from "./resource-selector";
|
||||||
import type { LogListRef } from "./list";
|
import type { LogListRef } from "./list";
|
||||||
import { LogList } from "./list";
|
// import { LogList } from "./list";
|
||||||
import { LogSearch } from "./search";
|
import { LogSearch } from "./search";
|
||||||
import { LogControls } from "./controls";
|
import { LogControls } from "./controls";
|
||||||
import { withInjectables } from "@ogre-tools/injectable-react";
|
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 subscribeStoresInjectable from "../../../kube-watch-api/subscribe-stores.injectable";
|
||||||
import type { PodStore } from "../../+workloads-pods/store";
|
import type { PodStore } from "../../+workloads-pods/store";
|
||||||
import podStoreInjectable from "../../+workloads-pods/store.injectable";
|
import podStoreInjectable from "../../+workloads-pods/store.injectable";
|
||||||
|
import { noop } from "lodash";
|
||||||
|
import { LogList } from "./log-list";
|
||||||
|
|
||||||
export interface LogsDockTabProps {
|
export interface LogsDockTabProps {
|
||||||
className?: string;
|
className?: string;
|
||||||
@ -83,7 +85,7 @@ const NonInjectedLogsDockTab = observer(({
|
|||||||
<LogResourceSelector model={model} />
|
<LogResourceSelector model={model} />
|
||||||
<LogSearch
|
<LogSearch
|
||||||
model={model}
|
model={model}
|
||||||
scrollToOverlay={scrollToOverlay}
|
scrollToOverlay={noop}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@ -91,7 +93,8 @@ const NonInjectedLogsDockTab = observer(({
|
|||||||
showButtons={false}
|
showButtons={false}
|
||||||
showStatusPanel={false}
|
showStatusPanel={false}
|
||||||
/>
|
/>
|
||||||
<LogList model={model} ref={logListElement} />
|
{/* <LogList model={model} ref={logListElement} /> */}
|
||||||
|
<LogList model={model} />
|
||||||
<LogControls model={model} />
|
<LogControls model={model} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user