feat: restore model health check (stream check) UI

Re-enable the stream check feature that was hidden in v3.11.0.
All backend code, database schema, and i18n keys were preserved;
only the frontend UI needed uncommenting across 4 files.
OpenCode and OpenClaw are excluded as the backend does not support them.
This commit is contained in:
Jason
2026-03-03 10:22:26 +08:00
parent b05234c6df
commit 2dcec4178d
4 changed files with 50 additions and 21 deletions
@@ -3,7 +3,7 @@ import { useState, useEffect } from "react";
import {
ChevronDown,
ChevronRight,
// FlaskConical, // Hidden: stream check feature disabled
FlaskConical,
Globe,
Coins,
Eye,
@@ -87,16 +87,15 @@ function parseProxyUrl(url: string): Partial<ProviderProxyConfig> {
}
export function ProviderAdvancedConfig({
testConfig: _testConfig, // Hidden: stream check feature disabled
testConfig,
proxyConfig,
pricingConfig,
onTestConfigChange: _onTestConfigChange, // Hidden: stream check feature disabled
onTestConfigChange,
onProxyConfigChange,
onPricingConfigChange,
}: ProviderAdvancedConfigProps) {
const { t } = useTranslation();
// Hidden: stream check feature disabled
// const [isTestConfigOpen, setIsTestConfigOpen] = useState(testConfig.enabled);
const [isTestConfigOpen, setIsTestConfigOpen] = useState(testConfig.enabled);
const [isProxyConfigOpen, setIsProxyConfigOpen] = useState(
proxyConfig.enabled,
);
@@ -111,10 +110,9 @@ export function ProviderAdvancedConfig({
// 标记是否为用户主动输入(用于区分外部更新和用户输入)
const [isUserTyping, setIsUserTyping] = useState(false);
// Hidden: stream check feature disabled
// useEffect(() => {
// setIsTestConfigOpen(testConfig.enabled);
// }, [testConfig.enabled]);
useEffect(() => {
setIsTestConfigOpen(testConfig.enabled);
}, [testConfig.enabled]);
// 同步外部 proxyConfig.enabled 变化到展开状态
useEffect(() => {
@@ -168,7 +166,6 @@ export function ProviderAdvancedConfig({
return (
<div className="space-y-4">
{/* Hidden: stream check feature disabled — model test config panel
<div className="rounded-lg border border-border/50 bg-muted/20">
<button
type="button"
@@ -344,7 +341,6 @@ export function ProviderAdvancedConfig({
</div>
</div>
</div>
*/}
{/* 代理配置 */}
<div className="rounded-lg border border-border/50 bg-muted/20">