Restyle the status page in Cottage's brand
The page (pages/, components/, styles/) is rewritten in Cottage's brand, replacing Mantine. - Brand files: tokens, fonts and component CSS copied from Hearth; logo, pod row, status pill and banner ported from the brand handbook. - Themes: light by default, dark when the OS asks. - Services: grouped; each has a status pill, uptime and 90 daily bars (30 on phones). - Bars: each bar has a text label, keyboard navigation and a day card. - Response-time chart: optional, drawn in brand colours. - Notices: colour-coded posted notices and planned maintenance. - Incident history: by month, with the brand's empty state. The check worker, D1 storage, types and Terraform are untouched, so upstream merges stay clean. uptime.config.ts lists Cottage's services (website, dashboard, apps in US East). `npm run dev` shows sample data (?sample=outage|maintenance|empty) since there's no D1. Deploys are gated on the CLOUDFLARE_DEPLOY repository variable until launch, Wrangler telemetry is off, and a Check workflow lints, type-checks and builds every pull request. Removed upstream's issue-translation workflow, funding file and translations.
This commit is contained in:
1 parent
8035521268
commit
fdc16007e3
54 files changed
+2197
-2705
No files matched your search
+54
-112
@@ -1,134 +1,76 @@
|
||||
// This is a simplified example config file for quickstart
|
||||
// Some not frequently used features are omitted/commented out here
|
||||
// For a full-featured example, please refer to `uptime.config.full.ts`
|
||||
|
||||
// Cottage's status page: what we check and what we've posted.
|
||||
// A push to main deploys it (see README.md). Field reference: uptime.config.full.ts.
|
||||
//
|
||||
// Don't edit this line
|
||||
import { MaintenanceConfig, PageConfig, WorkerConfig } from './types/config'
|
||||
|
||||
const pageConfig: PageConfig = {
|
||||
// Title for your status page
|
||||
title: "lyc8503's Status Page",
|
||||
// Links shown at the header of your status page, could set `highlight` to `true`
|
||||
title: 'Cottage status',
|
||||
// Buttons on the right of the header.
|
||||
links: [
|
||||
{ link: 'https://github.com/lyc8503', label: 'GitHub' },
|
||||
{ link: 'https://blog.lyc8503.net/', label: 'Blog' },
|
||||
{ link: 'mailto:[email protected]', label: 'Email Me', highlight: true },
|
||||
{ link: 'https://cottage.host', label: 'cottage.host' },
|
||||
{ link: 'https://app.cottage.host', label: 'Your dashboard', highlight: true },
|
||||
],
|
||||
// Sections, in order. Every monitor below should appear in exactly one.
|
||||
group: {
|
||||
Cottage: ['website', 'dashboard'],
|
||||
'Apps by region': ['apps-us-east'],
|
||||
},
|
||||
}
|
||||
|
||||
const workerConfig: WorkerConfig = {
|
||||
// Define all your monitors here
|
||||
// Checks run every minute from Cloudflare's network (the location nearest the worker).
|
||||
// The targets go live at launch; until then the page isn't deployed.
|
||||
monitors: [
|
||||
// Example HTTP Monitor
|
||||
{
|
||||
// `id` should be unique, history will be kept if the `id` remains constant
|
||||
id: 'foo_monitor',
|
||||
// `name` is used at status page and callback message
|
||||
name: 'My API Monitor',
|
||||
// `method` should be a valid HTTP Method
|
||||
id: 'website',
|
||||
name: 'Website',
|
||||
tooltip: 'cottage.host: pricing, the app catalog and docs',
|
||||
method: 'GET',
|
||||
// `target` is a valid URL
|
||||
target: 'https://example.com',
|
||||
// [OPTIONAL] `tooltip` is ONLY used at status page to show a tooltip
|
||||
tooltip: 'This is a tooltip for this monitor',
|
||||
// [OPTIONAL] `statusPageLink` is ONLY used for clickable link at status page
|
||||
statusPageLink: 'https://example.com',
|
||||
// [OPTIONAL] `expectedCodes` is an array of acceptable HTTP response codes, if not specified, default to 2xx
|
||||
expectedCodes: [200],
|
||||
// [OPTIONAL] `timeout` in millisecond, if not specified, default to 10000
|
||||
target: 'https://cottage.host',
|
||||
statusPageLink: 'https://cottage.host',
|
||||
timeout: 10000,
|
||||
// [OPTIONAL] headers to be sent
|
||||
headers: {
|
||||
'User-Agent': 'Uptimeflare',
|
||||
Authorization: 'Bearer YOUR_TOKEN_HERE',
|
||||
},
|
||||
// [OPTIONAL] body to be sent (require POST/PUT/PATCH method)
|
||||
// body: 'Hello, world!',
|
||||
// [OPTIONAL] if specified, the response must contains the keyword to be considered as operational.
|
||||
// responseKeyword: 'success',
|
||||
// [OPTIONAL] if specified, the response must NOT contains the keyword to be considered as operational.
|
||||
// responseForbiddenKeyword: 'bad gateway',
|
||||
// [OPTIONAL] if specified, will call the check proxy to check the monitor, mainly for geo-specific checks
|
||||
// refer to docs https://github.com/lyc8503/UptimeFlare/wiki/Check-proxy-setup before setting this value
|
||||
// currently supports `worker://`, `globalping://` and `http(s)://` proxies
|
||||
// checkProxy: 'worker://weur',
|
||||
// [OPTIONAL] if true, the check will fallback to local if the specified proxy is down
|
||||
// checkProxyFallback: true,
|
||||
headers: { 'User-Agent': 'cottage-status (+https://status.cottage.host)' },
|
||||
},
|
||||
// Example TCP Monitor
|
||||
{
|
||||
id: 'test_tcp_monitor',
|
||||
name: 'Example TCP Monitor',
|
||||
// `method` should be `TCP_PING` for tcp monitors
|
||||
method: 'TCP_PING',
|
||||
// `target` should be `host:port` for tcp monitors
|
||||
target: '1.2.3.4:22',
|
||||
tooltip: 'My production server SSH',
|
||||
statusPageLink: 'https://example.com',
|
||||
timeout: 5000,
|
||||
id: 'dashboard',
|
||||
name: 'Dashboard and billing',
|
||||
tooltip: 'Signing in, deploying and managing apps, and top-ups',
|
||||
method: 'GET',
|
||||
target: 'https://app.cottage.host/healthz',
|
||||
statusPageLink: 'https://app.cottage.host',
|
||||
expectedCodes: [200],
|
||||
timeout: 10000,
|
||||
headers: { 'User-Agent': 'cottage-status (+https://status.cottage.host)' },
|
||||
},
|
||||
{
|
||||
// A small app Cottage runs for itself on the region's servers, so this checks the
|
||||
// whole path a customer's app takes: Cloudflare, the node's proxy and a running app.
|
||||
// TODO at launch: deploy the canary app and put its address here.
|
||||
id: 'apps-us-east',
|
||||
name: 'Apps in US East',
|
||||
tooltip: 'Customer apps hosted in Virginia',
|
||||
method: 'GET',
|
||||
target: 'https://status-canary-vin1.cottagehost.com/',
|
||||
timeout: 10000,
|
||||
headers: { 'User-Agent': 'cottage-status (+https://status.cottage.host)' },
|
||||
},
|
||||
],
|
||||
// [Optional] Notification settings
|
||||
notification: {
|
||||
// [Optional] Notification webhook settings, if not specified, no notification will be sent
|
||||
// More info at Wiki: https://github.com/lyc8503/UptimeFlare/wiki/Setup-notification
|
||||
webhook: {
|
||||
// [Required] webhook URL (example: Telegram Bot API)
|
||||
url: 'https://api.telegram.org/bot123456:ABCDEF/sendMessage',
|
||||
// [Optional] HTTP method, default to 'GET' for payloadType=param, 'POST' otherwise
|
||||
// method: 'POST',
|
||||
// [Optional] headers to be sent
|
||||
// headers: {
|
||||
// foo: 'bar',
|
||||
// },
|
||||
// [Required] Specify how to encode the payload
|
||||
// Should be one of 'param', 'json' or 'x-www-form-urlencoded'
|
||||
// 'param': append url-encoded payload to URL search parameters
|
||||
// 'json': POST json payload as body, set content-type header to 'application/json'
|
||||
// 'x-www-form-urlencoded': POST url-encoded payload as body, set content-type header to 'x-www-form-urlencoded'
|
||||
payloadType: 'x-www-form-urlencoded',
|
||||
// [Required] payload to be sent
|
||||
// $MSG will be replaced with the human-readable notification message
|
||||
payload: {
|
||||
chat_id: 12345678,
|
||||
text: '$MSG',
|
||||
},
|
||||
// [Optional] timeout calling this webhook, in millisecond, default to 5000
|
||||
timeout: 10000,
|
||||
},
|
||||
// [Optional] timezone used in notification messages, default to "Etc/GMT"
|
||||
timeZone: 'Asia/Shanghai',
|
||||
// [Optional] grace period in minutes before sending a notification
|
||||
// notification will be sent only if the monitor is down for N continuous checks after the initial failure
|
||||
// if not specified, notification will be sent immediately
|
||||
gracePeriod: 5,
|
||||
},
|
||||
// Alerts come from Grafana Cloud (hearth infra/monitoring). A webhook here could page too.
|
||||
}
|
||||
|
||||
// You can define multiple maintenances here
|
||||
// During maintenance, an alert will be shown at status page
|
||||
// Also, related downtime notifications will be skipped (if any)
|
||||
// Of course, you can leave it empty if you don't need this feature
|
||||
|
||||
// const maintenances: MaintenanceConfig[] = []
|
||||
|
||||
const maintenances: MaintenanceConfig[] = [
|
||||
{
|
||||
// [Optional] Monitor IDs to be affected by this maintenance
|
||||
monitors: ['foo_monitor', 'bar_monitor'],
|
||||
// [Optional] default to "Scheduled Maintenance" if not specified
|
||||
title: 'Test Maintenance',
|
||||
// Description of the maintenance, will be shown at status page
|
||||
body: 'This is a test maintenance, server software upgrade',
|
||||
// Start time of the maintenance, in UNIX timestamp or ISO 8601 format
|
||||
start: '2020-01-01T00:00:00+08:00',
|
||||
// [Optional] end time of the maintenance, in UNIX timestamp or ISO 8601 format
|
||||
// if not specified, the maintenance will be considered as on-going
|
||||
end: '2050-01-01T00:00:00+08:00',
|
||||
// [Optional] color of the maintenance alert at status page, default to "yellow"
|
||||
color: 'blue',
|
||||
},
|
||||
]
|
||||
// Notices shown on the page: incident updates and planned maintenance. Newest last.
|
||||
// Write them in Cottage's voice: say what happened, who it affects and what to expect,
|
||||
// e.g. title 'Apps in US East were slow for 18 minutes'.
|
||||
// {
|
||||
// title: 'Some apps in US East aren’t loading',
|
||||
// body: 'We’re looking into it now. Next update within 30 minutes.',
|
||||
// monitors: ['apps-us-east'], // listed as "Affects: ..." and their status follows the colour
|
||||
// start: '2026-12-01T14:05:00Z',
|
||||
// end: '2026-12-01T14:40:00Z', // leave out while it's ongoing
|
||||
// color: 'red', // red = outage, yellow = degraded (default), blue = maintenance, green = resolved
|
||||
// },
|
||||
const maintenances: MaintenanceConfig[] = []
|
||||
|
||||
// Don't edit this line
|
||||
export { maintenances, pageConfig, workerConfig }
|
||||
Reference in new issue
Block a user