mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 17:30:23 +08:00
feat: 配置导出/导入支持 LDAP 和 OAuth Provider
- 新增配置格式 v2.1,支持导出/导入 LDAP 配置和 OAuth Providers - 导出时解密敏感字段(bind_password, client_secret, provider_ops credentials) - 导入时加密敏感字段后存储 - 前端支持预览和显示 LDAP/OAuth 导入结果
This commit is contained in:
@@ -538,6 +538,10 @@
|
||||
<li>
|
||||
API Keys: {{ importPreview.providers?.reduce((sum: number, p: any) => sum + (p.api_keys?.length || 0), 0) }} 个
|
||||
</li>
|
||||
<li v-if="importPreview.ldap_config">LDAP 配置: 1 个</li>
|
||||
<li v-if="importPreview.oauth_providers?.length">
|
||||
OAuth Providers: {{ importPreview.oauth_providers.length }} 个
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -655,6 +659,26 @@
|
||||
跳过: {{ importResult.stats.models.skipped }}
|
||||
</p>
|
||||
</div>
|
||||
<div v-if="importResult.stats.ldap">
|
||||
<p class="font-medium">
|
||||
LDAP 配置
|
||||
</p>
|
||||
<p class="text-muted-foreground">
|
||||
创建: {{ importResult.stats.ldap.created }},
|
||||
更新: {{ importResult.stats.ldap.updated }},
|
||||
跳过: {{ importResult.stats.ldap.skipped }}
|
||||
</p>
|
||||
</div>
|
||||
<div v-if="importResult.stats.oauth">
|
||||
<p class="font-medium">
|
||||
OAuth Providers
|
||||
</p>
|
||||
<p class="text-muted-foreground">
|
||||
创建: {{ importResult.stats.oauth.created }},
|
||||
更新: {{ importResult.stats.oauth.updated }},
|
||||
跳过: {{ importResult.stats.oauth.skipped }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
@@ -1293,8 +1317,8 @@ function handleConfigFileSelect(event: Event) {
|
||||
const content = e.target?.result as string
|
||||
const data = JSON.parse(content) as ConfigExportData
|
||||
|
||||
// 验证版本
|
||||
if (data.version !== '2.0') {
|
||||
// 验证版本(支持 2.0 和 2.1)
|
||||
if (!['2.0', '2.1'].includes(data.version)) {
|
||||
error(`不支持的配置版本: ${data.version}`)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user