Enhance configuration and model capabilities

This commit is contained in:
decolua committed 2026-06-16 23:32:28 +07:00
1 parent b282f05549
commit d03f9fb823
17 files changed
+121 -52

No files matched your search

@@ -48,7 +48,7 @@ export default function ProviderDetailPage() {
const [headerImgError, setHeaderImgError] = useState(false);
const [modelTestResults, setModelTestResults] = useState({});
const [modelsTestError, setModelsTestError] = useState("");
const [testingModelId, setTestingModelId] = useState(null);
const [testingModelIds, setTestingModelIds] = useState(() => new Set());
const [showAddCustomModel, setShowAddCustomModel] = useState(false);
const [selectedConnectionIds, setSelectedConnectionIds] = useState([]);
const [bulkProxyPoolId, setBulkProxyPoolId] = useState("__none__");
@@ -876,8 +876,8 @@ export default function ProviderDetailPage() {
);
const handleTestModel = async (modelId) => {
if (testingModelId) return;
setTestingModelId(modelId);
if (testingModelIds.has(modelId)) return;
setTestingModelIds((prev) => new Set(prev).add(modelId));
try {
const res = await fetch("/api/models/test", {
method: "POST",
@@ -891,7 +891,7 @@ export default function ProviderDetailPage() {
setModelTestResults((prev) => ({ ...prev, [modelId]: "error" }));
setModelsTestError("Network error");
} finally {
setTestingModelId(null);
setTestingModelIds((prev) => { const n = new Set(prev); n.delete(modelId); return n; });
}
};
@@ -952,7 +952,7 @@ export default function ProviderDetailPage() {
onDeleteAlias={() => handleDeleteAlias(model.alias)}
testStatus={modelTestResults[model.id]}
onTest={connections.length > 0 || isFreeNoAuth ? () => handleTestModel(model.id) : undefined}
isTesting={testingModelId === model.id}
isTesting={testingModelIds.has(model.id)}
isCustom
isFree={false}
caps={getCaps(`${providerId}/${model.id}`)}
@@ -977,7 +977,7 @@ export default function ProviderDetailPage() {
onDeleteAlias={() => handleDeleteAlias(existingAlias)}
testStatus={modelTestResults[model.id]}
onTest={connections.length > 0 || isFreeNoAuth ? () => handleTestModel(model.id) : undefined}
isTesting={testingModelId === model.id}
isTesting={testingModelIds.has(model.id)}
isFree={model.isFree}
onDisable={() => handleDisableModel(model.id)}
caps={getCaps(`${providerId}/${model.id}`)}