merge: 合入总仓库 weiyuan(bfdfb339) web/ 新功能,保留 ui-optimization 的 UI 重构
来源:luoguang/monkey-ai weiyuan@bfdfb339 的 web/(经 sync/main-weiyuan-web-bfdfb339 同步)
同步基准:总仓库 a2ca13cb = 本仓库初始导入 d8f3aee2
冲突处理原则:保留 ui-optimization 的 UI(样式/结构/组件),嫁接 weiyuan 的功能逻辑。
- i18n:按键三方合并;ours 的「令牌→密钥」改名键上移植 theirs 的术语修订
- task-logs / OrgLogs:ours 已手工移植同一功能(6ad95e2),保留 ours
- 删除:OrgCreate(theirs 下线 /org/create)、旧 image 组件与 VideoRegenerateModal(theirs 体验中心重写)、
OrgAvatarSection / PricingBentoPage / CommissionConsole(ours 重构中已移除)
- 测试:users-pagination 的 i18next mock 补 t();theirs 新增文件补 license header
This commit is contained in:
@@ -57,6 +57,7 @@ export default function SettingClaudeModel(props) {
|
||||
'claude.thinking_adapter_budget_tokens_percentage': 0.8,
|
||||
'claude.cache_creation_5m_ratio': 1.25,
|
||||
'claude.cache_creation_1h_ratio': 2,
|
||||
'claude.cache_ttl_override': 'off',
|
||||
});
|
||||
const refForm = useRef();
|
||||
const [inputsRow, setInputsRow] = useState(inputs);
|
||||
@@ -229,7 +230,7 @@ export default function SettingClaudeModel(props) {
|
||||
field={'claude.cache_creation_5m_ratio'}
|
||||
initValue={''}
|
||||
extraText={t(
|
||||
'仅作用于 Claude 模型,相对输入价格的倍率;未区分时长的缓存创建也按此倍率计费',
|
||||
'当前未生效:Claude 模型的全部缓存创建均按 1 小时缓存创建倍率计费',
|
||||
)}
|
||||
min={0}
|
||||
step={0.05}
|
||||
@@ -246,7 +247,9 @@ export default function SettingClaudeModel(props) {
|
||||
label={t('1小时缓存创建倍率')}
|
||||
field={'claude.cache_creation_1h_ratio'}
|
||||
initValue={''}
|
||||
extraText={t('仅作用于 Claude 模型,相对输入价格的倍率')}
|
||||
extraText={t(
|
||||
'仅作用于 Claude 模型,相对输入价格的倍率;5 分钟及未区分时长的缓存创建也统一按此倍率计费',
|
||||
)}
|
||||
min={0}
|
||||
step={0.05}
|
||||
onChange={(value) =>
|
||||
@@ -257,6 +260,27 @@ export default function SettingClaudeModel(props) {
|
||||
}
|
||||
/>
|
||||
</Col>
|
||||
<Col xs={24} sm={12} md={8} lg={8} xl={8}>
|
||||
<Form.Select
|
||||
label={t('缓存时长强制改写')}
|
||||
field={'claude.cache_ttl_override'}
|
||||
style={{ width: '100%' }}
|
||||
optionList={[
|
||||
{ label: t('不改写(跟随客户端)'), value: 'off' },
|
||||
{ label: t('强制 1 小时'), value: '1h' },
|
||||
{ label: t('强制 5 分钟'), value: '5m' },
|
||||
]}
|
||||
extraText={t(
|
||||
'改的是出境请求体,不是计费:会把请求里所有 cache_control 断点的 ttl 统一改写,包括客户端自己写死的值。透传模式(全局透传 / 渠道透传 / 仅 Claude Code 客户端)下不生效。',
|
||||
)}
|
||||
onChange={(value) =>
|
||||
setInputs({
|
||||
...inputs,
|
||||
'claude.cache_ttl_override': value,
|
||||
})
|
||||
}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<Row>
|
||||
|
||||
@@ -224,9 +224,7 @@ export default function SettingGeminiModel(props) {
|
||||
<Col span={16}>
|
||||
<Text>
|
||||
{t(
|
||||
'和Claude不同,默认情况下Gemini的思考模型会自动决定要不要思考,就算不开启适配模型也可以正常使用,' +
|
||||
'如果您需要计费,推荐设置无后缀模型价格按思考价格设置。' +
|
||||
'支持使用 gemini-2.5-pro-preview-06-05-thinking-128 格式来精确传递思考预算。',
|
||||
'和Claude不同,默认情况下Gemini的思考模型会自动决定要不要思考,就算不开启适配模型也可以正常使用,如果您需要计费,推荐设置无后缀模型价格按思考价格设置。支持使用 gemini-2.5-pro-preview-06-05-thinking-128 格式来精确传递思考预算。',
|
||||
)}
|
||||
</Text>
|
||||
</Col>
|
||||
|
||||
@@ -328,7 +328,10 @@ export default function SettingImagePricing({ options, refresh }) {
|
||||
<Space wrap>
|
||||
{(tiers || []).map((tier) => (
|
||||
<Tag key={tier.key} color='blue'>
|
||||
{`${tier.label || tier.key}: $${tier.price_per_image}/张`}
|
||||
{t('{{label}}: ${{price}}/张', {
|
||||
label: tier.label || tier.key,
|
||||
price: tier.price_per_image,
|
||||
})}
|
||||
</Tag>
|
||||
))}
|
||||
</Space>
|
||||
@@ -455,7 +458,7 @@ export default function SettingImagePricing({ options, refresh }) {
|
||||
>
|
||||
{RESOLUTION_RULE_OPTIONS.map((option) => (
|
||||
<Form.Select.Option key={option.value} value={option.value}>
|
||||
{option.label}
|
||||
{t(option.label)}
|
||||
</Form.Select.Option>
|
||||
))}
|
||||
</Form.Select>
|
||||
|
||||
@@ -330,7 +330,7 @@ export default function SettingVideoModel(props) {
|
||||
key: 'tier_param',
|
||||
render: (text) => {
|
||||
const opt = TIER_PARAM_OPTIONS.find((o) => o.value === text);
|
||||
return opt ? opt.label : text || 'resolution';
|
||||
return opt ? t(opt.label) : text || 'resolution';
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -401,7 +401,7 @@ export default function SettingVideoModel(props) {
|
||||
key: 'provider',
|
||||
render: (text) => {
|
||||
const provider = PROVIDER_OPTIONS.find((p) => p.value === text);
|
||||
return provider ? provider.label : text;
|
||||
return provider ? t(provider.label) : text;
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -410,7 +410,7 @@ export default function SettingVideoModel(props) {
|
||||
key: 'channel_type',
|
||||
render: (text) => {
|
||||
const channel = VIDEO_CHANNEL_TYPES.find((c) => c.value === text);
|
||||
return channel ? channel.label : text;
|
||||
return channel ? t(channel.label) : text;
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -697,7 +697,7 @@ export default function SettingVideoModel(props) {
|
||||
>
|
||||
{PROVIDER_OPTIONS.map((option) => (
|
||||
<Form.Select.Option key={option.value} value={option.value}>
|
||||
{option.label}
|
||||
{t(option.label)}
|
||||
</Form.Select.Option>
|
||||
))}
|
||||
</Form.Select>
|
||||
@@ -710,7 +710,7 @@ export default function SettingVideoModel(props) {
|
||||
>
|
||||
{VIDEO_CHANNEL_TYPES.map((option) => (
|
||||
<Form.Select.Option key={option.value} value={option.value}>
|
||||
{option.label}
|
||||
{t(option.label)}
|
||||
</Form.Select.Option>
|
||||
))}
|
||||
</Form.Select>
|
||||
@@ -768,7 +768,7 @@ export default function SettingVideoModel(props) {
|
||||
>
|
||||
{TIER_PARAM_OPTIONS.map((option) => (
|
||||
<Form.Select.Option key={option.value} value={option.value}>
|
||||
{option.label}
|
||||
{t(option.label)}
|
||||
</Form.Select.Option>
|
||||
))}
|
||||
</Form.Select>
|
||||
|
||||
Reference in New Issue
Block a user