+
+
{t('Channel models')}
{t('Select models to run batch tests.')}
+
+ {isBatchTesting ? (
+
+ ) : (
+ <>
+
+ {successModels.length > 0 && (
+
+ )}
+ {failedModels.length > 0 && (
+
+ )}
+ >
+ )}
+
- {isBatchTesting ? (
-
- ) : (
-
- )}
- {batchProgress && (
-
- )}
-
- {!isAnyTesting &&
- (successModels.length > 0 || failedModels.length > 0) && (
-
- {successModels.length > 0 && (
-
- )}
- {failedModels.length > 0 && (
-
- )}
-
- )}
-
-
+
+
}
@@ -1123,46 +1176,36 @@ function ChannelTestDialogContent({
)
}
-function BatchProgressSummary({
- progress,
- isStopping,
-}: {
- progress: BatchProgress
- isStopping: boolean
-}) {
+function TestStatusCell({ result }: { result?: TestResult }) {
const { t } = useTranslation()
- const progressValue =
- progress.total > 0
- ? Math.min(100, Math.round((progress.completed / progress.total) * 100))
- : 0
- return (
-
-
-
- {isStopping
- ? t('Stopping batch test...')
- : t('Batch testing models...')}
-
-
- {t('{{completed}}/{{total}} completed', {
- completed: progress.completed,
- total: progress.total,
- })}
-
-
-
-
- {t('{{success}} succeeded, {{failed}} failed', {
- success: progress.success,
- failed: progress.failed,
- })}
-
-
- )
+ if (!result || result.status === 'idle') {
+ return (
+
+ )
+ }
+
+ if (result.status === 'testing') {
+ return (
+
+
+
+ {t('Testing...')}
+
+
+ )
+ }
+
+ if (result.status === 'success') {
+ return (
+
+ )
+ }
+
+ return
}
-function TestStatusCell({
+function TestResultCell({
result,
model,
onOpenDetails,
@@ -1174,9 +1217,7 @@ function TestStatusCell({
const { t } = useTranslation()
if (!result || result.status === 'idle') {
- return (
-
- )
+ return -
}
if (result.status === 'testing') {
@@ -1189,20 +1230,17 @@ function TestStatusCell({
}
if (result.status === 'success') {
- return (
-
-
- {typeof result.responseTime === 'number' && (
-
- {formatResponseTime(result.responseTime, t)}
-
- )}
-
+ return typeof result.responseTime === 'number' ? (
+
+ {formatResponseTime(result.responseTime, t)}
+
+ ) : (
+ -
)
}
return (
-
-
-
+
+
{summary}
-
+
{isModelPriceError && (