diff --git a/Badge.md b/Badge.md index 1e45478..54a8ddd 100644 --- a/Badge.md +++ b/Badge.md @@ -1,3 +1,125 @@ (Version >= 1.16.0) -Please read: https://github.com/louislam/uptime-kuma/pull/1119 \ No newline at end of file + + +# Description + +`status`, `ping`, `uptime`, `avg-response`, `cert-exp` and `response`-badges are generated locally. +The server does this for all monitors which have been added to status pages and have thus been published. +The design is based on [badge-maker](https://www.npmjs.com/package/badge-maker) aka. [shields.io](http://shields.io/). + +These are the endpoints that return an SVG graphic for a given (public) monitor: + +| Badge Type | URL scheme | URL example | Graphic example | +|----------------|---------------------------------------------------------|---------------------------------------|----------------------------------------------| +| `status` | `/api/badge/:monitorID/status` | `/api/badge/1/status` | ![image](img/badge/status-example.png) | +| `uptime` | `/api/badge/:monitorID/uptime:duration` | `/api/badge/1/uptime` | ![image](img/badge/uptime-example.png) | +| `ping` | `/api/badge/:monitorID/ping:duration` | `/api/badge/1/ping` | ![image](img/badge/ping-example.png) | +| `avg-response` | `/api/badge/:monitorID/avg-response:duration` | `/api/badge/1/avg-response` | ![image](img/badge/avg-response-example.png) | +| `cert-exp` | `/api/badge/:monitorID/cert-exp` | `/api/badge/1/cert-exp` | ![image](img/badge/cert-exp-example.png) | +| `response` | `/api/badge/:monitorID/response` | `/api/badge/1/response` | ![image](img/badge/response-example.png) | + +> [!TIP] +> We have an Badge Generator integrated which makes this configuration more interactive. +> +> You can use said generator via: +> - navigating to a status page in edit mode +> -
Clicking on the settings icon +>

+> +> ![image](img/badge/settings-button.png) +> +>

+>
+> -
Clicking on the Open Badge Maker-button +>

+> +> ![image](img/badge/settings.png) +> +>

+>
+> -
filling out the form to create your own badge +>

+> +> ![image](img/badge/open-badge-generator.png) +> +>

+>
+ +# Badge Type Options + +## Status badge + +There are options to customize the **status** badge's appearance: +- `upLabel`,Default value: Up +- `downLabel`, Default value: Down +- `upColor` +- `downColor` + +**Examples** + +| Badge | Url | +|-------|-----| +| ![image](img/badge/status-label.png) | `/api/badge//status?upLabel=&downLabel=` | +| ![image](img/badge/status-bw.png) | `/api/badge//status?upColor=white&downColor=black` | + +## Ping, uptime, avg-response and response badge + +There are options to customize the **ping**, **uptime**, **avg-response** and **response** badge's text: +- `labelPrefix` +- `label` +- `labelSuffix`, Default: value: uptime, ping & avg-response image= `h` +- `prefix` +- `suffix`, Default value: uptime= `%`, ping, avg-response & response= `ms` +- `color` +- `labelColor` + +**Examples** + +| Badge | Url | +|-------|-----| +| ![image](img/badge/ping-label.png) | `/api/badge//ping/24?labelPrefix=&label=