feat(ui): enhance endpoint selection and date picker
This commit is contained in:
+21
-5
@@ -190,6 +190,10 @@ const endpointTypeOptions: Array<{ value: string; label: string }> = [
|
||||
{ value: 'embeddings', label: 'Embeddings (/v1/embeddings)' },
|
||||
]
|
||||
|
||||
const endpointSelectContentClass = 'w-[460px] max-w-[calc(100vw-2rem)]'
|
||||
const endpointSelectItemClass =
|
||||
'items-start py-2 [&_[data-slot=select-item-text]]:min-w-0 [&_[data-slot=select-item-text]]:shrink [&_[data-slot=select-item-text]]:whitespace-normal'
|
||||
|
||||
const STREAM_INCOMPATIBLE_ENDPOINTS = new Set([
|
||||
'embeddings',
|
||||
'image-generation',
|
||||
@@ -927,14 +931,26 @@ function ChannelTestDialogContent({
|
||||
value={endpointType}
|
||||
onValueChange={handleEndpointTypeChange}
|
||||
>
|
||||
<SelectTrigger id='endpoint-type'>
|
||||
<SelectValue placeholder={t('Auto detect (default)')} />
|
||||
<SelectTrigger id='endpoint-type' className='w-full min-w-0'>
|
||||
<SelectValue
|
||||
className='min-w-0 truncate'
|
||||
placeholder={t('Auto detect (default)')}
|
||||
/>
|
||||
</SelectTrigger>
|
||||
<SelectContent alignItemWithTrigger={false}>
|
||||
<SelectContent
|
||||
alignItemWithTrigger={false}
|
||||
className={endpointSelectContentClass}
|
||||
>
|
||||
<SelectGroup>
|
||||
{endpointSelectItems.map((option) => (
|
||||
<SelectItem key={option.value} value={option.value}>
|
||||
{option.label}
|
||||
<SelectItem
|
||||
key={option.value}
|
||||
value={option.value}
|
||||
className={endpointSelectItemClass}
|
||||
>
|
||||
<span className='min-w-0 whitespace-normal break-words leading-snug'>
|
||||
{option.label}
|
||||
</span>
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectGroup>
|
||||
|
||||
Reference in New Issue
Block a user