Skip to content

Commit 054e1f6

Browse files
committed
add header to runs view
1 parent f4aaa82 commit 054e1f6

File tree

2 files changed

+29
-10
lines changed

2 files changed

+29
-10
lines changed

frontend/src/components/Header.tsx

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import RunModal from './modals/RunModal'
3737
import SettingsModal from './modals/SettingsModal'
3838

3939
interface HeaderProps {
40-
activePage: 'dashboard' | 'workflow' | 'evals' | 'trace' | 'rag'
40+
activePage: 'dashboard' | 'workflow' | 'evals' | 'trace' | 'runs' | 'rag'
4141
associatedWorkflowId?: string
4242
runId?: string
4343
handleDownloadImage?: () => void
@@ -141,7 +141,7 @@ const Header: React.FC<HeaderProps> = ({ activePage, associatedWorkflowId, runId
141141
}, [isHistoryOpen])
142142

143143
useEffect(() => {
144-
if (activePage === 'workflow' || activePage === 'trace') {
144+
if (activePage === 'workflow' || activePage === 'trace' || activePage === 'runs') {
145145
document.title = `${projectName} - PySpur`
146146
}
147147
if (activePage === 'dashboard') {
@@ -309,7 +309,7 @@ const Header: React.FC<HeaderProps> = ({ activePage, associatedWorkflowId, runId
309309
)}
310310
</NavbarBrand>
311311

312-
{(activePage === 'workflow' || activePage === 'trace') && (
312+
{(activePage === 'workflow' || activePage === 'trace' || activePage === 'runs') && (
313313
<NavbarContent
314314
className="h-12 rounded-full bg-transparent sm:flex"
315315
id="workflow-title"
@@ -343,6 +343,7 @@ const Header: React.FC<HeaderProps> = ({ activePage, associatedWorkflowId, runId
343343
</NavbarItem>
344344
{activePage === 'workflow' && <NavbarItem isActive={activePage === 'workflow'}>Editor</NavbarItem>}
345345
{activePage === 'trace' && <NavbarItem isActive={activePage === 'trace'}>Trace</NavbarItem>}
346+
{activePage === 'runs' && <NavbarItem isActive={activePage === 'runs'}>Runs</NavbarItem>}
346347
<NavbarItem isActive={activePage === 'evals'}>
347348
<Link className="flex gap-2 text-inherit" href="/evals">
348349
Evals
@@ -657,6 +658,18 @@ const Header: React.FC<HeaderProps> = ({ activePage, associatedWorkflowId, runId
657658
</NavbarItem>
658659
</NavbarContent>
659660
)}
661+
{activePage === 'runs' && (
662+
<NavbarContent
663+
className="ml-auto flex h-12 max-w-fit items-center gap-0 rounded-full p-0 lg:bg-content2 lg:px-1 lg:dark:bg-content1"
664+
justify="end"
665+
>
666+
<NavbarItem>
667+
<Link href={`/workflows/${associatedWorkflowId}`}>
668+
<Button variant="light">Go To Workflow</Button>
669+
</Link>
670+
</NavbarItem>
671+
</NavbarContent>
672+
)}
660673
<NavbarContent
661674
className="flex h-12 max-w-fit items-center gap-0 rounded-full p-0 lg:bg-content2 lg:px-1 lg:dark:bg-content1"
662675
justify="end"

frontend/src/pages/runs/[id].tsx

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import { Spinner } from '@heroui/react'
44
import Head from 'next/head'
55
import { useRouter } from 'next/router'
66
import React, { useEffect, useState } from 'react'
7+
import { PersistGate } from 'redux-persist/integration/react'
8+
import Header from '../../components/Header'
9+
import { persistor } from '../../store/store'
710

811
const RunsPage: React.FC = () => {
912
const router = useRouter()
@@ -46,18 +49,21 @@ const RunsPage: React.FC = () => {
4649
}
4750

4851
return (
49-
<>
52+
<PersistGate loading={null} persistor={persistor}>
5053
<Head>
5154
<title>{workflowName ? `${workflowName} - Runs` : 'Spur Runs'}</title>
5255
</Head>
53-
<div className="max-w-7xl mx-auto px-4 py-6">
54-
<div className="mb-6">
55-
<h1 className="text-2xl font-bold text-default-900">{workflowName}</h1>
56-
<p className="text-default-500">Run History</p>
56+
<div style={{ height: '100vh', display: 'flex', flexDirection: 'column' }}>
57+
<Header activePage="runs" associatedWorkflowId={id} />
58+
<div className="max-w-7xl mx-auto px-4 py-6 flex-grow">
59+
<div className="mb-6">
60+
<h1 className="text-2xl font-bold text-default-900">{workflowName}</h1>
61+
<p className="text-default-500">Run History</p>
62+
</div>
63+
<TraceTable workflowId={id} />
5764
</div>
58-
<TraceTable workflowId={id} />
5965
</div>
60-
</>
66+
</PersistGate>
6167
)
6268
}
6369

0 commit comments

Comments
 (0)