diff --git a/src/app.scss b/src/app.scss index 6124068..4c0d416 100644 --- a/src/app.scss +++ b/src/app.scss @@ -127,6 +127,9 @@ a { &.ok { background-color: $primary-color; } + &.good { + background-color: #ffa500; + } &.down { background-color: #de484a; } diff --git a/src/components/uptimerobot.js b/src/components/uptimerobot.js index 4f6ee9b..aaa326f 100644 --- a/src/components/uptimerobot.js +++ b/src/components/uptimerobot.js @@ -8,6 +8,7 @@ function UptimeRobot({ apikey }) { const status = { ok: '正常', + good: '一般', down: '无法访问', unknow: '未知' }; @@ -35,6 +36,10 @@ function UptimeRobot({ apikey }) { status = 'ok'; text += `可用率 ${formatNumber(data.uptime)}%`; } + else if (data.uptime >= 98) { + status = 'good'; + text += `故障 ${data.down.times} 次,累计 ${formatDuration(data.down.duration)},可用率 ${formatNumber(data.uptime)}%`; + } else if (data.uptime <= 0 && data.down.times === 0) { status = 'none'; text += '无数据';