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

feat(ui): Improve logging view in jobs page #3256

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
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
16 changes: 10 additions & 6 deletions ee/tabby-ui/app/(dashboard)/(logs)/jobs/components/job-detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import React from 'react'
import { useRouter, useSearchParams } from 'next/navigation'
import Ansi from '@curvenote/ansi-to-react'
import humanizerDuration from 'humanize-duration'
import moment from 'moment'
import { useQuery } from 'urql'
Expand All @@ -20,6 +19,15 @@ import { ListSkeleton } from '@/components/skeleton'

import { getJobDisplayName, getLabelByJobRun } from '../utils'

import '@patternfly/react-core/dist/styles/base.css'
import './styles.css'

import { LogViewer } from '@patternfly/react-log-viewer'

const BasicSearchLogViewer = ({ data }: { data?: string }) => {
return <LogViewer data={data} hasLineNumbers={false} height={'72vh'} />
}

export default function JobRunDetail() {
const router = useRouter()
const searchParams = useSearchParams()
Expand Down Expand Up @@ -147,11 +155,7 @@ function StdoutView({
<IconSpinner className="h-8 w-8" />
</div>
)}
{value && (
<pre className="whitespace-pre-wrap p-4">
<Ansi>{value}</Ansi>
</pre>
)}
{value && <BasicSearchLogViewer data={value} />}
</div>
)
}
11 changes: 11 additions & 0 deletions ee/tabby-ui/app/(dashboard)/(logs)/jobs/components/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* Job Log Viewer */
.pf-v5-c-log-viewer__scroll-container {
--tw-bg-opacity: 1;
background-color: rgb(249 250 251/var(--tw-bg-opacity));
font-size: 1em;
}

/* reset log font */
.pf-v5-c-log-viewer__text {
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace !important;
}
3 changes: 2 additions & 1 deletion ee/tabby-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
"@codemirror/state": "^6.4.0",
"@codemirror/theme-one-dark": "^6.1.2",
"@codemirror/view": "^6.23.0",
"@curvenote/ansi-to-react": "^7.0.0",
"@hookform/resolvers": "^3.3.2",
"@patternfly/react-core": "^5.4.1",
"@patternfly/react-log-viewer": "^5.3.0",
"@radix-ui/react-accordion": "^1.1.2",
"@radix-ui/react-alert-dialog": "1.0.4",
"@radix-ui/react-avatar": "^1.0.4",
Expand Down
Loading