From bdb2bc6b37bd19ccfc16529ade481c11f6127a83 Mon Sep 17 00:00:00 2001 From: Marcel Debray Date: Fri, 5 Apr 2024 06:28:05 +0200 Subject: [PATCH] migrate badge documentation from pull into wiki (#83) * migrate badge documentation from pull into wiki from this pull https://github.com/louislam/uptime-kuma/pull/1119 * Update badges documentation resolve comments from CommanderStorm * Update Badge.md * Apply suggestions from code review Co-authored-by: Frank Elsinga * delete counting badges Co-authored-by: Frank Elsinga * Tip Open Badge Generator Co-authored-by: Frank Elsinga * Delete Screenshots * Reorder whole content * Delete Example Image * Update Badge.md delete ref pull Co-authored-by: Frank Elsinga * Update Badge.md delete headline open Badge Generator Co-authored-by: Frank Elsinga * Update Badge.md Change Sentence about the predefined or custom color Co-authored-by: Frank Elsinga * Update Badge.mf Change the appearance of all examples Co-authored-by: Frank Elsinga * Update Badge.md delete file inline Table of content Co-authored-by: Frank Elsinga * Update Badge.md Correction of the tables with examples * Update Badge.md Correct Markdown Typo Co-authored-by: Frank Elsinga --------- Co-authored-by: Frank Elsinga --- Badge.md | 124 ++++++++++++++++++++++++++++- img/badge/avg-response-example.png | Bin 0 -> 2626 bytes img/badge/badge-style.png | Bin 0 -> 6097 bytes img/badge/cert-exp-example.png | Bin 0 -> 2429 bytes img/badge/custom-colours.png | Bin 0 -> 8631 bytes img/badge/duration.png | Bin 0 -> 5115 bytes img/badge/open-badge-generator.png | Bin 0 -> 37215 bytes img/badge/ping-example.png | Bin 0 -> 2261 bytes img/badge/ping-label.png | Bin 0 -> 9609 bytes img/badge/response-example.png | Bin 0 -> 1843 bytes img/badge/settings-button.png | Bin 0 -> 8371 bytes img/badge/settings.png | Bin 0 -> 15007 bytes img/badge/status-bw.png | Bin 0 -> 4335 bytes img/badge/status-example.png | Bin 0 -> 3772 bytes img/badge/status-label.png | Bin 0 -> 7018 bytes img/badge/uptime-color.png | Bin 0 -> 8214 bytes img/badge/uptime-example.png | Bin 0 -> 2479 bytes img/badge/uptime-label.png | Bin 0 -> 9471 bytes 18 files changed, 123 insertions(+), 1 deletion(-) create mode 100644 img/badge/avg-response-example.png create mode 100644 img/badge/badge-style.png create mode 100644 img/badge/cert-exp-example.png create mode 100644 img/badge/custom-colours.png create mode 100644 img/badge/duration.png create mode 100644 img/badge/open-badge-generator.png create mode 100644 img/badge/ping-example.png create mode 100644 img/badge/ping-label.png create mode 100644 img/badge/response-example.png create mode 100644 img/badge/settings-button.png create mode 100644 img/badge/settings.png create mode 100644 img/badge/status-bw.png create mode 100644 img/badge/status-example.png create mode 100644 img/badge/status-label.png create mode 100644 img/badge/uptime-color.png create mode 100644 img/badge/uptime-example.png create mode 100644 img/badge/uptime-label.png 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=