feat: 优化系统配置和统计功能
- 系统配置支持显示完整的 Builder API Key(不再部分显示) - Secret 和 Passphrase 使用密码输入框,支持眼睛图标切换显示/隐藏 - 移除已配置提示,简化用户界面 - 修复总卖出金额统计:使用 SellMatchDetail 计算,确保准确性 - 修复 matchSellOrder 中价格不一致问题:matchDetails 使用实际卖出价格 - 移动端 Leader 列表移除网站显示行 - 优化订单创建前订单簿匹配检查,避免 FAK 订单失败
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { useEffect, useState } from 'react'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import { Card, Table, Button, Space, Tag, Popconfirm, message, List, Empty, Spin, Divider, Typography } from 'antd'
|
||||
import { PlusOutlined, EditOutlined, DeleteOutlined, LinkOutlined, GlobalOutlined } from '@ant-design/icons'
|
||||
import { PlusOutlined, EditOutlined, DeleteOutlined, GlobalOutlined } from '@ant-design/icons'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { apiService } from '../services/api'
|
||||
import type { Leader } from '../types'
|
||||
@@ -225,23 +225,6 @@ const LeaderList: React.FC = () => {
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* 网站 */}
|
||||
{leader.website && (
|
||||
<div style={{ marginBottom: '12px' }}>
|
||||
<Text type="secondary" style={{ fontSize: '12px' }}>
|
||||
{t('leaderList.website') || '网站'}:
|
||||
</Text>
|
||||
<a
|
||||
href={leader.website}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
style={{ fontSize: '12px', marginLeft: '4px' }}
|
||||
>
|
||||
<LinkOutlined /> {leader.website}
|
||||
</a>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<Divider style={{ margin: '12px 0' }} />
|
||||
|
||||
{/* 跟单关系数 */}
|
||||
|
||||
@@ -348,10 +348,11 @@ const SystemSettings: React.FC = () => {
|
||||
if (response.data.code === 0 && response.data.data) {
|
||||
const config = response.data.data
|
||||
setSystemConfig(config)
|
||||
// 将已配置的值填充到输入框中
|
||||
relayerForm.setFieldsValue({
|
||||
builderApiKey: '',
|
||||
builderSecret: '',
|
||||
builderPassphrase: '',
|
||||
builderApiKey: config.builderApiKeyDisplay || '',
|
||||
builderSecret: config.builderSecretDisplay || '',
|
||||
builderPassphrase: config.builderPassphraseDisplay || '',
|
||||
})
|
||||
autoRedeemForm.setFieldsValue({
|
||||
autoRedeemEnabled: config.autoRedeemEnabled
|
||||
@@ -685,30 +686,32 @@ const SystemSettings: React.FC = () => {
|
||||
<Form.Item
|
||||
label={t('builderApiKey.apiKey')}
|
||||
name="builderApiKey"
|
||||
help={systemConfig?.builderApiKeyConfigured ? t('builderApiKey.apiKeyHelp') : t('builderApiKey.apiKeyPlaceholder')}
|
||||
>
|
||||
<Input
|
||||
placeholder={systemConfig?.builderApiKeyConfigured ? t('builderApiKey.apiKeyHelp') : t('builderApiKey.apiKeyPlaceholder')}
|
||||
placeholder={t('builderApiKey.apiKeyPlaceholder')}
|
||||
style={{ fontFamily: 'monospace' }}
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label={t('builderApiKey.secret')}
|
||||
name="builderSecret"
|
||||
help={systemConfig?.builderSecretConfigured ? t('builderApiKey.secretHelp') : t('builderApiKey.secretPlaceholder')}
|
||||
>
|
||||
<Input
|
||||
placeholder={systemConfig?.builderSecretConfigured ? t('builderApiKey.secretHelp') : t('builderApiKey.secretPlaceholder')}
|
||||
<Input.Password
|
||||
placeholder={t('builderApiKey.secretPlaceholder')}
|
||||
style={{ fontFamily: 'monospace' }}
|
||||
iconRender={(visible) => (visible ? <span>👁️</span> : <span>👁️🗨️</span>)}
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label={t('builderApiKey.passphrase')}
|
||||
name="builderPassphrase"
|
||||
help={systemConfig?.builderPassphraseConfigured ? t('builderApiKey.passphraseHelp') : t('builderApiKey.passphrasePlaceholder')}
|
||||
>
|
||||
<Input
|
||||
placeholder={systemConfig?.builderPassphraseConfigured ? t('builderApiKey.passphraseHelp') : t('builderApiKey.passphrasePlaceholder')}
|
||||
<Input.Password
|
||||
placeholder={t('builderApiKey.passphrasePlaceholder')}
|
||||
style={{ fontFamily: 'monospace' }}
|
||||
iconRender={(visible) => (visible ? <span>👁️</span> : <span>👁️🗨️</span>)}
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
|
||||
@@ -770,6 +770,9 @@ export interface SystemConfig {
|
||||
builderApiKeyConfigured: boolean
|
||||
builderSecretConfigured: boolean
|
||||
builderPassphraseConfigured: boolean
|
||||
builderApiKeyDisplay?: string // Builder API Key 显示值(部分显示)
|
||||
builderSecretDisplay?: string // Builder Secret 显示值(部分显示)
|
||||
builderPassphraseDisplay?: string // Builder Passphrase 显示值(部分显示)
|
||||
autoRedeemEnabled: boolean // 自动赎回(系统级别配置,默认开启)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user