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
-
+
### 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
-
+
### 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.
-
+
@@ -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.
-
+
### Icon
@@ -45,7 +45,7 @@ The title of the link.
The URL to redirect to when the link is clicked.
-
+
---
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
-
+
@@ -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(/
@@ -74,7 +83,7 @@
-
+
@@ -104,10 +113,18 @@
-
-
-
-
+ {
+ sideBarHidden = !sideBarHidden;
+ }}
+ >
+ {#if sideBarHidden}
+
+ {:else}
+
+ {/if}
@@ -115,34 +132,40 @@
-
-
-
- {#each sidebar as item}
-
-
- {item.sectionTitle}
-
-
- {#each item.children as child}
-
- {/each}
+ {#if !sideBarHidden}
+
+
+
+ {#each sidebar as item}
+
+
+ {item.sectionTitle}
+
+
+ {#each item.children as child}
+
+ {/each}
+
-
- {/each}
-
-
+ {/each}
+
+
+ {/if}
-
-
+
+
{#if tableOfContents.length > 0}
-
+
On this page
{#each tableOfContents as item}
diff --git a/src/routes/(docs)/docs/[doc]/+page.svelte b/src/routes/(docs)/docs/[doc]/+page.svelte
index ac98429..3129eb4 100644
--- a/src/routes/(docs)/docs/[doc]/+page.svelte
+++ b/src/routes/(docs)/docs/[doc]/+page.svelte
@@ -1,63 +1,153 @@
- {data.title}
-
-
+ {data.title}
+
+
- {@html data.md}
+ {@html data.md}
+
+
+
+ {#if previousPath}
+
+
+ {previousPath.title}
+
+ {/if}
+
+
+ {#if nextPath}
+
+ {nextPath.title}
+
+
+ {/if}
+
diff --git a/static/confetti.gif b/static/confetti.gif
deleted file mode 100644
index ef80237..0000000
Binary files a/static/confetti.gif and /dev/null differ
diff --git a/static/dddepth-333.jpg b/static/dddepth-333.jpg
deleted file mode 100644
index 7042b9b..0000000
Binary files a/static/dddepth-333.jpg and /dev/null differ
diff --git a/static/discord_resolved.png b/static/documentation/discord_resolved.png
similarity index 100%
rename from static/discord_resolved.png
rename to static/documentation/discord_resolved.png
diff --git a/static/em_r.png b/static/documentation/em_r.png
similarity index 100%
rename from static/em_r.png
rename to static/documentation/em_r.png
diff --git a/static/em_t.png b/static/documentation/em_t.png
similarity index 100%
rename from static/em_t.png
rename to static/documentation/em_t.png
diff --git a/static/home_1.png b/static/documentation/home_1.png
similarity index 100%
rename from static/home_1.png
rename to static/documentation/home_1.png
diff --git a/static/home_2.png b/static/documentation/home_2.png
similarity index 100%
rename from static/home_2.png
rename to static/documentation/home_2.png
diff --git a/static/home_3.png b/static/documentation/home_3.png
similarity index 100%
rename from static/home_3.png
rename to static/documentation/home_3.png
diff --git a/static/m_api.png b/static/documentation/m_api.png
similarity index 100%
rename from static/m_api.png
rename to static/documentation/m_api.png
diff --git a/static/m_dns.png b/static/documentation/m_dns.png
similarity index 100%
rename from static/m_dns.png
rename to static/documentation/m_dns.png
diff --git a/static/m_ex_2.png b/static/documentation/m_ex_2.png
similarity index 100%
rename from static/m_ex_2.png
rename to static/documentation/m_ex_2.png
diff --git a/static/m_ex_3.png b/static/documentation/m_ex_3.png
similarity index 100%
rename from static/m_ex_3.png
rename to static/documentation/m_ex_3.png
diff --git a/static/m_ex_4.png b/static/documentation/m_ex_4.png
similarity index 100%
rename from static/m_ex_4.png
rename to static/documentation/m_ex_4.png
diff --git a/static/m_ex_website.png b/static/documentation/m_ex_website.png
similarity index 100%
rename from static/m_ex_website.png
rename to static/documentation/m_ex_website.png
diff --git a/static/documentation/m_group.png b/static/documentation/m_group.png
new file mode 100644
index 0000000..20817ff
Binary files /dev/null and b/static/documentation/m_group.png differ
diff --git a/static/m_main.png b/static/documentation/m_main.png
similarity index 100%
rename from static/m_main.png
rename to static/documentation/m_main.png
diff --git a/static/m_ping.png b/static/documentation/m_ping.png
similarity index 100%
rename from static/m_ping.png
rename to static/documentation/m_ping.png
diff --git a/static/m_tcp.png b/static/documentation/m_tcp.png
similarity index 100%
rename from static/m_tcp.png
rename to static/documentation/m_tcp.png
diff --git a/static/ms_1.png b/static/documentation/ms_1.png
similarity index 100%
rename from static/ms_1.png
rename to static/documentation/ms_1.png
diff --git a/static/s_2.png b/static/documentation/s_2.png
similarity index 100%
rename from static/s_2.png
rename to static/documentation/s_2.png
diff --git a/static/slack_resolved.png b/static/documentation/slack_resolved.png
similarity index 100%
rename from static/slack_resolved.png
rename to static/documentation/slack_resolved.png
diff --git a/static/trig_1.png b/static/documentation/trig_1.png
similarity index 100%
rename from static/trig_1.png
rename to static/documentation/trig_1.png
diff --git a/static/trig_2.png b/static/documentation/trig_2.png
similarity index 100%
rename from static/trig_2.png
rename to static/documentation/trig_2.png
diff --git a/static/trig_3.png b/static/documentation/trig_3.png
similarity index 100%
rename from static/trig_3.png
rename to static/documentation/trig_3.png
diff --git a/static/trig_4.png b/static/documentation/trig_4.png
similarity index 100%
rename from static/trig_4.png
rename to static/documentation/trig_4.png
diff --git a/static/trig_web.png b/static/documentation/trig_web.png
similarity index 100%
rename from static/trig_web.png
rename to static/documentation/trig_web.png
diff --git a/static/x1.png b/static/documentation/x1.png
similarity index 100%
rename from static/x1.png
rename to static/documentation/x1.png
diff --git a/static/x2.png b/static/documentation/x2.png
similarity index 100%
rename from static/x2.png
rename to static/documentation/x2.png
diff --git a/static/x3.png b/static/documentation/x3.png
similarity index 100%
rename from static/x3.png
rename to static/documentation/x3.png
diff --git a/static/x4.png b/static/documentation/x4.png
similarity index 100%
rename from static/x4.png
rename to static/documentation/x4.png
diff --git a/static/in_1.png b/static/in_1.png
deleted file mode 100644
index 096dbf8..0000000
Binary files a/static/in_1.png and /dev/null differ
diff --git a/static/in_2.png b/static/in_2.png
deleted file mode 100644
index 1289905..0000000
Binary files a/static/in_2.png and /dev/null differ
diff --git a/static/in_3.png b/static/in_3.png
deleted file mode 100644
index 199c431..0000000
Binary files a/static/in_3.png and /dev/null differ
diff --git a/static/in_4.png b/static/in_4.png
deleted file mode 100644
index be2f888..0000000
Binary files a/static/in_4.png and /dev/null differ
diff --git a/static/marken_90.png b/static/marken_90.png
deleted file mode 100644
index 2f8290f..0000000
Binary files a/static/marken_90.png and /dev/null differ
diff --git a/static/marken_api.png b/static/marken_api.png
deleted file mode 100644
index 1ab4b5a..0000000
Binary files a/static/marken_api.png and /dev/null differ
diff --git a/static/marken_badge.png b/static/marken_badge.png
deleted file mode 100644
index e5be4d7..0000000
Binary files a/static/marken_badge.png and /dev/null differ
diff --git a/static/marken_embed.png b/static/marken_embed.png
deleted file mode 100644
index 8bd878e..0000000
Binary files a/static/marken_embed.png and /dev/null differ
diff --git a/static/marken_inci.png b/static/marken_inci.png
deleted file mode 100644
index c0c1866..0000000
Binary files a/static/marken_inci.png and /dev/null differ
diff --git a/static/marken_share.png b/static/marken_share.png
deleted file mode 100644
index e0ec4c9..0000000
Binary files a/static/marken_share.png and /dev/null differ
diff --git a/static/marken_td.png b/static/marken_td.png
deleted file mode 100644
index b524f46..0000000
Binary files a/static/marken_td.png and /dev/null differ
diff --git a/static/marken_theme.png b/static/marken_theme.png
deleted file mode 100644
index 5549d3a..0000000
Binary files a/static/marken_theme.png and /dev/null differ
diff --git a/static/marken_tl.png b/static/marken_tl.png
deleted file mode 100644
index c03db84..0000000
Binary files a/static/marken_tl.png and /dev/null differ
diff --git a/static/ss.png b/static/ss.png
deleted file mode 100644
index a9ff0de..0000000
Binary files a/static/ss.png and /dev/null differ
diff --git a/static/ss2.png b/static/ss2.png
deleted file mode 100644
index da25c4b..0000000
Binary files a/static/ss2.png and /dev/null differ
diff --git a/static/ss3.png b/static/ss3.png
deleted file mode 100644
index f0a7419..0000000
Binary files a/static/ss3.png and /dev/null differ