mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-09-06 17:46:23 +00:00
perf(channels): compact model test row actions
- replace per-model test text buttons with icon-only actions matching the channel list. - let the action column shrink to its icon content to reduce table width.
This commit is contained in:
+23
-13
@@ -26,6 +26,7 @@ import {
|
|||||||
Check,
|
Check,
|
||||||
CheckCircle2,
|
CheckCircle2,
|
||||||
Copy,
|
Copy,
|
||||||
|
Gauge,
|
||||||
Info,
|
Info,
|
||||||
Loader2,
|
Loader2,
|
||||||
Settings,
|
Settings,
|
||||||
@@ -293,7 +294,7 @@ function getTestTableColumnClass(columnId: string) {
|
|||||||
case 'result':
|
case 'result':
|
||||||
return 'w-80 min-w-80 max-w-80 whitespace-normal'
|
return 'w-80 min-w-80 max-w-80 whitespace-normal'
|
||||||
case 'actions':
|
case 'actions':
|
||||||
return 'bg-popover w-24 min-w-24 whitespace-nowrap sm:w-28 sm:min-w-28'
|
return 'bg-popover w-px whitespace-nowrap'
|
||||||
default:
|
default:
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
@@ -922,17 +923,26 @@ function ChannelTestDialogContent({
|
|||||||
const isTestingModel = testingModels.has(model)
|
const isTestingModel = testingModels.has(model)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Button
|
<Tooltip>
|
||||||
variant='outline'
|
<TooltipTrigger
|
||||||
size='sm'
|
render={
|
||||||
onClick={() => testSingleModel(model)}
|
<Button
|
||||||
disabled={isTestingModel || isBatchTesting}
|
variant='ghost'
|
||||||
>
|
size='icon-sm'
|
||||||
{isTestingModel && (
|
onClick={() => testSingleModel(model)}
|
||||||
<Loader2 className='animate-spin' data-icon='inline-start' />
|
disabled={isTestingModel || isBatchTesting}
|
||||||
)}
|
aria-label={t('Test Connection')}
|
||||||
{t('Test')}
|
/>
|
||||||
</Button>
|
}
|
||||||
|
>
|
||||||
|
{isTestingModel ? (
|
||||||
|
<Loader2 className='size-4 animate-spin' />
|
||||||
|
) : (
|
||||||
|
<Gauge className='size-4' />
|
||||||
|
)}
|
||||||
|
</TooltipTrigger>
|
||||||
|
<TooltipContent>{t('Test Connection')}</TooltipContent>
|
||||||
|
</Tooltip>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
enableSorting: false,
|
enableSorting: false,
|
||||||
@@ -1130,7 +1140,7 @@ function ChannelTestDialogContent({
|
|||||||
<col className='w-auto' />
|
<col className='w-auto' />
|
||||||
<col className='w-28' />
|
<col className='w-28' />
|
||||||
<col className='w-80' />
|
<col className='w-80' />
|
||||||
<col className='w-auto' />
|
<col className='w-px' />
|
||||||
</colgroup>
|
</colgroup>
|
||||||
}
|
}
|
||||||
getColumnClassName={(columnId) =>
|
getColumnClassName={(columnId) =>
|
||||||
|
|||||||
Reference in New Issue
Block a user