disable fetch cache
parent
7b85b89325
commit
1f4900b143
41
README.md
41
README.md
|
|
@ -1,40 +1 @@
|
|||
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
|
||||
|
||||
## Getting Started
|
||||
|
||||
First, run the development server:
|
||||
|
||||
```bash
|
||||
npm run dev
|
||||
# or
|
||||
yarn dev
|
||||
# or
|
||||
pnpm dev
|
||||
# or
|
||||
bun dev
|
||||
```
|
||||
|
||||
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
||||
|
||||
You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.
|
||||
|
||||
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.
|
||||
|
||||
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
|
||||
|
||||
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
|
||||
|
||||
## Learn More
|
||||
|
||||
To learn more about Next.js, take a look at the following resources:
|
||||
|
||||
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
|
||||
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
||||
|
||||
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
|
||||
|
||||
## Deploy on Vercel
|
||||
|
||||
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
|
||||
|
||||
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
|
||||
## UptimeFlare
|
||||
|
|
|
|||
|
|
@ -82,9 +82,17 @@ export default function MonitorDetail({ monitor, state }: { monitor: MonitorTarg
|
|||
}
|
||||
}
|
||||
|
||||
const uptimePercentBars = []
|
||||
for (let i = 0; i < 90; i++) {
|
||||
uptimePercentBars.push(<div key={i} style={{ height: '50px', background: 'red' }}/>)
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Text mt='sm' style={{ display: 'flex', alignItems: 'center' }}>{statusIcon} {monitor.name}</Text>
|
||||
{/* <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, 1fr)' }}>
|
||||
{uptimePercentBars}
|
||||
</div> */}
|
||||
<div style={{ height: '150px' }}>
|
||||
<Line options={options} data={data} />
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -55,6 +55,16 @@ const config = {
|
|||
target: 'https://server.lyc8503.site',
|
||||
timeout: 10000
|
||||
},
|
||||
{
|
||||
id: 'homelab',
|
||||
name: 'HomeLab',
|
||||
method: 'GET',
|
||||
target: 'https://lyc8503.cn4.quickconnect.cn/webstation/hello.txt',
|
||||
timeout: 10000,
|
||||
headers: {
|
||||
"Cookie": "type=tunnel;"
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 'broken-test',
|
||||
name: 'Ping 1.1.1.1',
|
||||
|
|
|
|||
|
|
@ -50,7 +50,12 @@ async function getStatus(monitor: MonitorTarget): Promise<{ ping: number; up: bo
|
|||
const response = await fetchTimeout(monitor.target, monitor.timeout || 10000, {
|
||||
method: monitor.method,
|
||||
headers: monitor.headers,
|
||||
body: monitor.body
|
||||
body: monitor.body,
|
||||
cf: {
|
||||
cacheTtlByStatus: {
|
||||
'100-599': -1 // Don't cache any status code, from https://developers.cloudflare.com/workers/runtime-apis/request/#requestinitcfproperties
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
console.log(`${monitor.name} responded with ${response.status}`)
|
||||
|
|
|
|||
Loading…
Reference in New Issue