Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: add loading spinner on log pane #227

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions packages/frontend/components/blocks/RunInputOutput.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
import { useRun, useUser } from "@/utils/dataHooks"
import {
Badge,
Button,
Card,
Flex,
Group,
HoverCard,
ScrollArea,
Stack,
Switch,
Text,
} from "@mantine/core"
import { notifications } from "@mantine/notifications"
import { IconPencilShare } from "@tabler/icons-react"
import Link from "next/link"
import { hasAccess } from "shared"
import SmartViewer from "../SmartViewer"
import TokensBadge from "./TokensBadge"
import { useRun, useUser } from "@/utils/dataHooks"
import { notifications } from "@mantine/notifications"
import CopyText, { SuperCopyButton } from "./CopyText"
import { hasAccess } from "shared"
import ErrorBoundary from "./ErrorBoundary"
import TokensBadge from "./TokensBadge"

const isChatMessages = (obj) => {
return Array.isArray(obj)
Expand Down
24 changes: 16 additions & 8 deletions packages/frontend/pages/logs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
Drawer,
Flex,
Group,
Loader,
Menu,
SegmentedControl,
Stack,
Expand Down Expand Up @@ -386,15 +387,22 @@ export default function Logs() {
title={selectedLog ? formatDateTime(selectedLog.createdAt) : ""}
onClose={() => setSelectedId(null)}
>
{selectedLog?.type === "llm" && (
<RunInputOutput
initialRun={selectedLog}
withPlayground={true}
withShare={true}
/>
{loading ? (
<Loader />
) : (
<>
{selectedLog?.type === "llm" && (
<RunInputOutput
initialRun={selectedLog}
withPlayground={true}
withShare={true}
/>
)}
{selectedLog?.type === "thread" && (
<ChatReplay run={selectedLog} />
)}
</>
)}

{selectedLog?.type === "thread" && <ChatReplay run={selectedLog} />}
</Drawer>

<DataTable
Expand Down
Loading