Modify displayed
This commit is contained in:
parent
382b9409fd
commit
f669137839
@ -2,12 +2,12 @@
|
||||
window.Config = {
|
||||
|
||||
// 显示标题
|
||||
SiteName: '云生站点监测',
|
||||
SiteName: '浅语站点监测',
|
||||
|
||||
// UptimeRobot Api Keys
|
||||
// 支持 Monitor-Specific 和 Read-Only
|
||||
ApiKeys: [
|
||||
'ur1078385-b9802a0868414b8a975d5038',
|
||||
'ur2265723-f304ae7cfe64b92fbd6147f8',
|
||||
],
|
||||
|
||||
// 日志天数
|
||||
@ -22,15 +22,23 @@ window.Config = {
|
||||
Navi: [
|
||||
{
|
||||
text: '主页',
|
||||
url: 'https://tjys.tk'
|
||||
url: 'https://uv.wiki'
|
||||
},
|
||||
{
|
||||
text: '博客',
|
||||
url: 'https://blog.qikaile.tk'
|
||||
url: 'https://rainss.cn'
|
||||
},
|
||||
{
|
||||
text: 'GitHub',
|
||||
url: 'https://github.com/qikaile/uptime-status'
|
||||
text: '工具',
|
||||
url: 'https://tool.rainss.cn'
|
||||
},
|
||||
{
|
||||
text: '监控',
|
||||
url: 'https://dash.rains.autos'
|
||||
},
|
||||
{
|
||||
text: 'Github',
|
||||
url: 'https://github.com/rainerosion'
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
12
src/app.scss
12
src/app.scss
@ -34,7 +34,7 @@ a {
|
||||
padding: 30px 0 60px 0;
|
||||
color: white;
|
||||
width: 101%;
|
||||
height: 400px;
|
||||
height: 295px;
|
||||
padding-right: 1%;
|
||||
|
||||
.container {
|
||||
@ -105,7 +105,7 @@ a {
|
||||
max-width: 980px;
|
||||
margin: 0 auto;
|
||||
padding: 0 20px;
|
||||
margin-top: 200px;
|
||||
margin-top: 95px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@ -372,7 +372,7 @@ a {
|
||||
/* 小于 512px 时 */
|
||||
@media (max-width: 512px) {
|
||||
#header {
|
||||
height: 340px;
|
||||
height: 235px;
|
||||
|
||||
.logo {
|
||||
font-size: 18px;
|
||||
@ -384,7 +384,7 @@ a {
|
||||
}
|
||||
|
||||
.status-top {
|
||||
margin-top: 160px;
|
||||
margin-top: 55px;
|
||||
}
|
||||
|
||||
.status-tip {
|
||||
@ -412,7 +412,7 @@ a {
|
||||
/* 小于 370px 时 */
|
||||
@media (max-width: 370px) {
|
||||
#header {
|
||||
height: 300px;
|
||||
height: 195px;
|
||||
|
||||
.logo {
|
||||
font-size: 16px;
|
||||
@ -420,7 +420,7 @@ a {
|
||||
}
|
||||
|
||||
.status-top {
|
||||
margin-top: 90px;
|
||||
margin-top: 35px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
@ -11,12 +11,10 @@ export async function GetMonitors(apikey, days) {
|
||||
for (let d = 0; d < days; d++) {
|
||||
dates.push(today.subtract(d, 'day'));
|
||||
}
|
||||
|
||||
const ranges = dates.map((date) => `${date.unix()}_${date.add(1, 'day').unix()}`);
|
||||
const start = dates[dates.length - 1].unix();
|
||||
const end = dates[0].add(1, 'day').unix();
|
||||
ranges.push(`${start}_${end}`);
|
||||
|
||||
const postdata = {
|
||||
api_key: apikey,
|
||||
format: 'json',
|
||||
@ -24,7 +22,7 @@ export async function GetMonitors(apikey, days) {
|
||||
log_types: '1-2',
|
||||
logs_start_date: start,
|
||||
logs_end_date: end,
|
||||
custom_uptime_ranges: ranges.join('-'),
|
||||
custom_uptime_ranges: ranges.reverse().join('-'),
|
||||
};
|
||||
|
||||
const response = await axios.post('https://uptimestatus.qikaile.tk/v2/getMonitors', postdata, {
|
||||
@ -42,10 +40,10 @@ export async function GetMonitors(apikey, days) {
|
||||
return response.data.monitors.map((monitor) => {
|
||||
|
||||
const ranges = monitor.custom_uptime_ranges.split('-');
|
||||
const average = formatNumber(ranges.pop());
|
||||
const average = formatNumber(ranges.shift());
|
||||
const daily = [];
|
||||
const map = [];
|
||||
dates.forEach((date, index) => {
|
||||
dates.reverse().forEach((date, index) => {
|
||||
map[date.format('YYYYMMDD')] = index;
|
||||
daily[index] = {
|
||||
date: date,
|
||||
|
||||
@ -24,7 +24,7 @@ function App() {
|
||||
</div>
|
||||
<div id='footer'>
|
||||
<p>基于 <Link to='https://uptimerobot.com/' text='UptimeRobot' /> 接口 | 检测频率 5 分钟</p>
|
||||
<p>2020 - 2023 © Reach - <Link to='/' text='墨明' /></p>
|
||||
<p>2015 - 2023 © Rainerosion - <Link to='https://rainss.cn' text='浅语' /></p>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
|
||||
@ -29,6 +29,7 @@ function UptimeRobot({ apikey }) {
|
||||
</div>
|
||||
<div className='timeline'>
|
||||
{site.daily.map((data, index) => {
|
||||
debugger;
|
||||
let status = '';
|
||||
let text = data.date.format('YYYY-MM-DD ');
|
||||
if (data.uptime >= 100) {
|
||||
@ -47,13 +48,13 @@ function UptimeRobot({ apikey }) {
|
||||
})}
|
||||
</div>
|
||||
<div className='summary'>
|
||||
<span className='summary-now'>今天</span>
|
||||
<span className='summary-day'>{site.daily[site.daily.length - 1].date.format('YYYY-MM-DD')}</span>
|
||||
<span className='summary-note'>
|
||||
{site.total.times
|
||||
? `最近 ${CountDays} 天内故障 ${site.total.times} 次,累计 ${formatDuration(site.total.duration)},平均可用率 ${site.average}%`
|
||||
: `最近 ${CountDays} 天内可用率 ${site.average}%`}
|
||||
</span>
|
||||
<span className='summary-day'>{site.daily[site.daily.length - 1].date.format('YYYY-MM-DD')}</span>
|
||||
<span className='summary-now'>今天</span>
|
||||
</div>
|
||||
<ReactTooltip className='tooltip' place='top' type='dark' effect='solid' />
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user