fix: 修复移动端 API 健康页面缺少数据显示
- 移动端添加 URL 地址显示 - 移动端添加状态文本显示(正常/异常/未配置) - 移动端添加消息/状态信息显示 - 移动端和桌面端显示信息保持一致
This commit is contained in:
+9
-9
@@ -483,17 +483,17 @@ class PositionCheckService(
|
||||
if (isMarketEnded) {
|
||||
logger.debug("市场已结束: marketId=$marketId, closed=${market.closed}, endDate=${market.endDate}")
|
||||
// 市场已结束,检查该 outcome 是赢了还是输了
|
||||
val outcomeResult = checkOutcomeResult(market, outcomeIndex)
|
||||
when (outcomeResult) {
|
||||
OutcomeResult.WON -> {
|
||||
val outcomeResult = checkOutcomeResult(market, outcomeIndex)
|
||||
when (outcomeResult) {
|
||||
OutcomeResult.WON -> {
|
||||
logger.info("市场已结束且该 outcome 赢了,返回价格为 1: marketId=$marketId, outcomeIndex=$outcomeIndex")
|
||||
return BigDecimal.ONE
|
||||
}
|
||||
OutcomeResult.LOST -> {
|
||||
return BigDecimal.ONE
|
||||
}
|
||||
OutcomeResult.LOST -> {
|
||||
logger.info("市场已结束且该 outcome 输了,返回价格为 0: marketId=$marketId, outcomeIndex=$outcomeIndex")
|
||||
return BigDecimal.ZERO
|
||||
}
|
||||
OutcomeResult.UNKNOWN -> {
|
||||
return BigDecimal.ZERO
|
||||
}
|
||||
OutcomeResult.UNKNOWN -> {
|
||||
// 无法判断,记录警告并继续使用正常价格逻辑
|
||||
logger.warn("市场已结束但无法判断 outcome 结果,使用正常价格: marketId=$marketId, outcomeIndex=$outcomeIndex, closed=${market.closed}, endDate=${market.endDate}, outcomePrices=${market.outcomePrices}, bestBid=${market.bestBid}, bestAsk=${market.bestAsk}")
|
||||
}
|
||||
|
||||
+3
-3
@@ -100,14 +100,14 @@ class TelegramNotificationService(
|
||||
if (orderResponse.isSuccessful && orderResponse.body() != null) {
|
||||
val order = orderResponse.body()!!
|
||||
if (actualPrice == null) {
|
||||
actualPrice = order.price
|
||||
actualPrice = order.price
|
||||
}
|
||||
if (actualSize == null) {
|
||||
actualSize = order.originalSize // 使用 originalSize 作为订单数量
|
||||
actualSize = order.originalSize // 使用 originalSize 作为订单数量
|
||||
}
|
||||
actualSide = order.side // 使用订单详情中的 side
|
||||
if (actualOutcome == null) {
|
||||
actualOutcome = order.outcome // 使用订单详情中的 outcome(市场方向)
|
||||
actualOutcome = order.outcome // 使用订单详情中的 outcome(市场方向)
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
|
||||
@@ -99,22 +99,22 @@ const ApiHealthStatus: React.FC = () => {
|
||||
bodyStyle={{ padding: '12px' }}
|
||||
>
|
||||
<Space direction="vertical" size="small" style={{ width: '100%' }}>
|
||||
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', flexWrap: 'wrap', gap: '8px' }}>
|
||||
<Text strong style={{ fontSize: '14px' }}>
|
||||
{item.name}
|
||||
</Text>
|
||||
<Space>
|
||||
{item.responseTime !== undefined && item.responseTime !== null && (
|
||||
<Text type="secondary" style={{ fontSize: '12px' }}>
|
||||
<Text strong style={{ color: '#1890ff' }}>{item.responseTime}ms</Text>
|
||||
</Text>
|
||||
)}
|
||||
<Badge
|
||||
status={item.status === 'success' ? 'success' : item.status === 'skipped' ? 'default' : 'error'}
|
||||
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', flexWrap: 'wrap', gap: '8px' }}>
|
||||
<Text strong style={{ fontSize: '14px' }}>
|
||||
{item.name}
|
||||
</Text>
|
||||
<Space>
|
||||
{item.responseTime !== undefined && item.responseTime !== null && (
|
||||
<Text type="secondary" style={{ fontSize: '12px' }}>
|
||||
<Text strong style={{ color: '#1890ff' }}>{item.responseTime}ms</Text>
|
||||
</Text>
|
||||
)}
|
||||
<Badge
|
||||
status={item.status === 'success' ? 'success' : item.status === 'skipped' ? 'default' : 'error'}
|
||||
text={getStatusText(item.status)}
|
||||
/>
|
||||
</Space>
|
||||
</div>
|
||||
/>
|
||||
</Space>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Text type="secondary" style={{ fontSize: '12px', wordBreak: 'break-all' }}>
|
||||
|
||||
Reference in New Issue
Block a user