mirror of
https://github.com/qingchencloud/clawpanel.git
synced 2026-05-31 05:10:14 +08:00
i18n: - Add 9 new locale files (ja/ko/de/es/fr/pt/ru/vi/zh-TW) - Add multilingual README files for all 11 languages - Add locale helper, index, and modular translation system - Add translation generation scripts Website (docs/index.html): - Replace 公益AI接口 branding with 晴辰云AI接口 - Remove OpenClaw 独立安装包 promotion block - Update SEO meta tags (description, keywords, OG, Twitter, JSON-LD) - Add 11-language README links to footer - Update 元宝派 link to new URL Bug fixes: - fix(cron): delivery format mode:'push' → mode:'announce', remove invalid 'to' field (fixes #141) - fix(cron): allow single-channel users to select delivery channel - fix(cron): preserve delivery field in job state for editing - fix(models): add 'ollama' as recognized API type, prevent overwriting native ollama config (fixes #140) - fix(models): skip /v1 append for ollama native API baseUrl - fix(assistant): normalize 'google-generative-ai' consistently, add ollama hints - fix(version): use CLI path classification for source detection on Windows (fixes #139) - fix(version): default to 'official' instead of 'chinese' when source unknown - fix(version): reorder npm global package check based on active CLI
This commit is contained in:
@@ -509,13 +509,16 @@ function renderCommunity(page) {
|
||||
<div style="font-size:var(--font-size-sm);margin-top:8px;color:var(--text-secondary)">${t('about.feishuGroup')}</div>
|
||||
</div>
|
||||
<div style="flex:1;min-width:200px;display:flex;flex-direction:column;gap:8px;padding-top:4px">
|
||||
<div style="font-size:var(--font-size-sm);color:var(--text-secondary)">${t('about.communityDesc')}</div>
|
||||
<div style="font-size:var(--font-size-sm);color:var(--text-secondary)">${t('about.communityWelcome')}</div>
|
||||
<div style="font-size:var(--font-size-sm);color:var(--text-secondary);font-style:italic">${t('about.communityWelcomeIntl')}</div>
|
||||
<div style="font-size:var(--font-size-sm);color:var(--text-secondary);margin-top:4px">${t('about.communityDesc')}</div>
|
||||
<div style="display:flex;flex-wrap:wrap;gap:8px;margin-top:8px">
|
||||
<a class="btn btn-sm" href="https://discord.gg/U9AttmsNHh" target="_blank" rel="noopener" style="background:#5865F2;color:#fff;display:inline-flex;align-items:center;gap:4px;border:none">${icon('message-circle', 14)} ${t('about.joinDiscord')}</a>
|
||||
<a class="btn btn-primary btn-sm" href="https://qt.cool/c/OpenClaw" target="_blank" rel="noopener">${t('about.joinQQ')}</a>
|
||||
<a class="btn btn-primary btn-sm" href="https://qt.cool/c/OpenClawWx" target="_blank" rel="noopener">${t('about.joinWechat')}</a>
|
||||
<a class="btn btn-primary btn-sm" href="https://qt.cool/c/OpenClawDY" target="_blank" rel="noopener">${t('about.joinDouyin')}</a>
|
||||
<a class="btn btn-primary btn-sm" href="https://qt.cool/c/feishu" target="_blank" rel="noopener">${t('about.joinFeishu')}</a>
|
||||
<a class="btn btn-secondary btn-sm" href="https://yb.tencent.com/gp/i/LsvIw7mdR7Lb" target="_blank" rel="noopener">${t('about.joinYuanbao')}</a>
|
||||
<a class="btn btn-secondary btn-sm" href="https://yb.tencent.com/gp/i/IIGXzcMcdh84" target="_blank" rel="noopener">${t('about.joinYuanbao')}</a>
|
||||
</div>
|
||||
<div style="font-size:var(--font-size-xs);color:var(--text-tertiary);margin-top:8px">
|
||||
${t('about.communityNote')}
|
||||
|
||||
@@ -52,21 +52,23 @@ const API_TYPES = SHARED_API_TYPES
|
||||
function normalizeApiType(raw) {
|
||||
const type = (raw || '').trim()
|
||||
if (type === 'anthropic' || type === 'anthropic-messages') return 'anthropic-messages'
|
||||
if (type === 'google-gemini') return 'google-gemini'
|
||||
if (type === 'google-gemini' || type === 'google-generative-ai') return 'google-generative-ai'
|
||||
if (type === 'ollama') return 'ollama'
|
||||
if (type === 'openai' || type === 'openai-completions' || type === 'openai-responses') return 'openai-completions'
|
||||
return 'openai-completions'
|
||||
}
|
||||
|
||||
function requiresApiKey(apiType) {
|
||||
const type = normalizeApiType(apiType)
|
||||
return type === 'anthropic-messages' || type === 'google-gemini'
|
||||
return type === 'anthropic-messages' || type === 'google-generative-ai'
|
||||
}
|
||||
|
||||
function apiHintText(apiType) {
|
||||
return {
|
||||
'openai-completions': t('assistant.apiHintOpenai'),
|
||||
'anthropic-messages': t('assistant.apiHintAnthropic'),
|
||||
'google-gemini': t('assistant.apiHintGemini'),
|
||||
'google-generative-ai': t('assistant.apiHintGemini'),
|
||||
'ollama': 'Ollama 原生 API,baseUrl 填 http://127.0.0.1:11434(不需要 /v1)',
|
||||
}[normalizeApiType(apiType)] || t('assistant.apiHintOpenai')
|
||||
}
|
||||
|
||||
@@ -74,7 +76,8 @@ function apiBasePlaceholder(apiType) {
|
||||
return {
|
||||
'openai-completions': t('assistant.apiBasePlaceholderOpenai'),
|
||||
'anthropic-messages': 'https://api.anthropic.com',
|
||||
'google-gemini': 'https://generativelanguage.googleapis.com/v1beta',
|
||||
'google-generative-ai': 'https://generativelanguage.googleapis.com/v1beta',
|
||||
'ollama': 'http://127.0.0.1:11434',
|
||||
}[normalizeApiType(apiType)] || 'https://api.openai.com/v1'
|
||||
}
|
||||
|
||||
@@ -82,7 +85,8 @@ function apiKeyPlaceholder(apiType) {
|
||||
return {
|
||||
'openai-completions': t('assistant.apiKeyPlaceholderOpenai'),
|
||||
'anthropic-messages': 'sk-ant-...',
|
||||
'google-gemini': 'AIza...',
|
||||
'google-generative-ai': 'AIza...',
|
||||
'ollama': 'ollama-local',
|
||||
}[normalizeApiType(apiType)] || 'sk-...'
|
||||
}
|
||||
|
||||
|
||||
@@ -132,6 +132,7 @@ async function fetchJobs(page, state) {
|
||||
schedule: j.schedule || {},
|
||||
enabled: j.enabled !== false,
|
||||
agentId: j.agentId || null,
|
||||
delivery: j.delivery || null,
|
||||
lastRunStatus: j.state?.lastRunStatus || j.state?.lastStatus || null,
|
||||
lastRunAtMs: j.state?.lastRunAtMs || null,
|
||||
lastError: j.state?.lastError || null,
|
||||
@@ -352,7 +353,7 @@ async function openTaskDialog(job, page, state) {
|
||||
api.readOpenclawConfig().then(cfg => {
|
||||
const channels = cfg?.channels || {}
|
||||
const channelIds = Object.keys(channels).filter(k => k !== 'defaults')
|
||||
if (channelIds.length <= 1) return // 单渠道或无渠道不需要选
|
||||
if (channelIds.length === 0) return // 无渠道不需要选
|
||||
const select = modal.querySelector('select[name="deliveryChannel"]')
|
||||
if (!select) return
|
||||
const current = job?.delivery?.channel || ''
|
||||
@@ -427,7 +428,7 @@ async function openTaskDialog(job, page, state) {
|
||||
if (agentId) patch.agentId = agentId
|
||||
const deliveryChannel = modal.querySelector('select[name="deliveryChannel"]')?.value
|
||||
if (deliveryChannel) {
|
||||
patch.delivery = { mode: 'push', to: deliveryChannel, channel: deliveryChannel }
|
||||
patch.delivery = { mode: 'announce', channel: deliveryChannel }
|
||||
}
|
||||
await wsClient.request('cron.update', { jobId: job.id, patch })
|
||||
toast(t('cron.updated'), 'success')
|
||||
@@ -441,7 +442,7 @@ async function openTaskDialog(job, page, state) {
|
||||
if (agentId) params.agentId = agentId
|
||||
const deliveryChannel = modal.querySelector('select[name="deliveryChannel"]')?.value
|
||||
if (deliveryChannel) {
|
||||
params.delivery = { mode: 'push', to: deliveryChannel, channel: deliveryChannel }
|
||||
params.delivery = { mode: 'announce', channel: deliveryChannel }
|
||||
}
|
||||
await wsClient.request('cron.add', params)
|
||||
toast(t('cron.created'), 'success')
|
||||
|
||||
@@ -402,8 +402,8 @@ function normalizeProviderUrls(config) {
|
||||
const apiType = (p.api || 'openai-completions').toLowerCase()
|
||||
if (apiType === 'anthropic-messages') {
|
||||
if (!url.endsWith('/v1')) url += '/v1'
|
||||
} else if (apiType !== 'google-generative-ai') {
|
||||
// Ollama 端口检测:11434 默认需要加 /v1
|
||||
} else if (apiType !== 'google-generative-ai' && apiType !== 'ollama') {
|
||||
// Ollama OpenAI 兼容模式端口检测:11434 默认需要加 /v1(ollama 原生 API 不需要)
|
||||
if (/:11434$/.test(url) && !url.endsWith('/v1')) url += '/v1'
|
||||
// 不再强制追加 /v1,尊重用户填写的 URL(火山引擎等第三方用 /v3 等路径)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user