mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 22:05:56 +08:00
refactor(FE/RawLogView): move types to seperate file
This commit is contained in:
parent
d41805a3b0
commit
a37476a09b
@ -21,8 +21,6 @@ import {
|
|||||||
useMemo,
|
useMemo,
|
||||||
useState,
|
useState,
|
||||||
} from 'react';
|
} from 'react';
|
||||||
// interfaces
|
|
||||||
import { ILog } from 'types/api/logs/log';
|
|
||||||
|
|
||||||
// styles
|
// styles
|
||||||
import {
|
import {
|
||||||
@ -31,17 +29,10 @@ import {
|
|||||||
RawLogContent,
|
RawLogContent,
|
||||||
RawLogViewContainer,
|
RawLogViewContainer,
|
||||||
} from './styles';
|
} from './styles';
|
||||||
|
import { RawLogViewProps } from './types';
|
||||||
|
|
||||||
const convert = new Convert();
|
const convert = new Convert();
|
||||||
|
|
||||||
interface RawLogViewProps {
|
|
||||||
isActiveLog?: boolean;
|
|
||||||
isReadOnly?: boolean;
|
|
||||||
isTextOverflowEllipsisDisabled?: boolean;
|
|
||||||
data: ILog;
|
|
||||||
linesPerRow: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
function RawLogView({
|
function RawLogView({
|
||||||
isActiveLog,
|
isActiveLog,
|
||||||
isReadOnly,
|
isReadOnly,
|
||||||
|
@ -3,6 +3,8 @@ import { Col, Row, Space } from 'antd';
|
|||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { getActiveLogBackground, getDefaultLogBackground } from 'utils/logs';
|
import { getActiveLogBackground, getDefaultLogBackground } from 'utils/logs';
|
||||||
|
|
||||||
|
import { RawLogContentProps } from './types';
|
||||||
|
|
||||||
export const RawLogViewContainer = styled(Row)<{
|
export const RawLogViewContainer = styled(Row)<{
|
||||||
$isDarkMode: boolean;
|
$isDarkMode: boolean;
|
||||||
$isReadOnly?: boolean;
|
$isReadOnly?: boolean;
|
||||||
@ -31,13 +33,6 @@ export const ExpandIconWrapper = styled(Col)`
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
interface RawLogContentProps {
|
|
||||||
linesPerRow: number;
|
|
||||||
$isReadOnly?: boolean;
|
|
||||||
$isActiveLog?: boolean;
|
|
||||||
$isTextOverflowEllipsisDisabled?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const RawLogContent = styled.div<RawLogContentProps>`
|
export const RawLogContent = styled.div<RawLogContentProps>`
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
font-family: Fira Code, monospace;
|
font-family: Fira Code, monospace;
|
||||||
|
16
frontend/src/components/Logs/RawLogView/types.ts
Normal file
16
frontend/src/components/Logs/RawLogView/types.ts
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import { ILog } from 'types/api/logs/log';
|
||||||
|
|
||||||
|
export interface RawLogViewProps {
|
||||||
|
isActiveLog?: boolean;
|
||||||
|
isReadOnly?: boolean;
|
||||||
|
isTextOverflowEllipsisDisabled?: boolean;
|
||||||
|
data: ILog;
|
||||||
|
linesPerRow: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface RawLogContentProps {
|
||||||
|
linesPerRow: number;
|
||||||
|
$isReadOnly?: boolean;
|
||||||
|
$isActiveLog?: boolean;
|
||||||
|
$isTextOverflowEllipsisDisabled?: boolean;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user