Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | 137x 28x 28x 68x 68x 68x 68x 28x 28x | import { Outlet } from 'react-router-dom'
import { Page, DataTable, Crud } from '@/layers/L2R'
import type { PageConfig, ListConfig, CrudConfig } from '@/layers/interfaces'
import { LLM_CONFIG_FIELD_SET, LLM_CONFIG_FIELD_TYPES } from './llmConfigsCrudConfig'
export function LlmConfigsListPage() {
const pageConfig: PageConfig = { title: 'LLM Provider Config' }
const listConfig: ListConfig = {
entityPath: 'llm-configs',
prefix: 'llm',
columns: [
{
field: 'name',
label: 'Name',
sortable: true,
render: (row) => <a href={`#/llm-configs/${row.id}`}>{row.name as string}</a>,
},
{
field: 'model',
label: 'Default Model',
sortable: true,
},
{
field: 'base_url',
label: 'Base URL',
sortable: true,
},
{
field: 'default_temperature',
label: 'Temperature',
render: (row) => {
const val = row.default_temperature
if (val === undefined || val === null) return '\u2014'
return String(val)
},
},
],
sort: { field: 'name', order: 'asc' },
cIreateTarget: '/llm-configs/add',
createLabel: '+ Add Provider',
rowTarget: '/llm-configs/:id',
}
const crudConfig: CrudConfig = {
entityPath: 'llm-configs',
fieldSet: LLM_CONFIG_FIELD_SET,
fieldTypes: LLM_CONFIG_FIELD_TYPES,
successTarget: '/llm-configs/:id',
cancelTarget: '/llm-configs',
title: 'Add LLM Provider',
}
return (
<Page config={pageConfig}>
<DataTable config={listConfig} />
<Crud config={crudConfig} />
<Outlet />
</Page>
)
}
|