fix(platform): avoid false storage error while health loads
This commit is contained in:
@@ -18,7 +18,8 @@ function formatLag(value?: number | null) {
|
||||
}
|
||||
|
||||
function storageReadStatus(health: OpsHealth | null) {
|
||||
return health?.tdengineWritable && health.mysqlWritable ? 'ok' : 'error';
|
||||
if (!health) return 'pending';
|
||||
return health.tdengineWritable && health.mysqlWritable ? 'ok' : 'error';
|
||||
}
|
||||
|
||||
function formatRequestTimeout(health: OpsHealth | null) {
|
||||
@@ -191,7 +192,9 @@ export function Quality({
|
||||
<Col span={6}><Card bordered title="BFF 请求超时">{formatRequestTimeout(health)}</Card></Col>
|
||||
<Col span={6}>
|
||||
<Card bordered title="存储读取">
|
||||
<Tag color={statusColor[storageReadStatus(health)]}>{storageReadStatus(health) === 'ok' ? '正常' : '异常'}</Tag>
|
||||
<Tag color={statusColor[storageReadStatus(health)] ?? 'grey'}>
|
||||
{storageReadStatus(health) === 'pending' ? '检测中' : storageReadStatus(health) === 'ok' ? '正常' : '异常'}
|
||||
</Tag>
|
||||
</Card>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
Reference in New Issue
Block a user