minor fixes

pull/10/head
lyc8503 2024-03-18 15:44:26 +08:00
parent 4963a4815a
commit 8b17cb840b
2 changed files with 10 additions and 7 deletions

View File

@ -5,7 +5,7 @@ A more advanced, serverless, and free uptime monitoring & status page solution,
## ⭐Features
- Open-source, easy to deploy (in under 10 minutes, no local tools required), and free
- Monitoring capabilities
- Up to 50 checks at 2-minute intervals
- Up to 50 checks at 1-minute intervals
- Geo-specific checks from over [310 cities](https://www.cloudflare.com/network/) worldwide
- Support for HTTP/HTTPS/TCP port monitoring
- Up to 90-day uptime history and uptime percentage tracking
@ -38,5 +38,5 @@ Please refer to [Quickstart](https://github.com/lyc8503/UptimeFlare/wiki/Quickst
- [x] [Bark](https://bark.day.app) example
- [ ] Slack example
- [ ] Incident timeline
- [ ] Email notification via Cloudflare Email Workers
- [x] ~~Email notification via Cloudflare Email Workers~~
- [x] Specify region for monitors

View File

@ -10,8 +10,8 @@ const pageConfig = {
}
const workerConfig = {
// Write KV at most every 10 minutes unless the status changed.
kvWriteCooldownMinutes: 10,
// Write KV at most every 3 minutes unless the status changed.
kvWriteCooldownMinutes: 3,
// Define all your monitors here
monitors: [
// Example HTTP Monitor
@ -66,6 +66,10 @@ const workerConfig = {
timeNow: number,
reason: string
) => {
// This callback will be called when there's a status change for any monitor
// Write any Typescript code here
// By default, this sends Bark and Telegram notification on every status change if you setup Env correctly.
await notify(env, monitor, isUp, timeIncidentStart, timeNow, reason)
},
onIncident: async (
@ -76,7 +80,7 @@ const workerConfig = {
timeNow: number,
reason: string
) => {
// This callback will be called EVERY 2 MINTUES if there's an on-going incident for any monitor
// This callback will be called EVERY 1 MINTUE if there's an on-going incident for any monitor
// Write any Typescript code here
},
},
@ -156,8 +160,7 @@ export async function notifyTelegram(env: Env, monitor: any, operational: boolea
if (!response.ok) {
console.error(
`Failed to send Telegram notification "${text}", ${response.status} ${
response.statusText
`Failed to send Telegram notification "${text}", ${response.status} ${response.statusText
} ${await response.text()}`,
);
}