mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-08 02:17:46 +08:00
fix(provider): refine endpoint default paths for openai and claude roots
This commit is contained in:
@@ -153,10 +153,17 @@
|
||||
<Label class="text-xs text-muted-foreground">自定义路径</Label>
|
||||
<Input
|
||||
:model-value="getDisplayedPath(endpoint)"
|
||||
:placeholder="getDefaultPath(endpoint.api_format, getEndpointEditState(endpoint.id)?.url ?? endpoint.base_url) || '留空使用默认'"
|
||||
:placeholder="getEndpointDefaultPath(endpoint) || '留空使用默认'"
|
||||
:disabled="isFixedProvider"
|
||||
@update:model-value="(v) => updateEndpointField(endpoint.id, 'path', v)"
|
||||
/>
|
||||
<p
|
||||
v-if="getEndpointDefaultPath(endpoint)"
|
||||
class="text-[10px] text-muted-foreground truncate"
|
||||
:title="getEndpointDefaultPath(endpoint)"
|
||||
>
|
||||
当前默认路径:{{ getEndpointDefaultPath(endpoint) }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 保存/撤销按钮(URL/路径有修改时显示) -->
|
||||
@@ -963,6 +970,13 @@
|
||||
size="sm"
|
||||
:placeholder="newEndpointDefaultPath || '留空使用默认'"
|
||||
/>
|
||||
<p
|
||||
v-if="newEndpointDefaultPath"
|
||||
class="text-[10px] text-muted-foreground truncate"
|
||||
:title="newEndpointDefaultPath"
|
||||
>
|
||||
当前默认路径:{{ newEndpointDefaultPath }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1859,6 +1873,10 @@ function getDefaultPath(apiFormat: string, baseUrl?: string): string {
|
||||
})
|
||||
}
|
||||
|
||||
function getEndpointDefaultPath(endpoint: ProviderEndpoint): string {
|
||||
return getDefaultPath(endpoint.api_format, getEndpointEditState(endpoint.id)?.url ?? endpoint.base_url)
|
||||
}
|
||||
|
||||
function getDisplayedPath(endpoint: ProviderEndpoint): string {
|
||||
if (isFixedProvider.value) {
|
||||
return getDefaultPath(endpoint.api_format, endpoint.base_url)
|
||||
|
||||
Reference in New Issue
Block a user