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

refactor(dashboard): use code font #1326

Merged
merged 4 commits into from
Feb 23, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const TaskDetails: FC<{
</Entry>
}
<Entry label="Worker Log Output:">
<div className={"bg-gray-300 rounded-lg text-center border border-black max-w-52 text-nowrap min-h-5"} >
<div className={"bg-gray-300 rounded-lg text-center border border-black w-full text-nowrap min-h-5"} >
<OverflowText text={taskRunData.attempts[taskAttemptIndex].logOutput?.str ?? "-"} className="text-xs" variant={resultString === "ERROR" ? "error" : undefined} />
</div>
</Entry>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use client'
import { FC, useEffect, useRef, useState } from 'react'
import { cn } from '@/components/utils'
import { tryFormatAsJson } from '@/app/utils/tryFormatAsJson'
import { Button } from '@/components/ui/button'
import { ChevronRight } from 'lucide-react'
import { Dialog, DialogContent, DialogTrigger } from '@/components/ui/dialog'
import { cn } from '@/components/utils'
import { ChevronRight } from 'lucide-react'
import { FC, useEffect, useRef, useState } from 'react'
import { CopyButton } from './CopyButton'
import { tryFormatAsJson } from '@/app/utils/tryFormatAsJson'

type OverflowTextProps = {
text: string
Expand Down Expand Up @@ -37,7 +37,7 @@ export const OverflowText: FC<OverflowTextProps> = ({ text, className, variant }
className
)}
>
<span className="truncate">{formattedText}</span>
<span className="truncate font-code">{formattedText}</span>
<div className="flex flex-shrink-0 items-center gap-1 text-xs text-muted-foreground text-nowrap">
View
<ChevronRight className="h-4 w-4 opacity-50" />
Expand All @@ -51,14 +51,14 @@ export const OverflowText: FC<OverflowTextProps> = ({ text, className, variant }
'bg-status-failed text-red-500': variant === 'error',
})}
>
<div className="max-w-full whitespace-pre-wrap break-words p-4">{formattedText}</div>
<div className="max-w-full whitespace-pre-wrap break-words p-4 font-code">{formattedText}</div>
</div>
</DialogContent>
</Dialog>
)
}
return (
<div ref={textRef} className={cn(className, "flex items-center justify-center h-full")}>
<div ref={textRef} className={cn(className, "flex items-center justify-center h-full font-code")}>
{formattedText}
</div>
)
Expand Down
6 changes: 3 additions & 3 deletions dashboard/src/app/(authenticated)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { Toaster } from '@/components/ui/sonner'
import { WhoAmIContext } from '@/contexts/WhoAmIContext'
import type { Metadata } from 'next'
import { Inter } from 'next/font/google'
import { Header } from './[tenantId]/components/Header'
import { QueryProvider } from './[tenantId]/components/QueryProvider'
import { SWRConfig } from 'swr'
import getWhoAmI from '../getWhoami'
import '../globals.css'
import { SWRConfig } from 'swr'
import { Header } from './[tenantId]/components/Header'
import { QueryProvider } from './[tenantId]/components/QueryProvider'

const inter = Inter({ subsets: ['latin'] })

Expand Down
173 changes: 88 additions & 85 deletions dashboard/tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,91 +5,94 @@ const config = {
content: ['./pages/**/*.{ts,tsx}', './components/**/*.{ts,tsx}', './app/**/*.{ts,tsx}', './src/**/*.{ts,tsx}'],
prefix: '',
theme: {
container: {
center: true,
padding: '2rem',
screens: {
'2xl': '1400px'
}
},
extend: {
colors: {
border: 'hsl(var(--border))',
input: 'hsl(var(--input))',
ring: 'hsl(var(--ring))',
background: 'hsl(var(--background))',
foreground: 'hsl(var(--foreground))',
primary: {
DEFAULT: 'hsl(var(--primary))',
foreground: 'hsl(var(--primary-foreground))'
},
secondary: {
DEFAULT: 'hsl(var(--secondary))',
foreground: 'hsl(var(--secondary-foreground))'
},
destructive: {
DEFAULT: 'hsl(var(--destructive))',
foreground: 'hsl(var(--destructive-foreground))'
},
muted: {
DEFAULT: 'hsl(var(--muted))',
foreground: 'hsl(var(--muted-foreground))'
},
accent: {
DEFAULT: 'hsl(var(--accent))',
foreground: 'hsl(var(--accent-foreground))'
},
popover: {
DEFAULT: 'hsl(var(--popover))',
foreground: 'hsl(var(--popover-foreground))'
},
card: {
DEFAULT: 'hsl(var(--card))',
foreground: 'hsl(var(--card-foreground))'
},
status: {
running: 'theme("colors.blue.300")',
success: 'theme("colors.green.300")',
failed: 'theme("colors.red.300")',
exception: 'theme("colors.orange.300")',
halting: 'theme("colors.purple.300")'
},
chart: {
'1': 'hsl(var(--chart-1))',
'2': 'hsl(var(--chart-2))',
'3': 'hsl(var(--chart-3))',
'4': 'hsl(var(--chart-4))',
'5': 'hsl(var(--chart-5))'
}
},
borderRadius: {
lg: 'var(--radius)',
md: 'calc(var(--radius) - 2px)',
sm: 'calc(var(--radius) - 4px)'
},
keyframes: {
'accordion-down': {
from: {
height: '0'
},
to: {
height: 'var(--radix-accordion-content-height)'
}
},
'accordion-up': {
from: {
height: 'var(--radix-accordion-content-height)'
},
to: {
height: '0'
}
}
},
animation: {
'accordion-down': 'accordion-down 0.2s ease-out',
'accordion-up': 'accordion-up 0.2s ease-out'
}
}
container: {
center: true,
padding: '2rem',
screens: {
'2xl': '1400px',
},
},
extend: {
colors: {
border: 'hsl(var(--border))',
input: 'hsl(var(--input))',
ring: 'hsl(var(--ring))',
background: 'hsl(var(--background))',
foreground: 'hsl(var(--foreground))',
primary: {
DEFAULT: 'hsl(var(--primary))',
foreground: 'hsl(var(--primary-foreground))',
},
secondary: {
DEFAULT: 'hsl(var(--secondary))',
foreground: 'hsl(var(--secondary-foreground))',
},
destructive: {
DEFAULT: 'hsl(var(--destructive))',
foreground: 'hsl(var(--destructive-foreground))',
},
muted: {
DEFAULT: 'hsl(var(--muted))',
foreground: 'hsl(var(--muted-foreground))',
},
accent: {
DEFAULT: 'hsl(var(--accent))',
foreground: 'hsl(var(--accent-foreground))',
},
popover: {
DEFAULT: 'hsl(var(--popover))',
foreground: 'hsl(var(--popover-foreground))',
},
card: {
DEFAULT: 'hsl(var(--card))',
foreground: 'hsl(var(--card-foreground))',
},
status: {
running: 'theme("colors.blue.300")',
success: 'theme("colors.green.300")',
failed: 'theme("colors.red.300")',
exception: 'theme("colors.orange.300")',
halting: 'theme("colors.purple.300")',
},
chart: {
'1': 'hsl(var(--chart-1))',
'2': 'hsl(var(--chart-2))',
'3': 'hsl(var(--chart-3))',
'4': 'hsl(var(--chart-4))',
'5': 'hsl(var(--chart-5))',
},
},
borderRadius: {
lg: 'var(--radius)',
md: 'calc(var(--radius) - 2px)',
sm: 'calc(var(--radius) - 4px)',
},
keyframes: {
'accordion-down': {
from: {
height: '0',
},
to: {
height: 'var(--radix-accordion-content-height)',
},
},
'accordion-up': {
from: {
height: 'var(--radix-accordion-content-height)',
},
to: {
height: '0',
},
},
},
animation: {
'accordion-down': 'accordion-down 0.2s ease-out',
'accordion-up': 'accordion-up 0.2s ease-out',
},
fontFamily: {
code: ['Fira Code', 'sans-serif'],
},
},
},
plugins: [require('tailwindcss-animate')],
} satisfies Config
Expand Down
Loading