fix(*): 全量 UI 审查与 undefined 展示异常修复
分析模块:补齐看板、排行、趋势及报表数值兜底 企业与用户中心:修复统计、成员、技能及资金字段展示 充值与交易:修复充值、发票、订单、订阅及支付字段拼接 平台页面:修复渠道、模型、服务监控与状态空值展示 通用能力:新增安全展示工具,补齐九语言文案与回归测试 文档记录:更新修复范围、影响及回滚说明
This commit is contained in:
+37
-27
@@ -30,6 +30,7 @@ import {
|
||||
showSuccess,
|
||||
showError,
|
||||
} from './utils';
|
||||
import { formatPercent, toFiniteNumber } from './safeDisplay.js';
|
||||
import {
|
||||
STORAGE_KEYS,
|
||||
DEFAULT_TIME_INTERVALS,
|
||||
@@ -217,37 +218,46 @@ export const renderMonitorList = (
|
||||
grouped[g].push(m);
|
||||
});
|
||||
|
||||
const renderItem = (monitor, idx) => (
|
||||
<div key={idx} className='p-2 hover:bg-white rounded-lg transition-colors'>
|
||||
<div className='flex items-center justify-between mb-1'>
|
||||
<div className='flex items-center gap-2'>
|
||||
<div
|
||||
className='w-2 h-2 rounded-full flex-shrink-0'
|
||||
style={{ backgroundColor: getUptimeStatusColor(monitor.status) }}
|
||||
/>
|
||||
<span className='text-sm font-medium text-gray-900'>
|
||||
{monitor.name}
|
||||
const renderItem = (monitor, idx) => {
|
||||
const uptime = Math.max(
|
||||
0,
|
||||
Math.min(1, toFiniteNumber(monitor.uptime) ?? 0),
|
||||
);
|
||||
return (
|
||||
<div
|
||||
key={idx}
|
||||
className='p-2 hover:bg-white rounded-lg transition-colors'
|
||||
>
|
||||
<div className='flex items-center justify-between mb-1'>
|
||||
<div className='flex items-center gap-2'>
|
||||
<div
|
||||
className='w-2 h-2 rounded-full flex-shrink-0'
|
||||
style={{ backgroundColor: getUptimeStatusColor(monitor.status) }}
|
||||
/>
|
||||
<span className='text-sm font-medium text-gray-900'>
|
||||
{monitor.name}
|
||||
</span>
|
||||
</div>
|
||||
<span className='text-xs text-gray-500'>
|
||||
{formatPercent(uptime * 100, 2)}
|
||||
</span>
|
||||
</div>
|
||||
<span className='text-xs text-gray-500'>
|
||||
{((monitor.uptime || 0) * 100).toFixed(2)}%
|
||||
</span>
|
||||
</div>
|
||||
<div className='flex items-center gap-2'>
|
||||
<span className='text-xs text-gray-500'>
|
||||
{getUptimeStatusText(monitor.status)}
|
||||
</span>
|
||||
<div className='flex-1'>
|
||||
<Progress
|
||||
percent={(monitor.uptime || 0) * 100}
|
||||
showInfo={false}
|
||||
aria-label={`${monitor.name} uptime`}
|
||||
stroke={getUptimeStatusColor(monitor.status)}
|
||||
/>
|
||||
<div className='flex items-center gap-2'>
|
||||
<span className='text-xs text-gray-500'>
|
||||
{getUptimeStatusText(monitor.status)}
|
||||
</span>
|
||||
<div className='flex-1'>
|
||||
<Progress
|
||||
percent={uptime * 100}
|
||||
showInfo={false}
|
||||
aria-label={`${monitor.name} uptime`}
|
||||
stroke={getUptimeStatusColor(monitor.status)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
);
|
||||
};
|
||||
|
||||
return Object.entries(grouped).map(([gname, list]) => (
|
||||
<div key={gname || 'default'} className='mb-2'>
|
||||
|
||||
Reference in New Issue
Block a user