Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
36 changes: 36 additions & 0 deletions src/features/dashboard/templates/table-cells.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
useToast,
} from '@/lib/hooks/use-toast'
import { cn } from '@/lib/utils'
import { isVersionCompatible } from '@/lib/utils/version'
import {
deleteTemplateAction,
updateTemplateAction,
Expand Down Expand Up @@ -284,3 +285,38 @@ export function VisibilityCell({
</span>
)
}

const INVALID_ENVD_VERSION = '0.0.1'
const SDK_V2_MINIMAL_ENVD_VERSION = '0.2.0'

export function EnvdVersionCell({
getValue,
}: CellContext<Template | DefaultTemplate, unknown>) {
const valueString = getValue() as string
const versionValue =
valueString && valueString !== INVALID_ENVD_VERSION ? valueString : null

const isNotV2Compatible =
isVersionCompatible(
versionValue ?? SDK_V2_MINIMAL_ENVD_VERSION,
SDK_V2_MINIMAL_ENVD_VERSION
) === false
return (
<div
className={cn(
'text-fg-tertiary whitespace-nowrap font-mono flex flex-row gap-1.5',
{
'text-accent-error-highlight': isNotV2Compatible,
}
)}
>
{versionValue ?? 'N/A'}
{isNotV2Compatible && (
<HelpTooltip>
The envd version is not compatible with the SDK v2. To update the envd
version, you need to rebuild the template.
</HelpTooltip>
)}
</div>
)
}
9 changes: 9 additions & 0 deletions src/features/dashboard/templates/table-config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
ActionsCell,
CpuCell,
CreatedAtCell,
EnvdVersionCell,
MemoryCell,
TemplateIdCell,
TemplateNameCell,
Expand Down Expand Up @@ -138,6 +139,14 @@ export const useColumns = (deps: unknown[]) => {
enableSorting: false,
filterFn: 'equals',
},
{
accessorKey: 'envdVersion',
header: 'Envd Version',
size: 125,
minSize: 70,
cell: EnvdVersionCell,
enableSorting: false,
},
],
deps
)
Expand Down
Loading