fix(provider): split partial model fetch warnings from errors

This commit is contained in:
zhefox
2026-05-26 17:45:06 +08:00
parent aa409a8a9c
commit 1173a4d9d5
14 changed files with 171 additions and 48 deletions
@@ -154,7 +154,6 @@
<Input
:model-value="getDisplayedPath(endpoint)"
:placeholder="getEndpointDefaultPath(endpoint) || '留空使用默认'"
:disabled="isFixedProvider"
@update:model-value="(v) => updateEndpointField(endpoint.id, 'path', v)"
/>
<p
@@ -1878,9 +1877,6 @@ function getEndpointDefaultPath(endpoint: ProviderEndpoint): string {
}
function getDisplayedPath(endpoint: ProviderEndpoint): string {
if (isFixedProvider.value) {
return getDefaultPath(endpoint.api_format, endpoint.base_url)
}
return getEndpointEditState(endpoint.id)?.path ?? (endpoint.custom_path || '')
}
@@ -3217,13 +3213,13 @@ async function saveEndpoint(endpoint: ProviderEndpoint) {
savingEndpointId.value = endpoint.id
try {
// 仅提交变更字段,避免 fixed provider 因 base_url/custom_path 被锁定而更新失败
// 仅提交变更字段;fixed provider 锁定 base_url,但允许覆盖 custom_path。
const payload: Record<string, unknown> = {}
if (!isFixedProvider.value) {
if (state.url !== endpoint.base_url) payload.base_url = state.url
if (state.path !== (endpoint.custom_path || '')) payload.custom_path = state.path || null
}
if (state.path !== (endpoint.custom_path || '')) payload.custom_path = state.path || null
if (hasRulesChanges(endpoint)) payload.header_rules = rulesToHeaderRules(state.rules)
if (hasResponseHeaderRulesChanges(endpoint)) {