diff --git a/Dockerfile b/Dockerfile index 79020fb..8d27efd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -58,7 +58,8 @@ COPY . . # TODO: Reevaluate permissions (possibly reduce?)... # Remove docs directory and ensure required directories exist RUN rm -rf src/routes/\(docs\) && \ - mkdir -p uploads database && \ + rm -rf src/static/documentation && \ + mkdir -p uploads database && \ # TODO: Consider changing below to `chmod -R u-rwX,g=rX,o= uploads database` chmod -R 750 uploads database diff --git a/docs/alerting.md b/docs/alerting.md index 190ac25..5ef132e 100644 --- a/docs/alerting.md +++ b/docs/alerting.md @@ -64,24 +64,24 @@ Body of the webhook will be sent as below: ```json { - "id": "mockoon-9", - "alert_name": "Mockoon DOWN", - "severity": "critical", - "status": "TRIGGERED", - "source": "Kener", - "timestamp": "2024-11-27T04:55:00.369Z", - "description": "🚨 **Service Alert**: Check the details below", - "details": { - "metric": "Mockoon", - "current_value": 1, - "threshold": 1 - }, - "actions": [ - { - "text": "View Monitor", - "url": "https://kener.ing/monitor-mockoon" - } - ] + "id": "mockoon-9", + "alert_name": "Mockoon DOWN", + "severity": "critical", + "status": "TRIGGERED", + "source": "Kener", + "timestamp": "2024-11-27T04:55:00.369Z", + "description": "🚨 **Service Alert**: Check the details below", + "details": { + "metric": "Mockoon", + "current_value": 1, + "threshold": 1 + }, + "actions": [ + { + "text": "View Monitor", + "url": "https://kener.ing/monitor-mockoon" + } + ] } ``` @@ -108,7 +108,7 @@ The discord message when alert is `TRIGGERED` will look like this The discord message when alert is `RESOLVED` will look like this -![Discord](/discord_resolved.png) +![Discord](/documentation/discord_resolved.png) ### Slack @@ -118,7 +118,7 @@ The slack message when alert is `TRIGGERED` will look like this The slack message when alert is `RESOLVED` will look like this -![Slack](/slack_resolved.png) +![Slack](/documentation/slack_resolved.png) ### Add Alerts to Monitors diff --git a/docs/home-page.md b/docs/home-page.md index 21e46b4..26a7834 100644 --- a/docs/home-page.md +++ b/docs/home-page.md @@ -21,7 +21,7 @@ A small text that will be shown below the title.
-![Hero Section](/home_1.png) +![Hero Section](/documentation/home_1.png)
@@ -31,7 +31,7 @@ A small text that will be shown below the title. You can navigation links to other urls. You can add as many as you want. -![Nav Section](/home_2.png) +![Nav Section](/documentation/home_2.png) ### Icon @@ -45,7 +45,7 @@ The title of the link. The URL to redirect to when the link is clicked. -![Nav Section](/home_3.png) +![Nav Section](/documentation/home_3.png) --- diff --git a/docs/monitors-api.md b/docs/monitors-api.md index dc9ddaa..4acb42f 100644 --- a/docs/monitors-api.md +++ b/docs/monitors-api.md @@ -9,7 +9,7 @@ API monitors are used to monitor APIs. You can use API monitors to monitor the u
-![Monitors API](/m_api.png) +![Monitors API](/documentation/m_api.png)
@@ -69,7 +69,7 @@ This is an anonymous JS function, it should return a **Promise**, that resolves - `responseDataBase64` **REQUIRED** is a string. It is the base64 encoded response data. To use it you will have to decode it ```js -let decodedResp = atob(responseDataBase64); +let decodedResp = atob(responseDataBase64) //if the response is a json object //let jsonResp = JSON.parse(decodedResp) ``` @@ -79,61 +79,61 @@ let decodedResp = atob(responseDataBase64); The following example shows how to use the eval function to evaluate the response. The function checks if the status code is 2XX then the status is UP, if the status code is 5XX then the status is DOWN. If the response contains the word `Unknown Error` then the status is DOWN. If the response time is greater than 2000 then the status is DEGRADED. ```javascript -(async function (statusCode, responseTime, responseDataBase64) { - const resp = atob(responseDataBase64); //convert base64 to string +;(async function (statusCode, responseTime, responseDataBase64) { + const resp = atob(responseDataBase64) //convert base64 to string - let status = "DOWN"; + let status = "DOWN" - //if the status code is 2XX then the status is UP - if (/^[2]\d{2}$/.test(statusCode)) { - status = "UP"; - if (responseTime > 2000) { - status = "DEGRADED"; - } - } + //if the status code is 2XX then the status is UP + if (/^[2]\d{2}$/.test(statusCode)) { + status = "UP" + if (responseTime > 2000) { + status = "DEGRADED" + } + } - //if the status code is 5XX then the status is DOWN - if (/^[5]\d{2}$/.test(statusCode)) status = "DOWN"; + //if the status code is 5XX then the status is DOWN + if (/^[5]\d{2}$/.test(statusCode)) status = "DOWN" - if (resp.includes("Unknown Error")) { - status = "DOWN"; - } + if (resp.includes("Unknown Error")) { + status = "DOWN" + } - return { - status: status, - latency: responseTime - }; -}); + return { + status: status, + latency: responseTime + } +}) ``` This next example shows how to call another API withing eval. It is scrapping the second last script tag from the response and checking if the heading is "No recent issues" then the status is UP else it is DOWN. ```javascript -(async function raj(statusCode, responseTime, responseDataBase64) { - let htmlString = atob(responseDataBase64); - const scriptTags = htmlString.match(/]*src="([^"]+)"[^>]*>/g); - if (scriptTags && scriptTags.length >= 2) { - // Extract the second last script tag's src attribute - const secondLastScript = scriptTags[scriptTags.length - 2]; - const srcMatch = secondLastScript.match(/src="([^"]+)"/); - const secondLastScriptSrc = srcMatch ? srcMatch[1] : null; +;(async function raj(statusCode, responseTime, responseDataBase64) { + let htmlString = atob(responseDataBase64) + const scriptTags = htmlString.match(/]*src="([^"]+)"[^>]*>/g) + if (scriptTags && scriptTags.length >= 2) { + // Extract the second last script tag's src attribute + const secondLastScript = scriptTags[scriptTags.length - 2] + const srcMatch = secondLastScript.match(/src="([^"]+)"/) + const secondLastScriptSrc = srcMatch ? srcMatch[1] : null - let jsResp = await fetch(secondLastScriptSrc); //api call - let jsRespText = await jsResp.text(); - //check if heading":"No recent issues" exists - let noRecentIssues = jsRespText.indexOf('heading":"No recent issues"'); - if (noRecentIssues != -1) { - return { - status: "UP", - latency: responseTime - }; - } - } - return { - status: "DOWN", - latency: responseTime - }; -}); + let jsResp = await fetch(secondLastScriptSrc) //api call + let jsRespText = await jsResp.text() + //check if heading":"No recent issues" exists + let noRecentIssues = jsRespText.indexOf('heading":"No recent issues"') + if (noRecentIssues != -1) { + return { + status: "UP", + latency: responseTime + } + } + } + return { + status: "DOWN", + latency: responseTime + } +}) ``` ## Examples @@ -153,7 +153,7 @@ This is an example to monitor google every 5 minute.
-![Monitors API](/m_ex_website.png) +![Monitors API](/documentation/m_ex_website.png)
@@ -180,7 +180,7 @@ export SOME_TOKEN=some-token-example
-![Monitors API](/m_ex_2.png) +![Monitors API](/documentation/m_ex_2.png)
@@ -201,7 +201,7 @@ Example showing setting up a POST request every minute with a timeout of 2 secon
-![Monitors API](/m_ex_3.png) +![Monitors API](/documentation/m_ex_3.png)
@@ -228,7 +228,7 @@ export SERVICE_SECRET=secret2_secret
-![Monitors API](/m_ex_4.png) +![Monitors API](/documentation/m_ex_4.png)
diff --git a/docs/monitors-dns.md b/docs/monitors-dns.md index 198a546..a4fac58 100644 --- a/docs/monitors-dns.md +++ b/docs/monitors-dns.md @@ -9,7 +9,7 @@ DNS monitors are used to monitor DNS servers. Verify DNS queries for your server
-![Monitors Ping](/m_dns.png) +![Monitors Ping](/documentation/m_dns.png)
diff --git a/docs/monitors-group.md b/docs/monitors-group.md new file mode 100644 index 0000000..a42720c --- /dev/null +++ b/docs/monitors-group.md @@ -0,0 +1,40 @@ +--- +title: Group Monitors | Kener +description: Learn how to set up and work with Group monitors in kener. +--- + +# Group Monitors + +Group monitors are used to monitor multiple monitors at once. You can use Group monitors to monitor multiple monitors at once and get notified when they are down. + +
+ +![Monitors Group](/documentation/m_group.png) + +
+ +## Timeout + + + REQUIRED + + +The timeout is used to define the time in milliseconds after which the group monitor should timeout. + +Let us say the group monitor runs every minute, it will expect in the same minute all the other monitors to finish. It will wait till the timeout for them to complete. If not completed within that timeout, it will be marked as down. + +## Monitors + + + REQUIRED + + +You can add as many monitors as you want to monitor. The minimum number of monitors required is 2. The monitor can be any type of monitor. + +## Hide + +You can hide the monitors that are part of the group monitor. If you hide the monitors, the monitors inside the group will not be shown in the home page. + +
+The group status will be the worst status of the monitors in the group. +
diff --git a/docs/monitors-ping.md b/docs/monitors-ping.md index 4ab59e0..ad3c246 100644 --- a/docs/monitors-ping.md +++ b/docs/monitors-ping.md @@ -9,7 +9,7 @@ Ping monitors are used to monitor livenees of your servers. You can use Ping mon
-![Monitors Ping](/m_ping.png) +![Monitors Ping](/documentation/m_ping.png)
@@ -32,29 +32,29 @@ This is an anonymous JS function, it should return a **Promise**, that resolves > `{status:"DEGRADED", latency: 200}`. ```javascript -(async function (responseDataBase64) { - let arrayOfPings = JSON.parse(atob(responseDataBase64)); - let latencyTotal = arrayOfPings.reduce((acc, ping) => { - return acc + ping.latency; - }, 0); +;(async function (responseDataBase64) { + let arrayOfPings = JSON.parse(atob(responseDataBase64)) + let latencyTotal = arrayOfPings.reduce((acc, ping) => { + return acc + ping.latency + }, 0) - let alive = arrayOfPings.reduce((acc, ping) => { - return acc && ping.alive; - }, true); + let alive = arrayOfPings.reduce((acc, ping) => { + return acc && ping.alive + }, true) - return { - status: alive ? "UP" : "DOWN", - latency: latencyTotal / arrayOfPings.length - }; -}); + return { + status: alive ? "UP" : "DOWN", + latency: latencyTotal / arrayOfPings.length + } +}) ``` - `responseDataBase64` **REQUIRED** is a string. It is the base64 encoded response data. To use it you will have to decode it and the JSON parse it. Once parse it will be an array of objects. ```js -let decodedResp = atob(responseDataBase64); -let jsonResp = JSON.parse(decodedResp); -console.log(jsonResp); +let decodedResp = atob(responseDataBase64) +let jsonResp = JSON.parse(decodedResp) +console.log(jsonResp) /* [ { @@ -109,28 +109,28 @@ The input to the eval function is a base64 encoded string. You will have to deco The following example shows how to use the eval function to evaluate the response. The function checks if the combined latency is more 10ms then returns `DEGRADED`. ```javascript -(async function (responseDataBase64) { - let arrayOfPings = JSON.parse(atob(responseDataBase64)); - let latencyTotal = arrayOfPings.reduce((acc, ping) => { - return acc + ping.latency; - }, 0); +;(async function (responseDataBase64) { + let arrayOfPings = JSON.parse(atob(responseDataBase64)) + let latencyTotal = arrayOfPings.reduce((acc, ping) => { + return acc + ping.latency + }, 0) - let areAllOpen = arrayOfPings.reduce((acc, ping) => { - return acc && ping.alive; - }, true); + let areAllOpen = arrayOfPings.reduce((acc, ping) => { + return acc && ping.alive + }, true) - let avgLatency = latencyTotal / arrayOfPings.length; + let avgLatency = latencyTotal / arrayOfPings.length - if (areAllOpen && avgLatency > 10) { - return { - status: "DEGRADED", - latency: avgLatency - }; - } + if (areAllOpen && avgLatency > 10) { + return { + status: "DEGRADED", + latency: avgLatency + } + } - return { - status: areAllOpen ? "UP" : "DOWN", - latency: avgLatency - }; -}); + return { + status: areAllOpen ? "UP" : "DOWN", + latency: avgLatency + } +}) ``` diff --git a/docs/monitors-tcp.md b/docs/monitors-tcp.md index dd93b8e..c8e7d24 100644 --- a/docs/monitors-tcp.md +++ b/docs/monitors-tcp.md @@ -9,7 +9,7 @@ TCP monitors are used to monitor the livenees of your servers. You can use TCP m
-![Monitors TCP](/m_tcp.png) +![Monitors TCP](/documentation/m_tcp.png)
@@ -32,33 +32,33 @@ This is an anonymous JS function, it should return a **Promise**, that resolves > `{status:"DEGRADED", latency: 200}`. ```javascript -(async function (responseDataBase64) { - let arrayOfPings = JSON.parse(atob(responseDataBase64)); - let latencyTotal = arrayOfPings.reduce((acc, ping) => { - return acc + ping.latency; - }, 0); +;(async function (responseDataBase64) { + let arrayOfPings = JSON.parse(atob(responseDataBase64)) + let latencyTotal = arrayOfPings.reduce((acc, ping) => { + return acc + ping.latency + }, 0) - let alive = arrayOfPings.reduce((acc, ping) => { - if (ping.status === "open") { - return acc && true; - } else { - return false; - } - }, true); + let alive = arrayOfPings.reduce((acc, ping) => { + if (ping.status === "open") { + return acc && true + } else { + return false + } + }, true) - return { - status: alive ? "UP" : "DOWN", - latency: latencyTotal / arrayOfPings.length - }; -}); + return { + status: alive ? "UP" : "DOWN", + latency: latencyTotal / arrayOfPings.length + } +}) ``` - `responseDataBase64` **REQUIRED** is a string. It is the base64 encoded response data. To use it you will have to decode it and the JSON parse it. Once parse it will be an array of objects. ```js -let decodedResp = atob(responseDataBase64); -let jsonResp = JSON.parse(decodedResp); -console.log(jsonResp); +let decodedResp = atob(responseDataBase64) +let jsonResp = JSON.parse(decodedResp) +console.log(jsonResp) /* [ { @@ -104,32 +104,32 @@ The input to the eval function is a base64 encoded string. You will have to deco The following example shows how to use the eval function to evaluate the response. The function checks if the combined latency is more 10ms then returns `DEGRADED`. ```javascript -(async function (responseDataBase64) { - let arrayOfPings = JSON.parse(atob(responseDataBase64)); - let latencyTotal = arrayOfPings.reduce((acc, ping) => { - return acc + ping.latency; - }, 0); +;(async function (responseDataBase64) { + let arrayOfPings = JSON.parse(atob(responseDataBase64)) + let latencyTotal = arrayOfPings.reduce((acc, ping) => { + return acc + ping.latency + }, 0) - let areAllOpen = arrayOfPings.reduce((acc, ping) => { - if (ping.status === "open") { - return acc && true; - } else { - return false; - } - }, true); + let areAllOpen = arrayOfPings.reduce((acc, ping) => { + if (ping.status === "open") { + return acc && true + } else { + return false + } + }, true) - let avgLatency = latencyTotal / arrayOfPings.length; + let avgLatency = latencyTotal / arrayOfPings.length - if (areAllOpen && avgLatency > 10) { - return { - status: "DEGRADED", - latency: avgLatency - }; - } + if (areAllOpen && avgLatency > 10) { + return { + status: "DEGRADED", + latency: avgLatency + } + } - return { - status: areAllOpen ? "UP" : "DOWN", - latency: avgLatency - }; -}); + return { + status: areAllOpen ? "UP" : "DOWN", + latency: avgLatency + } +}) ``` diff --git a/docs/monitors.md b/docs/monitors.md index a88d98a..260ce43 100644 --- a/docs/monitors.md +++ b/docs/monitors.md @@ -13,7 +13,7 @@ Click on the āž• to add a monitor.
-![Monitors Main](/m_main.png) +![Monitors Main](/documentation/m_main.png)
diff --git a/docs/site.md b/docs/site.md index 89a7963..c55ed4e 100644 --- a/docs/site.md +++ b/docs/site.md @@ -19,11 +19,11 @@ Example: `Kener - Open-Source and Modern looking Node.js Status Page for Effortl ```html - Kener - Open-Source and Modern looking Node.js Status Page for Effortless Incident Management + Kener - Open-Source and Modern looking Node.js Status Page for Effortless Incident Management ``` -![Site Title](/ms_1.png) +![Site Title](/documentation/ms_1.png) ## Site Name @@ -33,7 +33,7 @@ Example: `Kener - Open-Source and Modern looking Node.js Status Page for Effortl This will be shown as a brand name on the status page on the nav bar top left. -![Site Name](/s_2.png) +![Site Name](/documentation/s_2.png) ## Home Location diff --git a/docs/structure.json b/docs/structure.json index d160cd1..8e101ad 100644 --- a/docs/structure.json +++ b/docs/structure.json @@ -1,166 +1,166 @@ { - "sidebar": [ - { - "sectionTitle": "Getting Started", - "children": [ - { - "title": "Introduction", - "link": "/docs/home", - "file": "/home.md" - }, - { - "title": "Get Started", - "link": "/docs/quick-start", - "file": "/quick-start.md" - }, - { - "title": "Concepts", - "link": "/docs/concepts", - "file": "/concepts.md" - }, + "sidebar": [ + { + "sectionTitle": "Getting Started", + "children": [ + { + "title": "Introduction", + "link": "/docs/home", + "file": "/home.md" + }, + { + "title": "Get Started", + "link": "/docs/quick-start", + "file": "/quick-start.md" + }, + { + "title": "Concepts", + "link": "/docs/concepts", + "file": "/concepts.md" + }, - { - "title": "Deployment", - "link": "/docs/deployment", - "file": "/deployment.md" - }, - { - "title": "Databases", - "link": "/docs/database", - "file": "/database.md" - } - ] - }, - { - "sectionTitle": "Guides", - "children": [ - { - "title": "Setup Environment", - "link": "/docs/environment-vars", - "file": "/environment-vars.md" - }, - { - "title": "Use Badges", - "link": "/docs/status-badges", - "file": "/status-badges.md" - }, - { - "title": "Setup Monitors", - "link": "/docs/monitors", - "file": "/monitors.md" - }, - { - "title": "API/Website Monitor", - "link": "/docs/monitors-api", - "file": "/monitors-api.md" - }, - { - "title": "Ping Monitor", - "link": "/docs/monitors-ping", - "file": "/monitors-ping.md" - }, - { - "title": "TCP Monitor", - "link": "/docs/monitors-tcp", - "file": "/monitors-tcp.md" - }, - { - "title": "DNS Monitor", - "link": "/docs/monitors-dns", - "file": "/monitors-dns.md" - }, - { - "title": "Setup Triggers", - "link": "/docs/triggers", - "file": "/triggers.md" - }, - { - "title": "Setup Site", - "link": "/docs/site", - "file": "/site.md" - }, - { - "title": "Setup Github", - "link": "/docs/gh-setup", - "file": "/gh-setup.md" - }, - { - "title": "Setup SEO", - "link": "/docs/seo", - "file": "/seo.md" - }, - { - "title": "Setup Home", - "link": "/docs/home-page", - "file": "/home-page.md" - }, - { - "title": "Setup Theme", - "link": "/docs/theme", - "file": "/theme.md" - }, - { - "title": "View Alerts", - "link": "/docs/alerts", - "file": "/alerts.md" - }, - { - "title": "API Keys", - "link": "/docs/apikeys", - "file": "/apikeys.md" - }, + { + "title": "Deployment", + "link": "/docs/deployment", + "file": "/deployment.md" + }, + { + "title": "Databases", + "link": "/docs/database", + "file": "/database.md" + } + ] + }, + { + "sectionTitle": "Guides", + "children": [ + { + "title": "Setup Environment", + "link": "/docs/environment-vars", + "file": "/environment-vars.md" + }, + { + "title": "Use Badges", + "link": "/docs/status-badges", + "file": "/status-badges.md" + }, + { + "title": "Setup Monitors", + "link": "/docs/monitors", + "file": "/monitors.md" + }, + { + "title": "API/Website Monitor", + "link": "/docs/monitors-api", + "file": "/monitors-api.md" + }, + { + "title": "Ping Monitor", + "link": "/docs/monitors-ping", + "file": "/monitors-ping.md" + }, + { + "title": "TCP Monitor", + "link": "/docs/monitors-tcp", + "file": "/monitors-tcp.md" + }, + { + "title": "DNS Monitor", + "link": "/docs/monitors-dns", + "file": "/monitors-dns.md" + }, + { + "title": "Group Monitor", + "link": "/docs/monitors-group", + "file": "/monitors-group.md" + }, + { + "title": "Setup Triggers", + "link": "/docs/triggers", + "file": "/triggers.md" + }, + { + "title": "Setup Site", + "link": "/docs/site", + "file": "/site.md" + }, + { + "title": "Setup SEO", + "link": "/docs/seo", + "file": "/seo.md" + }, + { + "title": "Setup Home", + "link": "/docs/home-page", + "file": "/home-page.md" + }, + { + "title": "Setup Theme", + "link": "/docs/theme", + "file": "/theme.md" + }, + { + "title": "View Alerts", + "link": "/docs/alerts", + "file": "/alerts.md" + }, + { + "title": "API Keys", + "link": "/docs/apikeys", + "file": "/apikeys.md" + }, - { - "title": "Incident Management", - "link": "/docs/incident-management", - "file": "/incident-management.md" - }, - { - "title": "Embed", - "link": "/docs/embed", - "file": "/embed.md" - }, - { - "title": "Custom JS/CSS", - "link": "/docs/custom-js-css-guide", - "file": "/custom-js-css-guide.md" - }, - { - "title": "Internationalization", - "link": "/docs/i18n", - "file": "/i18n.md" - } - ] - }, - { - "sectionTitle": "API Reference", - "children": [ - { - "title": "Kener APIs", - "link": "/docs/kener-apis", - "file": "/kener-apis.md" - } - ] - }, - { - "sectionTitle": "Help", - "children": [ - { - "title": "Fonts", - "link": "/docs/custom-fonts", - "file": "/custom-fonts.md" - }, - { - "title": "Changelogs", - "link": "/docs/changelogs", - "file": "/changelogs.md" - }, - { - "title": "Roadmap", - "link": "/docs/roadmap", - "file": "/roadmap.md" - } - ] - } - ] + { + "title": "Incident Management", + "link": "/docs/incident-management", + "file": "/incident-management.md" + }, + { + "title": "Embed", + "link": "/docs/embed", + "file": "/embed.md" + }, + { + "title": "Custom JS/CSS", + "link": "/docs/custom-js-css-guide", + "file": "/custom-js-css-guide.md" + }, + { + "title": "Internationalization", + "link": "/docs/i18n", + "file": "/i18n.md" + } + ] + }, + { + "sectionTitle": "API Reference", + "children": [ + { + "title": "Kener APIs", + "link": "/docs/kener-apis", + "file": "/kener-apis.md" + } + ] + }, + { + "sectionTitle": "Help", + "children": [ + { + "title": "Fonts", + "link": "/docs/custom-fonts", + "file": "/custom-fonts.md" + }, + { + "title": "Changelogs", + "link": "/docs/changelogs", + "file": "/changelogs.md" + }, + { + "title": "Roadmap", + "link": "/docs/roadmap", + "file": "/roadmap.md" + } + ] + } + ] } diff --git a/docs/theme.md b/docs/theme.md index 1f0763d..79ab677 100644 --- a/docs/theme.md +++ b/docs/theme.md @@ -11,7 +11,7 @@ Kener provides you with the ability to customize the theme of your status page. ## Home Page Pattern -Kener can show a subtle pattern in all your pages. It is either sqaure or dots. Right now you cannot modify the color of the pattern. However, you can disable it by choosing none +Kener can show a subtle pattern in all your pages. It is either square or dots. Right now you cannot modify the color of the pattern. However, you can disable it by choosing none --- @@ -35,13 +35,13 @@ You can change how the bars and summary of a monitor looks like. The status bar will be a gradient from green to red/yellow based on the status of the monitor. -![Trigger API](/x1.png) +![Trigger API](/documentation/x1.png) #### Full The status bar will be a solid color based on the status of the monitor. -![Trigger API](/x2.png) +![Trigger API](/documentation/x2.png) --- @@ -51,11 +51,11 @@ Adjust the roundness of the status bar. #### SHARP -![Trigger API](/x4.png) +![Trigger API](/documentation/x4.png) #### ROUNDED -![Trigger API](/x3.png) +![Trigger API](/documentation/x3.png) --- @@ -97,7 +97,7 @@ You can add custom CSS to your status page. This will be added to the head of th ```css .my-class { - color: red; + color: red; } ``` diff --git a/docs/triggers.md b/docs/triggers.md index 7e15454..b41811f 100644 --- a/docs/triggers.md +++ b/docs/triggers.md @@ -9,7 +9,7 @@ Triggers are used to trigger actions based on the status of your monitors. You c
-![Trigger API](/trig_1.png) +![Trigger API](/documentation/trig_1.png)
@@ -38,7 +38,7 @@ Webhook triggers are used to send a HTTP POST request to a URL when a monitor go
-![Trigger API](/trig_web.png) +![Trigger API](/documentation/trig_web.png)
@@ -72,24 +72,24 @@ Body of the webhook will be sent as below: ```json { - "id": "mockoon-9", - "alert_name": "Mockoon DOWN", - "severity": "critical", - "status": "TRIGGERED", - "source": "Kener", - "timestamp": "2024-11-27T04:55:00.369Z", - "description": "🚨 **Service Alert**: Check the details below", - "details": { - "metric": "Mockoon", - "current_value": 1, - "threshold": 1 - }, - "actions": [ - { - "text": "View Monitor", - "url": "https://kener.ing/monitor-mockoon" - } - ] + "id": "mockoon-9", + "alert_name": "Mockoon DOWN", + "severity": "critical", + "status": "TRIGGERED", + "source": "Kener", + "timestamp": "2024-11-27T04:55:00.369Z", + "description": "🚨 **Service Alert**: Check the details below", + "details": { + "metric": "Mockoon", + "current_value": 1, + "threshold": 1 + }, + "actions": [ + { + "text": "View Monitor", + "url": "https://kener.ing/monitor-mockoon" + } + ] } ``` @@ -118,7 +118,7 @@ Discord triggers are used to send a message to a discord channel when a monitor
-![Trigger API](/trig_2.png) +![Trigger API](/documentation/trig_2.png)
@@ -147,7 +147,7 @@ The discord message when alert is `TRIGGERED` will look like this The discord message when alert is `RESOLVED` will look like this -![Discord](/discord_resolved.png) +![Discord](/documentation/discord_resolved.png) ## Slack @@ -155,7 +155,7 @@ Slack triggers are used to send a message to a slack channel when a monitor goes
-![Trigger API](/trig_3.png) +![Trigger API](/documentation/trig_3.png)
@@ -185,7 +185,7 @@ The slack message when alert is `TRIGGERED` will look like this The slack message when alert is `RESOLVED` will look like this -![Slack](/slack_resolved.png) +![Slack](/documentation/slack_resolved.png) ## Email @@ -193,7 +193,7 @@ Email triggers are used to send an email when a monitor goes down or up. Kener s
-![Trigger API](/trig_4.png) +![Trigger API](/documentation/trig_4.png)
@@ -250,11 +250,11 @@ Subject of the email when `RESOLVED` The emaik message when alert is `TRIGGERED` will look like this -![Slack](/em_t.png) +![Slack](/documentation/em_t.png) The emaik message when alert is `RESOLVED` will look like this -![Slack](/em_r.png) +![Slack](/documentation/em_r.png) --- @@ -278,9 +278,9 @@ Set the URL to `https://api.telegram.org/bot[BOT_TOKEN]/sendMessage`. Replace [B ```json { - "chat_id": "[CHAT_ID]", // Replace [CHAT_ID] with your chat id - "text": "${alert_name}\n\nSeverity: ${severity}\nStatus: ${status}\nSource: Kener\nTime: ${timestamp}\n\nšŸ“Œ Details:\n- Metric:${metric}\n- Current Value: ${current_value}\n- Threshold: ${threshold}\n\nšŸ” ${action_text}", - "parse_mode": "HTML" + "chat_id": "[CHAT_ID]", // Replace [CHAT_ID] with your chat id + "text": "${alert_name}\n\nSeverity: ${severity}\nStatus: ${status}\nSource: Kener\nTime: ${timestamp}\n\nšŸ“Œ Details:\n- Metric:${metric}\n- Current Value: ${current_value}\n- Threshold: ${threshold}\n\nšŸ” ${action_text}", + "parse_mode": "HTML" } ``` diff --git a/src/docs.css b/src/docs.css index a5cee65..78cb408 100644 --- a/src/docs.css +++ b/src/docs.css @@ -1,69 +1,82 @@ code:not([class^="language-"]) { - @apply rounded bg-gray-100 px-1.5 py-0.5 font-mono text-xs dark:bg-gray-800; + @apply rounded bg-gray-100 px-1.5 py-0.5 font-mono text-xs dark:bg-gray-800; } .sidebar-item.active, .sidebar-item:hover { - color: #ed702d; + color: #ed702d; } .w-585px { - width: 585px; + width: 585px; } main { - scroll-behavior: smooth; + scroll-behavior: smooth; } .kener-home-links a { - text-decoration: none; - background-color: var(--bg-background); + text-decoration: none; + background-color: var(--bg-background); } .kener-home-links > div:hover { - transition: all 0.3s; - box-shadow: 0 0 8px 1.5px #3e9a4b; + transition: all 0.3s; + box-shadow: 0 0 8px 1.5px #3e9a4b; } .accm input:checked ~ div { - display: block; + display: block; } .accm input ~ div { - display: none; + display: none; } .accm input { - visibility: hidden; + visibility: hidden; } .accmt { - background-color: hsl(223, 10%, 14%); + background-color: hsl(223, 10%, 14%); } .accm input:checked ~ .showaccm span:first-child { - display: none; + display: none; } .accm input:checked ~ .showaccm span:last-child { - display: block; + display: block; } .accm input ~ .showaccm span:first-child { - display: block; + display: block; } .accm input ~ .showaccm span:last-child { - display: none; + display: none; } .hljs { - background: transparent !important; + background: transparent !important; } .note { - @apply mt-4 rounded-md border bg-background p-3 text-sm shadow-sm; + @apply mt-4 rounded-md border bg-background p-3 text-sm shadow-sm; } .note.danger { - border: 1px solid #e3342f; - color: #e3342f; + border: 1px solid #e3342f; + color: #e3342f; } .note.info { - border: 1px solid #3490dc; - color: #3490dc; + border: 1px solid #3490dc; + color: #3490dc; +} + +.copybtn .copy-btn { + transform: scale(1); +} +.copybtn .check-btn { + transform: scale(0); +} +.copybtn:focus .copy-btn { + transform: scale(0); +} +.copybtn:focus .check-btn { + transform: scale(1); } diff --git a/src/lib/components/manage/monitorsAdd.svelte b/src/lib/components/manage/monitorsAdd.svelte index 0416f71..0d88520 100644 --- a/src/lib/components/manage/monitorsAdd.svelte +++ b/src/lib/components/manage/monitorsAdd.svelte @@ -32,7 +32,7 @@ //broadcast a custom event named blockScroll if (!!isMounted) { const noScrollEvent = new CustomEvent("noScroll", { - detail: showAddMonitor + detail: showAddMonitor || draggableMenu || shareMenusToggle }); window.dispatchEvent(noScrollEvent); @@ -163,7 +163,7 @@ headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ action: "getTriggers", data: { status: "ACTIVE" } }) + body: JSON.stringify({ action: "getTriggers", data: {} }) }); triggers = await apiResp.json(); } catch (error) { @@ -623,7 +623,7 @@

Choose Triggers

{#each triggers as trigger}
-