mirror of https://github.com/yb/uptime-status
Add new grade
parent
25e5229498
commit
12284bcd22
|
@ -127,6 +127,9 @@ a {
|
||||||
&.ok {
|
&.ok {
|
||||||
background-color: $primary-color;
|
background-color: $primary-color;
|
||||||
}
|
}
|
||||||
|
&.good {
|
||||||
|
background-color: #ffa500;
|
||||||
|
}
|
||||||
&.down {
|
&.down {
|
||||||
background-color: #de484a;
|
background-color: #de484a;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ function UptimeRobot({ apikey }) {
|
||||||
|
|
||||||
const status = {
|
const status = {
|
||||||
ok: '正常',
|
ok: '正常',
|
||||||
|
good: '一般',
|
||||||
down: '无法访问',
|
down: '无法访问',
|
||||||
unknow: '未知'
|
unknow: '未知'
|
||||||
};
|
};
|
||||||
|
@ -35,6 +36,10 @@ function UptimeRobot({ apikey }) {
|
||||||
status = 'ok';
|
status = 'ok';
|
||||||
text += `可用率 ${formatNumber(data.uptime)}%`;
|
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) {
|
else if (data.uptime <= 0 && data.down.times === 0) {
|
||||||
status = 'none';
|
status = 'none';
|
||||||
text += '无数据';
|
text += '无数据';
|
||||||
|
|
Loading…
Reference in New Issue