formatting
This commit is contained in:
parent
0471443716
commit
4b28a69856
1 changed files with 2438 additions and 1874 deletions
|
|
@ -1,10 +1,19 @@
|
|||
import { Badge, Button, Card, Code, Collapse, Group, Stack, Text } from '@mantine/core';
|
||||
import {
|
||||
Badge,
|
||||
Button,
|
||||
Card,
|
||||
Code,
|
||||
Collapse,
|
||||
Group,
|
||||
Stack,
|
||||
Text,
|
||||
} from "@mantine/core";
|
||||
|
||||
export interface HistoryChildEntry {
|
||||
timestamp: string;
|
||||
method: string;
|
||||
target?: string;
|
||||
status: 'success' | 'error';
|
||||
status: "success" | "error";
|
||||
durationMs: number;
|
||||
}
|
||||
|
||||
|
|
@ -12,7 +21,7 @@ export interface HistoryEntryProps {
|
|||
timestamp: string;
|
||||
method: string;
|
||||
target?: string;
|
||||
status: 'success' | 'error';
|
||||
status: "success" | "error";
|
||||
durationMs: number;
|
||||
parameters?: Record<string, unknown>;
|
||||
response?: Record<string, unknown>;
|
||||
|
|
@ -46,15 +55,23 @@ export function HistoryEntry({
|
|||
<Stack gap="sm">
|
||||
<Group justify="space-between" wrap="nowrap">
|
||||
<Group gap="sm">
|
||||
<Text size="sm" c="dimmed" ff="monospace">{timestamp}</Text>
|
||||
<Text size="sm" c="dimmed" ff="monospace">
|
||||
{timestamp}
|
||||
</Text>
|
||||
<Badge color="dark">{method}</Badge>
|
||||
{target && <Text size="sm" fw={500}>{target}</Text>}
|
||||
{target && (
|
||||
<Text size="sm" fw={500}>
|
||||
{target}
|
||||
</Text>
|
||||
)}
|
||||
</Group>
|
||||
<Group gap="sm">
|
||||
<Badge color={status === 'success' ? 'green' : 'red'}>
|
||||
{status === 'success' ? 'OK' : 'Error'}
|
||||
<Badge color={status === "success" ? "green" : "red"}>
|
||||
{status === "success" ? "OK" : "Error"}
|
||||
</Badge>
|
||||
<Text size="sm" c="dimmed">{durationMs}ms</Text>
|
||||
<Text size="sm" c="dimmed">
|
||||
{durationMs}ms
|
||||
</Text>
|
||||
</Group>
|
||||
</Group>
|
||||
|
||||
|
|
@ -63,11 +80,11 @@ export function HistoryEntry({
|
|||
Replay
|
||||
</Button>
|
||||
<Button variant="subtle" size="xs" onClick={onTogglePin}>
|
||||
{isPinned ? 'Unpin' : 'Pin'}
|
||||
{isPinned && pinLabel ? ` (${pinLabel})` : ''}
|
||||
{isPinned ? "Unpin" : "Pin"}
|
||||
{isPinned && pinLabel ? ` (${pinLabel})` : ""}
|
||||
</Button>
|
||||
<Button variant="subtle" size="xs" onClick={onToggleExpand} ml="auto">
|
||||
{isExpanded ? 'Collapse' : 'Expand'}
|
||||
{isExpanded ? "Collapse" : "Expand"}
|
||||
</Button>
|
||||
</Group>
|
||||
|
||||
|
|
@ -89,14 +106,25 @@ export function HistoryEntry({
|
|||
<Stack gap="xs">
|
||||
{children.map((child, index) => (
|
||||
<Group key={index} pl="lg" gap="sm">
|
||||
<Text size="sm" c="dimmed" ff="monospace">+-- </Text>
|
||||
<Text size="sm" c="dimmed" ff="monospace">{child.timestamp}</Text>
|
||||
<Badge color="dark" size="sm">{child.method}</Badge>
|
||||
{child.target && <Text size="sm">{child.target}</Text>}
|
||||
<Badge color={child.status === 'success' ? 'green' : 'red'} size="sm">
|
||||
{child.status === 'success' ? 'OK' : 'Error'}
|
||||
<Text size="sm" c="dimmed" ff="monospace">
|
||||
+--{" "}
|
||||
</Text>
|
||||
<Text size="sm" c="dimmed" ff="monospace">
|
||||
{child.timestamp}
|
||||
</Text>
|
||||
<Badge color="dark" size="sm">
|
||||
{child.method}
|
||||
</Badge>
|
||||
<Text size="sm" c="dimmed">{child.durationMs}ms</Text>
|
||||
{child.target && <Text size="sm">{child.target}</Text>}
|
||||
<Badge
|
||||
color={child.status === "success" ? "green" : "red"}
|
||||
size="sm"
|
||||
>
|
||||
{child.status === "success" ? "OK" : "Error"}
|
||||
</Badge>
|
||||
<Text size="sm" c="dimmed">
|
||||
{child.durationMs}ms
|
||||
</Text>
|
||||
</Group>
|
||||
))}
|
||||
</Stack>
|
||||
|
|
|
|||
Loading…
Reference in a new issue