feat(KIRO): 添加KIRO_REFRESH_IDC_URL字段和认证提示信息
添加KIRO提供商的新配置字段KIRO_REFRESH_IDC_URL 为KIRO OAuth认证添加提示信息说明需要clientId和clientSecret 调整相关表单样式和字段处理逻辑
This commit is contained in:
parent
6a8e81d7f3
commit
b0d1094207
5 changed files with 580 additions and 363 deletions
|
|
@ -349,6 +349,7 @@ const translations = {
|
|||
'modal.provider.add.failed': '添加失败',
|
||||
'modal.provider.resetHealth.success': '成功重置 {count} 个节点的健康状态',
|
||||
'modal.provider.resetHealth.failed': '重置健康状态失败',
|
||||
'modal.provider.kiroAuthHint': '使用 AWS Builder ID 登录方式时,需要 <code>clientId</code> 和 <code>clientSecret</code> 字段,可在同文件夹下的另一个 JSON 文件中获取',
|
||||
|
||||
// Pagination
|
||||
'pagination.showing': '显示 {start}-{end} / 共 {total} 条',
|
||||
|
|
@ -768,6 +769,7 @@ const translations = {
|
|||
'modal.provider.add.failed': 'Add failed',
|
||||
'modal.provider.resetHealth.success': 'Successfully reset health status for {count} nodes',
|
||||
'modal.provider.resetHealth.failed': 'Failed to reset health status',
|
||||
'modal.provider.kiroAuthHint': 'When using AWS Builder ID login, <code>clientId</code> and <code>clientSecret</code> fields are required, which can be found in another JSON file in the same folder',
|
||||
|
||||
// Pagination
|
||||
'pagination.showing': 'Showing {start}-{end} of {total}',
|
||||
|
|
|
|||
|
|
@ -534,6 +534,7 @@ function renderProviderConfig(provider) {
|
|||
`;
|
||||
} else if (field1IsOAuthFilePath) {
|
||||
// OAuth凭据文件路径字段,添加上传按钮
|
||||
const field1IsKiro = field1Key.includes('KIRO');
|
||||
html += `
|
||||
<div class="config-item">
|
||||
<label>${field1Label}</label>
|
||||
|
|
@ -549,6 +550,7 @@ function renderProviderConfig(provider) {
|
|||
<i class="fas fa-upload"></i>
|
||||
</button>
|
||||
</div>
|
||||
${field1IsKiro ? '<small class="form-text"><i class="fas fa-info-circle"></i> ' + t('modal.provider.kiroAuthHint') + '</small>' : ''}
|
||||
</div>
|
||||
`;
|
||||
} else {
|
||||
|
|
@ -594,6 +596,7 @@ function renderProviderConfig(provider) {
|
|||
`;
|
||||
} else if (field2IsOAuthFilePath) {
|
||||
// OAuth凭据文件路径字段,添加上传按钮
|
||||
const field2IsKiro = field2Key.includes('KIRO');
|
||||
html += `
|
||||
<div class="config-item">
|
||||
<label>${field2Label}</label>
|
||||
|
|
@ -609,6 +612,7 @@ function renderProviderConfig(provider) {
|
|||
<i class="fas fa-upload"></i>
|
||||
</button>
|
||||
</div>
|
||||
${field2IsKiro ? '<small class="form-text"><i class="fas fa-info-circle"></i> ' + t('modal.provider.kiroAuthHint') + '</small>' : ''}
|
||||
</div>
|
||||
`;
|
||||
} else {
|
||||
|
|
@ -670,7 +674,7 @@ function getFieldOrder(provider) {
|
|||
'openaiResponses-custom': ['OPENAI_API_KEY', 'OPENAI_BASE_URL'],
|
||||
'claude-custom': ['CLAUDE_API_KEY', 'CLAUDE_BASE_URL'],
|
||||
'gemini-cli-oauth': ['PROJECT_ID', 'GEMINI_OAUTH_CREDS_FILE_PATH', 'GEMINI_BASE_URL'],
|
||||
'claude-kiro-oauth': ['KIRO_OAUTH_CREDS_FILE_PATH', 'KIRO_BASE_URL', 'KIRO_REFRESH_URL'],
|
||||
'claude-kiro-oauth': ['KIRO_OAUTH_CREDS_FILE_PATH', 'KIRO_BASE_URL', 'KIRO_REFRESH_URL', 'KIRO_REFRESH_IDC_URL'],
|
||||
'openai-qwen-oauth': ['QWEN_OAUTH_CREDS_FILE_PATH', 'QWEN_BASE_URL', 'QWEN_OAUTH_BASE_URL'],
|
||||
'gemini-antigravity': ['PROJECT_ID', 'ANTIGRAVITY_OAUTH_CREDS_FILE_PATH', 'ANTIGRAVITY_BASE_URL_DAILY', 'ANTIGRAVITY_BASE_URL_AUTOPUSH']
|
||||
};
|
||||
|
|
@ -1116,19 +1120,19 @@ function addDynamicConfigFields(form, providerType) {
|
|||
`;
|
||||
} else if (isOAuthFilePath1) {
|
||||
// OAuth凭据文件路径字段,添加上传按钮
|
||||
const isKiroField = field1.id.includes('Kiro');
|
||||
fields += `
|
||||
<div class="form-group">
|
||||
<label>${field1.label}</label>
|
||||
<div class="file-input-group">
|
||||
<input type="text" id="new${field1.id}" class="form-control" placeholder="${field1.placeholder || ''}" value="${field1.value || ''}">
|
||||
<button type="button" class="btn btn-outline upload-btn" data-target="new${field1.id}" aria-label="上传文件">
|
||||
<i class="fas fa-upload"></i>
|
||||
</button>
|
||||
</div>
|
||||
${isKiroField ? '<small class="form-text"><i class="fas fa-info-circle"></i> 使用 AWS 登录方式时,请确保授权文件中包含 <code>clientId</code> 和 <code>clientSecret</code> 字段</small>' : ''}
|
||||
</div>
|
||||
`;
|
||||
const isKiroField = field1.id.includes('KIRO');
|
||||
fields += `
|
||||
<div class="form-group">
|
||||
<label>${field1.label}</label>
|
||||
<div class="file-input-group">
|
||||
<input type="text" id="new${field1.id}" class="form-control" placeholder="${field1.placeholder || ''}" value="${field1.value || ''}">
|
||||
<button type="button" class="btn btn-outline upload-btn" data-target="new${field1.id}" aria-label="上传文件">
|
||||
<i class="fas fa-upload"></i>
|
||||
</button>
|
||||
</div>
|
||||
${isKiroField ? '<small class="form-text"><i class="fas fa-info-circle"></i> ' + t('modal.provider.kiroAuthHint') + '</small>' : ''}
|
||||
</div>
|
||||
`;
|
||||
} else {
|
||||
fields += `
|
||||
<div class="form-group">
|
||||
|
|
@ -1159,19 +1163,19 @@ function addDynamicConfigFields(form, providerType) {
|
|||
`;
|
||||
} else if (isOAuthFilePath2) {
|
||||
// OAuth凭据文件路径字段,添加上传按钮
|
||||
const isKiroField = field2.id.includes('Kiro');
|
||||
fields += `
|
||||
<div class="form-group">
|
||||
<label>${field2.label}</label>
|
||||
<div class="file-input-group">
|
||||
<input type="text" id="new${field2.id}" class="form-control" placeholder="${field2.placeholder || ''}" value="${field2.value || ''}">
|
||||
<button type="button" class="btn btn-outline upload-btn" data-target="new${field2.id}" aria-label="上传文件">
|
||||
<i class="fas fa-upload"></i>
|
||||
</button>
|
||||
</div>
|
||||
${isKiroField ? '<small class="form-text"><i class="fas fa-info-circle"></i> 使用 AWS 登录方式时,请确保授权文件中包含 <code>clientId</code> 和 <code>clientSecret</code> 字段</small>' : ''}
|
||||
</div>
|
||||
`;
|
||||
const isKiroField = field2.id.includes('KIRO');
|
||||
fields += `
|
||||
<div class="form-group">
|
||||
<label>${field2.label}</label>
|
||||
<div class="file-input-group">
|
||||
<input type="text" id="new${field2.id}" class="form-control" placeholder="${field2.placeholder || ''}" value="${field2.value || ''}">
|
||||
<button type="button" class="btn btn-outline upload-btn" data-target="new${field2.id}" aria-label="上传文件">
|
||||
<i class="fas fa-upload"></i>
|
||||
</button>
|
||||
</div>
|
||||
${isKiroField ? '<small class="form-text"><i class="fas fa-info-circle"></i> ' + t('modal.provider.kiroAuthHint') + '</small>' : ''}
|
||||
</div>
|
||||
`;
|
||||
} else {
|
||||
fields += `
|
||||
<div class="form-group">
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -84,6 +84,7 @@ function getFieldLabel(key) {
|
|||
'GEMINI_BASE_URL': 'Gemini Base URL',
|
||||
'KIRO_BASE_URL': 'Base URL',
|
||||
'KIRO_REFRESH_URL': 'Refresh URL',
|
||||
'KIRO_REFRESH_IDC_URL': 'Refresh IDC URL',
|
||||
'QWEN_BASE_URL': 'Qwen Base URL',
|
||||
'QWEN_OAUTH_BASE_URL': 'OAuth Base URL',
|
||||
'ANTIGRAVITY_BASE_URL_DAILY': 'Daily Base URL',
|
||||
|
|
|
|||
|
|
@ -545,7 +545,7 @@
|
|||
<input type="number" id="port" class="form-control" value="3000">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="form-group pool-section">
|
||||
<label data-i18n="config.modelProvider">模型提供商 (可多选)</label>
|
||||
<div id="modelProvider" class="provider-checklist">
|
||||
<label class="checkbox-item">
|
||||
|
|
@ -577,7 +577,7 @@
|
|||
<span>OpenAI Responses</span>
|
||||
</label>
|
||||
</div>
|
||||
<small class="form-text text-muted" data-i18n="config.modelProviderHelp">勾选启动时初始化的模型提供商 (必须至少勾选一个)</small>
|
||||
<small class="form-text" data-i18n="config.modelProviderHelp">勾选启动时初始化的模型提供商 (必须至少勾选一个)</small>
|
||||
</div>
|
||||
|
||||
<!-- 高级配置区域 -->
|
||||
|
|
@ -592,7 +592,7 @@
|
|||
<input type="text" id="proxyUrl" class="form-control" data-i18n-placeholder="config.proxy.urlPlaceholder" placeholder="例如: http://127.0.0.1:7890 或 socks5://127.0.0.1:1080">
|
||||
<small class="form-text" data-i18n="config.proxy.urlNote">支持 HTTP、HTTPS 和 SOCKS5 代理,留空则不使用代理</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="form-group pool-section">
|
||||
<label data-i18n="config.proxy.enabledProviders">启用代理的提供商</label>
|
||||
<div id="proxyProviders" class="provider-checklist">
|
||||
<label class="checkbox-item">
|
||||
|
|
|
|||
Loading…
Reference in a new issue