Compare commits
468 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 622327cdf6 | |||
| b0a4cd5c42 | |||
| 25e73d097c | |||
| 1970cd8891 | |||
| 8ae9b2dec1 | |||
| 1662608984 | |||
| 42693983f1 | |||
| f43048d783 | |||
| b5ec332b4a | |||
| dab1c44b18 | |||
| d9c0bff780 | |||
| beceace2c2 | |||
| 5373636704 | |||
| e8d04eccf6 | |||
| d978c82263 | |||
| 883a458ed3 | |||
| 9009d9df99 | |||
| 81c0fa1243 | |||
| 01221616ae | |||
| be75a0f5e9 | |||
| 1b40839490 | |||
| 80f5780602 | |||
| dcf1817cd6 | |||
| ae251803ad | |||
| f6d9627ceb | |||
| 0cbc6b7b56 | |||
| f0af2d14e4 | |||
| b797039144 | |||
| 86e29e5065 | |||
| fddef22e8e | |||
| ad7551b7af | |||
| f09eb18bcc | |||
| 5c65e35f24 | |||
| 8cbe859971 | |||
| 67f38db847 | |||
| 28a72a3592 | |||
| dae334694d | |||
| e57fe3a046 | |||
| 54670c7845 | |||
| 3dbcef1500 | |||
| 24bbad05cb | |||
| cacbda3164 | |||
| da9b1a3a64 | |||
| 394b911eca | |||
| 220778e84f | |||
| c6e343da5d | |||
| 268e5b7478 | |||
| b9ccd16a02 | |||
| 302ad0e8a6 | |||
| e052f435db | |||
| caa1330f39 | |||
| 870d19f566 | |||
| a28f787833 | |||
| 335a51b589 | |||
| 72f9471486 | |||
| f0cd101af5 | |||
| 52876bd77e | |||
| aabe1926bd | |||
| e785227064 | |||
| 0cb88eec3b | |||
| 8cd2914f73 | |||
| f70e2ee8eb | |||
| c60a21ef32 | |||
| 77a57ee609 | |||
| fc15f0e083 | |||
| 6115beece3 | |||
| 54434fbe78 | |||
| 83755bdd25 | |||
| 08f901c5f0 | |||
| 06910fbd4d | |||
| 154e7dd185 | |||
| 8bde3226bf | |||
| e5565145b5 | |||
| 37a667daff | |||
| eda98bacfc | |||
| ee1ee52e13 | |||
| d03bf41ad1 | |||
| ba2fe24629 | |||
| 547116090a | |||
| 974826f42d | |||
| 4914b029f9 | |||
| ff864fbaab | |||
| f583ba4938 | |||
| d552f541ac | |||
| d46d02e37a | |||
| 4e0c6e85da | |||
| 1147808366 | |||
| a7c27a60e0 | |||
| 974976bd90 | |||
| 9bbe665984 | |||
| d0ea8551b6 | |||
| 089ee9bc07 | |||
| 786c4f8207 | |||
| 13879aefdd | |||
| d03a8fd7a4 | |||
| c00aae5566 | |||
| e923f4d650 | |||
| 654c07a364 | |||
| 820eeb0aac | |||
| 2a338baa26 | |||
| ec7351272f | |||
| 13dec43ef3 | |||
| 43673e3349 | |||
| 1e77253a63 | |||
| 798af326a2 | |||
| d349a7591e | |||
| 8370145f6c | |||
| 304945acea | |||
| 1dd05fee50 | |||
| 374eda4103 | |||
| 52a8cca3e8 | |||
| 22ef4d75b6 | |||
| 534e6a0ad3 | |||
| 80ed4fc5fa | |||
| 445eb02386 | |||
| 53ae0b89b0 | |||
| c7376b4d8f | |||
| e3e59b7e24 | |||
| 07f59ac581 | |||
| 7176c3d4f4 | |||
| 13366284c6 | |||
| 0f0b447137 | |||
| f7cc28c896 | |||
| fd790003d1 | |||
| fdad329148 | |||
| 73bf5f3fbe | |||
| 103d64a659 | |||
| 92c4d35992 | |||
| 3b1d95b71b | |||
| 4fd9bf2bb6 | |||
| ce96b6f55d | |||
| 54bbc1dd00 | |||
| ffa31bcacc | |||
| 559f5bd257 | |||
| 977e49e1ce | |||
| 30cb707436 | |||
| ae439633b9 | |||
| 7f33f6ddfd | |||
| 8404415a93 | |||
| 5ddddf8b5d | |||
| 927db19cc6 | |||
| eccff16c5f | |||
| 7be9c62c7c | |||
| 76ce14e8b1 | |||
| fd0074c0b0 | |||
| ad01cdb5ac | |||
| 1b4ca67cf0 | |||
| 53936e19d4 | |||
| b58d00c5a6 | |||
| 41db0c45cd | |||
| 5361b551eb | |||
| eb87647466 | |||
| d9b900f28d | |||
| 198bd6c723 | |||
| 1831e6309f | |||
| 007f5149d2 | |||
| 1a094e3511 | |||
| db1ddc1292 | |||
| 535e3bb36a | |||
| 785237e55e | |||
| e6bf47a859 | |||
| 93ae1711f1 | |||
| af97812beb | |||
| 78cf22ade9 | |||
| b4a461d93a | |||
| 5f33c02064 | |||
| 46c1a392b8 | |||
| c6880c5df6 | |||
| 646da94ef9 | |||
| 36ede93dce | |||
| 9ed35589f7 | |||
| e946dd18e0 | |||
| 51cad598c1 | |||
| 0595f23c18 | |||
| b88816706b | |||
| 80edaae023 | |||
| 883c46b064 | |||
| 4248cc31f2 | |||
| 5f81c6d61a | |||
| 00d82cc817 | |||
| a9edfde162 | |||
| 468d7f445d | |||
| 4cc74deece | |||
| f9831490af | |||
| a055a616eb | |||
| 8009a2cbc4 | |||
| 693cc149cf | |||
| d126fe0bce | |||
| 4cc49cce9e | |||
| f7cb4cd805 | |||
| a2bd9883d1 | |||
| 10a079c304 | |||
| 65f12f1082 | |||
| c15f855c72 | |||
| 3d38483022 | |||
| 57dc1e7175 | |||
| ead68c929f | |||
| d54b346259 | |||
| a05de8269c | |||
| 130b70c6af | |||
| 7247a54c08 | |||
| 28de7ebff8 | |||
| e2c9d4dc2d | |||
| 4866382180 | |||
| 1b1507db1a | |||
| 0ea7d687a7 | |||
| 502e1539ca | |||
| f3910fea1b | |||
| ee9b48fb79 | |||
| 142686ef92 | |||
| 2aa187984e | |||
| c20d4d71c3 | |||
| 4f4d1e1b39 | |||
| f38b590f70 | |||
| c2caf42fd3 | |||
| 8c279c8c10 | |||
| 3480c78360 | |||
| 79ce708f60 | |||
| a4526eb4b5 | |||
| 866a133917 | |||
| adce978244 | |||
| dd3c26b29a | |||
| 25ad42ba9b | |||
| 3285b7e472 | |||
| c7da55480a | |||
| 35e81b5782 | |||
| 769a9526e7 | |||
| 5470153f4f | |||
| 9d6ad87275 | |||
| ac6261d9ac | |||
| 48effe077e | |||
| c656bf8612 | |||
| 9daf7c7156 | |||
| 4bd3bfae9d | |||
| 727964949c | |||
| 21e1fc1aca | |||
| eeba2ef2d4 | |||
| b3e738ce03 | |||
| 46848c7b19 | |||
| 5f3d48597f | |||
| 0efc3e5999 | |||
| 0c0ce89317 | |||
| 4a47061f76 | |||
| 9b3ff9b362 | |||
| 8315fede7d | |||
| d6d0568f67 | |||
| ff0119db9b | |||
| 37d776c315 | |||
| f53d4abd8b | |||
| f827bd4aeb | |||
| f28c4e96c5 | |||
| cf81b11c0b | |||
| 17dc752902 | |||
| bc9faf9456 | |||
| e5b615267c | |||
| 70e9086646 | |||
| 0cc30bc67e | |||
| 73792e7ce6 | |||
| 32f873d9c2 | |||
| 6566bc5f8f | |||
| cc93114eab | |||
| 6d5d949f5c | |||
| f1be4a4db0 | |||
| 8b9f576b30 | |||
| 0735f959ef | |||
| f91d65b7a4 | |||
| c8d4920cd3 | |||
| 27625bc31a | |||
| 67e22e4339 | |||
| b4ed5cffd6 | |||
| 6209ff12bb | |||
| 392a0e85be | |||
| a7abf37781 | |||
| c09f87daa7 | |||
| 43072d2777 | |||
| ed52f28743 | |||
| fe953b6b36 | |||
| d931f3ec6d | |||
| 2fbf404bf3 | |||
| 49064e4e25 | |||
| 2c4004d91f | |||
| 37706b87c4 | |||
| c8a98a745d | |||
| abae472545 | |||
| 749593f1af | |||
| a824a5dcf2 | |||
| 8b2fe90eb7 | |||
| e6370fab66 | |||
| 92ea4b64f9 | |||
| 9f6d071f25 | |||
| 274536eafa | |||
| 5b0ad39526 | |||
| 01d54f504b | |||
| e413fb7ecd | |||
| dc665ec581 | |||
| f7fa0452cd | |||
| 47253cc54b | |||
| 71b56db909 | |||
| ad41edc972 | |||
| 9076561644 | |||
| ff5601aad2 | |||
| 21629b7bed | |||
| 052e38a292 | |||
| 38c44396b0 | |||
| f80e19e18a | |||
| ebdda050f8 | |||
| 110fb1c180 | |||
| fd361f9482 | |||
| 1b8e05ad1f | |||
| 28184d2a52 | |||
| 9a14a81956 | |||
| 3312bbe8e4 | |||
| a9602f5576 | |||
| 0f5dd0fd31 | |||
| e45b016cca | |||
| e1fe07cf26 | |||
| 18e851a205 | |||
| c992ec22ca | |||
| c57f75d1ea | |||
| 5abfafe2fa | |||
| bd87aded67 | |||
| c0332fe035 | |||
| 3941cc4e9b | |||
| 6ebaec5c3b | |||
| 4b8aebdc1b | |||
| 10afb34921 | |||
| 068a3b9c5e | |||
| 94ac704582 | |||
| fd677396ee | |||
| 06d81fb419 | |||
| 3264e86426 | |||
| 5767f2d2c3 | |||
| a267c4028a | |||
| 4916a6b380 | |||
| 55550ade86 | |||
| 8a30906bd4 | |||
| e049ec7782 | |||
| fab2a2aed7 | |||
| 3abc8b730f | |||
| 80bf60e75d | |||
| d0095d3e31 | |||
| 04a9e85bd2 | |||
| 5bab933364 | |||
| ad768296c3 | |||
| cc830827bb | |||
| 0c24507bb2 | |||
| be1ecf1af6 | |||
| 1f449258ab | |||
| 3e7579852b | |||
| b58af80552 | |||
| e17ccd1519 | |||
| 780d053871 | |||
| a25ce58ebf | |||
| fa1a16ad30 | |||
| 0c9073aa6f | |||
| e8a39cbe19 | |||
| c3d3ff39f0 | |||
| 240f3b0380 | |||
| 1238b379ce | |||
| c580472282 | |||
| 07d9aab45f | |||
| 6bb9808d0c | |||
| 283c38c9a5 | |||
| c0084a5d61 | |||
| f0ccb32b51 | |||
| f6e2fb3e89 | |||
| 6114e2693d | |||
| 9dde9b0763 | |||
| 4fed2f32ae | |||
| 2885cd621c | |||
| 3c91ff2860 | |||
| 68ca90e52e | |||
| dd592dc684 | |||
| 75d6a271bf | |||
| 090b24079a | |||
| f5f5d4fdc9 | |||
| b166df13b0 | |||
| 1078607805 | |||
| 94877a056a | |||
| dbc76a9106 | |||
| 5dc3e6c258 | |||
| 8f024a853f | |||
| f921df0e97 | |||
| 73147eee27 | |||
| 8cdf217a45 | |||
| 15b48eb622 | |||
| c99f4013fe | |||
| 52ff46a1ce | |||
| 72d979abe3 | |||
| 5e5ab9439b | |||
| 78c173d215 | |||
| 5d8b5283a6 | |||
| 7042caa356 | |||
| e6076efd6f | |||
| c3d2497965 | |||
| 52638a8ca5 | |||
| 1840675f26 | |||
| 9c89634b0b | |||
| 1b4fa02efe | |||
| 8880dfa4c6 | |||
| 7bea01dbb6 | |||
| a85820ed2b | |||
| 0e136afd61 | |||
| 231ec66d5e | |||
| 1ebd40f922 | |||
| d4a919c1d7 | |||
| 70b80cac62 | |||
| ffc3055aec | |||
| 471c6ddd33 | |||
| b7abe28c57 | |||
| 905fbc2bc3 | |||
| d3a7116747 | |||
| 7fe340bd5f | |||
| 6026369e16 | |||
| 321b053538 | |||
| cbcdebb06f | |||
| 9ae7405166 | |||
| 139da41e28 | |||
| 4d0147a174 | |||
| 6766bec87d | |||
| b64f3aea75 | |||
| c15ec146b8 | |||
| ec9934b3e1 | |||
| 31e212b869 | |||
| 74ea57d6bb | |||
| b7eb788c26 | |||
| 18d9589594 | |||
| 901b942ebf | |||
| 84cdb43f12 | |||
| abe75a7207 | |||
| 32b623d391 | |||
| 1aa9c5860a | |||
| 61e4c15c28 | |||
| 55cb221b52 | |||
| ea12920e7e | |||
| 3a845080b4 | |||
| 3e87eb73e9 | |||
| 5add3752b7 | |||
| 50b88957c9 | |||
| e38bf074b6 | |||
| 696e30a581 | |||
| 4be7f7a325 | |||
| 80958a4710 | |||
| 5c527cdec8 | |||
| 3dd395626f | |||
| 6788ded1b3 | |||
| 638b7328bd | |||
| 42e2024d71 | |||
| e011335287 | |||
| b90667966c | |||
| 051be76da3 | |||
| d38366eed8 | |||
| 14141a25ff | |||
| 1bbd9cbe22 | |||
| ca6e94fc42 | |||
| 12db7649b8 | |||
| adbb541585 | |||
| 4315c0ae70 | |||
| 79aa44ec46 | |||
| 861cf32613 | |||
| 1dd7dff4d3 | |||
| a335bdb835 | |||
| 8a22c0d02a | |||
| b7b225d13a | |||
| 8b119bf98a | |||
| fdc02b206c | |||
| 082f33d95d | |||
| 3b818fb41f |
@@ -0,0 +1,9 @@
|
||||
node_modules
|
||||
.git
|
||||
.github
|
||||
.vscode
|
||||
dist
|
||||
build
|
||||
.env
|
||||
.DS_Store
|
||||
*.log
|
||||
@@ -0,0 +1,52 @@
|
||||
# EditorConfig helps maintain consistent coding styles between editors
|
||||
root = true
|
||||
|
||||
# Default settings for all files (e.g. most common, best-practice standard across all filetypes)
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
# Svelte files
|
||||
[*.svelte]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
# JavaScript and TypeScript
|
||||
[*.{js,ts,tsx,cjs,mjs}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
# JSON files (package.json, config files, etc.) - per JSON (RFC 8259) specification
|
||||
[*.json,.prettierrc]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
# YAML files (e.g., GitHub Actions, Lint configs) - per YAML 1.2 (2009) specification
|
||||
[*.{yaml,yml}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
# Markdown files
|
||||
[*.md]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
# Dockerfile
|
||||
[Dockerfile*]
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
insert_final_newline = false
|
||||
|
||||
# Ignore binary files
|
||||
[*.{png,jpg,jpeg,gif,ico,svg,woff,woff2,eot,ttf,otf}]
|
||||
charset = unset
|
||||
trim_trailing_whitespace = false
|
||||
insert_final_newline = false
|
||||
@@ -0,0 +1,26 @@
|
||||
TZ=Etc/UTC
|
||||
KENER_SECRET_KEY=please_change_me_to_something_secure
|
||||
|
||||
# For SQLite database...
|
||||
DATABASE_URL=sqlite://./database/kener.sqlite.db
|
||||
|
||||
# For PostgreSQL database...
|
||||
# DATABASE_URL=postgresql://db_user:db_password@localhost:5432/kener_db
|
||||
# POSTGRES_PASSWORD=some_super_random_secure_password
|
||||
|
||||
# For MySQL database...
|
||||
# DATABASE_URL=mysql://db_user:db_password@127.0.0.1:3306/kener_db
|
||||
# MYSQL_PASSWORD=some_super_random_secure_password
|
||||
|
||||
KENER_BASE_PATH=""
|
||||
ORIGIN=http://localhost:3000
|
||||
|
||||
RESEND_API_KEY=""
|
||||
RESEND_SENDER_EMAIL=Accounts <accounts@resend.dev>
|
||||
|
||||
# Likely no need to change...
|
||||
# NODE_ENV=production # already defined in container
|
||||
# PORT=3000 # default port Kener service is exposed upon
|
||||
|
||||
# Add the below variable if you would like to ‘white-label’ the product (aka. remove some of the attributions scattered throughout the app)
|
||||
# WHITE_LABEL=true
|
||||
@@ -0,0 +1,48 @@
|
||||
# Contributing to Kener
|
||||
|
||||
Thank you for considering contributing to our project! Here are some guidelines to help you get started.
|
||||
|
||||
---
|
||||
|
||||
## How to Contribute
|
||||
|
||||
1. Fork the repository and clone it locally.
|
||||
2. Create a new branch for your feature or bug fix:
|
||||
```bash
|
||||
git checkout -b feature/your-feature-name
|
||||
```
|
||||
3. Make your changes and commit them:
|
||||
```bash
|
||||
git commit -m 'Describe your changes'
|
||||
```
|
||||
4. Push your changes to your fork:
|
||||
```bash
|
||||
git push origin feature/your-feature-name
|
||||
```
|
||||
5. Create a pull request to the `main` branch.
|
||||
|
||||
|
||||
## Development
|
||||
|
||||
1. Install dependencies:
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
2. Create a `.env` file in the root of the project and add the following:
|
||||
```bash
|
||||
cp .env.example .env
|
||||
```
|
||||
2. Start the development server:
|
||||
```bash
|
||||
npm run dev
|
||||
```
|
||||
3. Open [http://localhost:3000](http://localhost:3000) in your browser.
|
||||
|
||||
## Documentation
|
||||
|
||||
The documentation is available in the `docs` folder. You can view it by going to [http://localhost:3000/docs/home](http://localhost:3000/docs/home) in your browser.
|
||||
|
||||
## Where to Start
|
||||
|
||||
1. Check out the [roadmap items](https://kener.ing/docs/roadmap/)
|
||||
2. Add language support by following the [i18n guide](https://kener.ing/docs/i18n/)
|
||||
@@ -0,0 +1,2 @@
|
||||
github: rajnandan1
|
||||
buy_me_a_coffee: rajnandan1
|
||||
@@ -0,0 +1,36 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Version**
|
||||
Which version of kener you are using.
|
||||
|
||||
**Environment**
|
||||
Which environment you are using or where is it deployed. `docker`, `kubernetes`, `bare-metal`, `development`, `pm2` etc
|
||||
|
||||
**Database**
|
||||
Which database you are using. `sqlite`, `mysql`, `postgres`
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
@@ -0,0 +1,83 @@
|
||||
name: Generate README
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'README.template.md'
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'README.template.md'
|
||||
workflow_dispatch: # Allows for manual execution
|
||||
workflow_run: # Triggers this workflow to run when it recognizes 'publish-images' workflow has ran and successfully completed
|
||||
workflows: ["Publish Docker Image to Registries"]
|
||||
types:
|
||||
- completed
|
||||
|
||||
permissions:
|
||||
contents: write # Explicitly allow pushing changes
|
||||
|
||||
jobs:
|
||||
generate-readme:
|
||||
name: Generate README from template
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4.2.2
|
||||
with:
|
||||
fetch-depth: 0 # Fetch full history, including tags
|
||||
persist-credentials: false # We'll manually authenticate
|
||||
|
||||
- name: Configure Git
|
||||
run: |
|
||||
git config --global user.name "github-actions"
|
||||
git config --global user.email "github-actions@github.com"
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4.2.0
|
||||
with:
|
||||
node-version: "20"
|
||||
|
||||
- name: Install Dependencies
|
||||
run: npm install mustache dotenv
|
||||
|
||||
- name: Extract Major and Major-Minor Versions
|
||||
run: |
|
||||
VERSION="${{ vars.BUILD_VERSION }}"
|
||||
|
||||
# Check if VERSION is empty and set a fallback value
|
||||
if [ -z "$VERSION" ]; then
|
||||
# Fetch the latest release using Git
|
||||
VERSION=$(git tag -l --sort=-v:refname | grep -E '^v?[0-9]+\.[0-9]+\.[0-9]+$' | head -n 1 || echo "3.1.0")
|
||||
fi
|
||||
|
||||
MAJOR=$(echo "$VERSION" | cut -d. -f1)
|
||||
MAJOR_MINOR=$(echo "$VERSION" | cut -d. -f1,2)
|
||||
|
||||
echo "Full version: $VERSION"
|
||||
echo "Major version: $MAJOR"
|
||||
echo "Major-Minor version: $MAJOR_MINOR"
|
||||
|
||||
# Export all as environment variables
|
||||
echo "LATEST_VERSION=$VERSION" >> $GITHUB_ENV
|
||||
echo "LATEST_MAJOR_VERSION=$MAJOR" >> $GITHUB_ENV
|
||||
echo "LATEST_MAJOR_MINOR_VERSION=$MAJOR_MINOR" >> $GITHUB_ENV
|
||||
|
||||
- name: Generate README.md
|
||||
env:
|
||||
BUILD_FULL_VERSION: ${{ env.LATEST_VERSION }} # e.g., 1.2.3
|
||||
BUILD_MAJOR_VERSION: ${{ env.LATEST_MAJOR_VERSION}} # e.g., 1
|
||||
BUILD_MAJOR_MINOR_VERSION: ${{ env.LATEST_MAJOR_MINOR_VERSION }} # e.g., 1.2
|
||||
run: node scripts/generate-readme.js
|
||||
|
||||
- name: Commit and Push Changes
|
||||
env:
|
||||
GH_PAT: ${{ secrets.GH_PAT }}
|
||||
run: |
|
||||
git add README.md
|
||||
git commit -m "Auto-generate README.md with release versions" || echo "No changes to commit"
|
||||
git push https://x-access-token:${{ secrets.GH_PAT }}@github.com/${{ github.repository }}.git HEAD:main
|
||||
@@ -0,0 +1,21 @@
|
||||
name: Prevent Direct README Changes
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- "README.md"
|
||||
|
||||
jobs:
|
||||
check-readme:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: Detect direct README changes
|
||||
run: |
|
||||
if git diff --name-only origin/main | grep -q "README.md"; then
|
||||
echo "❌ Direct modifications to README.md are not allowed!"
|
||||
echo "Please update README.template.md instead."
|
||||
exit 1
|
||||
fi
|
||||
@@ -0,0 +1,157 @@
|
||||
name: Publish Docker Image to Registries
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- published # Runs only when a GitHub Release is published
|
||||
workflow_dispatch: # Allows for manual execution
|
||||
|
||||
env:
|
||||
ALPINE_VERSION: "23-alpine"
|
||||
DEBIAN_VERSION: "23-slim"
|
||||
# Registry URLs
|
||||
DOCKERHUB_REGISTRY: docker.io
|
||||
GITHUB_REGISTRY: ghcr.io
|
||||
# Docker Hub image name (using Docker Hub username)
|
||||
DOCKERHUB_IMAGE_NAME: ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}
|
||||
# GitHub image name (formatted as `account/repo`)
|
||||
GITHUB_IMAGE_NAME: ${{ github.repository }}
|
||||
|
||||
jobs:
|
||||
check-lockfile:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20' # Adjust as needed
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Check for lock-file changes
|
||||
run: |
|
||||
git diff --exit-code package-lock.json || (
|
||||
echo "🫥 package-lock.json is outdated or missing. Please run 'npm install' and commit the updated lockfile."
|
||||
exit 1
|
||||
)
|
||||
|
||||
build-and-push-to-registries:
|
||||
needs: check-lockfile # Runs only after `check-lockfile` completes successfully
|
||||
name: Push Docker images to Docker Hub and GitHub Container Registry
|
||||
strategy:
|
||||
matrix:
|
||||
variant: [alpine, debian]
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: write
|
||||
contents: write
|
||||
packages: write
|
||||
# This is used to complete the identity challenge with sigstore/fulcio when running outside of PRs.
|
||||
id-token: write
|
||||
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v4.2.2
|
||||
|
||||
# Install the cosign tool (except on PR)
|
||||
# https://github.com/sigstore/cosign-installer
|
||||
- name: Install cosign
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: sigstore/cosign-installer@v3.8.0
|
||||
with:
|
||||
cosign-release: 'v2.2.4'
|
||||
|
||||
# Set up BuildKit Docker container builder to be able to build multi-platform images and export cache
|
||||
# https://github.com/docker/setup-buildx-action
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3.8.0
|
||||
|
||||
# Log in to Docker Hub (except on PR)
|
||||
- name: Log in to Docker Hub
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v3.3.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
# Log in to GitHub Container Registry (except on PR)
|
||||
- name: Log in to GitHub Container Registry
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v3.3.0
|
||||
with:
|
||||
registry: ${{ env.GITHUB_REGISTRY }}
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
# Combined metadata extraction for both registries
|
||||
- name: Extract Docker metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5.6.1
|
||||
with:
|
||||
images: |
|
||||
${{ env.DOCKERHUB_IMAGE_NAME }}
|
||||
${{ env.GITHUB_REGISTRY }}/${{ env.GITHUB_IMAGE_NAME }}
|
||||
tags: |
|
||||
# Tag non-main branches (...for Alpine variant, add suffix)
|
||||
type=ref,event=branch,suffix=-${{ matrix.variant }},enable=${{ matrix.variant == 'alpine' && github.ref != 'refs/heads/main' }}
|
||||
type=ref,event=branch,enable=${{ matrix.variant == 'debian' && github.ref != 'refs/heads/main' }}
|
||||
# Tag matrix.variant (Alpine) releases as version (1.0.0), major.minor (1.0), major (1), and matrix.variant (alpine)
|
||||
type=semver,pattern={{version}},suffix=-${{ matrix.variant }},enable=${{ matrix.variant == 'alpine' }}
|
||||
type=semver,pattern={{major}}.{{minor}},suffix=-${{ matrix.variant }},enable=${{ matrix.variant == 'alpine' }}
|
||||
type=semver,pattern={{major}},suffix=-${{ matrix.variant }},enable=${{ matrix.variant == 'alpine' }}
|
||||
type=raw,value=${{ matrix.variant }},enable=${{ matrix.variant == 'alpine' && github.ref == 'refs/heads/main' }}
|
||||
# Tag default (Debian) releases as version (1.0.0), major.minor (1.0), major (1), and latest
|
||||
type=semver,pattern={{version}},enable=${{ matrix.variant == 'debian' }}
|
||||
type=semver,pattern={{major}}.{{minor}},enable=${{ matrix.variant == 'debian' }}
|
||||
type=semver,pattern={{major}},enable=${{ matrix.variant == 'debian' }}
|
||||
type=raw,value=latest,enable=${{ matrix.variant == 'debian' && github.ref == 'refs/heads/main' }}
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3.3.0
|
||||
|
||||
# Build and push Docker image with Buildx to both registries (don't push on PR)
|
||||
- name: Build and push Docker image
|
||||
id: build-and-push
|
||||
uses: docker/build-push-action@v6.13.0
|
||||
with:
|
||||
context: .
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
build-args: |
|
||||
VARIANT=${{ matrix.variant }}
|
||||
ALPINE_VERSION=${{ env.ALPINE_VERSION }}
|
||||
DEBIAN_VERSION=${{ env.DEBIAN_VERSION }}
|
||||
platforms: linux/amd64,linux/arm64
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
# Sign the resulting Docker image digests
|
||||
- name: Sign the published Docker images
|
||||
if: ${{ github.event_name != 'pull_request' }}
|
||||
env:
|
||||
TAGS: ${{ steps.meta.outputs.tags }}
|
||||
DIGEST: ${{ steps.build-and-push.outputs.digest }}
|
||||
run: |
|
||||
echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
|
||||
|
||||
# For use in other workflows (e.g. 'generate-readme', etc.)
|
||||
- name: Save Build Version to Repository Variable
|
||||
if: matrix.variant == 'debian' && github.run_attempt == 1
|
||||
run: |
|
||||
VERSION="${{ steps.meta.outputs.version }}"
|
||||
|
||||
# Check if VERSION is empty and set a fallback value
|
||||
if [ -z "$VERSION" ]; then
|
||||
# Fetch the latest release using Git
|
||||
VERSION=$(git tag -l --sort=-v:refname | grep -E '^v?[0-9]+\.[0-9]+\.[0-9]+$' | head -n 1 || echo "3.1.0")
|
||||
fi
|
||||
|
||||
echo "Setting BUILD_VERSION to $VERSION"
|
||||
gh variable set BUILD_VERSION --body "$VERSION"
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GH_PAT }} # Needs to be PAT w/ Read access to metadata and secrets & Read and Write access to actions, actions variables, and code
|
||||
@@ -1,9 +1,10 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
static/kener
|
||||
build/client/kener
|
||||
build
|
||||
config/monitors.yaml
|
||||
config/site.yaml
|
||||
config/server.yaml
|
||||
/.svelte-kit
|
||||
/src/lib/.kener
|
||||
/package
|
||||
@@ -13,3 +14,17 @@ config/site.yaml
|
||||
vite.config.js.timestamp-*
|
||||
vite.config.ts.timestamp-*
|
||||
nodemon.json
|
||||
.okgit/
|
||||
config/static/*
|
||||
!config/static/.kener
|
||||
db/*
|
||||
!db/.kener
|
||||
database/*
|
||||
!database/.kener
|
||||
uploads/*
|
||||
!uploads/upload.dir
|
||||
|
||||
static/uploads/*
|
||||
!static/uploads/upload.dir
|
||||
temp.txt
|
||||
temp.js
|
||||
@@ -0,0 +1,22 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
static/kener
|
||||
build
|
||||
config/monitors.yaml
|
||||
config/site.yaml
|
||||
/.svelte-kit
|
||||
/package
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
|
||||
# Ignore files for PNPM, NPM and YARN
|
||||
pnpm-lock.yaml
|
||||
package-lock.json
|
||||
yarn.lock
|
||||
.okgit/
|
||||
config/static/*
|
||||
!config/static/.kener
|
||||
**/*.yaml
|
||||
**/*.yml
|
||||
.github/
|
||||
@@ -0,0 +1,71 @@
|
||||
{
|
||||
"useTabs": false,
|
||||
"semi": true,
|
||||
"tabWidth": 2,
|
||||
"trailingComma": "none",
|
||||
"printWidth": 100,
|
||||
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
|
||||
"overrides": [
|
||||
{
|
||||
"files": "*.svelte",
|
||||
"options": {
|
||||
"parser": "svelte",
|
||||
"useTabs": false,
|
||||
"semi": true,
|
||||
"tabWidth": 2,
|
||||
"trailingComma": "none",
|
||||
"printWidth": 120
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["*.js", "*.ts", "*.tsx", "*.cjs", "*.mjs"],
|
||||
"options": {
|
||||
"useTabs": false,
|
||||
"semi": true,
|
||||
"tabWidth": 2,
|
||||
"trailingComma": "all",
|
||||
"printWidth": 120
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["*.json", ".prettierrc"],
|
||||
"options": {
|
||||
"useTabs": false,
|
||||
"semi": false,
|
||||
"tabWidth": 2,
|
||||
"trailingComma": "none",
|
||||
"printWidth": 120
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["*.yaml", "*.yml"],
|
||||
"options": {
|
||||
"useTabs": false,
|
||||
"semi": false,
|
||||
"tabWidth": 2,
|
||||
"trailingComma": "none",
|
||||
"printWidth": 80
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": "*.md",
|
||||
"options": {
|
||||
"useTabs": false,
|
||||
"semi": false,
|
||||
"tabWidth": 4,
|
||||
"trailingComma": "none",
|
||||
"printWidth": 100
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": "Dockerfile",
|
||||
"options": {
|
||||
"useTabs": true,
|
||||
"tabWidth": 4,
|
||||
"semi": false,
|
||||
"trailingComma": "none",
|
||||
"printWidth": 120
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,147 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
# Global build arguments
|
||||
ARG ALPINE_VERSION=23.7.0-alpine3.21
|
||||
ARG DEBIAN_VERSION=23.7.0-bookworm-slim
|
||||
ARG VARIANT=debian
|
||||
|
||||
#==========================================================#
|
||||
# STAGE 1: BUILD STAGE #
|
||||
#==========================================================#
|
||||
|
||||
FROM node:${DEBIAN_VERSION} AS builder-debian
|
||||
RUN apt-get update && apt-get install -y \
|
||||
build-essential=12.9 \
|
||||
python3=3.11.2-1+b1 \
|
||||
sqlite3=3.40.1-2+deb12u1 \
|
||||
libsqlite3-dev=3.40.1-2+deb12u1 \
|
||||
make=4.3-4.1 \
|
||||
node-gyp=9.3.0-2 \
|
||||
g++=4:12.2.0-3 \
|
||||
tzdata=2024b-0+deb12u1 \
|
||||
iputils-ping=3:20221126-1+deb12u1 && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
FROM node:${ALPINE_VERSION} AS builder-alpine
|
||||
RUN apk add --no-cache --update \
|
||||
build-base=0.5-r3 \
|
||||
python3=3.12.9-r0 \
|
||||
py3-pip=24.3.1-r0 \
|
||||
make=4.4.1-r2 \
|
||||
g++=14.2.0-r4 \
|
||||
sqlite=3.48.0-r0 \
|
||||
sqlite-dev=3.48.0-r0 \
|
||||
tzdata \
|
||||
iputils=20240905-r0
|
||||
|
||||
FROM builder-${VARIANT} AS builder
|
||||
|
||||
# Set environment variables
|
||||
ENV NPM_CONFIG_LOGLEVEL=error \
|
||||
VITE_BUILD_ENV=production
|
||||
|
||||
# Set the working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package files for dependency installation
|
||||
COPY package*.json ./
|
||||
|
||||
# Install all dependencies, including `devDependencies` (cache enabled for faster builds)
|
||||
# TODO: Possibly add `--no-audit` flag to `npm ci` to prevent `npm` from running a security audit on installed packages. (By default, `npm install` performs an audit to check for vulnerabilities in dependencies, which can slow down installation. Adding this flag would skip the audit, thus making `npm install` significantly faster for the CI/CD pipeline.)
|
||||
RUN --mount=type=cache,target=/root/.npm \
|
||||
npm ci --no-fund && \
|
||||
npm cache clean --force
|
||||
|
||||
# Copy application source code
|
||||
COPY . .
|
||||
|
||||
# TODO: Reevaluate permissions (possibly reduce?)...
|
||||
# Remove docs directory and ensure required directories exist
|
||||
RUN rm -rf src/routes/\(docs\) && \
|
||||
rm -rf 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
|
||||
|
||||
# Build the application and remove `devDependencies`
|
||||
RUN npm run build && \
|
||||
npm prune --omit=dev
|
||||
|
||||
#==========================================================#
|
||||
# STAGE 2: PRODUCTION/FINAL STAGE #
|
||||
#==========================================================#
|
||||
|
||||
FROM node:${DEBIAN_VERSION} AS final-debian
|
||||
# TODO: Consider adding `--no-install-recommends`, but will need testing (may further help reduce final build size)
|
||||
RUN apt-get update && apt-get install -y \
|
||||
iputils-ping=3:20221126-1+deb12u1 \
|
||||
sqlite3=3.40.1-2+deb12u1 \
|
||||
tzdata=2024b-0+deb12u1 \
|
||||
# TODO: Is it ok to change to `curl` here so that we don't have to maintain `wget` version mismatch between Debian architectures? (`curl` is only used for the container healthcheck and because there is an Alpine variant (best!) we probably don't care if the Debian image ends up building bigger due to `curl`.)
|
||||
curl=7.88.1-10+deb12u8 && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
FROM node:${ALPINE_VERSION} AS final-alpine
|
||||
RUN apk add --no-cache --update \
|
||||
iputils=20240905-r0 \
|
||||
sqlite=3.48.0-r0 \
|
||||
tzdata
|
||||
|
||||
FROM final-${VARIANT} AS final
|
||||
|
||||
ARG PORT=3000 \
|
||||
USERNAME=node
|
||||
|
||||
# Set environment variables
|
||||
ENV HEALTHCHECK_PORT=$PORT \
|
||||
HEALTHCHECK_PATH= \
|
||||
NODE_ENV=production \
|
||||
NPM_CONFIG_LOGLEVEL=error \
|
||||
PORT=$PORT \
|
||||
TZ=Etc/UTC
|
||||
|
||||
# Set the working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package files build artifacts, and necessary files from builder stage
|
||||
COPY --chown=node:node --from=builder /app/src/lib/ ./src/lib/
|
||||
COPY --chown=node:node --from=builder /app/build ./build
|
||||
COPY --chown=node:node --from=builder /app/uploads ./uploads
|
||||
COPY --chown=node:node --from=builder /app/database ./database
|
||||
# TODO: Consider changing from copying `node_modules` to instead letting `npm ci --omit=dev` handle production dependencies. Right now, copying `node_modules` is leading to a smaller image, whereas letting `npm ci` handle the install in final image is slightly faster, but leads to larger image size. IMO, having a slightly longer build time (e.g. ~10 sec.) is better in the end to have a smaller image.
|
||||
COPY --chown=node:node --from=builder /app/node_modules ./node_modules
|
||||
COPY --chown=node:node --from=builder /app/migrations ./migrations
|
||||
COPY --chown=node:node --from=builder /app/seeds ./seeds
|
||||
COPY --chown=node:node --from=builder /app/static ./static
|
||||
COPY --chown=node:node --from=builder /app/entrypoint.sh ./entrypoint.sh
|
||||
COPY --chown=node:node --from=builder /app/knexfile.js ./knexfile.js
|
||||
COPY --chown=node:node --from=builder /app/main.js ./main.js
|
||||
COPY --chown=node:node --from=builder /app/openapi.json ./openapi.json
|
||||
COPY --chown=node:node --from=builder /app/openapi.yaml ./openapi.yaml
|
||||
|
||||
# Ensure necessary directories are writable
|
||||
VOLUME ["/uploads", "/database"]
|
||||
|
||||
# Set container timezone and make entrypoint script executable
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && \
|
||||
chmod +x ./entrypoint.sh
|
||||
# TODO: To improve security, consider dropping unnecessary capabilities instead of granting image all network capabilities of host. (Maybe `setcap cap_net_raw+p /usr/bin/ping`, etc.) Could also drop all and then grant only the capabilities that are explicitly needed. Some examples are commented out below...
|
||||
# setcap cap_net_bind_service=+ep /usr/local/bin/node
|
||||
# setcap cap_net_bind_service=+ep /usr/bin/ping
|
||||
# setcap cap_net_bind_service=+ep /usr/bin/ping6
|
||||
# setcap cap_net_bind_service=+ep /usr/bin/tracepath
|
||||
# setcap cap_net_bind_service=+ep /usr/bin/clockdiff
|
||||
|
||||
# Expose the application port
|
||||
EXPOSE $PORT
|
||||
|
||||
# Add a healthcheck to the container; `wget` vs. `curl` depending on base image. Using this approach because `wget` does not actually maintain versioning across architectures, so we cannot pin a `wget` version (in above `final-debian` base, `apt-get install`) between differing architectures (e.g. arm64, amd64)
|
||||
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
|
||||
CMD sh -c 'if [ -f "/etc/alpine-release" ]; then wget --quiet --spider http://localhost:$HEALTHCHECK_PORT$HEALTHCHECK_PATH || exit 1; else curl --silent --head --fail http://localhost:$HEALTHCHECK_PORT$HEALTHCHECK_PATH || exit 1; fi'
|
||||
|
||||
# TODO: Revisit letting user define $PUID & $PGID overrides (e.g. `addgroup -g $PGID newgroup && adduser -D -G newgroup -u $PUID node`) as well as potentially ensure no root user exists. (Make sure no processes are running as root, first!)
|
||||
# Use a non-root user (recommended for security)
|
||||
USER $USERNAME
|
||||
|
||||
ENTRYPOINT ["/app/entrypoint.sh"]
|
||||
CMD ["node", "main"]
|
||||
@@ -1,55 +1,217 @@
|
||||
|
||||
<p align="center"><img src="https://kener.ing/ss.png" width="100%" height="auto" alt="kener example illustration"></p>
|
||||
# Kener - Stunning Status Pages
|
||||
|
||||
<p align="center">
|
||||
<img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/rajnandan1/kener?label=Star%20Repo&style=social">
|
||||
<a href="https://github.com/ivbeg/awesome-status-pages"><img src="https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg" alt="Awesome status page" /></a></p>
|
||||
<img src="https://kener.ing/newbg.png?v=1" width="100%" height="auto" class="rounded-lg shadow-lg" alt="kener example illustration">
|
||||
</p>
|
||||
|
||||
# Kener - Status Page System
|
||||
Kener: Open-source Node.js status page tool, designed to make service monitoring and incident handling a breeze. It offers a sleek and user-friendly interface that simplifies tracking service outages and improves how we communicate during incidents. And the best part? Kener integrates seamlessly with GitHub, making incident management a team effort—making it easier for us to track and fix issues together in a collaborative and friendly environment.
|
||||
<p align="center">
|
||||
<img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/rajnandan1/kener?label=Star%20Repo&style=social">
|
||||
<a href="https://github.com/ivbeg/awesome-status-pages"><img src="https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg" alt="Awesome status page" /></a>
|
||||
<a href="https://awesome-selfhosted.net/tags/status--uptime-pages.html#kener"><img src="https://awesome.re/mentioned-badge.svg" alt="Awesome self hosted" /></a>
|
||||
</p>
|
||||
|
||||
It uses files to store the data. Other adapters are coming soon
|
||||
<p align="center">
|
||||
<a href="https://hub.docker.com/r/rajnandan1/kener"><img src="https://img.shields.io/docker/pulls/rajnandan1/kener" alt="Docker Kener" /></a>
|
||||
<a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=latest"><img alt="Docker Image Size" src="https://img.shields.io/docker/image-size/rajnandan1/kener/latest?logo=docker&logoColor=white&label=debian" /></a>
|
||||
<a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=alpine"><img alt="Docker Image Size" src="https://img.shields.io/docker/image-size/rajnandan1/kener/alpine?logo=docker&logoColor=white&label=alpine" /></a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/rajnandan1/kener/actions/workflows/publish-images.yml"><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/rajnandan1/kener/publish-images.yml" /></a>
|
||||
<a href="https://github.com/rajnandan1/kener/commit/HEAD"><img src="https://img.shields.io/github/last-commit/rajnandan1/kener/main" alt="" /></a>
|
||||
<a href="https://github.com/rajnandan1/kener/issues"><img alt="GitHub issues" src="https://img.shields.io/github/issues/rajnandan1/kener.svg" /></a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://www.producthunt.com/posts/kener-2" target="_blank">
|
||||
<img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=kener-2&theme=light" alt="Kener on Product Hunt">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
> **Warning**
|
||||
> Kener is still under development. There might be bugs. Please report them by raising a github issue and I will fix them.
|
||||
<p align="center">
|
||||
<picture>
|
||||
<source srcset="https://fonts.gstatic.com/s/e/notoemoji/latest/1f514/512.webp" type="image/webp">
|
||||
<img src="https://fonts.gstatic.com/s/e/notoemoji/latest/1f514/512.gif" alt="🔔" width="32" height="32">
|
||||
</picture>
|
||||
<picture>
|
||||
<source srcset="https://fonts.gstatic.com/s/e/notoemoji/latest/1f680/512.webp" type="image/webp">
|
||||
<img src="https://fonts.gstatic.com/s/e/notoemoji/latest/1f680/512.gif" alt="🚀" width="32" height="32">
|
||||
</picture>
|
||||
<picture>
|
||||
<source srcset="https://fonts.gstatic.com/s/e/notoemoji/latest/1f6a7/512.webp" type="image/webp">
|
||||
<img src="https://fonts.gstatic.com/s/e/notoemoji/latest/1f6a7/512.gif" alt="🚧" width="32" height="32">
|
||||
</picture>
|
||||
</p>
|
||||
|
||||
Visit a live server [here](https://kener.ing)
|
||||
Read the documentation [here](https://kener.ing/docs)
|
||||

|
||||
| [🌍 Live Server](https://kener.ing) | [🎉 Quick Start](https://kener.ing/docs/quick-start) | [🗄 Documentation](https://kener.ing/docs/home) |
|
||||
| ----------------------------------- | ---------------------------------------------------- | ----------------------------------------------- |
|
||||
|
||||
## What is Kener?
|
||||
|
||||
**Kener** is a sleek and lightweight status page system built with **SvelteKit** and **NodeJS**. It’s not here to replace heavyweights like Datadog or Atlassian but rather to offer a simple, modern, and hassle-free way to set up a great-looking status page with minimal effort.
|
||||
|
||||
Designed with **ease of use** and **customization in mind**, Kener provides all the essential features you’d expect from a status page—without unnecessary complexity.
|
||||
|
||||
### Why Kener?
|
||||
|
||||
✅ Minimal overhead – Set up quickly with a clean, modern UI<br>
|
||||
✅ Customizable – Easily tailor it to match your brand<br>
|
||||
✅ Open-source & free – Because great tools should be accessible to everyone
|
||||
|
||||
### What's in a Name?
|
||||
|
||||
“Kener” is inspired by the Assamese word _“Kene”_, meaning _“how’s it going?”_. The _‘.ing’_ was added because, well… that domain was available. 😄
|
||||
|
||||
## Installation
|
||||
|
||||
### Manual
|
||||
|
||||
```shell
|
||||
# Clone the repository
|
||||
git clone https://github.com/rajnandan1/kener.git
|
||||
cd kener
|
||||
npm install
|
||||
cp .env.example .env
|
||||
npm run dev
|
||||
```
|
||||
|
||||
### Docker
|
||||
|
||||
Official Docker images for **Kener** are available on [Docker Hub](https://hub.docker.com/r/rajnandan1/kener). Multiple versions are maintained to support different use cases.
|
||||
|
||||
<a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=3.1.5"><img src="https://img.shields.io/badge/Latest_Stable_Release-3.1.5-blue" alt="Kener latest stable version: 3.1.5" /></a>
|
||||
|
||||
#### Available Tags
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Image Tag</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" colspan="2" style="color:#A81D33;text-align:left;">Debian 12 <small>(Bookwork Slim)</small> w/ Node.js v23.7.0 <strong><em>(default)</em></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=latest" target="_blank"><code>latest</code></td>
|
||||
<td>Latest stable release (aka 3.1.5)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=3.1.5" target="_blank"><code>3.1.5</code></a></td>
|
||||
<td>Specific release version</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=3.1" target="_blank"><code>3.1</code></a></td>
|
||||
<td>Major-minor version tag pointing to the latest patch (3.1.5) release within that minor version (3.1.x)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=3" target="_blank"><code>3</code></a></td>
|
||||
<td>Major version tag pointing to the latest stable (3.1.5) release within that major version (3.x.x)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" colspan="2" style="color:#0D597F;text-align:left;">Alpine Linux 3.21 w/ Node.js v23.7.0 <strong><em>(smallest image size)</em></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=alpine" target="_blank"><code>alpine</code></td>
|
||||
<td>Latest stable release (aka 3.1.5)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=3.1.5-alpine" target="_blank"><code>3.1.5-alpine</code></a></td>
|
||||
<td>Specific release version</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=3.1-alpine" target="_blank"><code>3.1-alpine</code></a></td>
|
||||
<td>Major-minor version tag pointing to the latest patch (3.1.5) release within that minor version (3.1.x)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=3-alpine" target="_blank"><code>3-alpine</code></a></td>
|
||||
<td>Major version tag pointing to the latest stable (3.1.5) release within that major version (3.x.x)</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
#### Usage
|
||||
|
||||
Pull the latest stable version:
|
||||
|
||||
```sh
|
||||
docker pull rajnandan1/kener:latest
|
||||
```
|
||||
|
||||
Or use the smaller, Alpine-based variant:
|
||||
|
||||
```sh
|
||||
docker pull rajnandan1/kener:alpine
|
||||
```
|
||||
|
||||
For a production setup, refer to the sample [docker-compose.yml](https://github.com/rajnandan1/kener/blob/main/docker-compose.yml).
|
||||
This keeps things clean, structured, and easy to read while preserving all the details.
|
||||
|
||||
### One Click
|
||||
|
||||
[](https://railway.com/template/spSvic?referralCode=1Pn7vs)
|
||||
|
||||
## Features
|
||||
|
||||
- Real-time monitoring
|
||||
- Customizable status page
|
||||
- Easy installation and setup
|
||||
- Automated incident management
|
||||
- GitHub integration for issue tracking
|
||||
- Environment variable configuration
|
||||
- Production and custom deployment options
|
||||
- API for status updates
|
||||
- Badge generation for status and uptime display
|
||||
- Branding and theme customization
|
||||
- Flexible monitor configuration using YAML
|
||||
- Cron-based scheduling for monitors
|
||||
- Secrets management for headers and bodies
|
||||
- Evaluators for HTTP response parsing
|
||||
- Incident tagging and labeling
|
||||
- Meta tag customization for SEO
|
||||
- User-friendly interface
|
||||
- Support for light and dark themes
|
||||
- Responsive design for various devices
|
||||
Here are some of the features that you get out of the box. Please read the documentation to know how to use them.
|
||||
|
||||
### 📊 Monitoring and Tracking
|
||||
|
||||
## Technologies used
|
||||
- [SvelteKit](https://kit.svelte.dev/)
|
||||
- [shadcn-svelte](https://www.shadcn-svelte.com/)
|
||||
- Advanced **application performance monitoring** tools
|
||||
- **Real-time network monitoring** capabilities
|
||||
- Supports **polling HTTP endpoints** or **pushing data** via REST APIs
|
||||
- **Timezone auto-adjustment** for visitors
|
||||
- Organize monitors into **custom sections**
|
||||
- **Cron-based scheduling** (minimum: **every minute**)
|
||||
- **Create complex API polls** (chaining, secrets, etc.)
|
||||
- Set a **default status** for monitors
|
||||
- Supports **base path hosting in Kubernetes (k8s)**
|
||||
- **Pre-built Docker images** for easy deployment
|
||||
|
||||
## Inspired from
|
||||
- [Upptime](https://upptime.js.org/)
|
||||
### 🎨 Customization and Branding
|
||||
|
||||
## Roadmap
|
||||
- [ ] Add notification
|
||||
- [x] Add api to create incident
|
||||
- [ ] Add Mysql adapter
|
||||
- Fully **customizable status page**
|
||||
- **Badge generation** for status and uptime tracking
|
||||
- Support for **custom domains**
|
||||
- Embed monitors as **iframes or widgets**
|
||||
- **Light & Dark Mode**
|
||||
- **Internationalization (i18n) support**
|
||||
- **Sleek, beautifully crafted UI**
|
||||
|
||||
### 🚨 Incident Management
|
||||
|
||||
- **Incident tracking & communication** tools
|
||||
- **Comprehensive APIs** for incident management
|
||||
|
||||
### 🧑💻 User Experience and Design
|
||||
|
||||
- **Accessible & user-friendly interface**
|
||||
- **Quick & easy installation**
|
||||
- **Responsive design** for all devices
|
||||
- **Auto SEO & Social Media ready**
|
||||
- **Server-Side Rendering (SSR) for better performance**
|
||||
|
||||
<div align="left">
|
||||
<img alt="Visitor Stats" src="https://widgetbite.com/stats/rajnandan"/>
|
||||
</div>
|
||||
|
||||
## Technologies Used
|
||||
|
||||
- [SvelteKit](https://kit.svelte.dev/)
|
||||
- [shadcn-svelte](https://www.shadcn-svelte.com/)
|
||||
|
||||
## Support Me
|
||||
|
||||
If you’re enjoying Kener and want to support its development, consider sponsoring me on GitHub or treating me to a coffee. Your support helps keep the project growing! 🚀
|
||||
|
||||
[Sponsor Me Using Github](https://github.com/sponsors/rajnandan1)
|
||||
|
||||
☕ [Buy Me a Coffee](https://www.buymeacoffee.com/rajnandan1)
|
||||
|
||||

|
||||
|
||||
## Contributing
|
||||
|
||||
If you want to contribute to Kener, please read the [Contribution Guide](https://github.com/rajnandan1/kener/blob/main/.github/CONTRIBUTING.md).
|
||||
|
||||
## Star History
|
||||
|
||||
[](https://star-history.com/#rajnandan1/kener&Date)
|
||||
|
||||
@@ -0,0 +1,217 @@
|
||||
# Kener - Stunning Status Pages
|
||||
|
||||
<p align="center">
|
||||
<img src="https://kener.ing/newbg.png?v=1" width="100%" height="auto" class="rounded-lg shadow-lg" alt="kener example illustration">
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/rajnandan1/kener?label=Star%20Repo&style=social">
|
||||
<a href="https://github.com/ivbeg/awesome-status-pages"><img src="https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg" alt="Awesome status page" /></a>
|
||||
<a href="https://awesome-selfhosted.net/tags/status--uptime-pages.html#kener"><img src="https://awesome.re/mentioned-badge.svg" alt="Awesome self hosted" /></a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://hub.docker.com/r/rajnandan1/kener"><img src="https://img.shields.io/docker/pulls/rajnandan1/kener" alt="Docker Kener" /></a>
|
||||
<a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=latest"><img alt="Docker Image Size" src="https://img.shields.io/docker/image-size/rajnandan1/kener/latest?logo=docker&logoColor=white&label=debian" /></a>
|
||||
<a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=alpine"><img alt="Docker Image Size" src="https://img.shields.io/docker/image-size/rajnandan1/kener/alpine?logo=docker&logoColor=white&label=alpine" /></a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/rajnandan1/kener/actions/workflows/publish-images.yml"><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/rajnandan1/kener/publish-images.yml" /></a>
|
||||
<a href="https://github.com/rajnandan1/kener/commit/HEAD"><img src="https://img.shields.io/github/last-commit/rajnandan1/kener/main" alt="" /></a>
|
||||
<a href="https://github.com/rajnandan1/kener/issues"><img alt="GitHub issues" src="https://img.shields.io/github/issues/rajnandan1/kener.svg" /></a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://www.producthunt.com/posts/kener-2" target="_blank">
|
||||
<img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=kener-2&theme=light" alt="Kener on Product Hunt">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<picture>
|
||||
<source srcset="https://fonts.gstatic.com/s/e/notoemoji/latest/1f514/512.webp" type="image/webp">
|
||||
<img src="https://fonts.gstatic.com/s/e/notoemoji/latest/1f514/512.gif" alt="🔔" width="32" height="32">
|
||||
</picture>
|
||||
<picture>
|
||||
<source srcset="https://fonts.gstatic.com/s/e/notoemoji/latest/1f680/512.webp" type="image/webp">
|
||||
<img src="https://fonts.gstatic.com/s/e/notoemoji/latest/1f680/512.gif" alt="🚀" width="32" height="32">
|
||||
</picture>
|
||||
<picture>
|
||||
<source srcset="https://fonts.gstatic.com/s/e/notoemoji/latest/1f6a7/512.webp" type="image/webp">
|
||||
<img src="https://fonts.gstatic.com/s/e/notoemoji/latest/1f6a7/512.gif" alt="🚧" width="32" height="32">
|
||||
</picture>
|
||||
</p>
|
||||
|
||||
| [🌍 Live Server](https://kener.ing) | [🎉 Quick Start](https://kener.ing/docs/quick-start) | [🗄 Documentation](https://kener.ing/docs/home) |
|
||||
| ----------------------------------- | ---------------------------------------------------- | ----------------------------------------------- |
|
||||
|
||||
## What is Kener?
|
||||
|
||||
**Kener** is a sleek and lightweight status page system built with **SvelteKit** and **NodeJS**. It’s not here to replace heavyweights like Datadog or Atlassian but rather to offer a simple, modern, and hassle-free way to set up a great-looking status page with minimal effort.
|
||||
|
||||
Designed with **ease of use** and **customization in mind**, Kener provides all the essential features you’d expect from a status page—without unnecessary complexity.
|
||||
|
||||
### Why Kener?
|
||||
|
||||
✅ Minimal overhead – Set up quickly with a clean, modern UI<br>
|
||||
✅ Customizable – Easily tailor it to match your brand<br>
|
||||
✅ Open-source & free – Because great tools should be accessible to everyone
|
||||
|
||||
### What's in a Name?
|
||||
|
||||
“Kener” is inspired by the Assamese word _“Kene”_, meaning _“how’s it going?”_. The _‘.ing’_ was added because, well… that domain was available. 😄
|
||||
|
||||
## Installation
|
||||
|
||||
### Manual
|
||||
|
||||
```shell
|
||||
# Clone the repository
|
||||
git clone https://github.com/rajnandan1/kener.git
|
||||
cd kener
|
||||
npm install
|
||||
cp .env.example .env
|
||||
npm run dev
|
||||
```
|
||||
|
||||
### Docker
|
||||
|
||||
Official Docker images for **Kener** are available on [Docker Hub](https://hub.docker.com/r/rajnandan1/kener). Multiple versions are maintained to support different use cases.
|
||||
|
||||
<a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name={{kener_full_version}}"><img src="https://img.shields.io/badge/Latest_Stable_Release-{{kener_full_version}}-blue" alt="Kener latest stable version: {{kener_full_version}}" /></a>
|
||||
|
||||
#### Available Tags
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Image Tag</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" colspan="2" style="color:#A81D33;text-align:left;">Debian 12 <small>(Bookwork Slim)</small> w/ Node.js v23.7.0 <strong><em>(default)</em></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=latest" target="_blank"><code>latest</code></td>
|
||||
<td>Latest stable release (aka {{kener_full_version}})</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name={{kener_full_version}}" target="_blank"><code>{{kener_full_version}}</code></a></td>
|
||||
<td>Specific release version</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name={{kener_major_minor_version}}" target="_blank"><code>{{kener_major_minor_version}}</code></a></td>
|
||||
<td>Major-minor version tag pointing to the latest patch ({{kener_full_version}}) release within that minor version ({{kener_major_minor_version}}.x)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name={{kener_major_version}}" target="_blank"><code>{{kener_major_version}}</code></a></td>
|
||||
<td>Major version tag pointing to the latest stable ({{kener_full_version}}) release within that major version ({{kener_major_version}}.x.x)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" colspan="2" style="color:#0D597F;text-align:left;">Alpine Linux 3.21 w/ Node.js v23.7.0 <strong><em>(smallest image size)</em></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name=alpine" target="_blank"><code>alpine</code></td>
|
||||
<td>Latest stable release (aka {{kener_full_version}})</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name={{kener_full_version}}-alpine" target="_blank"><code>{{kener_full_version}}-alpine</code></a></td>
|
||||
<td>Specific release version</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name={{kener_major_minor_version}}-alpine" target="_blank"><code>{{kener_major_minor_version}}-alpine</code></a></td>
|
||||
<td>Major-minor version tag pointing to the latest patch ({{kener_full_version}}) release within that minor version ({{kener_major_minor_version}}.x)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://hub.docker.com/r/rajnandan1/kener/tags?page=1&ordering=last_updated&name={{kener_major_version}}-alpine" target="_blank"><code>{{kener_major_version}}-alpine</code></a></td>
|
||||
<td>Major version tag pointing to the latest stable ({{kener_full_version}}) release within that major version ({{kener_major_version}}.x.x)</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
#### Usage
|
||||
|
||||
Pull the latest stable version:
|
||||
|
||||
```sh
|
||||
docker pull rajnandan1/kener:latest
|
||||
```
|
||||
|
||||
Or use the smaller, Alpine-based variant:
|
||||
|
||||
```sh
|
||||
docker pull rajnandan1/kener:alpine
|
||||
```
|
||||
|
||||
For a production setup, refer to the sample [docker-compose.yml](https://github.com/rajnandan1/kener/blob/main/docker-compose.yml).
|
||||
This keeps things clean, structured, and easy to read while preserving all the details.
|
||||
|
||||
### One Click
|
||||
|
||||
[](https://railway.com/template/spSvic?referralCode=1Pn7vs)
|
||||
|
||||
## Features
|
||||
|
||||
Here are some of the features that you get out of the box. Please read the documentation to know how to use them.
|
||||
|
||||
### 📊 Monitoring and Tracking
|
||||
|
||||
- Advanced **application performance monitoring** tools
|
||||
- **Real-time network monitoring** capabilities
|
||||
- Supports **polling HTTP endpoints** or **pushing data** via REST APIs
|
||||
- **Timezone auto-adjustment** for visitors
|
||||
- Organize monitors into **custom sections**
|
||||
- **Cron-based scheduling** (minimum: **every minute**)
|
||||
- **Create complex API polls** (chaining, secrets, etc.)
|
||||
- Set a **default status** for monitors
|
||||
- Supports **base path hosting in Kubernetes (k8s)**
|
||||
- **Pre-built Docker images** for easy deployment
|
||||
|
||||
### 🎨 Customization and Branding
|
||||
|
||||
- Fully **customizable status page**
|
||||
- **Badge generation** for status and uptime tracking
|
||||
- Support for **custom domains**
|
||||
- Embed monitors as **iframes or widgets**
|
||||
- **Light & Dark Mode**
|
||||
- **Internationalization (i18n) support**
|
||||
- **Sleek, beautifully crafted UI**
|
||||
|
||||
### 🚨 Incident Management
|
||||
|
||||
- **Incident tracking & communication** tools
|
||||
- **Comprehensive APIs** for incident management
|
||||
|
||||
### 🧑💻 User Experience and Design
|
||||
|
||||
- **Accessible & user-friendly interface**
|
||||
- **Quick & easy installation**
|
||||
- **Responsive design** for all devices
|
||||
- **Auto SEO & Social Media ready**
|
||||
- **Server-Side Rendering (SSR) for better performance**
|
||||
|
||||
<div align="left">
|
||||
<img alt="Visitor Stats" src="https://widgetbite.com/stats/rajnandan"/>
|
||||
</div>
|
||||
|
||||
## Technologies Used
|
||||
|
||||
- [SvelteKit](https://kit.svelte.dev/)
|
||||
- [shadcn-svelte](https://www.shadcn-svelte.com/)
|
||||
|
||||
## Support Me
|
||||
|
||||
If you’re enjoying Kener and want to support its development, consider sponsoring me on GitHub or treating me to a coffee. Your support helps keep the project growing! 🚀
|
||||
|
||||
[Sponsor Me Using Github](https://github.com/sponsors/rajnandan1)
|
||||
|
||||
☕ [Buy Me a Coffee](https://www.buymeacoffee.com/rajnandan1)
|
||||
|
||||

|
||||
|
||||
## Contributing
|
||||
|
||||
If you want to contribute to Kener, please read the [Contribution Guide](https://github.com/rajnandan1/kener/blob/main/.github/CONTRIBUTING.md).
|
||||
|
||||
## Star History
|
||||
|
||||
[](https://star-history.com/#rajnandan1/kener&Date)
|
||||
@@ -1 +0,0 @@
|
||||
const o=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;export{o as g};
|
||||
@@ -1 +0,0 @@
|
||||
import{u as b,s as w,_ as m,J as q,T as x}from"./scheduler.0e55af49.js";const a=[];function z(s,u){return{subscribe:A(s,u).subscribe}}function A(s,u=b){let t;const r=new Set;function o(n){if(w(s,n)&&(s=n,t)){const i=!a.length;for(const e of r)e[1](),a.push(e,s);if(i){for(let e=0;e<a.length;e+=2)a[e][0](a[e+1]);a.length=0}}}function f(n){o(n(s))}function l(n,i=b){const e=[n,i];return r.add(e),r.size===1&&(t=u(o,f)||b),n(s),()=>{r.delete(e),r.size===0&&t&&(t(),t=null)}}return{set:o,update:f,subscribe:l}}function E(s,u,t){const r=!Array.isArray(s),o=r?[s]:s;if(!o.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const f=u.length<2;return z(t,(l,n)=>{let i=!1;const e=[];let d=0,p=b;const y=()=>{if(d)return;p();const c=u(r?e[0]:e,l,n);f?l(c):p=x(c)?c:b},_=o.map((c,g)=>m(c,h=>{e[g]=h,d&=~(1<<g),i&&y()},()=>{d|=1<<g}));return i=!0,y(),function(){q(_),p(),i=!1}})}function J(s){return{subscribe:s.subscribe.bind(s)}}export{J as a,E as d,z as r,A as w};
|
||||
@@ -1,4 +0,0 @@
|
||||
var K=Object.defineProperty;var Q=(t,e,n)=>e in t?K(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var I=(t,e,n)=>(Q(t,typeof e!="symbol"?e+"":e,n),n);import{u as x,$ as W,d as V,a0 as X,J as E,T as j,O,a1 as Y,a2 as N,a3 as T,h as Z,a4 as tt,a5 as et,a6 as nt,a7 as it,a8 as U,a9 as st,aa as rt,ab as at,ac as ot,ad as ft}from"./scheduler.0e55af49.js";const q=typeof window<"u";let B=q?()=>window.performance.now():()=>Date.now(),D=q?t=>requestAnimationFrame(t):x;const k=new Set;function G(t){k.forEach(e=>{e.c(t)||(k.delete(e),e.f())}),k.size!==0&&D(G)}function F(t){let e;return k.size===0&&D(G),{promise:new Promise(n=>{k.add(e={c:t,f:n})}),abort(){k.delete(e)}}}const P=new Map;let R=0;function ut(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}function lt(t,e){const n={stylesheet:X(e),rules:{}};return P.set(t,n),n}function z(t,e,n,r,u,a,l,i=0){const c=16.666/r;let s=`{
|
||||
`;for(let $=0;$<=1;$+=c){const g=e+(n-e)*a($);s+=$*100+`%{${l(g,1-g)}}
|
||||
`}const _=s+`100% {${l(n,1-n)}}
|
||||
}`,f=`__svelte_${ut(_)}_${i}`,m=W(t),{stylesheet:h,rules:o}=P.get(m)||lt(m,t);o[f]||(o[f]=!0,h.insertRule(`@keyframes ${f} ${_}`,h.cssRules.length));const d=t.style.animation||"";return t.style.animation=`${d?`${d}, `:""}${f} ${r}ms linear ${u}ms 1 both`,R+=1,f}function A(t,e){const n=(t.style.animation||"").split(", "),r=n.filter(e?a=>a.indexOf(e)<0:a=>a.indexOf("__svelte")===-1),u=n.length-r.length;u&&(t.style.animation=r.join(", "),R-=u,R||ct())}function ct(){D(()=>{R||(P.forEach(t=>{const{ownerNode:e}=t.stylesheet;e&&V(e)}),P.clear())})}let S;function J(){return S||(S=Promise.resolve(),S.then(()=>{S=null})),S}function w(t,e,n){t.dispatchEvent(Y(`${e?"intro":"outro"}${n}`))}const M=new Set;let p;function yt(){p={r:0,c:[],p}}function vt(){p.r||E(p.c),p=p.p}function _t(t,e){t&&t.i&&(M.delete(t),t.i(e))}function wt(t,e,n,r){if(t&&t.o){if(M.has(t))return;M.add(t),p.c.push(()=>{M.delete(t),r&&(n&&t.d(1),r())}),t.o(e)}else r&&r()}const L={duration:0};function xt(t,e,n){const r={direction:"in"};let u=e(t,n,r),a=!1,l,i,c=0;function s(){l&&A(t,l)}function _(){const{delay:m=0,duration:h=300,easing:o=N,tick:d=x,css:$}=u||L;$&&(l=z(t,0,1,h,m,o,$,c++)),d(0,1);const g=B()+m,y=g+h;i&&i.abort(),a=!0,O(()=>w(t,!0,"start")),i=F(v=>{if(a){if(v>=y)return d(1,0),w(t,!0,"end"),s(),a=!1;if(v>=g){const b=o((v-g)/h);d(b,1-b)}}return a})}let f=!1;return{start(){f||(f=!0,A(t),j(u)?(u=u(r),J().then(_)):_())},invalidate(){f=!1},end(){a&&(s(),a=!1)}}}function bt(t,e,n){const r={direction:"out"};let u=e(t,n,r),a=!0,l;const i=p;i.r+=1;let c;function s(){const{delay:_=0,duration:f=300,easing:m=N,tick:h=x,css:o}=u||L;o&&(l=z(t,1,0,f,_,m,o));const d=B()+_,$=d+f;O(()=>w(t,!1,"start")),"inert"in t&&(c=t.inert,t.inert=!0),F(g=>{if(a){if(g>=$)return h(0,1),w(t,!1,"end"),--i.r||E(i.c),!1;if(g>=d){const y=m((g-d)/f);h(1-y,y)}}return a})}return j(u)?J().then(()=>{u=u(r),s()}):s(),{end(_){_&&"inert"in t&&(t.inert=c),_&&u.tick&&u.tick(1,0),a&&(l&&A(t,l),a=!1)}}}function kt(t,e,n,r){let a=e(t,n,{direction:"both"}),l=r?0:1,i=null,c=null,s=null,_;function f(){s&&A(t,s)}function m(o,d){const $=o.b-l;return d*=Math.abs($),{a:l,b:o.b,d:$,duration:d,start:o.start,end:o.start+d,group:o.group}}function h(o){const{delay:d=0,duration:$=300,easing:g=N,tick:y=x,css:v}=a||L,b={start:B()+d,b:o};o||(b.group=p,p.r+=1),"inert"in t&&(o?_!==void 0&&(t.inert=_):(_=t.inert,t.inert=!0)),i||c?c=b:(v&&(f(),s=z(t,l,o,$,d,g,v)),o&&y(0,1),i=m(b,$),O(()=>w(t,o,"start")),F(C=>{if(c&&C>c.start&&(i=m(c,$),c=null,w(t,i.b,"start"),v&&(f(),s=z(t,l,i.b,i.duration,0,g,a.css))),i){if(C>=i.end)y(l=i.b,1-l),w(t,i.b,"end"),c||(i.b?f():--i.group.r||E(i.group.c)),i=null;else if(C>=i.start){const H=C-i.start;l=i.a+i.d*g(H/i.duration),y(l,1-l)}}return!!(i||c)}))}return{run(o){j(a)?J().then(()=>{a=a({direction:o?"in":"out"}),h(o)}):h(o)},end(){f(),i=c=null}}}function Et(t){t&&t.c()}function St(t,e){t&&t.l(e)}function dt(t,e,n){const{fragment:r,after_update:u}=t.$$;r&&r.m(e,n),O(()=>{const a=t.$$.on_mount.map(st).filter(j);t.$$.on_destroy?t.$$.on_destroy.push(...a):E(a),t.$$.on_mount=[]}),u.forEach(O)}function $t(t,e){const n=t.$$;n.fragment!==null&&(nt(n.after_update),E(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function ht(t,e){t.$$.dirty[0]===-1&&(rt.push(t),at(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function Ot(t,e,n,r,u,a,l=null,i=[-1]){const c=it;U(t);const s=t.$$={fragment:null,ctx:[],props:a,update:x,not_equal:u,bound:T(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:T(),dirty:i,skip_bound:!1,root:e.target||c.$$.root};l&&l(s.root);let _=!1;if(s.ctx=n?n(t,e.props||{},(f,m,...h)=>{const o=h.length?h[0]:m;return s.ctx&&u(s.ctx[f],s.ctx[f]=o)&&(!s.skip_bound&&s.bound[f]&&s.bound[f](o),_&&ht(t,f)),m}):[],s.update(),_=!0,E(s.before_update),s.fragment=r?r(s.ctx):!1,e.target){if(e.hydrate){ot();const f=Z(e.target);s.fragment&&s.fragment.l(f),f.forEach(V)}else s.fragment&&s.fragment.c();e.intro&&_t(t.$$.fragment),dt(t,e.target,e.anchor),ft(),tt()}U(c)}class jt{constructor(){I(this,"$$");I(this,"$$set")}$destroy(){$t(this,1),this.$destroy=x}$on(e,n){if(!j(n))return x;const r=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return r.push(n),()=>{const u=r.indexOf(n);u!==-1&&r.splice(u,1)}}$set(e){this.$$set&&!et(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const mt="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(mt);export{jt as S,_t as a,Et as b,vt as c,St as d,$t as e,bt as f,yt as g,xt as h,Ot as i,kt as j,dt as m,wt as t};
|
||||
@@ -1 +0,0 @@
|
||||
import{w as u}from"./index.3cd3e9b4.js";var _;const k=((_=globalThis.__sveltekit_6a2ovu)==null?void 0:_.base)??"";var g;const m=((g=globalThis.__sveltekit_6a2ovu)==null?void 0:g.assets)??k,w="1704897850035",T="sveltekit:snapshot",y="sveltekit:scroll",I="sveltekit:index",f={tap:1,hover:2,viewport:3,eager:4,off:-1},h=location.origin;function S(e){let t=e.baseURI;if(!t){const n=e.getElementsByTagName("base");t=n.length?n[0].href:e.URL}return t}function x(){return{x:pageXOffset,y:pageYOffset}}function c(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const d={...f,"":f.hover};function b(e){let t=e.assignedSlot??e.parentNode;return(t==null?void 0:t.nodeType)===11&&(t=t.host),t}function O(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=b(e)}}function U(e,t){let n;try{n=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI)}catch{}const o=e instanceof SVGAElement?e.target.baseVal:e.target,r=!n||!!o||A(n,t)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),l=(n==null?void 0:n.origin)===h&&e.hasAttribute("download");return{url:n,external:r,target:o,download:l}}function L(e){let t=null,n=null,o=null,r=null,l=null,a=null,s=e;for(;s&&s!==document.documentElement;)o===null&&(o=c(s,"preload-code")),r===null&&(r=c(s,"preload-data")),t===null&&(t=c(s,"keepfocus")),n===null&&(n=c(s,"noscroll")),l===null&&(l=c(s,"reload")),a===null&&(a=c(s,"replacestate")),s=b(s);function i(v){switch(v){case"":case"true":return!0;case"off":case"false":return!1;default:return null}}return{preload_code:d[o??"off"],preload_data:d[r??"off"],keep_focus:i(t),noscroll:i(n),reload:i(l),replace_state:i(a)}}function p(e){const t=u(e);let n=!0;function o(){n=!0,t.update(a=>a)}function r(a){n=!1,t.set(a)}function l(a){let s;return t.subscribe(i=>{(s===void 0||n&&i!==s)&&a(s=i)})}return{notify:o,set:r,subscribe:l}}function E(){const{set:e,subscribe:t}=u(!1);let n;async function o(){clearTimeout(n);try{const r=await fetch(`${m}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!r.ok)return!1;const a=(await r.json()).version!==w;return a&&(e(!0),clearTimeout(n)),a}catch{return!1}}return{subscribe:t,check:o}}function A(e,t){return e.origin!==h||!e.pathname.startsWith(t)}function N(e){e.client}const P={url:p({}),page:p({}),navigating:u(null),updated:E()};export{I,f as P,y as S,T as a,U as b,L as c,P as d,k as e,O as f,S as g,N as h,A as i,h as o,x as s};
|
||||
@@ -1 +0,0 @@
|
||||
import{s as S,f as _,l as d,a as x,g as f,h as g,m as h,d as u,c as q,i as m,r as v,n as $,u as E,D as y}from"../chunks/scheduler.0e55af49.js";import{S as C,i as D}from"../chunks/index.7fa4eb0f.js";import{d as H}from"../chunks/singletons.acbee524.js";const P=()=>{const s=H;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},j={subscribe(s){return P().page.subscribe(s)}};function k(s){var b;let t,r=s[0].status+"",o,n,i,c=((b=s[0].error)==null?void 0:b.message)+"",l;return{c(){t=_("h1"),o=d(r),n=x(),i=_("p"),l=d(c)},l(e){t=f(e,"H1",{});var a=g(t);o=h(a,r),a.forEach(u),n=q(e),i=f(e,"P",{});var p=g(i);l=h(p,c),p.forEach(u)},m(e,a){m(e,t,a),v(t,o),m(e,n,a),m(e,i,a),v(i,l)},p(e,[a]){var p;a&1&&r!==(r=e[0].status+"")&&$(o,r),a&1&&c!==(c=((p=e[0].error)==null?void 0:p.message)+"")&&$(l,c)},i:E,o:E,d(e){e&&(u(t),u(n),u(i))}}}function w(s,t,r){let o;return y(s,j,n=>r(0,o=n)),[o]}let F=class extends C{constructor(t){super(),D(this,t,w,k,S,{})}};export{F as component};
|
||||
@@ -1 +0,0 @@
|
||||
{"version":"1704897850035"}
|
||||
|
Before Width: | Height: | Size: 156 KiB |
|
Before Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 2.5 KiB |
@@ -1 +0,0 @@
|
||||
User-agent: *
|
||||
|
Before Width: | Height: | Size: 420 KiB |
|
Before Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 9.1 KiB |
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="256px" height="308px" viewBox="0 0 256 308" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid">
|
||||
<g>
|
||||
<path d="M239.681566,40.706757 C211.113272,-0.181889366 154.69089,-12.301439 113.894816,13.6910393 L42.2469062,59.3555354 C22.6760042,71.6680028 9.1958152,91.6538543 5.11196889,114.412133 C1.69420521,133.371174 4.6982178,152.928576 13.6483951,169.987905 C7.51549676,179.291145 3.33259428,189.7413 1.3524912,200.706787 C-2.77083771,223.902098 2.62286977,247.780539 16.3159596,266.951444 C44.8902975,307.843936 101.312954,319.958266 142.10271,293.967161 L213.75062,248.302665 C233.322905,235.991626 246.803553,216.005094 250.885557,193.246067 C254.302867,174.287249 251.30121,154.730228 242.355449,137.668922 C248.486748,128.365895 252.667894,117.916162 254.646134,106.951413 C258.772188,83.7560394 253.378243,59.8765465 239.682665,40.706757" fill="#FF3E00"></path>
|
||||
<path d="M106.888658,270.841265 C83.7871855,276.848065 59.3915045,267.805346 45.7864111,248.192566 C37.5477583,236.66102 34.3023491,222.296573 36.7830958,208.343155 C37.1989333,206.075414 37.7711933,203.839165 38.4957755,201.650433 L39.845476,197.534835 L43.5173097,200.231763 C51.9971301,206.462491 61.4784803,211.199728 71.5527203,214.239302 L74.2164003,215.047419 L73.9710252,217.705878 C73.6455499,221.487851 74.6696022,225.262925 76.8616703,228.361972 C80.9560313,234.269749 88.3011363,236.995968 95.2584831,235.190159 C96.8160691,234.773852 98.3006859,234.121384 99.6606718,233.25546 L171.331634,187.582718 C174.877468,185.349963 177.321139,181.729229 178.065299,177.605596 C178.808171,173.400048 177.830501,169.072361 175.351884,165.594581 C171.255076,159.685578 163.908134,156.9582 156.947927,158.762547 C155.392392,159.178888 153.90975,159.83088 152.551509,160.695872 L125.202489,178.130144 C120.705281,180.989558 115.797437,183.144784 110.64897,184.521162 C87.547692,190.527609 63.1523949,181.484801 49.5475471,161.872188 C41.3085624,150.340895 38.0631179,135.976391 40.5442317,122.023052 C43.0002744,108.333716 51.1099574,96.3125326 62.8835328,88.9089537 L134.548175,43.2323647 C139.047294,40.3682559 143.958644,38.21032 149.111311,36.8336525 C172.21244,30.8273594 196.607527,39.8700206 210.212459,59.4823515 C218.451112,71.013898 221.696522,85.3783452 219.215775,99.3317627 C218.798144,101.59911 218.225915,103.835236 217.503095,106.024485 L216.153395,110.140083 L212.483484,107.447276 C204.004261,101.212984 194.522,96.4735732 184.44615,93.4336926 L181.78247,92.6253012 L182.027845,89.9668419 C182.350522,86.1852063 181.326723,82.4111645 179.1372,79.3110228 C175.042839,73.4032457 167.697734,70.677026 160.740387,72.4828355 C159.182801,72.8991426 157.698185,73.5516104 156.338199,74.4175344 L84.6672364,120.0922 C81.1218886,122.323199 78.6795938,125.943704 77.9387928,130.066574 C77.1913232,134.271925 78.1673502,138.601163 80.6469865,142.078963 C84.7438467,147.987899 92.0907405,150.71526 99.0509435,148.910997 C100.608143,148.493836 102.092543,147.841423 103.452857,146.976298 L130.798305,129.548621 C135.293566,126.685437 140.201191,124.528302 145.350175,123.152382 C168.451453,117.145935 192.846751,126.188743 206.451598,145.801356 C214.690583,157.332649 217.936027,171.697153 215.454914,185.650492 C212.997261,199.340539 204.888162,211.362752 193.115613,218.769811 L121.450695,264.442553 C116.951576,267.306662 112.040226,269.464598 106.887559,270.841265" fill="#FFFFFF"></path>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 3.4 KiB |
@@ -1,37 +0,0 @@
|
||||
/* global "" */
|
||||
|
||||
const expected = new Set([
|
||||
'SOCKET_PATH',
|
||||
'HOST',
|
||||
'PORT',
|
||||
'ORIGIN',
|
||||
'XFF_DEPTH',
|
||||
'ADDRESS_HEADER',
|
||||
'PROTOCOL_HEADER',
|
||||
'HOST_HEADER',
|
||||
'BODY_SIZE_LIMIT'
|
||||
]);
|
||||
|
||||
if ("") {
|
||||
for (const name in process.env) {
|
||||
if (name.startsWith("")) {
|
||||
const unprefixed = name.slice("".length);
|
||||
if (!expected.has(unprefixed)) {
|
||||
throw new Error(
|
||||
`You should change envPrefix (${""}) to avoid conflicts with existing environment variables — unexpectedly saw ${name}`
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} name
|
||||
* @param {any} fallback
|
||||
*/
|
||||
function env(name, fallback) {
|
||||
const prefixed = "" + name;
|
||||
return prefixed in process.env ? process.env[prefixed] : fallback;
|
||||
}
|
||||
|
||||
export { env };
|
||||
@@ -1,225 +0,0 @@
|
||||
import { handler } from './handler.js';
|
||||
import { env } from './env.js';
|
||||
import http from 'http';
|
||||
import * as qs from 'querystring';
|
||||
|
||||
function parse$1 (str, loose) {
|
||||
if (str instanceof RegExp) return { keys:false, pattern:str };
|
||||
var c, o, tmp, ext, keys=[], pattern='', arr = str.split('/');
|
||||
arr[0] || arr.shift();
|
||||
|
||||
while (tmp = arr.shift()) {
|
||||
c = tmp[0];
|
||||
if (c === '*') {
|
||||
keys.push('wild');
|
||||
pattern += '/(.*)';
|
||||
} else if (c === ':') {
|
||||
o = tmp.indexOf('?', 1);
|
||||
ext = tmp.indexOf('.', 1);
|
||||
keys.push( tmp.substring(1, !!~o ? o : !!~ext ? ext : tmp.length) );
|
||||
pattern += !!~o && !~ext ? '(?:/([^/]+?))?' : '/([^/]+?)';
|
||||
if (!!~ext) pattern += (!!~o ? '?' : '') + '\\' + tmp.substring(ext);
|
||||
} else {
|
||||
pattern += '/' + tmp;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
keys: keys,
|
||||
pattern: new RegExp('^' + pattern + (loose ? '(?=$|\/)' : '\/?$'), 'i')
|
||||
};
|
||||
}
|
||||
|
||||
class Trouter {
|
||||
constructor() {
|
||||
this.routes = [];
|
||||
|
||||
this.all = this.add.bind(this, '');
|
||||
this.get = this.add.bind(this, 'GET');
|
||||
this.head = this.add.bind(this, 'HEAD');
|
||||
this.patch = this.add.bind(this, 'PATCH');
|
||||
this.options = this.add.bind(this, 'OPTIONS');
|
||||
this.connect = this.add.bind(this, 'CONNECT');
|
||||
this.delete = this.add.bind(this, 'DELETE');
|
||||
this.trace = this.add.bind(this, 'TRACE');
|
||||
this.post = this.add.bind(this, 'POST');
|
||||
this.put = this.add.bind(this, 'PUT');
|
||||
}
|
||||
|
||||
use(route, ...fns) {
|
||||
let handlers = [].concat.apply([], fns);
|
||||
let { keys, pattern } = parse$1(route, true);
|
||||
this.routes.push({ keys, pattern, method:'', handlers });
|
||||
return this;
|
||||
}
|
||||
|
||||
add(method, route, ...fns) {
|
||||
let { keys, pattern } = parse$1(route);
|
||||
let handlers = [].concat.apply([], fns);
|
||||
this.routes.push({ keys, pattern, method, handlers });
|
||||
return this;
|
||||
}
|
||||
|
||||
find(method, url) {
|
||||
let isHEAD=(method === 'HEAD');
|
||||
let i=0, j=0, k, tmp, arr=this.routes;
|
||||
let matches=[], params={}, handlers=[];
|
||||
for (; i < arr.length; i++) {
|
||||
tmp = arr[i];
|
||||
if (tmp.method.length === 0 || tmp.method === method || isHEAD && tmp.method === 'GET') {
|
||||
if (tmp.keys === false) {
|
||||
matches = tmp.pattern.exec(url);
|
||||
if (matches === null) continue;
|
||||
if (matches.groups !== void 0) for (k in matches.groups) params[k]=matches.groups[k];
|
||||
tmp.handlers.length > 1 ? (handlers=handlers.concat(tmp.handlers)) : handlers.push(tmp.handlers[0]);
|
||||
} else if (tmp.keys.length > 0) {
|
||||
matches = tmp.pattern.exec(url);
|
||||
if (matches === null) continue;
|
||||
for (j=0; j < tmp.keys.length;) params[tmp.keys[j]]=matches[++j];
|
||||
tmp.handlers.length > 1 ? (handlers=handlers.concat(tmp.handlers)) : handlers.push(tmp.handlers[0]);
|
||||
} else if (tmp.pattern.test(url)) {
|
||||
tmp.handlers.length > 1 ? (handlers=handlers.concat(tmp.handlers)) : handlers.push(tmp.handlers[0]);
|
||||
}
|
||||
} // else not a match
|
||||
}
|
||||
|
||||
return { params, handlers };
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef ParsedURL
|
||||
* @type {import('.').ParsedURL}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef Request
|
||||
* @property {string} url
|
||||
* @property {ParsedURL} _parsedUrl
|
||||
*/
|
||||
|
||||
/**
|
||||
* @param {Request} req
|
||||
* @returns {ParsedURL|void}
|
||||
*/
|
||||
function parse(req) {
|
||||
let raw = req.url;
|
||||
if (raw == null) return;
|
||||
|
||||
let prev = req._parsedUrl;
|
||||
if (prev && prev.raw === raw) return prev;
|
||||
|
||||
let pathname=raw, search='', query;
|
||||
|
||||
if (raw.length > 1) {
|
||||
let idx = raw.indexOf('?', 1);
|
||||
|
||||
if (idx !== -1) {
|
||||
search = raw.substring(idx);
|
||||
pathname = raw.substring(0, idx);
|
||||
if (search.length > 1) {
|
||||
query = qs.parse(search.substring(1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return req._parsedUrl = { pathname, search, query, raw };
|
||||
}
|
||||
|
||||
function onError(err, req, res) {
|
||||
let code = typeof err.status === 'number' && err.status;
|
||||
code = res.statusCode = (code && code >= 100 ? code : 500);
|
||||
if (typeof err === 'string' || Buffer.isBuffer(err)) res.end(err);
|
||||
else res.end(err.message || http.STATUS_CODES[code]);
|
||||
}
|
||||
|
||||
const mount = fn => fn instanceof Polka ? fn.attach : fn;
|
||||
|
||||
class Polka extends Trouter {
|
||||
constructor(opts={}) {
|
||||
super();
|
||||
this.parse = parse;
|
||||
this.server = opts.server;
|
||||
this.handler = this.handler.bind(this);
|
||||
this.onError = opts.onError || onError; // catch-all handler
|
||||
this.onNoMatch = opts.onNoMatch || this.onError.bind(null, { status: 404 });
|
||||
this.attach = (req, res) => setImmediate(this.handler, req, res);
|
||||
}
|
||||
|
||||
use(base, ...fns) {
|
||||
if (base === '/') {
|
||||
super.use(base, fns.map(mount));
|
||||
} else if (typeof base === 'function' || base instanceof Polka) {
|
||||
super.use('/', [base, ...fns].map(mount));
|
||||
} else {
|
||||
super.use(base,
|
||||
(req, _, next) => {
|
||||
if (typeof base === 'string') {
|
||||
let len = base.length;
|
||||
base.startsWith('/') || len++;
|
||||
req.url = req.url.substring(len) || '/';
|
||||
req.path = req.path.substring(len) || '/';
|
||||
} else {
|
||||
req.url = req.url.replace(base, '') || '/';
|
||||
req.path = req.path.replace(base, '') || '/';
|
||||
}
|
||||
if (req.url.charAt(0) !== '/') {
|
||||
req.url = '/' + req.url;
|
||||
}
|
||||
next();
|
||||
},
|
||||
fns.map(mount),
|
||||
(req, _, next) => {
|
||||
req.path = req._parsedUrl.pathname;
|
||||
req.url = req.path + req._parsedUrl.search;
|
||||
next();
|
||||
}
|
||||
);
|
||||
}
|
||||
return this; // chainable
|
||||
}
|
||||
|
||||
listen() {
|
||||
(this.server = this.server || http.createServer()).on('request', this.attach);
|
||||
this.server.listen.apply(this.server, arguments);
|
||||
return this;
|
||||
}
|
||||
|
||||
handler(req, res, next) {
|
||||
let info = this.parse(req), path = info.pathname;
|
||||
let obj = this.find(req.method, req.path=path);
|
||||
|
||||
req.url = path + info.search;
|
||||
req.originalUrl = req.originalUrl || req.url;
|
||||
req.query = info.query || {};
|
||||
req.search = info.search;
|
||||
req.params = obj.params;
|
||||
|
||||
if (path.length > 1 && path.indexOf('%', 1) !== -1) {
|
||||
for (let k in req.params) {
|
||||
try { req.params[k] = decodeURIComponent(req.params[k]); }
|
||||
catch (e) { /* malform uri segment */ }
|
||||
}
|
||||
}
|
||||
|
||||
let i=0, arr=obj.handlers.concat(this.onNoMatch), len=arr.length;
|
||||
let loop = async () => res.finished || (i < len) && arr[i++](req, res, next);
|
||||
(next = next || (err => err ? this.onError(err, req, res, next) : loop().catch(next)))(); // init
|
||||
}
|
||||
}
|
||||
|
||||
function polka (opts) {
|
||||
return new Polka(opts);
|
||||
}
|
||||
|
||||
const path = env('SOCKET_PATH', false);
|
||||
const host = env('HOST', '0.0.0.0');
|
||||
const port = env('PORT', !path && '3000');
|
||||
|
||||
const server = polka().use(handler);
|
||||
|
||||
server.listen({ path, host, port }, () => {
|
||||
console.log(`Listening on ${path ? path : host + ':' + port}`);
|
||||
});
|
||||
|
||||
export { host, path, port, server };
|
||||
@@ -1,31 +0,0 @@
|
||||
import fs from 'fs-extra';
|
||||
import { p as public_env } from './shared-server-58a5f352.js';
|
||||
|
||||
async function load({ params, route, url, cookies }) {
|
||||
let site = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/site.json", "utf8"));
|
||||
let localTz = "GMT";
|
||||
const localTzCookie = cookies.get("localTz");
|
||||
if (!!localTzCookie) {
|
||||
localTz = localTzCookie;
|
||||
}
|
||||
return {
|
||||
site,
|
||||
localTz
|
||||
};
|
||||
}
|
||||
|
||||
var _layout_server = /*#__PURE__*/Object.freeze({
|
||||
__proto__: null,
|
||||
load: load
|
||||
});
|
||||
|
||||
const index = 0;
|
||||
let component_cache;
|
||||
const component = async () => component_cache ??= (await import('./_layout.svelte-69122555.js')).default;
|
||||
const server_id = "src/routes/+layout.server.js";
|
||||
const imports = ["_app/immutable/nodes/0.2061eca5.js","_app/immutable/chunks/scheduler.0e55af49.js","_app/immutable/chunks/index.7fa4eb0f.js","_app/immutable/chunks/globals.7f7f1b26.js","_app/immutable/chunks/ctx.b7ea881a.js","_app/immutable/chunks/index.3cd3e9b4.js","_app/immutable/chunks/index.8cfb104d.js"];
|
||||
const stylesheets = ["_app/immutable/assets/0.ea6e2bb0.css"];
|
||||
const fonts = [];
|
||||
|
||||
export { component, fonts, imports, index, _layout_server as server, server_id, stylesheets };
|
||||
//# sourceMappingURL=0-c10236e4.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"0-c10236e4.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/_layout.server.js","../../../.svelte-kit/adapter-node/nodes/0.js"],"sourcesContent":["import fs from \"fs-extra\";\nimport { p as public_env } from \"../../chunks/shared-server.js\";\nasync function load({ params, route, url, cookies }) {\n let site = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + \"/site.json\", \"utf8\"));\n let localTz = \"GMT\";\n const localTzCookie = cookies.get(\"localTz\");\n if (!!localTzCookie) {\n localTz = localTzCookie;\n }\n return {\n site,\n localTz\n };\n}\nexport {\n load\n};\n","import * as server from '../entries/pages/_layout.server.js';\n\nexport const index = 0;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/_layout.svelte.js')).default;\nexport { server };\nexport const server_id = \"src/routes/+layout.server.js\";\nexport const imports = [\"_app/immutable/nodes/0.2061eca5.js\",\"_app/immutable/chunks/scheduler.0e55af49.js\",\"_app/immutable/chunks/index.7fa4eb0f.js\",\"_app/immutable/chunks/globals.7f7f1b26.js\",\"_app/immutable/chunks/ctx.b7ea881a.js\",\"_app/immutable/chunks/index.3cd3e9b4.js\",\"_app/immutable/chunks/index.8cfb104d.js\"];\nexport const stylesheets = [\"_app/immutable/assets/0.ea6e2bb0.css\"];\nexport const fonts = [];\n"],"names":[],"mappings":";;;AAEA,eAAe,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE;AACrD,EAAE,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,mBAAmB,GAAG,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;AAChG,EAAE,IAAI,OAAO,GAAG,KAAK,CAAC;AACtB,EAAE,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AAC/C,EAAE,IAAI,CAAC,CAAC,aAAa,EAAE;AACvB,IAAI,OAAO,GAAG,aAAa,CAAC;AAC5B,GAAG;AACH,EAAE,OAAO;AACT,IAAI,IAAI;AACR,IAAI,OAAO;AACX,GAAG,CAAC;AACJ;;;;;;;ACXY,MAAC,KAAK,GAAG,EAAE;AACvB,IAAI,eAAe,CAAC;AACR,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,8BAAoC,CAAC,EAAE,QAAQ;AAE1G,MAAC,SAAS,GAAG,+BAA+B;AAC5C,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,6CAA6C,CAAC,yCAAyC,CAAC,2CAA2C,CAAC,uCAAuC,CAAC,yCAAyC,CAAC,yCAAyC,EAAE;AAClT,MAAC,WAAW,GAAG,CAAC,sCAAsC,EAAE;AACxD,MAAC,KAAK,GAAG;;;;"}
|
||||
@@ -1,9 +0,0 @@
|
||||
const index = 1;
|
||||
let component_cache;
|
||||
const component = async () => component_cache ??= (await import('./error.svelte-9dc5c501.js')).default;
|
||||
const imports = ["_app/immutable/nodes/1.5a4270e1.js","_app/immutable/chunks/scheduler.0e55af49.js","_app/immutable/chunks/index.7fa4eb0f.js","_app/immutable/chunks/singletons.acbee524.js","_app/immutable/chunks/index.3cd3e9b4.js"];
|
||||
const stylesheets = [];
|
||||
const fonts = [];
|
||||
|
||||
export { component, fonts, imports, index, stylesheets };
|
||||
//# sourceMappingURL=1-2ea57da0.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"1-2ea57da0.js","sources":["../../../.svelte-kit/adapter-node/nodes/1.js"],"sourcesContent":["\n\nexport const index = 1;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/fallbacks/error.svelte.js')).default;\nexport const imports = [\"_app/immutable/nodes/1.5a4270e1.js\",\"_app/immutable/chunks/scheduler.0e55af49.js\",\"_app/immutable/chunks/index.7fa4eb0f.js\",\"_app/immutable/chunks/singletons.acbee524.js\",\"_app/immutable/chunks/index.3cd3e9b4.js\"];\nexport const stylesheets = [];\nexport const fonts = [];\n"],"names":[],"mappings":"AAEY,MAAC,KAAK,GAAG,EAAE;AACvB,IAAI,eAAe,CAAC;AACR,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,4BAAsC,CAAC,EAAE,QAAQ;AAC5G,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,6CAA6C,CAAC,yCAAyC,CAAC,8CAA8C,CAAC,yCAAyC,EAAE;AACnO,MAAC,WAAW,GAAG,GAAG;AAClB,MAAC,KAAK,GAAG;;;;"}
|
||||
@@ -1,136 +0,0 @@
|
||||
import { G as GetIncidents, M as Mapper } from './github-54c09baa.js';
|
||||
import fs from 'fs-extra';
|
||||
import { G as GetMinuteStartNowTimestampUTC, B as BeginingOfDay } from './tool-153dc604.js';
|
||||
import { S as StatusObj, P as ParseUptime, a as ParsePercentage } from './helpers-6076deb3.js';
|
||||
import { p as public_env } from './shared-server-58a5f352.js';
|
||||
import 'axios';
|
||||
import 'marked';
|
||||
|
||||
const secondsInDay = 24 * 60 * 60;
|
||||
function getDayData(day0, startTime, endTime) {
|
||||
let dayData = {
|
||||
UP: 0,
|
||||
DEGRADED: 0,
|
||||
DOWN: 0,
|
||||
timestamp: startTime,
|
||||
cssClass: StatusObj.NO_DATA,
|
||||
message: "No Data"
|
||||
};
|
||||
for (let i = startTime; i <= endTime; i += 60) {
|
||||
if (day0[i] === void 0) {
|
||||
continue;
|
||||
}
|
||||
if (day0[i].status == "UP") {
|
||||
dayData.UP++;
|
||||
} else if (day0[i].status == "DEGRADED") {
|
||||
dayData.DEGRADED++;
|
||||
} else if (day0[i].status == "DOWN") {
|
||||
dayData.DOWN++;
|
||||
}
|
||||
}
|
||||
dayData.uptimePercentage = ParseUptime(dayData.UP + dayData.DEGRADED, dayData.UP + dayData.DEGRADED + dayData.DOWN);
|
||||
let cssClass = StatusObj.UP;
|
||||
let message = "Status OK";
|
||||
if (dayData.DEGRADED > 0) {
|
||||
cssClass = StatusObj.DEGRADED;
|
||||
message = "Degraded for " + dayData.DEGRADED + " minutes";
|
||||
}
|
||||
if (dayData.DOWN > 0) {
|
||||
cssClass = StatusObj.DOWN;
|
||||
message = "Down for " + dayData.DOWN + " minutes";
|
||||
}
|
||||
if (dayData.DEGRADED + dayData.DOWN + dayData.UP > 0) {
|
||||
dayData.message = message;
|
||||
dayData.cssClass = cssClass;
|
||||
}
|
||||
return dayData;
|
||||
}
|
||||
const FetchData = async function(monitor, localTz) {
|
||||
let _0Day = {};
|
||||
let _90Day = {};
|
||||
let uptime0Day = "0";
|
||||
let dailyUps = 0;
|
||||
let dailyDown = 0;
|
||||
let percentage90DaysBuildUp = [];
|
||||
let dailyDegraded = 0;
|
||||
const now = GetMinuteStartNowTimestampUTC();
|
||||
const midnight = BeginingOfDay({ timeZone: localTz });
|
||||
const midnight90DaysAgo = midnight - 90 * 24 * 60 * 60;
|
||||
const midnightTomorrow = midnight + secondsInDay;
|
||||
for (let i = midnight; i <= now; i += 60) {
|
||||
_0Day[i] = {
|
||||
timestamp: i,
|
||||
status: "NO_DATA",
|
||||
cssClass: StatusObj.NO_DATA,
|
||||
index: (i - midnight) / 60
|
||||
};
|
||||
}
|
||||
let day0 = JSON.parse(fs.readFileSync(monitor.path0Day, "utf8"));
|
||||
for (const timestamp in day0) {
|
||||
const element = day0[timestamp];
|
||||
let status = element.status;
|
||||
if (_0Day[timestamp] !== void 0) {
|
||||
_0Day[timestamp].status = status;
|
||||
_0Day[timestamp].cssClass = StatusObj[status];
|
||||
dailyUps = status == "UP" ? dailyUps + 1 : dailyUps;
|
||||
dailyDown = status == "DOWN" ? dailyDown + 1 : dailyDown;
|
||||
dailyDegraded = status == "DEGRADED" ? dailyDegraded + 1 : dailyDegraded;
|
||||
}
|
||||
}
|
||||
for (let i = midnight90DaysAgo; i < midnightTomorrow; i += secondsInDay) {
|
||||
_90Day[i] = getDayData(day0, i, i + secondsInDay - 1);
|
||||
}
|
||||
for (const key in _90Day) {
|
||||
const element = _90Day[key];
|
||||
const uptimePercentage = element.uptimePercentage;
|
||||
delete _90Day[key].UP;
|
||||
delete _90Day[key].DEGRADED;
|
||||
delete _90Day[key].DOWN;
|
||||
delete _90Day[key].uptimePercentage;
|
||||
if (element.message == "No Data")
|
||||
continue;
|
||||
percentage90DaysBuildUp.push(parseFloat(uptimePercentage));
|
||||
}
|
||||
uptime0Day = ParseUptime(dailyUps + dailyDegraded, dailyUps + dailyDown + dailyDegraded);
|
||||
return {
|
||||
_90Day,
|
||||
uptime0Day,
|
||||
uptime90Day: ParsePercentage(percentage90DaysBuildUp.reduce((a, b) => a + b, 0) / percentage90DaysBuildUp.length),
|
||||
dailyUps,
|
||||
dailyDown,
|
||||
dailyDegraded
|
||||
};
|
||||
};
|
||||
async function load({ params, route, url, parent }) {
|
||||
let monitors = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/monitors.json", "utf8"));
|
||||
const parentData = await parent();
|
||||
const siteData = parentData.site;
|
||||
const github = siteData.github;
|
||||
for (let i = 0; i < monitors.length; i++) {
|
||||
const gitHubActiveIssues = await GetIncidents(monitors[i].tag, github, "open");
|
||||
delete monitors[i].api;
|
||||
delete monitors[i].defaultStatus;
|
||||
let data = await FetchData(monitors[i], parentData.localTz);
|
||||
monitors[i].pageData = data;
|
||||
monitors[i].activeIncidents = await Promise.all(gitHubActiveIssues.map(Mapper, { github }));
|
||||
}
|
||||
return {
|
||||
monitors
|
||||
};
|
||||
}
|
||||
|
||||
var _page_server = /*#__PURE__*/Object.freeze({
|
||||
__proto__: null,
|
||||
load: load
|
||||
});
|
||||
|
||||
const index = 2;
|
||||
let component_cache;
|
||||
const component = async () => component_cache ??= (await import('./_page.svelte-cc95dca1.js')).default;
|
||||
const server_id = "src/routes/+page.server.js";
|
||||
const imports = ["_app/immutable/nodes/2.64eb8373.js","_app/immutable/chunks/scheduler.0e55af49.js","_app/immutable/chunks/index.7fa4eb0f.js","_app/immutable/chunks/ctx.b7ea881a.js","_app/immutable/chunks/index.3cd3e9b4.js","_app/immutable/chunks/incident.99422fec.js","_app/immutable/chunks/chevron-down.2b71fd98.js","_app/immutable/chunks/index.8cfb104d.js"];
|
||||
const stylesheets = [];
|
||||
const fonts = [];
|
||||
|
||||
export { component, fonts, imports, index, _page_server as server, server_id, stylesheets };
|
||||
//# sourceMappingURL=2-81154d8f.js.map
|
||||
@@ -1,24 +0,0 @@
|
||||
import axios from 'axios';
|
||||
|
||||
async function load({ params, route, url, parent }) {
|
||||
const { data } = await axios.get("https://raw.githubusercontent.com/rajnandan1/kener/main/docs.md");
|
||||
return {
|
||||
md: data
|
||||
};
|
||||
}
|
||||
|
||||
var _page_server = /*#__PURE__*/Object.freeze({
|
||||
__proto__: null,
|
||||
load: load
|
||||
});
|
||||
|
||||
const index = 3;
|
||||
let component_cache;
|
||||
const component = async () => component_cache ??= (await import('./_page.svelte-dcde5ae6.js')).default;
|
||||
const server_id = "src/routes/docs/+page.server.js";
|
||||
const imports = ["_app/immutable/nodes/3.f09cadd6.js","_app/immutable/chunks/scheduler.0e55af49.js","_app/immutable/chunks/index.7fa4eb0f.js","_app/immutable/chunks/globals.7f7f1b26.js","_app/immutable/chunks/ctx.b7ea881a.js","_app/immutable/chunks/index.3cd3e9b4.js","_app/immutable/chunks/chevron-down.2b71fd98.js"];
|
||||
const stylesheets = [];
|
||||
const fonts = [];
|
||||
|
||||
export { component, fonts, imports, index, _page_server as server, server_id, stylesheets };
|
||||
//# sourceMappingURL=3-ff55fac2.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"3-ff55fac2.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/docs/_page.server.js","../../../.svelte-kit/adapter-node/nodes/3.js"],"sourcesContent":["import axios from \"axios\";\nasync function load({ params, route, url, parent }) {\n const { data } = await axios.get(\"https://raw.githubusercontent.com/rajnandan1/kener/main/docs.md\");\n return {\n md: data\n };\n}\nexport {\n load\n};\n","import * as server from '../entries/pages/docs/_page.server.js';\n\nexport const index = 3;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/docs/_page.svelte.js')).default;\nexport { server };\nexport const server_id = \"src/routes/docs/+page.server.js\";\nexport const imports = [\"_app/immutable/nodes/3.f09cadd6.js\",\"_app/immutable/chunks/scheduler.0e55af49.js\",\"_app/immutable/chunks/index.7fa4eb0f.js\",\"_app/immutable/chunks/globals.7f7f1b26.js\",\"_app/immutable/chunks/ctx.b7ea881a.js\",\"_app/immutable/chunks/index.3cd3e9b4.js\",\"_app/immutable/chunks/chevron-down.2b71fd98.js\"];\nexport const stylesheets = [];\nexport const fonts = [];\n"],"names":[],"mappings":";;AACA,eAAe,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE;AACpD,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,iEAAiE,CAAC,CAAC;AACtG,EAAE,OAAO;AACT,IAAI,EAAE,EAAE,IAAI;AACZ,GAAG,CAAC;AACJ;;;;;;;ACJY,MAAC,KAAK,GAAG,EAAE;AACvB,IAAI,eAAe,CAAC;AACR,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,4BAAuC,CAAC,EAAE,QAAQ;AAE7G,MAAC,SAAS,GAAG,kCAAkC;AAC/C,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,6CAA6C,CAAC,yCAAyC,CAAC,2CAA2C,CAAC,uCAAuC,CAAC,yCAAyC,CAAC,gDAAgD,EAAE;AACzT,MAAC,WAAW,GAAG,GAAG;AAClB,MAAC,KAAK,GAAG;;;;"}
|
||||
@@ -1,43 +0,0 @@
|
||||
import { p as public_env } from './shared-server-58a5f352.js';
|
||||
import { G as GetIncidents, M as Mapper } from './github-54c09baa.js';
|
||||
import fs from 'fs-extra';
|
||||
import 'axios';
|
||||
import './tool-153dc604.js';
|
||||
import 'marked';
|
||||
|
||||
async function load({ params, route, url, parent }) {
|
||||
let monitors = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/monitors.json", "utf8"));
|
||||
const siteData = await parent();
|
||||
const github = siteData.site.github;
|
||||
const { description, name, tag, image } = monitors.find((monitor) => monitor.folderName === params.id);
|
||||
const allIncidents = await GetIncidents(tag, github, "all");
|
||||
const gitHubActiveIssues = allIncidents.filter((issue) => {
|
||||
return issue.state === "open";
|
||||
});
|
||||
const gitHubPastIssues = allIncidents.filter((issue) => {
|
||||
return issue.state === "closed";
|
||||
});
|
||||
return {
|
||||
issues: params.id,
|
||||
githubConfig: github,
|
||||
monitor: { description, name, image },
|
||||
activeIncidents: await Promise.all(gitHubActiveIssues.map(Mapper, { github })),
|
||||
pastIncidents: await Promise.all(gitHubPastIssues.map(Mapper, { github }))
|
||||
};
|
||||
}
|
||||
|
||||
var _page_server = /*#__PURE__*/Object.freeze({
|
||||
__proto__: null,
|
||||
load: load
|
||||
});
|
||||
|
||||
const index = 4;
|
||||
let component_cache;
|
||||
const component = async () => component_cache ??= (await import('./_page.svelte-48e57f95.js')).default;
|
||||
const server_id = "src/routes/incident/[id]/+page.server.js";
|
||||
const imports = ["_app/immutable/nodes/4.9a5d33f6.js","_app/immutable/chunks/scheduler.0e55af49.js","_app/immutable/chunks/index.7fa4eb0f.js","_app/immutable/chunks/ctx.b7ea881a.js","_app/immutable/chunks/index.3cd3e9b4.js","_app/immutable/chunks/incident.99422fec.js","_app/immutable/chunks/chevron-down.2b71fd98.js","_app/immutable/chunks/index.8cfb104d.js"];
|
||||
const stylesheets = [];
|
||||
const fonts = [];
|
||||
|
||||
export { component, fonts, imports, index, _page_server as server, server_id, stylesheets };
|
||||
//# sourceMappingURL=4-5261b32b.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"4-5261b32b.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/incident/_id_/_page.server.js","../../../.svelte-kit/adapter-node/nodes/4.js"],"sourcesContent":["import { p as public_env } from \"../../../../chunks/shared-server.js\";\nimport { e as GetIncidents, M as Mapper } from \"../../../../chunks/github.js\";\nimport fs from \"fs-extra\";\nasync function load({ params, route, url, parent }) {\n let monitors = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + \"/monitors.json\", \"utf8\"));\n const siteData = await parent();\n const github = siteData.site.github;\n const { description, name, tag, image } = monitors.find((monitor) => monitor.folderName === params.id);\n const allIncidents = await GetIncidents(tag, github, \"all\");\n const gitHubActiveIssues = allIncidents.filter((issue) => {\n return issue.state === \"open\";\n });\n const gitHubPastIssues = allIncidents.filter((issue) => {\n return issue.state === \"closed\";\n });\n return {\n issues: params.id,\n githubConfig: github,\n monitor: { description, name, image },\n activeIncidents: await Promise.all(gitHubActiveIssues.map(Mapper, { github })),\n pastIncidents: await Promise.all(gitHubPastIssues.map(Mapper, { github }))\n };\n}\nexport {\n load\n};\n","import * as server from '../entries/pages/incident/_id_/_page.server.js';\n\nexport const index = 4;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/incident/_id_/_page.svelte.js')).default;\nexport { server };\nexport const server_id = \"src/routes/incident/[id]/+page.server.js\";\nexport const imports = [\"_app/immutable/nodes/4.9a5d33f6.js\",\"_app/immutable/chunks/scheduler.0e55af49.js\",\"_app/immutable/chunks/index.7fa4eb0f.js\",\"_app/immutable/chunks/ctx.b7ea881a.js\",\"_app/immutable/chunks/index.3cd3e9b4.js\",\"_app/immutable/chunks/incident.99422fec.js\",\"_app/immutable/chunks/chevron-down.2b71fd98.js\",\"_app/immutable/chunks/index.8cfb104d.js\"];\nexport const stylesheets = [];\nexport const fonts = [];\n"],"names":[],"mappings":";;;;;;;AAGA,eAAe,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE;AACpD,EAAE,IAAI,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,mBAAmB,GAAG,gBAAgB,EAAE,MAAM,CAAC,CAAC,CAAC;AACxG,EAAE,MAAM,QAAQ,GAAG,MAAM,MAAM,EAAE,CAAC;AAClC,EAAE,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;AACtC,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,UAAU,KAAK,MAAM,CAAC,EAAE,CAAC,CAAC;AACzG,EAAE,MAAM,YAAY,GAAG,MAAM,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAC9D,EAAE,MAAM,kBAAkB,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,KAAK,KAAK;AAC5D,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,MAAM,CAAC;AAClC,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,gBAAgB,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,KAAK,KAAK;AAC1D,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,CAAC;AACpC,GAAG,CAAC,CAAC;AACL,EAAE,OAAO;AACT,IAAI,MAAM,EAAE,MAAM,CAAC,EAAE;AACrB,IAAI,YAAY,EAAE,MAAM;AACxB,IAAI,OAAO,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,EAAE;AACzC,IAAI,eAAe,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;AAClF,IAAI,aAAa,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;AAC9E,GAAG,CAAC;AACJ;;;;;;;ACpBY,MAAC,KAAK,GAAG,EAAE;AACvB,IAAI,eAAe,CAAC;AACR,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,4BAAgD,CAAC,EAAE,QAAQ;AAEtH,MAAC,SAAS,GAAG,2CAA2C;AACxD,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,6CAA6C,CAAC,yCAAyC,CAAC,uCAAuC,CAAC,yCAAyC,CAAC,4CAA4C,CAAC,gDAAgD,CAAC,yCAAyC,EAAE;AACpW,MAAC,WAAW,GAAG,GAAG;AAClB,MAAC,KAAK,GAAG;;;;"}
|
||||
@@ -1,26 +0,0 @@
|
||||
import { c as create_ssr_component, v as validate_component, e as escape, a as each, b as add_attribute } from './ssr-c85d451a.js';
|
||||
import './index3-58d8c192.js';
|
||||
import './ctx-168edc6f.js';
|
||||
import './index2-d9c461ad.js';
|
||||
import 'clsx';
|
||||
import 'tailwind-variants';
|
||||
|
||||
const Nav = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let { data } = $$props;
|
||||
if ($$props.data === void 0 && $$bindings.data && data !== void 0)
|
||||
$$bindings.data(data);
|
||||
return `<div class="one"></div> <header class="relative z-50 w-full"><div class="container flex h-14 items-center"><div class="mr-4 flex blurry-bg"><a${add_attribute("href", data.site.home ? data.site.home : "/", 0)} class="mr-6 flex items-center space-x-2">${data.site.logo ? `<img${add_attribute("src", data.site.logo, 0)} class="h-9 w-9"${add_attribute("alt", data.site.title, 0)} srcset="">` : ``} ${data.site.title ? `<span class="hidden font-bold sm:inline-block text-[15px] lg:text-base">${escape(data.site.title)}</span>` : ``}</a> ${data.site.nav ? `<nav class="flex items-center space-x-6 text-sm font-medium">${each(data.site.nav, (navItem) => {
|
||||
return `<a${add_attribute("href", navItem.url, 0)}>${escape(navItem.name)} </a>`;
|
||||
})}</nav>` : ``}</div></div></header>`;
|
||||
});
|
||||
const Layout = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let { data } = $$props;
|
||||
if ($$props.data === void 0 && $$bindings.data && data !== void 0)
|
||||
$$bindings.data(data);
|
||||
return `${validate_component(Nav, "Nav").$$render($$result, { data }, {}, {})} ${$$result.head += `<!-- HEAD_svelte-xs6o1m_START -->${$$result.title = `<title>${escape(data.site.title)}</title>`, ""}${each(Object.entries(data.site.metaTags), ([key, value]) => {
|
||||
return `<meta${add_attribute("name", key, 0)}${add_attribute("content", value, 0)}>`;
|
||||
})}<!-- HEAD_svelte-xs6o1m_END -->`, ""} ${slots.default ? slots.default({}) : ``}`;
|
||||
});
|
||||
|
||||
export { Layout as default };
|
||||
//# sourceMappingURL=_layout.svelte-69122555.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"_layout.svelte-69122555.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/_layout.svelte.js"],"sourcesContent":["import { c as create_ssr_component, a as add_attribute, e as escape, b as each, v as validate_component } from \"../../chunks/ssr.js\";\nimport \"../../chunks/index3.js\";\nconst app = \"\";\nconst kener = \"\";\nconst Nav = create_ssr_component(($$result, $$props, $$bindings, slots) => {\n let { data } = $$props;\n if ($$props.data === void 0 && $$bindings.data && data !== void 0)\n $$bindings.data(data);\n return `<div class=\"one\"></div> <header class=\"relative z-50 w-full\"><div class=\"container flex h-14 items-center\"><div class=\"mr-4 flex blurry-bg\"><a${add_attribute(\"href\", data.site.home ? data.site.home : \"/\", 0)} class=\"mr-6 flex items-center space-x-2\">${data.site.logo ? `<img${add_attribute(\"src\", data.site.logo, 0)} class=\"h-9 w-9\"${add_attribute(\"alt\", data.site.title, 0)} srcset=\"\">` : ``} ${data.site.title ? `<span class=\"hidden font-bold sm:inline-block text-[15px] lg:text-base\">${escape(data.site.title)}</span>` : ``}</a> ${data.site.nav ? `<nav class=\"flex items-center space-x-6 text-sm font-medium\">${each(data.site.nav, (navItem) => {\n return `<a${add_attribute(\"href\", navItem.url, 0)}>${escape(navItem.name)} </a>`;\n })}</nav>` : ``}</div></div></header>`;\n});\nconst Layout = create_ssr_component(($$result, $$props, $$bindings, slots) => {\n let { data } = $$props;\n if ($$props.data === void 0 && $$bindings.data && data !== void 0)\n $$bindings.data(data);\n return `${validate_component(Nav, \"Nav\").$$render($$result, { data }, {}, {})} ${$$result.head += `<!-- HEAD_svelte-xs6o1m_START -->${$$result.title = `<title>${escape(data.site.title)}</title>`, \"\"}${each(Object.entries(data.site.metaTags), ([key, value]) => {\n return `<meta${add_attribute(\"name\", key, 0)}${add_attribute(\"content\", value, 0)}>`;\n })}<!-- HEAD_svelte-xs6o1m_END -->`, \"\"} ${slots.default ? slots.default({}) : ``}`;\n});\nexport {\n Layout as default\n};\n"],"names":[],"mappings":";;;;;;;AAIA,MAAM,GAAG,GAAG,oBAAoB,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,KAAK;AAC3E,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;AACzB,EAAE,IAAI,OAAO,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,UAAU,CAAC,IAAI,IAAI,IAAI,KAAK,KAAK,CAAC;AACnE,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,EAAE,OAAO,CAAC,8IAA8I,EAAE,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,0CAA0C,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,gBAAgB,EAAE,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,wEAAwE,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,6DAA6D,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,KAAK;AACjpB,IAAI,OAAO,CAAC,EAAE,EAAE,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC;AACrF,GAAG,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC;AACzC,CAAC,CAAC,CAAC;AACE,MAAC,MAAM,GAAG,oBAAoB,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,KAAK;AAC9E,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;AACzB,EAAE,IAAI,OAAO,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,UAAU,CAAC,IAAI,IAAI,IAAI,KAAK,KAAK,CAAC;AACnE,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,EAAE,OAAO,CAAC,EAAE,kBAAkB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,IAAI,IAAI,CAAC,iCAAiC,EAAE,QAAQ,CAAC,KAAK,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK;AACtQ,IAAI,OAAO,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACzF,GAAG,CAAC,CAAC,+BAA+B,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACtF,CAAC;;;;"}
|
||||
@@ -1,110 +0,0 @@
|
||||
import { c as create_ssr_component, e as escape, v as validate_component, a as each, f as compute_rest_props, d as subscribe, h as spread, i as escape_object } from './ssr-c85d451a.js';
|
||||
import 'clsx';
|
||||
import { B as Badge, I as Incident } from './incident-e1bd1794.js';
|
||||
import { e as setCtx, f as getAttrs } from './ctx-168edc6f.js';
|
||||
import { c as cn } from './chevron-down-226abe3e.js';
|
||||
import 'moment';
|
||||
import './index2-d9c461ad.js';
|
||||
import './helpers-6076deb3.js';
|
||||
import './index3-58d8c192.js';
|
||||
import 'tailwind-variants';
|
||||
import 'tailwind-merge';
|
||||
|
||||
const Separator$1 = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let builder;
|
||||
let $$restProps = compute_rest_props($$props, ["orientation", "decorative", "asChild"]);
|
||||
let $root, $$unsubscribe_root;
|
||||
let { orientation = "horizontal" } = $$props;
|
||||
let { decorative = true } = $$props;
|
||||
let { asChild = false } = $$props;
|
||||
const { elements: { root }, updateOption } = setCtx({ orientation, decorative });
|
||||
$$unsubscribe_root = subscribe(root, (value) => $root = value);
|
||||
const attrs = getAttrs("root");
|
||||
if ($$props.orientation === void 0 && $$bindings.orientation && orientation !== void 0)
|
||||
$$bindings.orientation(orientation);
|
||||
if ($$props.decorative === void 0 && $$bindings.decorative && decorative !== void 0)
|
||||
$$bindings.decorative(decorative);
|
||||
if ($$props.asChild === void 0 && $$bindings.asChild && asChild !== void 0)
|
||||
$$bindings.asChild(asChild);
|
||||
{
|
||||
updateOption("orientation", orientation);
|
||||
}
|
||||
{
|
||||
updateOption("decorative", decorative);
|
||||
}
|
||||
builder = $root;
|
||||
$$unsubscribe_root();
|
||||
return `${asChild ? `${slots.default ? slots.default({ builder, attrs }) : ``}` : `<div${spread([escape_object(builder), escape_object($$restProps), escape_object(attrs)], {})}></div>`}`;
|
||||
});
|
||||
const Separator = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let $$restProps = compute_rest_props($$props, ["class", "orientation", "decorative"]);
|
||||
let { class: className = void 0 } = $$props;
|
||||
let { orientation = "horizontal" } = $$props;
|
||||
let { decorative = void 0 } = $$props;
|
||||
if ($$props.class === void 0 && $$bindings.class && className !== void 0)
|
||||
$$bindings.class(className);
|
||||
if ($$props.orientation === void 0 && $$bindings.orientation && orientation !== void 0)
|
||||
$$bindings.orientation(orientation);
|
||||
if ($$props.decorative === void 0 && $$bindings.decorative && decorative !== void 0)
|
||||
$$bindings.decorative(decorative);
|
||||
return `${validate_component(Separator$1, "SeparatorPrimitive.Root").$$render(
|
||||
$$result,
|
||||
Object.assign(
|
||||
{},
|
||||
{
|
||||
class: cn(
|
||||
"shrink-0 bg-border",
|
||||
orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
||||
className
|
||||
)
|
||||
},
|
||||
{ orientation },
|
||||
{ decorative },
|
||||
$$restProps
|
||||
),
|
||||
{},
|
||||
{}
|
||||
)}`;
|
||||
});
|
||||
const Page = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let { data } = $$props;
|
||||
if ($$props.data === void 0 && $$bindings.data && data !== void 0)
|
||||
$$bindings.data(data);
|
||||
return `${$$result.head += `<!-- HEAD_svelte-1j8jcnk_START -->${$$result.title = `<title> ${escape(data.monitor.name)} - Incidents
|
||||
</title>`, ""}<!-- HEAD_svelte-1j8jcnk_END -->`, ""} <section class="mx-auto flex w-full max-w-4xl flex-1 flex-col items-start justify-center"><div class="mx-auto max-w-screen-xl px-4 pt-32 pb-16 lg:flex lg:items-center"><div class="mx-auto max-w-3xl text-center blurry-bg"><h1 class="bg-gradient-to-r from-green-300 via-blue-500 to-purple-600 bg-clip-text text-5xl font-extrabold text-transparent leading-snug">${escape(data.monitor.name)}</h1> <p class="mx-auto mt-4 max-w-xl sm:text-xl">${escape(data.monitor.description)}</p></div></div></section> <section class="mx-auto flex-1 mt-8 flex-col mb-4 flex w-full" id="active_incident"><div class="container"><h1 class="mb-4 text-2xl font-bold leading-none">${validate_component(Badge, "Badge").$$render($$result, { variant: "outline" }, {}, {
|
||||
default: () => {
|
||||
return `Active Incidents`;
|
||||
}
|
||||
})}</h1> ${data.activeIncidents.length > 0 ? `${each(data.activeIncidents, (incident, i) => {
|
||||
return `${validate_component(Incident, "Incident").$$render(
|
||||
$$result,
|
||||
{
|
||||
incident,
|
||||
state: i == 0 ? "open" : "close",
|
||||
variant: "title+body+comments",
|
||||
monitor: data.monitor
|
||||
},
|
||||
{},
|
||||
{}
|
||||
)}`;
|
||||
})}` : `<div class="flex items-center justify-left" data-svelte-h="svelte-dr0k6a"><p class="text-xl">No active incidents</p></div>`}</div></section> ${validate_component(Separator, "Separator").$$render($$result, { class: "container mb-4 w-[400px]" }, {}, {})} <section class="mx-auto flex-1 mt-8 flex-col mb-4 flex w-full" id="active_incident"><div class="container"><h1 class="mb-4 text-2xl font-bold leading-none">${validate_component(Badge, "Badge").$$render($$result, { variant: "outline" }, {}, {
|
||||
default: () => {
|
||||
return `Recent Incidents`;
|
||||
}
|
||||
})}</h1> ${data.pastIncidents.length > 0 ? `${each(data.pastIncidents, (incident) => {
|
||||
return `${validate_component(Incident, "Incident").$$render(
|
||||
$$result,
|
||||
{
|
||||
incident,
|
||||
state: "close",
|
||||
variant: "title+body+comments",
|
||||
monitor: data.monitor
|
||||
},
|
||||
{},
|
||||
{}
|
||||
)}`;
|
||||
})}` : `<div class="flex items-center justify-left" data-svelte-h="svelte-b2l9ix"><p class="text-xl">No recent incidents</p></div>`}</div></section>`;
|
||||
});
|
||||
|
||||
export { Page as default };
|
||||
//# sourceMappingURL=_page.svelte-48e57f95.js.map
|
||||
@@ -1,118 +0,0 @@
|
||||
import { c as create_ssr_component, b as add_attribute, e as escape, v as validate_component, a as each } from './ssr-c85d451a.js';
|
||||
import 'clsx';
|
||||
import { B as Badge, I as Incident, R as Root, T as Trigger, H as Hover_card_content } from './incident-e1bd1794.js';
|
||||
import './ctx-168edc6f.js';
|
||||
import { b as buttonVariants } from './index3-58d8c192.js';
|
||||
import { C as Card, a as Card_content, I as Icon$1 } from './chevron-down-226abe3e.js';
|
||||
import './index2-d9c461ad.js';
|
||||
import './helpers-6076deb3.js';
|
||||
import 'moment';
|
||||
import 'tailwind-variants';
|
||||
import 'tailwind-merge';
|
||||
|
||||
const Arrow_right = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
const iconNode = [["path", { "d": "M5 12h14" }], ["path", { "d": "m12 5 7 7-7 7" }]];
|
||||
return `${validate_component(Icon$1, "Icon").$$render($$result, Object.assign({}, { name: "arrow-right" }, $$props, { iconNode }), {}, {
|
||||
default: () => {
|
||||
return `${slots.default ? slots.default({}) : ``}`;
|
||||
}
|
||||
})}`;
|
||||
});
|
||||
const ArrowRight = Arrow_right;
|
||||
const Monitor = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let { monitor } = $$props;
|
||||
let { localTz } = $$props;
|
||||
let _90Day = monitor.pageData._90Day;
|
||||
let uptime0Day = monitor.pageData.uptime0Day;
|
||||
let uptime90Day = monitor.pageData.uptime90Day;
|
||||
monitor.pageData.dailyUps;
|
||||
monitor.pageData.dailyDown;
|
||||
monitor.pageData.dailyDegraded;
|
||||
let todayDD = Object.keys(_90Day)[Object.keys(_90Day).length - 1];
|
||||
if ($$props.monitor === void 0 && $$bindings.monitor && monitor !== void 0)
|
||||
$$bindings.monitor(monitor);
|
||||
if ($$props.localTz === void 0 && $$bindings.localTz && localTz !== void 0)
|
||||
$$bindings.localTz(localTz);
|
||||
return `<div class="grid grid-cols-12 gap-4 monitor pb-4"><div class="col-span-12 md:col-span-4"><div class="pt-1"><div class="scroll-m-20 text-2xl font-semibold tracking-tight">${monitor.image ? `<img${add_attribute("src", monitor.image, 0)} class="w-6 h-6 inline" alt="" srcset="">` : ``} ${escape(monitor.name)} ${monitor.description ? `${validate_component(Root, "HoverCard.Root").$$render($$result, {}, {}, {
|
||||
default: () => {
|
||||
return `${validate_component(Trigger, "HoverCard.Trigger").$$render($$result, {}, {}, {
|
||||
default: () => {
|
||||
return `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide inline lucide-info"><circle cx="12" cy="12" r="10"></circle><path d="M12 16v-4"></path><path d="M12 8h.01"></path></svg>`;
|
||||
}
|
||||
})} ${validate_component(Hover_card_content, "HoverCard.Content").$$render($$result, { class: "dark:invert" }, {}, {
|
||||
default: () => {
|
||||
return `${escape(monitor.description)}`;
|
||||
}
|
||||
})}`;
|
||||
}
|
||||
})}` : ``}</div></div> <div class="mt-2"><div class="grid grid-cols-2 gap-0"><div class="col-span-2 -mt-2"><a href="${"/incident/" + escape(monitor.folderName, true) + "#past_incident"}" class="${"pt-0 pl-0 pb-0 text-indigo-500 text-left " + escape(buttonVariants({ variant: "link" }), true)}">Recent Incidents ${validate_component(ArrowRight, "ArrowRight").$$render($$result, { size: 16 }, {}, {})}</a></div></div></div></div> <div class="col-span-12 md:col-span-8 pt-2"><div class="grid grid-cols-12"><div class="col-span-12 md:col-span-8 h-[32px]"><button class="inline-block">${validate_component(Badge, "Badge").$$render(
|
||||
$$result,
|
||||
{
|
||||
variant: ""
|
||||
},
|
||||
{},
|
||||
{
|
||||
default: () => {
|
||||
return `90 Day ► ${escape(uptime90Day)}%`;
|
||||
}
|
||||
}
|
||||
)}</button> <button>${validate_component(Badge, "Badge").$$render($$result, { variant: "outline" }, {}, {
|
||||
default: () => {
|
||||
return `Today ► ${escape(uptime0Day)}%`;
|
||||
}
|
||||
})}</button></div> <div class="col-span-12 md:col-span-4 text-right h-[32px]">${_90Day[todayDD] ? `<div class="${"text-api-up md:pr-6 text-sm font-semibold mt-[4px] text-" + escape(_90Day[todayDD].cssClass, true)}">${escape(_90Day[todayDD].message)}</div>` : ``}</div></div> <div class="grid grid-cols-12">${`<div class="chart-status relative mt-1 col-span-12"><div class="flex overflow-x-auto daygrid90 overflow-y-hidden">${each(Object.entries(_90Day), ([ts, bar]) => {
|
||||
return `<div class="h-[30px] w-[6px] rounded-sm oneline"><div class="${"h-[30px] bg-" + escape(bar.cssClass, true) + " w-[4px] rounded-sm mr-[2px]"}"></div></div> <div class="absolute show-hover text-sm bg-background"><div class="${"text-" + escape(bar.cssClass, true) + " font-semibold"}">${bar.message != "No Data" ? `● ${escape(new Date(bar.timestamp * 1e3).toLocaleDateString())} ${escape(bar.message)}` : `● ${escape(new Date(bar.timestamp * 1e3).toLocaleDateString())} ${escape(bar.message)}`}</div> </div>`;
|
||||
})}</div></div>`}</div></div></div>`;
|
||||
});
|
||||
const Page = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let { data } = $$props;
|
||||
let hasActiveIncidents = false;
|
||||
for (let i = 0; i < data.monitors.length; i++) {
|
||||
if (data.monitors[i].activeIncidents.length > 0) {
|
||||
hasActiveIncidents = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($$props.data === void 0 && $$bindings.data && data !== void 0)
|
||||
$$bindings.data(data);
|
||||
return `<div class="mt-32"></div> ${data.site.hero ? `<section class="mx-auto flex w-full max-w-4xl mb-8 flex-1 flex-col items-start justify-center"><div class="mx-auto max-w-screen-xl px-4 lg:flex lg:items-center"><div class="mx-auto max-w-3xl text-center blurry-bg">${data.site.hero.image ? `<img${add_attribute("src", data.site.hero.image, 0)} class="h-16 w-16 m-auto" alt="" srcset="">` : ``} ${data.site.hero.title ? `<h1 class="bg-gradient-to-r from-green-300 via-blue-500 to-purple-600 bg-clip-text text-5xl font-extrabold text-transparent leading-snug">${escape(data.site.hero.title)}</h1>` : ``} ${data.site.hero.subtitle ? `<p class="mx-auto mt-4 max-w-xl sm:text-xl">${escape(data.site.hero.subtitle)}</p>` : ``}</div></div></section>` : ``} ${hasActiveIncidents ? `<section class="mx-auto bg-transparent mb-4 flex w-full max-w-[890px] flex-1 flex-col items-start justify-center" id=""><div class="grid w-full grid-cols-2 gap-4"><div class="col-span-2 md:col-span-1 text-center md:text-left">${validate_component(Badge, "Badge").$$render($$result, { variant: "outline" }, {}, {
|
||||
default: () => {
|
||||
return `Ongoing Incidents`;
|
||||
}
|
||||
})}</div></div></section> <section class="mx-auto backdrop-blur-[2px] mb-8 flex w-full max-w-[890px] flex-1 flex-col items-start justify-center" id="">${each(data.monitors, (monitor) => {
|
||||
return `${each(monitor.activeIncidents, (incident, i) => {
|
||||
return `${validate_component(Incident, "Incident").$$render(
|
||||
$$result,
|
||||
{
|
||||
incident,
|
||||
state: "close",
|
||||
variant: "title+body+comments+monitor",
|
||||
monitor
|
||||
},
|
||||
{},
|
||||
{}
|
||||
)}`;
|
||||
})}`;
|
||||
})}</section>` : ``} ${data.monitors.length > 0 ? `<section class="mx-auto bg-transparent mb-4 flex w-full max-w-[890px] flex-1 flex-col items-start justify-center" id=""><div class="grid w-full grid-cols-2 gap-4"><div class="col-span-2 md:col-span-1 text-center md:text-left">${validate_component(Badge, "Badge").$$render($$result, { class: "", variant: "outline" }, {}, {
|
||||
default: () => {
|
||||
return `Availability per Component`;
|
||||
}
|
||||
})}</div> <div class="col-span-2 md:col-span-1 text-center md:text-right">${validate_component(Badge, "Badge").$$render($$result, { variant: "outline" }, {}, {
|
||||
default: () => {
|
||||
return `<span class="w-[8px] h-[8px] inline-flex rounded-full bg-api-up opacity-75 mr-1"></span> <span class="mr-3" data-svelte-h="svelte-fd8nbr">UP</span> <span class="w-[8px] h-[8px] inline-flex rounded-full bg-api-degraded opacity-75 mr-1"></span> <span class="mr-3" data-svelte-h="svelte-ddctvm">DEGRADED</span> <span class="w-[8px] h-[8px] inline-flex rounded-full bg-api-down opacity-75 mr-1"></span> <span class="mr-3" data-svelte-h="svelte-1o75psw">DOWN</span>`;
|
||||
}
|
||||
})}</div></div></section> <section class="mx-auto backdrop-blur-[2px] mb-8 flex w-full max-w-[890px] flex-1 flex-col items-start justify-center">${validate_component(Card, "Card.Root").$$render($$result, { class: "w-full " }, {}, {
|
||||
default: () => {
|
||||
return `${validate_component(Card_content, "Card.Content").$$render($$result, { class: "p-0 monitors-card" }, {}, {
|
||||
default: () => {
|
||||
return `${each(data.monitors, (monitor) => {
|
||||
return `${validate_component(Monitor, "Monitor").$$render($$result, { monitor, localTz: data.localTz }, {}, {})}`;
|
||||
})}`;
|
||||
}
|
||||
})}`;
|
||||
}
|
||||
})}</section>` : ``}`;
|
||||
});
|
||||
|
||||
export { Page as default };
|
||||
//# sourceMappingURL=_page.svelte-cc95dca1.js.map
|
||||
@@ -1,326 +0,0 @@
|
||||
import { c as create_ssr_component, v as validate_component, a as each, e as escape, f as compute_rest_props, d as subscribe, h as spread, i as escape_object } from './ssr-c85d451a.js';
|
||||
import { marked } from 'marked';
|
||||
import { C as Card, a as Card_content, c as cn, b as ChevronDown, d as createDispatcher, e as cubicOut } from './chevron-down-226abe3e.js';
|
||||
import 'clsx';
|
||||
import { s as setCtx$2, a as setItem, g as getCtx$1, b as getTrigger, c as getContent, d as getAttrs$2 } from './ctx-168edc6f.js';
|
||||
import 'tailwind-merge';
|
||||
import './index2-d9c461ad.js';
|
||||
|
||||
const Accordion = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let builder;
|
||||
let $$restProps = compute_rest_props($$props, ["multiple", "value", "onValueChange", "disabled", "asChild"]);
|
||||
let $root, $$unsubscribe_root;
|
||||
let { multiple = false } = $$props;
|
||||
let { value = void 0 } = $$props;
|
||||
let { onValueChange = void 0 } = $$props;
|
||||
let { disabled = false } = $$props;
|
||||
let { asChild = false } = $$props;
|
||||
const { elements: { root }, states: { value: localValue }, updateOption } = setCtx$2({
|
||||
multiple,
|
||||
disabled,
|
||||
defaultValue: value,
|
||||
onValueChange: ({ next }) => {
|
||||
if (value !== next) {
|
||||
onValueChange?.(next);
|
||||
value = next;
|
||||
}
|
||||
return next;
|
||||
}
|
||||
});
|
||||
$$unsubscribe_root = subscribe(root, (value2) => $root = value2);
|
||||
const attrs = getAttrs$2("root");
|
||||
if ($$props.multiple === void 0 && $$bindings.multiple && multiple !== void 0)
|
||||
$$bindings.multiple(multiple);
|
||||
if ($$props.value === void 0 && $$bindings.value && value !== void 0)
|
||||
$$bindings.value(value);
|
||||
if ($$props.onValueChange === void 0 && $$bindings.onValueChange && onValueChange !== void 0)
|
||||
$$bindings.onValueChange(onValueChange);
|
||||
if ($$props.disabled === void 0 && $$bindings.disabled && disabled !== void 0)
|
||||
$$bindings.disabled(disabled);
|
||||
if ($$props.asChild === void 0 && $$bindings.asChild && asChild !== void 0)
|
||||
$$bindings.asChild(asChild);
|
||||
{
|
||||
localValue.set(value);
|
||||
}
|
||||
{
|
||||
updateOption("multiple", multiple);
|
||||
}
|
||||
{
|
||||
updateOption("disabled", disabled);
|
||||
}
|
||||
builder = $root;
|
||||
$$unsubscribe_root();
|
||||
return `${asChild ? `${slots.default ? slots.default({ builder, attrs }) : ``}` : `<div${spread([escape_object(builder), escape_object($$restProps), escape_object(attrs)], {})}>${slots.default ? slots.default({ builder, attrs }) : ``}</div>`}`;
|
||||
});
|
||||
const AccordionItem = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let builder;
|
||||
let $$restProps = compute_rest_props($$props, ["value", "disabled", "asChild"]);
|
||||
let $item, $$unsubscribe_item;
|
||||
let { value } = $$props;
|
||||
let { disabled = void 0 } = $$props;
|
||||
let { asChild = false } = $$props;
|
||||
const { item, props } = setItem({ value, disabled });
|
||||
$$unsubscribe_item = subscribe(item, (value2) => $item = value2);
|
||||
const attrs = getAttrs$2("item");
|
||||
if ($$props.value === void 0 && $$bindings.value && value !== void 0)
|
||||
$$bindings.value(value);
|
||||
if ($$props.disabled === void 0 && $$bindings.disabled && disabled !== void 0)
|
||||
$$bindings.disabled(disabled);
|
||||
if ($$props.asChild === void 0 && $$bindings.asChild && asChild !== void 0)
|
||||
$$bindings.asChild(asChild);
|
||||
builder = $item(props);
|
||||
$$unsubscribe_item();
|
||||
return `${asChild ? `${slots.default ? slots.default({ builder, attrs }) : ``}` : `<div${spread([escape_object(builder), escape_object($$restProps), escape_object(attrs)], {})}>${slots.default ? slots.default({ builder, attrs }) : ``}</div>`}`;
|
||||
});
|
||||
const AccordionHeader = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let builder;
|
||||
let $$restProps = compute_rest_props($$props, ["level", "asChild"]);
|
||||
let $header, $$unsubscribe_header;
|
||||
let { level = 3 } = $$props;
|
||||
let { asChild = false } = $$props;
|
||||
const { elements: { heading: header } } = getCtx$1();
|
||||
$$unsubscribe_header = subscribe(header, (value) => $header = value);
|
||||
const attrs = getAttrs$2("header");
|
||||
if ($$props.level === void 0 && $$bindings.level && level !== void 0)
|
||||
$$bindings.level(level);
|
||||
if ($$props.asChild === void 0 && $$bindings.asChild && asChild !== void 0)
|
||||
$$bindings.asChild(asChild);
|
||||
builder = $header(level);
|
||||
$$unsubscribe_header();
|
||||
return `${asChild ? `${slots.default ? slots.default({ builder, attrs }) : ``}` : `<div${spread([escape_object(builder), escape_object($$restProps), escape_object(attrs)], {})}>${slots.default ? slots.default({ builder, attrs }) : ``}</div>`}`;
|
||||
});
|
||||
const AccordionTrigger = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let builder;
|
||||
let $$restProps = compute_rest_props($$props, ["asChild"]);
|
||||
let $trigger, $$unsubscribe_trigger;
|
||||
let { asChild = false } = $$props;
|
||||
const { trigger, props } = getTrigger();
|
||||
$$unsubscribe_trigger = subscribe(trigger, (value) => $trigger = value);
|
||||
createDispatcher();
|
||||
const attrs = getAttrs$2("trigger");
|
||||
if ($$props.asChild === void 0 && $$bindings.asChild && asChild !== void 0)
|
||||
$$bindings.asChild(asChild);
|
||||
builder = $trigger(props);
|
||||
$$unsubscribe_trigger();
|
||||
return `${asChild ? `${slots.default ? slots.default({ builder, attrs }) : ``}` : `<button${spread(
|
||||
[
|
||||
escape_object(builder),
|
||||
{ type: "button" },
|
||||
escape_object($$restProps),
|
||||
escape_object(attrs)
|
||||
],
|
||||
{}
|
||||
)}>${slots.default ? slots.default({ builder, attrs }) : ``}</button>`}`;
|
||||
});
|
||||
const AccordionContent = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let builder;
|
||||
let $$restProps = compute_rest_props($$props, [
|
||||
"transition",
|
||||
"transitionConfig",
|
||||
"inTransition",
|
||||
"inTransitionConfig",
|
||||
"outTransition",
|
||||
"outTransitionConfig",
|
||||
"asChild"
|
||||
]);
|
||||
let $content, $$unsubscribe_content;
|
||||
let $isSelected, $$unsubscribe_isSelected;
|
||||
let { transition = void 0 } = $$props;
|
||||
let { transitionConfig = void 0 } = $$props;
|
||||
let { inTransition = void 0 } = $$props;
|
||||
let { inTransitionConfig = void 0 } = $$props;
|
||||
let { outTransition = void 0 } = $$props;
|
||||
let { outTransitionConfig = void 0 } = $$props;
|
||||
let { asChild = false } = $$props;
|
||||
const { content, isSelected, props } = getContent();
|
||||
$$unsubscribe_content = subscribe(content, (value) => $content = value);
|
||||
$$unsubscribe_isSelected = subscribe(isSelected, (value) => $isSelected = value);
|
||||
const attrs = getAttrs$2("content");
|
||||
if ($$props.transition === void 0 && $$bindings.transition && transition !== void 0)
|
||||
$$bindings.transition(transition);
|
||||
if ($$props.transitionConfig === void 0 && $$bindings.transitionConfig && transitionConfig !== void 0)
|
||||
$$bindings.transitionConfig(transitionConfig);
|
||||
if ($$props.inTransition === void 0 && $$bindings.inTransition && inTransition !== void 0)
|
||||
$$bindings.inTransition(inTransition);
|
||||
if ($$props.inTransitionConfig === void 0 && $$bindings.inTransitionConfig && inTransitionConfig !== void 0)
|
||||
$$bindings.inTransitionConfig(inTransitionConfig);
|
||||
if ($$props.outTransition === void 0 && $$bindings.outTransition && outTransition !== void 0)
|
||||
$$bindings.outTransition(outTransition);
|
||||
if ($$props.outTransitionConfig === void 0 && $$bindings.outTransitionConfig && outTransitionConfig !== void 0)
|
||||
$$bindings.outTransitionConfig(outTransitionConfig);
|
||||
if ($$props.asChild === void 0 && $$bindings.asChild && asChild !== void 0)
|
||||
$$bindings.asChild(asChild);
|
||||
builder = $content(props);
|
||||
$$unsubscribe_content();
|
||||
$$unsubscribe_isSelected();
|
||||
return `${asChild && $isSelected(props) ? `${slots.default ? slots.default({ builder, attrs }) : ``}` : `${transition && $isSelected(props) ? `<div${spread([escape_object(builder), escape_object($$restProps), escape_object(attrs)], {})}>${slots.default ? slots.default({ builder, attrs }) : ``}</div>` : `${inTransition && outTransition && $isSelected(props) ? `<div${spread([escape_object(builder), escape_object($$restProps), escape_object(attrs)], {})}>${slots.default ? slots.default({ builder, attrs }) : ``}</div>` : `${inTransition && $isSelected(props) ? `<div${spread(
|
||||
[
|
||||
escape_object(builder),
|
||||
escape_object($$restProps),
|
||||
escape_object(attrs)
|
||||
],
|
||||
{}
|
||||
)}>${slots.default ? slots.default({ builder, attrs }) : ``}</div>` : `${outTransition && $isSelected(props) ? `<div${spread(
|
||||
[
|
||||
escape_object(builder),
|
||||
escape_object($$restProps),
|
||||
escape_object(attrs)
|
||||
],
|
||||
{}
|
||||
)}>${slots.default ? slots.default({ builder, attrs }) : ``}</div>` : `${$isSelected(props) ? `<div${spread(
|
||||
[
|
||||
escape_object(builder),
|
||||
escape_object($$restProps),
|
||||
escape_object(attrs)
|
||||
],
|
||||
{}
|
||||
)}>${slots.default ? slots.default({ builder, attrs }) : ``}</div>` : ``}`}`}`}`}`}`;
|
||||
});
|
||||
function slide(node, { delay = 0, duration = 400, easing = cubicOut, axis = "y" } = {}) {
|
||||
const style = getComputedStyle(node);
|
||||
const opacity = +style.opacity;
|
||||
const primary_property = axis === "y" ? "height" : "width";
|
||||
const primary_property_value = parseFloat(style[primary_property]);
|
||||
const secondary_properties = axis === "y" ? ["top", "bottom"] : ["left", "right"];
|
||||
const capitalized_secondary_properties = secondary_properties.map(
|
||||
(e) => `${e[0].toUpperCase()}${e.slice(1)}`
|
||||
);
|
||||
const padding_start_value = parseFloat(style[`padding${capitalized_secondary_properties[0]}`]);
|
||||
const padding_end_value = parseFloat(style[`padding${capitalized_secondary_properties[1]}`]);
|
||||
const margin_start_value = parseFloat(style[`margin${capitalized_secondary_properties[0]}`]);
|
||||
const margin_end_value = parseFloat(style[`margin${capitalized_secondary_properties[1]}`]);
|
||||
const border_width_start_value = parseFloat(
|
||||
style[`border${capitalized_secondary_properties[0]}Width`]
|
||||
);
|
||||
const border_width_end_value = parseFloat(
|
||||
style[`border${capitalized_secondary_properties[1]}Width`]
|
||||
);
|
||||
return {
|
||||
delay,
|
||||
duration,
|
||||
easing,
|
||||
css: (t) => `overflow: hidden;opacity: ${Math.min(t * 20, 1) * opacity};${primary_property}: ${t * primary_property_value}px;padding-${secondary_properties[0]}: ${t * padding_start_value}px;padding-${secondary_properties[1]}: ${t * padding_end_value}px;margin-${secondary_properties[0]}: ${t * margin_start_value}px;margin-${secondary_properties[1]}: ${t * margin_end_value}px;border-${secondary_properties[0]}-width: ${t * border_width_start_value}px;border-${secondary_properties[1]}-width: ${t * border_width_end_value}px;`
|
||||
};
|
||||
}
|
||||
const Accordion_content = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let $$restProps = compute_rest_props($$props, ["class", "transition", "transitionConfig"]);
|
||||
let { class: className = void 0 } = $$props;
|
||||
let { transition = slide } = $$props;
|
||||
let { transitionConfig = { duration: 200 } } = $$props;
|
||||
if ($$props.class === void 0 && $$bindings.class && className !== void 0)
|
||||
$$bindings.class(className);
|
||||
if ($$props.transition === void 0 && $$bindings.transition && transition !== void 0)
|
||||
$$bindings.transition(transition);
|
||||
if ($$props.transitionConfig === void 0 && $$bindings.transitionConfig && transitionConfig !== void 0)
|
||||
$$bindings.transitionConfig(transitionConfig);
|
||||
return `${validate_component(AccordionContent, "AccordionPrimitive.Content").$$render(
|
||||
$$result,
|
||||
Object.assign(
|
||||
{},
|
||||
{
|
||||
class: cn("overflow-hidden text-sm transition-all", className)
|
||||
},
|
||||
{ transition },
|
||||
{ transitionConfig },
|
||||
$$restProps
|
||||
),
|
||||
{},
|
||||
{
|
||||
default: () => {
|
||||
return `<div class="pb-4 pt-0">${slots.default ? slots.default({}) : ``}</div>`;
|
||||
}
|
||||
}
|
||||
)}`;
|
||||
});
|
||||
const Accordion_item = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let $$restProps = compute_rest_props($$props, ["class", "value"]);
|
||||
let { class: className = void 0 } = $$props;
|
||||
let { value } = $$props;
|
||||
if ($$props.class === void 0 && $$bindings.class && className !== void 0)
|
||||
$$bindings.class(className);
|
||||
if ($$props.value === void 0 && $$bindings.value && value !== void 0)
|
||||
$$bindings.value(value);
|
||||
return `${validate_component(AccordionItem, "AccordionPrimitive.Item").$$render($$result, Object.assign({}, { value }, { class: cn("border-b", className) }, $$restProps), {}, {
|
||||
default: () => {
|
||||
return `${slots.default ? slots.default({}) : ``}`;
|
||||
}
|
||||
})}`;
|
||||
});
|
||||
const Accordion_trigger = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let $$restProps = compute_rest_props($$props, ["class", "level"]);
|
||||
let { class: className = void 0 } = $$props;
|
||||
let { level = 3 } = $$props;
|
||||
if ($$props.class === void 0 && $$bindings.class && className !== void 0)
|
||||
$$bindings.class(className);
|
||||
if ($$props.level === void 0 && $$bindings.level && level !== void 0)
|
||||
$$bindings.level(level);
|
||||
return `${validate_component(AccordionHeader, "AccordionPrimitive.Header").$$render($$result, { level, class: "flex" }, {}, {
|
||||
default: () => {
|
||||
return `${validate_component(AccordionTrigger, "AccordionPrimitive.Trigger").$$render(
|
||||
$$result,
|
||||
Object.assign(
|
||||
{},
|
||||
{
|
||||
class: cn("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180", className)
|
||||
},
|
||||
$$restProps
|
||||
),
|
||||
{},
|
||||
{
|
||||
default: () => {
|
||||
return `${slots.default ? slots.default({}) : ``} ${validate_component(ChevronDown, "ChevronDown").$$render(
|
||||
$$result,
|
||||
{
|
||||
class: "h-4 w-4 transition-transform duration-200"
|
||||
},
|
||||
{},
|
||||
{}
|
||||
)}`;
|
||||
}
|
||||
}
|
||||
)}`;
|
||||
}
|
||||
})}`;
|
||||
});
|
||||
const Root = Accordion;
|
||||
const Page = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let { data } = $$props;
|
||||
let html = marked.parse(data.md);
|
||||
let sideBar = [];
|
||||
if ($$props.data === void 0 && $$bindings.data && data !== void 0)
|
||||
$$bindings.data(data);
|
||||
return `${$$result.head += `<!-- HEAD_svelte-tjl0wq_START -->${$$result.title = `<title>
|
||||
Kener Documentation
|
||||
</title>`, ""}<!-- HEAD_svelte-tjl0wq_END -->`, ""} <section class="mx-auto container rounded-3xl scroll-smooth mt-8">${validate_component(Card, "Card.Root").$$render($$result, {}, {}, {
|
||||
default: () => {
|
||||
return `${validate_component(Card_content, "Card.Content").$$render($$result, { class: "px-1" }, {}, {
|
||||
default: () => {
|
||||
return `<div class="grid grid-cols-5 gap-4"><div class="col-span-5 md:col-span-1 pt-2 hidden md:block pr-1 border-r-2 border-secondary sticky top-0 overflow-y-auto max-h-screen">${each(sideBar, (item) => {
|
||||
return `${validate_component(Root, "Accordion.Root").$$render($$result, {}, {}, {
|
||||
default: () => {
|
||||
return `${validate_component(Accordion_item, "Accordion.Item").$$render($$result, { value: item.id }, {}, {
|
||||
default: () => {
|
||||
return `${validate_component(Accordion_trigger, "Accordion.Trigger").$$render($$result, { class: "text-sm font-semibold pl-2 pr-3" }, {}, {
|
||||
default: () => {
|
||||
return `<a href="${"#" + escape(item.id, true)}" class="sidebar-a">${escape(item.text)}</a> `;
|
||||
}
|
||||
})} ${validate_component(Accordion_content, "Accordion.Content").$$render($$result, {}, {}, {
|
||||
default: () => {
|
||||
return ` <ul class="text-sm font-medium pl-6">${each(item.children, (child) => {
|
||||
return `<li class="w-full py-2"><a href="${"#" + escape(child.id, true)}" class="sidebar-a">${escape(child.text)}</a> </li>`;
|
||||
})}</ul> `;
|
||||
}
|
||||
})} `;
|
||||
}
|
||||
})} `;
|
||||
}
|
||||
})}`;
|
||||
})}</div> <div class="col-span-5 md:col-span-4"><div class="pt-6 p-0 md:p-10 "><article id="markdown" class="prose prose-stone max-w-none dark:prose-invert dark:prose-pre:bg-neutral-900 prose-code:py-[0.2rem] prose-code:font-normal prose-code:font-mono prose-code:text-sm prose-code:rounded"><!-- HTML_TAG_START -->${html}<!-- HTML_TAG_END --></article></div></div></div>`;
|
||||
}
|
||||
})}`;
|
||||
}
|
||||
})}</section>`;
|
||||
});
|
||||
|
||||
export { Page as default };
|
||||
//# sourceMappingURL=_page.svelte-dcde5ae6.js.map
|
||||
@@ -1,31 +0,0 @@
|
||||
import { p as public_env } from './shared-server-58a5f352.js';
|
||||
import fs from 'fs-extra';
|
||||
import { b as StatusColor } from './helpers-6076deb3.js';
|
||||
import { makeBadge } from 'badge-maker';
|
||||
|
||||
const monitors = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/monitors.json", "utf8"));
|
||||
async function GET({ params, setHeaders, url }) {
|
||||
const { path0Day, name } = monitors.find((monitor) => monitor.tag === params.tag);
|
||||
const dayData = JSON.parse(fs.readFileSync(path0Day, "utf8"));
|
||||
const lastObj = dayData[Object.keys(dayData)[Object.keys(dayData).length - 1]];
|
||||
const query = url.searchParams;
|
||||
const labelColor = query.get("labelColor") || "#333";
|
||||
const color = query.get("color") || StatusColor[lastObj.status];
|
||||
const style = query.get("style") || "flat";
|
||||
const format = {
|
||||
label: name,
|
||||
message: lastObj.status,
|
||||
color,
|
||||
labelColor,
|
||||
style
|
||||
};
|
||||
const svg = makeBadge(format);
|
||||
return new Response(svg, {
|
||||
headers: {
|
||||
"Content-Type": "image/svg+xml"
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export { GET };
|
||||
//# sourceMappingURL=_server-07e8e63c.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"_server-07e8e63c.js","sources":["../../../.svelte-kit/adapter-node/entries/endpoints/badge/_tag_/status/_server.js"],"sourcesContent":["import { p as public_env } from \"../../../../../chunks/shared-server.js\";\nimport fs from \"fs-extra\";\nimport { a as StatusColor } from \"../../../../../chunks/helpers.js\";\nimport { makeBadge } from \"badge-maker\";\nconst monitors = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + \"/monitors.json\", \"utf8\"));\nasync function GET({ params, setHeaders, url }) {\n const { path0Day, name } = monitors.find((monitor) => monitor.tag === params.tag);\n const dayData = JSON.parse(fs.readFileSync(path0Day, \"utf8\"));\n const lastObj = dayData[Object.keys(dayData)[Object.keys(dayData).length - 1]];\n const query = url.searchParams;\n const labelColor = query.get(\"labelColor\") || \"#333\";\n const color = query.get(\"color\") || StatusColor[lastObj.status];\n const style = query.get(\"style\") || \"flat\";\n const format = {\n label: name,\n message: lastObj.status,\n color,\n labelColor,\n style\n };\n const svg = makeBadge(format);\n return new Response(svg, {\n headers: {\n \"Content-Type\": \"image/svg+xml\"\n }\n });\n}\nexport {\n GET\n};\n"],"names":[],"mappings":";;;;;AAIA,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,mBAAmB,GAAG,gBAAgB,EAAE,MAAM,CAAC,CAAC,CAAC;AACxG,eAAe,GAAG,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,EAAE;AAChD,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,GAAG,KAAK,MAAM,CAAC,GAAG,CAAC,CAAC;AACpF,EAAE,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;AAChE,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;AACjF,EAAE,MAAM,KAAK,GAAG,GAAG,CAAC,YAAY,CAAC;AACjC,EAAE,MAAM,UAAU,GAAG,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,MAAM,CAAC;AACvD,EAAE,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AAClE,EAAE,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC;AAC7C,EAAE,MAAM,MAAM,GAAG;AACjB,IAAI,KAAK,EAAE,IAAI;AACf,IAAI,OAAO,EAAE,OAAO,CAAC,MAAM;AAC3B,IAAI,KAAK;AACT,IAAI,UAAU;AACd,IAAI,KAAK;AACT,GAAG,CAAC;AACJ,EAAE,MAAM,GAAG,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;AAChC,EAAE,OAAO,IAAI,QAAQ,CAAC,GAAG,EAAE;AAC3B,IAAI,OAAO,EAAE;AACb,MAAM,cAAc,EAAE,eAAe;AACrC,KAAK;AACL,GAAG,CAAC,CAAC;AACL;;;;"}
|
||||
@@ -1,74 +0,0 @@
|
||||
import { j as json } from './index-2b68e648.js';
|
||||
import { a as auth, P as ParseIncidentPayload, G as GHIssueToKenerIncident } from './webhook-bd364d16.js';
|
||||
import { U as UpdateIssue, a as GetIncidentByNumber } from './github-54c09baa.js';
|
||||
import { p as public_env } from './shared-server-58a5f352.js';
|
||||
import fs from 'fs-extra';
|
||||
import './tool-153dc604.js';
|
||||
import 'randomstring';
|
||||
import 'axios';
|
||||
import 'marked';
|
||||
|
||||
async function PATCH({ request, params }) {
|
||||
const authError = auth(request);
|
||||
if (authError !== null) {
|
||||
return json(
|
||||
{ error: authError.message },
|
||||
{
|
||||
status: 401
|
||||
}
|
||||
);
|
||||
}
|
||||
const incidentNumber = params.incidentNumber;
|
||||
const payload = await request.json();
|
||||
if (!incidentNumber || isNaN(incidentNumber)) {
|
||||
return json(
|
||||
{ error: "Invalid incidentNumber" },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
let { title, body, githubLabels, error } = ParseIncidentPayload(payload);
|
||||
if (error) {
|
||||
return json(
|
||||
{ error },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
let site = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/site.json", "utf8"));
|
||||
let github = site.github;
|
||||
let resp = await UpdateIssue(github, incidentNumber, title, body, githubLabels);
|
||||
if (resp === null) {
|
||||
return json(
|
||||
{ error: "github error" },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
return json(GHIssueToKenerIncident(resp), {
|
||||
status: 200
|
||||
});
|
||||
}
|
||||
async function GET({ request, params }) {
|
||||
const incidentNumber = params.incidentNumber;
|
||||
let site = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/site.json", "utf8"));
|
||||
let github = site.github;
|
||||
let issue = await GetIncidentByNumber(github, incidentNumber);
|
||||
if (issue === null) {
|
||||
return json(
|
||||
{ error: "incident not found" },
|
||||
{
|
||||
status: 404
|
||||
}
|
||||
);
|
||||
}
|
||||
return json(GHIssueToKenerIncident(issue), {
|
||||
status: 200
|
||||
});
|
||||
}
|
||||
|
||||
export { GET, PATCH };
|
||||
//# sourceMappingURL=_server-21dfbd18.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"_server-21dfbd18.js","sources":["../../../.svelte-kit/adapter-node/entries/endpoints/api/incident/_incidentNumber_/_server.js"],"sourcesContent":["import { j as json } from \"../../../../../chunks/index.js\";\nimport { a as auth, P as ParseIncidentPayload, G as GHIssueToKenerIncident } from \"../../../../../chunks/webhook.js\";\nimport { U as UpdateIssue, G as GetIncidentByNumber } from \"../../../../../chunks/github.js\";\nimport { p as public_env } from \"../../../../../chunks/shared-server.js\";\nimport fs from \"fs-extra\";\nasync function PATCH({ request, params }) {\n const authError = auth(request);\n if (authError !== null) {\n return json(\n { error: authError.message },\n {\n status: 401\n }\n );\n }\n const incidentNumber = params.incidentNumber;\n const payload = await request.json();\n if (!incidentNumber || isNaN(incidentNumber)) {\n return json(\n { error: \"Invalid incidentNumber\" },\n {\n status: 400\n }\n );\n }\n let { title, body, githubLabels, error } = ParseIncidentPayload(payload);\n if (error) {\n return json(\n { error },\n {\n status: 400\n }\n );\n }\n let site = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + \"/site.json\", \"utf8\"));\n let github = site.github;\n let resp = await UpdateIssue(github, incidentNumber, title, body, githubLabels);\n if (resp === null) {\n return json(\n { error: \"github error\" },\n {\n status: 400\n }\n );\n }\n return json(GHIssueToKenerIncident(resp), {\n status: 200\n });\n}\nasync function GET({ request, params }) {\n const incidentNumber = params.incidentNumber;\n let site = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + \"/site.json\", \"utf8\"));\n let github = site.github;\n let issue = await GetIncidentByNumber(github, incidentNumber);\n if (issue === null) {\n return json(\n { error: \"incident not found\" },\n {\n status: 404\n }\n );\n }\n return json(GHIssueToKenerIncident(issue), {\n status: 200\n });\n}\nexport {\n GET,\n PATCH\n};\n"],"names":[],"mappings":";;;;;;;;;;AAKA,eAAe,KAAK,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;AAC1C,EAAE,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;AAClC,EAAE,IAAI,SAAS,KAAK,IAAI,EAAE;AAC1B,IAAI,OAAO,IAAI;AACf,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,OAAO,EAAE;AAClC,MAAM;AACN,QAAQ,MAAM,EAAE,GAAG;AACnB,OAAO;AACP,KAAK,CAAC;AACN,GAAG;AACH,EAAE,MAAM,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;AAC/C,EAAE,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,IAAI,EAAE,CAAC;AACvC,EAAE,IAAI,CAAC,cAAc,IAAI,KAAK,CAAC,cAAc,CAAC,EAAE;AAChD,IAAI,OAAO,IAAI;AACf,MAAM,EAAE,KAAK,EAAE,wBAAwB,EAAE;AACzC,MAAM;AACN,QAAQ,MAAM,EAAE,GAAG;AACnB,OAAO;AACP,KAAK,CAAC;AACN,GAAG;AACH,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC3E,EAAE,IAAI,KAAK,EAAE;AACb,IAAI,OAAO,IAAI;AACf,MAAM,EAAE,KAAK,EAAE;AACf,MAAM;AACN,QAAQ,MAAM,EAAE,GAAG;AACnB,OAAO;AACP,KAAK,CAAC;AACN,GAAG;AACH,EAAE,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,mBAAmB,GAAG,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;AAChG,EAAE,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAC3B,EAAE,IAAI,IAAI,GAAG,MAAM,WAAW,CAAC,MAAM,EAAE,cAAc,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;AAClF,EAAE,IAAI,IAAI,KAAK,IAAI,EAAE;AACrB,IAAI,OAAO,IAAI;AACf,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE;AAC/B,MAAM;AACN,QAAQ,MAAM,EAAE,GAAG;AACnB,OAAO;AACP,KAAK,CAAC;AACN,GAAG;AACH,EAAE,OAAO,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,EAAE;AAC5C,IAAI,MAAM,EAAE,GAAG;AACf,GAAG,CAAC,CAAC;AACL,CAAC;AACD,eAAe,GAAG,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;AACxC,EAAE,MAAM,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;AAC/C,EAAE,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,mBAAmB,GAAG,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;AAChG,EAAE,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAC3B,EAAE,IAAI,KAAK,GAAG,MAAM,mBAAmB,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AAChE,EAAE,IAAI,KAAK,KAAK,IAAI,EAAE;AACtB,IAAI,OAAO,IAAI;AACf,MAAM,EAAE,KAAK,EAAE,oBAAoB,EAAE;AACrC,MAAM;AACN,QAAQ,MAAM,EAAE,GAAG;AACnB,OAAO;AACP,KAAK,CAAC;AACN,GAAG;AACH,EAAE,OAAO,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC,EAAE;AAC7C,IAAI,MAAM,EAAE,GAAG;AACf,GAAG,CAAC,CAAC;AACL;;;;"}
|
||||
@@ -1,34 +0,0 @@
|
||||
import fs from 'fs-extra';
|
||||
import { j as json } from './index-2b68e648.js';
|
||||
import { G as GetMinuteStartNowTimestampUTC, B as BeginingOfDay } from './tool-153dc604.js';
|
||||
import { S as StatusObj } from './helpers-6076deb3.js';
|
||||
|
||||
async function POST({ request }) {
|
||||
const payload = await request.json();
|
||||
const monitor = payload.monitor;
|
||||
const localTz = payload.localTz;
|
||||
let _0Day = {};
|
||||
const now = GetMinuteStartNowTimestampUTC();
|
||||
const midnight = BeginingOfDay({ timeZone: localTz });
|
||||
for (let i = midnight; i <= now; i += 60) {
|
||||
_0Day[i] = {
|
||||
timestamp: i,
|
||||
status: "NO_DATA",
|
||||
cssClass: StatusObj.NO_DATA,
|
||||
index: (i - midnight) / 60
|
||||
};
|
||||
}
|
||||
let day0 = JSON.parse(fs.readFileSync(monitor.path0Day, "utf8"));
|
||||
for (const timestamp in day0) {
|
||||
const element = day0[timestamp];
|
||||
let status = element.status;
|
||||
if (_0Day[timestamp] !== void 0) {
|
||||
_0Day[timestamp].status = status;
|
||||
_0Day[timestamp].cssClass = StatusObj[status];
|
||||
}
|
||||
}
|
||||
return json(_0Day);
|
||||
}
|
||||
|
||||
export { POST };
|
||||
//# sourceMappingURL=_server-30ce804a.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"_server-30ce804a.js","sources":["../../../.svelte-kit/adapter-node/entries/endpoints/api/today/_server.js"],"sourcesContent":["import fs from \"fs-extra\";\nimport { j as json } from \"../../../../chunks/index.js\";\nimport { b as GetMinuteStartNowTimestampUTC, B as BeginingOfDay } from \"../../../../chunks/tool.js\";\nimport { S as StatusObj } from \"../../../../chunks/helpers.js\";\nasync function POST({ request }) {\n const payload = await request.json();\n const monitor = payload.monitor;\n const localTz = payload.localTz;\n let _0Day = {};\n const now = GetMinuteStartNowTimestampUTC();\n const midnight = BeginingOfDay({ timeZone: localTz });\n for (let i = midnight; i <= now; i += 60) {\n _0Day[i] = {\n timestamp: i,\n status: \"NO_DATA\",\n cssClass: StatusObj.NO_DATA,\n index: (i - midnight) / 60\n };\n }\n let day0 = JSON.parse(fs.readFileSync(monitor.path0Day, \"utf8\"));\n for (const timestamp in day0) {\n const element = day0[timestamp];\n let status = element.status;\n if (_0Day[timestamp] !== void 0) {\n _0Day[timestamp].status = status;\n _0Day[timestamp].cssClass = StatusObj[status];\n }\n }\n return json(_0Day);\n}\nexport {\n POST\n};\n"],"names":[],"mappings":";;;;;AAIA,eAAe,IAAI,CAAC,EAAE,OAAO,EAAE,EAAE;AACjC,EAAE,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,IAAI,EAAE,CAAC;AACvC,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;AAClC,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;AAClC,EAAE,IAAI,KAAK,GAAG,EAAE,CAAC;AACjB,EAAE,MAAM,GAAG,GAAG,6BAA6B,EAAE,CAAC;AAC9C,EAAE,MAAM,QAAQ,GAAG,aAAa,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;AACxD,EAAE,KAAK,IAAI,CAAC,GAAG,QAAQ,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE;AAC5C,IAAI,KAAK,CAAC,CAAC,CAAC,GAAG;AACf,MAAM,SAAS,EAAE,CAAC;AAClB,MAAM,MAAM,EAAE,SAAS;AACvB,MAAM,QAAQ,EAAE,SAAS,CAAC,OAAO;AACjC,MAAM,KAAK,EAAE,CAAC,CAAC,GAAG,QAAQ,IAAI,EAAE;AAChC,KAAK,CAAC;AACN,GAAG;AACH,EAAE,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;AACnE,EAAE,KAAK,MAAM,SAAS,IAAI,IAAI,EAAE;AAChC,IAAI,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC;AACpC,IAAI,IAAI,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;AAChC,IAAI,IAAI,KAAK,CAAC,SAAS,CAAC,KAAK,KAAK,CAAC,EAAE;AACrC,MAAM,KAAK,CAAC,SAAS,CAAC,CAAC,MAAM,GAAG,MAAM,CAAC;AACvC,MAAM,KAAK,CAAC,SAAS,CAAC,CAAC,QAAQ,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;AACpD,KAAK;AACL,GAAG;AACH,EAAE,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;AACrB;;;;"}
|
||||
@@ -1,48 +0,0 @@
|
||||
import { j as json } from './index-2b68e648.js';
|
||||
import { a as auth, P as ParseIncidentPayload, G as GHIssueToKenerIncident } from './webhook-bd364d16.js';
|
||||
import { C as CreateIssue } from './github-54c09baa.js';
|
||||
import { p as public_env } from './shared-server-58a5f352.js';
|
||||
import fs from 'fs-extra';
|
||||
import './tool-153dc604.js';
|
||||
import 'randomstring';
|
||||
import 'axios';
|
||||
import 'marked';
|
||||
|
||||
async function POST({ request }) {
|
||||
const payload = await request.json();
|
||||
const authError = auth(request);
|
||||
if (authError !== null) {
|
||||
return json(
|
||||
{ error: authError.message },
|
||||
{
|
||||
status: 401
|
||||
}
|
||||
);
|
||||
}
|
||||
let { title, body, githubLabels, error } = ParseIncidentPayload(payload);
|
||||
if (error) {
|
||||
return json(
|
||||
{ error },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
let site = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/site.json", "utf8"));
|
||||
let github = site.github;
|
||||
let resp = await CreateIssue(github, title, body, githubLabels);
|
||||
if (resp === null) {
|
||||
return json(
|
||||
{ error: "github error" },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
return json(GHIssueToKenerIncident(resp), {
|
||||
status: 200
|
||||
});
|
||||
}
|
||||
|
||||
export { POST };
|
||||
//# sourceMappingURL=_server-589e42d1.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"_server-589e42d1.js","sources":["../../../.svelte-kit/adapter-node/entries/endpoints/api/incident/_server.js"],"sourcesContent":["import { j as json } from \"../../../../chunks/index.js\";\nimport { a as auth, P as ParseIncidentPayload, G as GHIssueToKenerIncident } from \"../../../../chunks/webhook.js\";\nimport { C as CreateIssue } from \"../../../../chunks/github.js\";\nimport { p as public_env } from \"../../../../chunks/shared-server.js\";\nimport fs from \"fs-extra\";\nasync function POST({ request }) {\n const payload = await request.json();\n const authError = auth(request);\n if (authError !== null) {\n return json(\n { error: authError.message },\n {\n status: 401\n }\n );\n }\n let { title, body, githubLabels, error } = ParseIncidentPayload(payload);\n if (error) {\n return json(\n { error },\n {\n status: 400\n }\n );\n }\n let site = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + \"/site.json\", \"utf8\"));\n let github = site.github;\n let resp = await CreateIssue(github, title, body, githubLabels);\n if (resp === null) {\n return json(\n { error: \"github error\" },\n {\n status: 400\n }\n );\n }\n return json(GHIssueToKenerIncident(resp), {\n status: 200\n });\n}\nexport {\n POST\n};\n"],"names":[],"mappings":";;;;;;;;;;AAKA,eAAe,IAAI,CAAC,EAAE,OAAO,EAAE,EAAE;AACjC,EAAE,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,IAAI,EAAE,CAAC;AACvC,EAAE,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;AAClC,EAAE,IAAI,SAAS,KAAK,IAAI,EAAE;AAC1B,IAAI,OAAO,IAAI;AACf,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,OAAO,EAAE;AAClC,MAAM;AACN,QAAQ,MAAM,EAAE,GAAG;AACnB,OAAO;AACP,KAAK,CAAC;AACN,GAAG;AACH,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC3E,EAAE,IAAI,KAAK,EAAE;AACb,IAAI,OAAO,IAAI;AACf,MAAM,EAAE,KAAK,EAAE;AACf,MAAM;AACN,QAAQ,MAAM,EAAE,GAAG;AACnB,OAAO;AACP,KAAK,CAAC;AACN,GAAG;AACH,EAAE,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,mBAAmB,GAAG,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;AAChG,EAAE,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAC3B,EAAE,IAAI,IAAI,GAAG,MAAM,WAAW,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;AAClE,EAAE,IAAI,IAAI,KAAK,IAAI,EAAE;AACrB,IAAI,OAAO,IAAI;AACf,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE;AAC/B,MAAM;AACN,QAAQ,MAAM,EAAE,GAAG;AACnB,OAAO;AACP,KAAK,CAAC;AACN,GAAG;AACH,EAAE,OAAO,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,EAAE;AAC5C,IAAI,MAAM,EAAE,GAAG;AACf,GAAG,CAAC,CAAC;AACL;;;;"}
|
||||
@@ -1,50 +0,0 @@
|
||||
import { p as public_env } from './shared-server-58a5f352.js';
|
||||
import fs from 'fs-extra';
|
||||
import { P as ParseUptime } from './helpers-6076deb3.js';
|
||||
import { makeBadge } from 'badge-maker';
|
||||
|
||||
const monitors = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/monitors.json", "utf8"));
|
||||
async function GET({ params, url }) {
|
||||
const { path0Day, name } = monitors.find((monitor) => monitor.tag === params.tag);
|
||||
const dayData = JSON.parse(fs.readFileSync(path0Day, "utf8"));
|
||||
const query = url.searchParams;
|
||||
const rangeInSeconds = query.get("sinceLast") || 90 * 24 * 60 * 60;
|
||||
const now = Math.floor(Date.now() / 1e3);
|
||||
const since = now - rangeInSeconds;
|
||||
let ups = 0;
|
||||
let downs = 0;
|
||||
let degradeds = 0;
|
||||
for (const timestamp in dayData) {
|
||||
if (timestamp < since) {
|
||||
continue;
|
||||
}
|
||||
const obj = dayData[timestamp];
|
||||
if (obj.status == "UP") {
|
||||
ups++;
|
||||
} else if (obj.status == "DEGRADED") {
|
||||
degradeds++;
|
||||
} else if (obj.status == "DOWN") {
|
||||
downs++;
|
||||
}
|
||||
}
|
||||
let uptime = ParseUptime(ups + degradeds, ups + degradeds + downs) + "%";
|
||||
const labelColor = query.get("labelColor") || "#333";
|
||||
const color = query.get("color") || "#0079FF";
|
||||
const style = query.get("style") || "flat";
|
||||
const format = {
|
||||
label: name,
|
||||
message: uptime,
|
||||
color,
|
||||
labelColor,
|
||||
style
|
||||
};
|
||||
const svg = makeBadge(format);
|
||||
return new Response(svg, {
|
||||
headers: {
|
||||
"Content-Type": "image/svg+xml"
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export { GET };
|
||||
//# sourceMappingURL=_server-8ff593c4.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"_server-8ff593c4.js","sources":["../../../.svelte-kit/adapter-node/entries/endpoints/badge/_tag_/uptime/_server.js"],"sourcesContent":["import { p as public_env } from \"../../../../../chunks/shared-server.js\";\nimport fs from \"fs-extra\";\nimport { P as ParseUptime } from \"../../../../../chunks/helpers.js\";\nimport { makeBadge } from \"badge-maker\";\nconst monitors = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + \"/monitors.json\", \"utf8\"));\nasync function GET({ params, url }) {\n const { path0Day, name } = monitors.find((monitor) => monitor.tag === params.tag);\n const dayData = JSON.parse(fs.readFileSync(path0Day, \"utf8\"));\n const query = url.searchParams;\n const rangeInSeconds = query.get(\"sinceLast\") || 90 * 24 * 60 * 60;\n const now = Math.floor(Date.now() / 1e3);\n const since = now - rangeInSeconds;\n let ups = 0;\n let downs = 0;\n let degradeds = 0;\n for (const timestamp in dayData) {\n if (timestamp < since) {\n continue;\n }\n const obj = dayData[timestamp];\n if (obj.status == \"UP\") {\n ups++;\n } else if (obj.status == \"DEGRADED\") {\n degradeds++;\n } else if (obj.status == \"DOWN\") {\n downs++;\n }\n }\n let uptime = ParseUptime(ups + degradeds, ups + degradeds + downs) + \"%\";\n const labelColor = query.get(\"labelColor\") || \"#333\";\n const color = query.get(\"color\") || \"#0079FF\";\n const style = query.get(\"style\") || \"flat\";\n const format = {\n label: name,\n message: uptime,\n color,\n labelColor,\n style\n };\n const svg = makeBadge(format);\n return new Response(svg, {\n headers: {\n \"Content-Type\": \"image/svg+xml\"\n }\n });\n}\nexport {\n GET\n};\n"],"names":[],"mappings":";;;;;AAIA,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,mBAAmB,GAAG,gBAAgB,EAAE,MAAM,CAAC,CAAC,CAAC;AACxG,eAAe,GAAG,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE;AACpC,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,GAAG,KAAK,MAAM,CAAC,GAAG,CAAC,CAAC;AACpF,EAAE,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;AAChE,EAAE,MAAM,KAAK,GAAG,GAAG,CAAC,YAAY,CAAC;AACjC,EAAE,MAAM,cAAc,GAAG,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AACrE,EAAE,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,CAAC,CAAC;AAC3C,EAAE,MAAM,KAAK,GAAG,GAAG,GAAG,cAAc,CAAC;AACrC,EAAE,IAAI,GAAG,GAAG,CAAC,CAAC;AACd,EAAE,IAAI,KAAK,GAAG,CAAC,CAAC;AAChB,EAAE,IAAI,SAAS,GAAG,CAAC,CAAC;AACpB,EAAE,KAAK,MAAM,SAAS,IAAI,OAAO,EAAE;AACnC,IAAI,IAAI,SAAS,GAAG,KAAK,EAAE;AAC3B,MAAM,SAAS;AACf,KAAK;AACL,IAAI,MAAM,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AACnC,IAAI,IAAI,GAAG,CAAC,MAAM,IAAI,IAAI,EAAE;AAC5B,MAAM,GAAG,EAAE,CAAC;AACZ,KAAK,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,UAAU,EAAE;AACzC,MAAM,SAAS,EAAE,CAAC;AAClB,KAAK,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,MAAM,EAAE;AACrC,MAAM,KAAK,EAAE,CAAC;AACd,KAAK;AACL,GAAG;AACH,EAAE,IAAI,MAAM,GAAG,WAAW,CAAC,GAAG,GAAG,SAAS,EAAE,GAAG,GAAG,SAAS,GAAG,KAAK,CAAC,GAAG,GAAG,CAAC;AAC3E,EAAE,MAAM,UAAU,GAAG,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,MAAM,CAAC;AACvD,EAAE,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,SAAS,CAAC;AAChD,EAAE,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC;AAC7C,EAAE,MAAM,MAAM,GAAG;AACjB,IAAI,KAAK,EAAE,IAAI;AACf,IAAI,OAAO,EAAE,MAAM;AACnB,IAAI,KAAK;AACT,IAAI,UAAU;AACd,IAAI,KAAK;AACT,GAAG,CAAC;AACJ,EAAE,MAAM,GAAG,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;AAChC,EAAE,OAAO,IAAI,QAAQ,CAAC,GAAG,EAAE;AAC3B,IAAI,OAAO,EAAE;AACb,MAAM,cAAc,EAAE,eAAe;AACrC,KAAK;AACL,GAAG,CAAC,CAAC;AACL;;;;"}
|
||||
@@ -1,99 +0,0 @@
|
||||
import { j as json } from './index-2b68e648.js';
|
||||
import { a as auth } from './webhook-bd364d16.js';
|
||||
import { b as GetCommentsForIssue, A as AddComment } from './github-54c09baa.js';
|
||||
import { p as public_env } from './shared-server-58a5f352.js';
|
||||
import fs from 'fs-extra';
|
||||
import './tool-153dc604.js';
|
||||
import 'randomstring';
|
||||
import 'axios';
|
||||
import 'marked';
|
||||
|
||||
async function GET({ request, params }) {
|
||||
const authError = auth(request);
|
||||
if (authError !== null) {
|
||||
return json(
|
||||
{ error: authError.message },
|
||||
{
|
||||
status: 401
|
||||
}
|
||||
);
|
||||
}
|
||||
const incidentNumber = params.incidentNumber;
|
||||
if (!incidentNumber || isNaN(incidentNumber)) {
|
||||
return json(
|
||||
{ error: "Invalid incidentNumber" },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
let site = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/site.json", "utf8"));
|
||||
let github = site.github;
|
||||
let resp = await GetCommentsForIssue(incidentNumber, github);
|
||||
return json(
|
||||
resp.map((comment) => {
|
||||
return {
|
||||
commentID: comment.id,
|
||||
body: comment.body,
|
||||
createdAt: Math.floor(new Date(comment.created_at).getTime() / 1e3)
|
||||
};
|
||||
}),
|
||||
{
|
||||
status: 200
|
||||
}
|
||||
);
|
||||
}
|
||||
async function POST({ request, params }) {
|
||||
const authError = auth(request);
|
||||
if (authError !== null) {
|
||||
return json(
|
||||
{ error: authError.message },
|
||||
{
|
||||
status: 401
|
||||
}
|
||||
);
|
||||
}
|
||||
const incidentNumber = params.incidentNumber;
|
||||
if (!incidentNumber || isNaN(incidentNumber)) {
|
||||
return json(
|
||||
{ error: "Invalid incidentNumber" },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
const payload = await request.json();
|
||||
let body = payload.body;
|
||||
if (!body || typeof body !== "string") {
|
||||
return json(
|
||||
{ error: "Invalid body" },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
let site = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/site.json", "utf8"));
|
||||
let github = site.github;
|
||||
let resp = await AddComment(github, incidentNumber, body);
|
||||
if (resp === null) {
|
||||
return json(
|
||||
{ error: "github error" },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
return json(
|
||||
{
|
||||
commentID: resp.id,
|
||||
body: resp.body,
|
||||
createdAt: Math.floor(new Date(resp.created_at).getTime() / 1e3)
|
||||
},
|
||||
{
|
||||
status: 200
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export { GET, POST };
|
||||
//# sourceMappingURL=_server-d9ce737b.js.map
|
||||
@@ -1,89 +0,0 @@
|
||||
import { j as json } from './index-2b68e648.js';
|
||||
import { a as auth, G as GHIssueToKenerIncident } from './webhook-bd364d16.js';
|
||||
import { a as GetIncidentByNumber, c as UpdateIssueLabels } from './github-54c09baa.js';
|
||||
import { p as public_env } from './shared-server-58a5f352.js';
|
||||
import fs from 'fs-extra';
|
||||
import './tool-153dc604.js';
|
||||
import 'randomstring';
|
||||
import 'axios';
|
||||
import 'marked';
|
||||
|
||||
async function POST({ request, params }) {
|
||||
const payload = await request.json();
|
||||
const incidentNumber = params.incidentNumber;
|
||||
const authError = auth(request);
|
||||
if (authError !== null) {
|
||||
return json(
|
||||
{ error: authError.message },
|
||||
{
|
||||
status: 401
|
||||
}
|
||||
);
|
||||
}
|
||||
let isIdentified = payload.isIdentified;
|
||||
let isResolved = payload.isResolved;
|
||||
let endDatetime = payload.endDatetime;
|
||||
if (!incidentNumber || isNaN(incidentNumber)) {
|
||||
return json(
|
||||
{ error: "Invalid incidentNumber" },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
if (endDatetime && typeof endDatetime !== "number") {
|
||||
return json(
|
||||
{ error: "Invalid endDatetime" },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
let site = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/site.json", "utf8"));
|
||||
let github = site.github;
|
||||
let issue = await GetIncidentByNumber(github, incidentNumber);
|
||||
if (issue === null) {
|
||||
return json(
|
||||
{ error: "github error" },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
let labels = issue.labels.map((label) => {
|
||||
return label.name;
|
||||
});
|
||||
if (isIdentified !== void 0) {
|
||||
labels = labels.filter((label) => label !== "identified");
|
||||
if (isIdentified === true) {
|
||||
labels.push("identified");
|
||||
}
|
||||
}
|
||||
if (isResolved !== void 0) {
|
||||
labels = labels.filter((label) => label !== "resolved");
|
||||
if (isResolved === true) {
|
||||
labels.push("resolved");
|
||||
}
|
||||
}
|
||||
let body = issue.body;
|
||||
if (endDatetime) {
|
||||
body = body.replace(/\[end_datetime:(\d+)\]/g, "");
|
||||
body = body.trim();
|
||||
body = body + ` [end_datetime:${endDatetime}]`;
|
||||
}
|
||||
let resp = await UpdateIssueLabels(github, incidentNumber, labels, body);
|
||||
if (resp === null) {
|
||||
return json(
|
||||
{ error: "github error" },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
return json(GHIssueToKenerIncident(resp), {
|
||||
status: 200
|
||||
});
|
||||
}
|
||||
|
||||
export { POST };
|
||||
//# sourceMappingURL=_server-e0c327de.js.map
|
||||
@@ -1,29 +0,0 @@
|
||||
import { j as json } from './index-2b68e648.js';
|
||||
import { a as auth, s as store } from './webhook-bd364d16.js';
|
||||
import 'fs-extra';
|
||||
import './shared-server-58a5f352.js';
|
||||
import './tool-153dc604.js';
|
||||
import './github-54c09baa.js';
|
||||
import 'axios';
|
||||
import 'marked';
|
||||
import 'randomstring';
|
||||
|
||||
async function POST({ request }) {
|
||||
const payload = await request.json();
|
||||
const authError = auth(request);
|
||||
if (authError !== null) {
|
||||
return json(
|
||||
{ error: authError.message },
|
||||
{
|
||||
status: 401
|
||||
}
|
||||
);
|
||||
}
|
||||
let resp = store(payload);
|
||||
return json(resp, {
|
||||
status: resp.status
|
||||
});
|
||||
}
|
||||
|
||||
export { POST };
|
||||
//# sourceMappingURL=_server-e6873bc7.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"_server-e6873bc7.js","sources":["../../../.svelte-kit/adapter-node/entries/endpoints/api/status/_server.js"],"sourcesContent":["import { j as json } from \"../../../../chunks/index.js\";\nimport { a as auth, s as store } from \"../../../../chunks/webhook.js\";\nasync function POST({ request }) {\n const payload = await request.json();\n const authError = auth(request);\n if (authError !== null) {\n return json(\n { error: authError.message },\n {\n status: 401\n }\n );\n }\n let resp = store(payload);\n return json(resp, {\n status: resp.status\n });\n}\nexport {\n POST\n};\n"],"names":[],"mappings":";;;;;;;;;;AAEA,eAAe,IAAI,CAAC,EAAE,OAAO,EAAE,EAAE;AACjC,EAAE,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,IAAI,EAAE,CAAC;AACvC,EAAE,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;AAClC,EAAE,IAAI,SAAS,KAAK,IAAI,EAAE;AAC1B,IAAI,OAAO,IAAI;AACf,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,OAAO,EAAE;AAClC,MAAM;AACN,QAAQ,MAAM,EAAE,GAAG;AACnB,OAAO;AACP,KAAK,CAAC;AACN,GAAG;AACH,EAAE,IAAI,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;AAC5B,EAAE,OAAO,IAAI,CAAC,IAAI,EAAE;AACpB,IAAI,MAAM,EAAE,IAAI,CAAC,MAAM;AACvB,GAAG,CAAC,CAAC;AACL;;;;"}
|
||||
@@ -1,154 +0,0 @@
|
||||
import { c as create_ssr_component, f as compute_rest_props, h as spread, j as escape_attribute_value, i as escape_object, k as createEventDispatcher, v as validate_component, a as each } from './ssr-c85d451a.js';
|
||||
import { clsx } from 'clsx';
|
||||
import { twMerge } from 'tailwind-merge';
|
||||
|
||||
const void_element_names = /^(?:area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/;
|
||||
function is_void(name) {
|
||||
return void_element_names.test(name) || name.toLowerCase() === "!doctype";
|
||||
}
|
||||
function createDispatcher() {
|
||||
const dispatch = createEventDispatcher();
|
||||
return (e) => {
|
||||
const { originalEvent } = e.detail;
|
||||
const { cancelable } = e;
|
||||
const type = originalEvent.type;
|
||||
const shouldContinue = dispatch(type, { originalEvent, currentTarget: originalEvent.currentTarget }, { cancelable });
|
||||
if (!shouldContinue) {
|
||||
e.preventDefault();
|
||||
}
|
||||
};
|
||||
}
|
||||
function cubicOut(t) {
|
||||
const f = t - 1;
|
||||
return f * f * f + 1;
|
||||
}
|
||||
function cn(...inputs) {
|
||||
return twMerge(clsx(inputs));
|
||||
}
|
||||
const flyAndScale = (node, params = { y: -8, x: 0, start: 0.95, duration: 150 }) => {
|
||||
const style = getComputedStyle(node);
|
||||
const transform = style.transform === "none" ? "" : style.transform;
|
||||
const scaleConversion = (valueA, scaleA, scaleB) => {
|
||||
const [minA, maxA] = scaleA;
|
||||
const [minB, maxB] = scaleB;
|
||||
const percentage = (valueA - minA) / (maxA - minA);
|
||||
const valueB = percentage * (maxB - minB) + minB;
|
||||
return valueB;
|
||||
};
|
||||
const styleToString = (style2) => {
|
||||
return Object.keys(style2).reduce((str, key) => {
|
||||
if (style2[key] === void 0)
|
||||
return str;
|
||||
return str + `${key}:${style2[key]};`;
|
||||
}, "");
|
||||
};
|
||||
return {
|
||||
duration: params.duration ?? 200,
|
||||
delay: 0,
|
||||
css: (t) => {
|
||||
const y = scaleConversion(t, [0, 1], [params.y ?? 5, 0]);
|
||||
const x = scaleConversion(t, [0, 1], [params.x ?? 0, 0]);
|
||||
const scale = scaleConversion(t, [0, 1], [params.start ?? 0.95, 1]);
|
||||
return styleToString({
|
||||
transform: `${transform} translate3d(${x}px, ${y}px, 0) scale(${scale})`,
|
||||
opacity: t
|
||||
});
|
||||
},
|
||||
easing: cubicOut
|
||||
};
|
||||
};
|
||||
const Card = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let $$restProps = compute_rest_props($$props, ["class"]);
|
||||
let { class: className = void 0 } = $$props;
|
||||
if ($$props.class === void 0 && $$bindings.class && className !== void 0)
|
||||
$$bindings.class(className);
|
||||
return `<div${spread(
|
||||
[
|
||||
{
|
||||
class: escape_attribute_value(cn("rounded-lg border bg-card text-card-foreground shadow-sm", className))
|
||||
},
|
||||
escape_object($$restProps)
|
||||
],
|
||||
{}
|
||||
)}>${slots.default ? slots.default({}) : ``}</div>`;
|
||||
});
|
||||
const Card_content = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let $$restProps = compute_rest_props($$props, ["class"]);
|
||||
let { class: className = void 0 } = $$props;
|
||||
if ($$props.class === void 0 && $$bindings.class && className !== void 0)
|
||||
$$bindings.class(className);
|
||||
return `<div${spread(
|
||||
[
|
||||
{
|
||||
class: escape_attribute_value(cn("p-6 pt-0", className))
|
||||
},
|
||||
escape_object($$restProps)
|
||||
],
|
||||
{}
|
||||
)}>${slots.default ? slots.default({}) : ``}</div>`;
|
||||
});
|
||||
const defaultAttributes = {
|
||||
xmlns: "http://www.w3.org/2000/svg",
|
||||
width: 24,
|
||||
height: 24,
|
||||
viewBox: "0 0 24 24",
|
||||
fill: "none",
|
||||
stroke: "currentColor",
|
||||
"stroke-width": 2,
|
||||
"stroke-linecap": "round",
|
||||
"stroke-linejoin": "round"
|
||||
};
|
||||
const Icon = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let $$restProps = compute_rest_props($$props, ["name", "color", "size", "strokeWidth", "absoluteStrokeWidth", "iconNode"]);
|
||||
let { name } = $$props;
|
||||
let { color = "currentColor" } = $$props;
|
||||
let { size = 24 } = $$props;
|
||||
let { strokeWidth = 2 } = $$props;
|
||||
let { absoluteStrokeWidth = false } = $$props;
|
||||
let { iconNode } = $$props;
|
||||
if ($$props.name === void 0 && $$bindings.name && name !== void 0)
|
||||
$$bindings.name(name);
|
||||
if ($$props.color === void 0 && $$bindings.color && color !== void 0)
|
||||
$$bindings.color(color);
|
||||
if ($$props.size === void 0 && $$bindings.size && size !== void 0)
|
||||
$$bindings.size(size);
|
||||
if ($$props.strokeWidth === void 0 && $$bindings.strokeWidth && strokeWidth !== void 0)
|
||||
$$bindings.strokeWidth(strokeWidth);
|
||||
if ($$props.absoluteStrokeWidth === void 0 && $$bindings.absoluteStrokeWidth && absoluteStrokeWidth !== void 0)
|
||||
$$bindings.absoluteStrokeWidth(absoluteStrokeWidth);
|
||||
if ($$props.iconNode === void 0 && $$bindings.iconNode && iconNode !== void 0)
|
||||
$$bindings.iconNode(iconNode);
|
||||
return `<svg${spread(
|
||||
[
|
||||
escape_object(defaultAttributes),
|
||||
escape_object($$restProps),
|
||||
{ width: escape_attribute_value(size) },
|
||||
{ height: escape_attribute_value(size) },
|
||||
{ stroke: escape_attribute_value(color) },
|
||||
{
|
||||
"stroke-width": escape_attribute_value(absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth)
|
||||
},
|
||||
{
|
||||
class: escape_attribute_value(`lucide-icon lucide lucide-${name} ${$$props.class ?? ""}`)
|
||||
}
|
||||
],
|
||||
{}
|
||||
)}>${each(iconNode, ([tag, attrs]) => {
|
||||
return `${((tag$1) => {
|
||||
return tag$1 ? `<${tag}${spread([escape_object(attrs)], {})}>${is_void(tag$1) ? "" : ``}${is_void(tag$1) ? "" : `</${tag$1}>`}` : "";
|
||||
})(tag)}`;
|
||||
})}${slots.default ? slots.default({}) : ``}</svg>`;
|
||||
});
|
||||
const Icon$1 = Icon;
|
||||
const Chevron_down = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
const iconNode = [["path", { "d": "m6 9 6 6 6-6" }]];
|
||||
return `${validate_component(Icon$1, "Icon").$$render($$result, Object.assign({}, { name: "chevron-down" }, $$props, { iconNode }), {}, {
|
||||
default: () => {
|
||||
return `${slots.default ? slots.default({}) : ``}`;
|
||||
}
|
||||
})}`;
|
||||
});
|
||||
const ChevronDown = Chevron_down;
|
||||
|
||||
export { Card as C, Icon$1 as I, Card_content as a, ChevronDown as b, cn as c, createDispatcher as d, cubicOut as e, flyAndScale as f, is_void as i };
|
||||
//# sourceMappingURL=chevron-down-226abe3e.js.map
|
||||
@@ -1,32 +0,0 @@
|
||||
import { c as create_ssr_component, d as subscribe, e as escape, g as getContext } from './ssr-c85d451a.js';
|
||||
|
||||
const getStores = () => {
|
||||
const stores = getContext("__svelte__");
|
||||
return {
|
||||
/** @type {typeof page} */
|
||||
page: {
|
||||
subscribe: stores.page.subscribe
|
||||
},
|
||||
/** @type {typeof navigating} */
|
||||
navigating: {
|
||||
subscribe: stores.navigating.subscribe
|
||||
},
|
||||
/** @type {typeof updated} */
|
||||
updated: stores.updated
|
||||
};
|
||||
};
|
||||
const page = {
|
||||
subscribe(fn) {
|
||||
const store = getStores().page;
|
||||
return store.subscribe(fn);
|
||||
}
|
||||
};
|
||||
const Error$1 = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let $page, $$unsubscribe_page;
|
||||
$$unsubscribe_page = subscribe(page, (value) => $page = value);
|
||||
$$unsubscribe_page();
|
||||
return `<h1>${escape($page.status)}</h1> <p>${escape($page.error?.message)}</p>`;
|
||||
});
|
||||
|
||||
export { Error$1 as default };
|
||||
//# sourceMappingURL=error.svelte-9dc5c501.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"error.svelte-9dc5c501.js","sources":["../../../.svelte-kit/adapter-node/entries/fallbacks/error.svelte.js"],"sourcesContent":["import { g as getContext, c as create_ssr_component, d as subscribe, e as escape } from \"../../chunks/ssr.js\";\nconst getStores = () => {\n const stores = getContext(\"__svelte__\");\n return {\n /** @type {typeof page} */\n page: {\n subscribe: stores.page.subscribe\n },\n /** @type {typeof navigating} */\n navigating: {\n subscribe: stores.navigating.subscribe\n },\n /** @type {typeof updated} */\n updated: stores.updated\n };\n};\nconst page = {\n subscribe(fn) {\n const store = getStores().page;\n return store.subscribe(fn);\n }\n};\nconst Error$1 = create_ssr_component(($$result, $$props, $$bindings, slots) => {\n let $page, $$unsubscribe_page;\n $$unsubscribe_page = subscribe(page, (value) => $page = value);\n $$unsubscribe_page();\n return `<h1>${escape($page.status)}</h1> <p>${escape($page.error?.message)}</p>`;\n});\nexport {\n Error$1 as default\n};\n"],"names":[],"mappings":";;AACA,MAAM,SAAS,GAAG,MAAM;AACxB,EAAE,MAAM,MAAM,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;AAC1C,EAAE,OAAO;AACT;AACA,IAAI,IAAI,EAAE;AACV,MAAM,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,SAAS;AACtC,KAAK;AACL;AACA,IAAI,UAAU,EAAE;AAChB,MAAM,SAAS,EAAE,MAAM,CAAC,UAAU,CAAC,SAAS;AAC5C,KAAK;AACL;AACA,IAAI,OAAO,EAAE,MAAM,CAAC,OAAO;AAC3B,GAAG,CAAC;AACJ,CAAC,CAAC;AACF,MAAM,IAAI,GAAG;AACb,EAAE,SAAS,CAAC,EAAE,EAAE;AAChB,IAAI,MAAM,KAAK,GAAG,SAAS,EAAE,CAAC,IAAI,CAAC;AACnC,IAAI,OAAO,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;AAC/B,GAAG;AACH,CAAC,CAAC;AACG,MAAC,OAAO,GAAG,oBAAoB,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,KAAK;AAC/E,EAAE,IAAI,KAAK,EAAE,kBAAkB,CAAC;AAChC,EAAE,kBAAkB,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC,KAAK,KAAK,KAAK,GAAG,KAAK,CAAC,CAAC;AACjE,EAAE,kBAAkB,EAAE,CAAC;AACvB,EAAE,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC;AACnF,CAAC;;;;"}
|
||||
@@ -1,230 +0,0 @@
|
||||
import axios from 'axios';
|
||||
import { G as GetMinuteStartNowTimestampUTC } from './tool-153dc604.js';
|
||||
import { marked } from 'marked';
|
||||
|
||||
const GH_TOKEN = process.env.GH_TOKEN;
|
||||
const GhnotconfireguredMsg = "owner or repo or GH_TOKEN is undefined. Read the docs to configure github: https://kener.ing/docs#h2github-setup";
|
||||
function getAxiosOptions(url) {
|
||||
const options = {
|
||||
url,
|
||||
method: "GET",
|
||||
headers: {
|
||||
Accept: "application/vnd.github+json",
|
||||
Authorization: "Bearer " + GH_TOKEN,
|
||||
"X-GitHub-Api-Version": "2022-11-28"
|
||||
}
|
||||
};
|
||||
return options;
|
||||
}
|
||||
function postAxiosOptions(url, data) {
|
||||
const options = {
|
||||
url,
|
||||
method: "POST",
|
||||
headers: {
|
||||
Accept: "application/vnd.github+json",
|
||||
Authorization: "Bearer " + GH_TOKEN,
|
||||
"X-GitHub-Api-Version": "2022-11-28"
|
||||
},
|
||||
data
|
||||
};
|
||||
return options;
|
||||
}
|
||||
function patchAxiosOptions(url, data) {
|
||||
const options = {
|
||||
url,
|
||||
method: "PATCH",
|
||||
headers: {
|
||||
Accept: "application/vnd.github+json",
|
||||
Authorization: "Bearer " + GH_TOKEN,
|
||||
"X-GitHub-Api-Version": "2022-11-28"
|
||||
},
|
||||
data
|
||||
};
|
||||
return options;
|
||||
}
|
||||
const GetStartTimeFromBody = function(text) {
|
||||
const pattern = /\[start_datetime:(\d+)\]/;
|
||||
const matches = pattern.exec(text);
|
||||
if (matches) {
|
||||
const timestamp = matches[1];
|
||||
return parseInt(timestamp);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
const GetEndTimeFromBody = function(text) {
|
||||
const pattern = /\[end_datetime:(\d+)\]/;
|
||||
const matches = pattern.exec(text);
|
||||
if (matches) {
|
||||
const timestamp = matches[1];
|
||||
return parseInt(timestamp);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
const GetIncidentByNumber = async function(githubConfig, incidentNumber) {
|
||||
if (githubConfig.owner === void 0 || githubConfig.repo === void 0 || GH_TOKEN === void 0) {
|
||||
console.log(GhnotconfireguredMsg);
|
||||
return null;
|
||||
}
|
||||
const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues/${incidentNumber}`;
|
||||
const options = getAxiosOptions(url);
|
||||
try {
|
||||
const response = await axios.request(options);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.log(error.message, options, url);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
const GetIncidents = async function(tagName, githubConfig, state = "all") {
|
||||
if (githubConfig.owner === void 0 || githubConfig.repo === void 0 || GH_TOKEN === void 0) {
|
||||
console.log(GhnotconfireguredMsg);
|
||||
return [];
|
||||
}
|
||||
if (tagName === void 0) {
|
||||
return [];
|
||||
}
|
||||
const since = GetMinuteStartNowTimestampUTC() - githubConfig.incidentSince * 60 * 60;
|
||||
const sinceISO = new Date(since * 1e3).toISOString();
|
||||
const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues?state=${state}&labels=${tagName},incident&sort=created&direction=desc&since=${sinceISO}`;
|
||||
const options = getAxiosOptions(url);
|
||||
try {
|
||||
const response = await axios.request(options);
|
||||
let issues = response.data;
|
||||
issues = issues.filter((issue) => {
|
||||
return new Date(issue.created_at) >= new Date(sinceISO);
|
||||
});
|
||||
return issues;
|
||||
} catch (error) {
|
||||
return [];
|
||||
}
|
||||
};
|
||||
async function Mapper(issue) {
|
||||
const html = marked.parse(issue.body);
|
||||
const comments = await GetCommentsForIssue(issue.number, this.github);
|
||||
const issueCreatedAt = new Date(issue.created_at);
|
||||
const issueCreatedAtTimestamp = issueCreatedAt.getTime() / 1e3;
|
||||
let issueClosedAtTimestamp = null;
|
||||
if (issue.closed_at !== null) {
|
||||
const issueClosedAt = new Date(issue.closed_at);
|
||||
issueClosedAtTimestamp = issueClosedAt.getTime() / 1e3;
|
||||
}
|
||||
return {
|
||||
title: issue.title,
|
||||
incident_start_time: GetStartTimeFromBody(issue.body) || issueCreatedAtTimestamp,
|
||||
incident_end_time: GetEndTimeFromBody(issue.body) || issueClosedAtTimestamp,
|
||||
number: issue.number,
|
||||
body: html,
|
||||
created_at: issue.created_at,
|
||||
updated_at: issue.updated_at,
|
||||
collapsed: true,
|
||||
comments: issue.comments,
|
||||
// @ts-ignore
|
||||
state: issue.state,
|
||||
closed_at: issue.closed_at,
|
||||
// @ts-ignore
|
||||
labels: issue.labels.map(function(label) {
|
||||
return label.name;
|
||||
}),
|
||||
html_url: issue.html_url,
|
||||
// @ts-ignore
|
||||
comments: comments.map((comment) => {
|
||||
const html2 = marked.parse(comment.body);
|
||||
return {
|
||||
body: html2,
|
||||
created_at: comment.created_at,
|
||||
updated_at: comment.updated_at,
|
||||
html_url: comment.html_url
|
||||
};
|
||||
})
|
||||
};
|
||||
}
|
||||
async function GetCommentsForIssue(issueID, githubConfig) {
|
||||
if (githubConfig.owner === void 0 || githubConfig.repo === void 0 || GH_TOKEN === void 0) {
|
||||
console.log(GhnotconfireguredMsg);
|
||||
return [];
|
||||
}
|
||||
const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues/${issueID}/comments`;
|
||||
try {
|
||||
const response = await axios.request(getAxiosOptions(url));
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.log(error.response.data);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
async function CreateIssue(githubConfig, issueTitle, issueBody, issueLabels) {
|
||||
if (githubConfig.owner === void 0 || githubConfig.repo === void 0 || GH_TOKEN === void 0) {
|
||||
console.log(GhnotconfireguredMsg);
|
||||
return null;
|
||||
}
|
||||
const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues`;
|
||||
try {
|
||||
const payload = {
|
||||
title: issueTitle,
|
||||
body: issueBody,
|
||||
labels: issueLabels
|
||||
};
|
||||
const response = await axios.request(postAxiosOptions(url, payload));
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.log(error.response.data);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
async function UpdateIssue(githubConfig, incidentNumber, issueTitle, issueBody, issueLabels) {
|
||||
if (githubConfig.owner === void 0 || githubConfig.repo === void 0 || GH_TOKEN === void 0) {
|
||||
console.log(GhnotconfireguredMsg);
|
||||
return null;
|
||||
}
|
||||
const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues/${incidentNumber}`;
|
||||
try {
|
||||
const payload = {
|
||||
title: issueTitle,
|
||||
body: issueBody,
|
||||
labels: issueLabels
|
||||
};
|
||||
const response = await axios.request(patchAxiosOptions(url, payload));
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.log(error.response.data);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
async function AddComment(githubConfig, incidentNumber, commentBody) {
|
||||
if (githubConfig.owner === void 0 || githubConfig.repo === void 0 || GH_TOKEN === void 0) {
|
||||
console.log(GhnotconfireguredMsg);
|
||||
return null;
|
||||
}
|
||||
const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues/${incidentNumber}/comments`;
|
||||
try {
|
||||
const payload = {
|
||||
body: commentBody
|
||||
};
|
||||
const response = await axios.request(postAxiosOptions(url, payload));
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.log(error.response.data);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
async function UpdateIssueLabels(githubConfig, incidentNumber, issueLabels, body) {
|
||||
if (githubConfig.owner === void 0 || githubConfig.repo === void 0 || GH_TOKEN === void 0) {
|
||||
console.log(GhnotconfireguredMsg);
|
||||
return null;
|
||||
}
|
||||
const url = `https://api.github.com/repos/${githubConfig.owner}/${githubConfig.repo}/issues/${incidentNumber}`;
|
||||
try {
|
||||
const payload = {
|
||||
labels: issueLabels,
|
||||
body
|
||||
};
|
||||
const response = await axios.request(postAxiosOptions(url, payload));
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.log(error.response.data);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export { AddComment as A, CreateIssue as C, GetIncidents as G, Mapper as M, UpdateIssue as U, GetIncidentByNumber as a, GetCommentsForIssue as b, UpdateIssueLabels as c, GetStartTimeFromBody as d, GetEndTimeFromBody as e };
|
||||
//# sourceMappingURL=github-54c09baa.js.map
|
||||
@@ -1,36 +0,0 @@
|
||||
const StatusObj = {
|
||||
UP: "api-up",
|
||||
DEGRADED: "api-degraded",
|
||||
DOWN: "api-down",
|
||||
NO_DATA: "api-nodata"
|
||||
};
|
||||
const StatusColor = {
|
||||
UP: "00dfa2",
|
||||
DEGRADED: "ffb84c",
|
||||
DOWN: "ff0060",
|
||||
NO_DATA: "b8bcbe"
|
||||
};
|
||||
const ParseUptime = function(up, all) {
|
||||
if (all === 0)
|
||||
return String("-");
|
||||
if (up == 0)
|
||||
return String("0");
|
||||
if (up == all) {
|
||||
return String((up / all * parseFloat(100)).toFixed(0));
|
||||
}
|
||||
return String((up / all * parseFloat(100)).toFixed(4));
|
||||
};
|
||||
const ParsePercentage = function(n) {
|
||||
if (isNaN(n))
|
||||
return "-";
|
||||
if (n == 0) {
|
||||
return "0";
|
||||
}
|
||||
if (n == 100) {
|
||||
return "100";
|
||||
}
|
||||
return n.toFixed(4);
|
||||
};
|
||||
|
||||
export { ParseUptime as P, StatusObj as S, ParsePercentage as a, StatusColor as b };
|
||||
//# sourceMappingURL=helpers-6076deb3.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"helpers-6076deb3.js","sources":["../../../.svelte-kit/adapter-node/chunks/helpers.js"],"sourcesContent":["const StatusObj = {\n UP: \"api-up\",\n DEGRADED: \"api-degraded\",\n DOWN: \"api-down\",\n NO_DATA: \"api-nodata\"\n};\nconst StatusColor = {\n UP: \"00dfa2\",\n DEGRADED: \"ffb84c\",\n DOWN: \"ff0060\",\n NO_DATA: \"b8bcbe\"\n};\nconst ParseUptime = function(up, all) {\n if (all === 0)\n return String(\"-\");\n if (up == 0)\n return String(\"0\");\n if (up == all) {\n return String((up / all * parseFloat(100)).toFixed(0));\n }\n return String((up / all * parseFloat(100)).toFixed(4));\n};\nconst ParsePercentage = function(n) {\n if (isNaN(n))\n return \"-\";\n if (n == 0) {\n return \"0\";\n }\n if (n == 100) {\n return \"100\";\n }\n return n.toFixed(4);\n};\nexport {\n ParseUptime as P,\n StatusObj as S,\n StatusColor as a,\n ParsePercentage as b\n};\n"],"names":[],"mappings":"AAAK,MAAC,SAAS,GAAG;AAClB,EAAE,EAAE,EAAE,QAAQ;AACd,EAAE,QAAQ,EAAE,cAAc;AAC1B,EAAE,IAAI,EAAE,UAAU;AAClB,EAAE,OAAO,EAAE,YAAY;AACvB,EAAE;AACG,MAAC,WAAW,GAAG;AACpB,EAAE,EAAE,EAAE,QAAQ;AACd,EAAE,QAAQ,EAAE,QAAQ;AACpB,EAAE,IAAI,EAAE,QAAQ;AAChB,EAAE,OAAO,EAAE,QAAQ;AACnB,EAAE;AACG,MAAC,WAAW,GAAG,SAAS,EAAE,EAAE,GAAG,EAAE;AACtC,EAAE,IAAI,GAAG,KAAK,CAAC;AACf,IAAI,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;AACvB,EAAE,IAAI,EAAE,IAAI,CAAC;AACb,IAAI,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;AACvB,EAAE,IAAI,EAAE,IAAI,GAAG,EAAE;AACjB,IAAI,OAAO,MAAM,CAAC,CAAC,EAAE,GAAG,GAAG,GAAG,UAAU,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3D,GAAG;AACH,EAAE,OAAO,MAAM,CAAC,CAAC,EAAE,GAAG,GAAG,GAAG,UAAU,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AACzD,EAAE;AACG,MAAC,eAAe,GAAG,SAAS,CAAC,EAAE;AACpC,EAAE,IAAI,KAAK,CAAC,CAAC,CAAC;AACd,IAAI,OAAO,GAAG,CAAC;AACf,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE;AACd,IAAI,OAAO,GAAG,CAAC;AACf,GAAG;AACH,EAAE,IAAI,CAAC,IAAI,GAAG,EAAE;AAChB,IAAI,OAAO,KAAK,CAAC;AACjB,GAAG;AACH,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AACtB;;;;"}
|
||||
@@ -1,508 +0,0 @@
|
||||
import { c as create_ssr_component, f as compute_rest_props, h as spread, j as escape_attribute_value, i as escape_object, v as validate_component, b as add_attribute, e as escape, a as each, d as subscribe } from './ssr-c85d451a.js';
|
||||
import { c as cn, i as is_void, C as Card, b as ChevronDown, a as Card_content, d as createDispatcher, f as flyAndScale, I as Icon$1 } from './chevron-down-226abe3e.js';
|
||||
import 'clsx';
|
||||
import { h as setCtx$1, i as getCtx, j as getAttrs$1 } from './ctx-168edc6f.js';
|
||||
import { d as derived } from './index2-d9c461ad.js';
|
||||
import { S as StatusObj } from './helpers-6076deb3.js';
|
||||
import moment from 'moment';
|
||||
import { b as buttonVariants } from './index3-58d8c192.js';
|
||||
import { tv } from 'tailwind-variants';
|
||||
|
||||
function getAttrs(builders) {
|
||||
const attrs = {};
|
||||
builders.forEach((builder) => {
|
||||
Object.keys(builder).forEach((key) => {
|
||||
if (key !== "action") {
|
||||
attrs[key] = builder[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
return attrs;
|
||||
}
|
||||
const Button$1 = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let $$restProps = compute_rest_props($$props, ["href", "type", "builders"]);
|
||||
let { href = void 0 } = $$props;
|
||||
let { type = void 0 } = $$props;
|
||||
let { builders = [] } = $$props;
|
||||
const attrs = { "data-bits-button-root": "" };
|
||||
if ($$props.href === void 0 && $$bindings.href && href !== void 0)
|
||||
$$bindings.href(href);
|
||||
if ($$props.type === void 0 && $$bindings.type && type !== void 0)
|
||||
$$bindings.type(type);
|
||||
if ($$props.builders === void 0 && $$bindings.builders && builders !== void 0)
|
||||
$$bindings.builders(builders);
|
||||
return `${builders && builders.length ? ` ${((tag) => {
|
||||
return tag ? `<${href ? "a" : "button"}${spread(
|
||||
[
|
||||
{
|
||||
type: escape_attribute_value(href ? void 0 : type)
|
||||
},
|
||||
{ href: escape_attribute_value(href) },
|
||||
{ tabindex: "0" },
|
||||
escape_object(getAttrs(builders)),
|
||||
escape_object($$restProps),
|
||||
escape_object(attrs)
|
||||
],
|
||||
{}
|
||||
)}>${is_void(tag) ? "" : `${slots.default ? slots.default({}) : ``}`}${is_void(tag) ? "" : `</${tag}>`}` : "";
|
||||
})(href ? "a" : "button")}` : ` ${((tag) => {
|
||||
return tag ? `<${href ? "a" : "button"}${spread(
|
||||
[
|
||||
{
|
||||
type: escape_attribute_value(href ? void 0 : type)
|
||||
},
|
||||
{ href: escape_attribute_value(href) },
|
||||
{ tabindex: "0" },
|
||||
escape_object($$restProps),
|
||||
escape_object(attrs)
|
||||
],
|
||||
{}
|
||||
)}>${is_void(tag) ? "" : `${slots.default ? slots.default({}) : ``}`}${is_void(tag) ? "" : `</${tag}>`}` : "";
|
||||
})(href ? "a" : "button")}`}`;
|
||||
});
|
||||
const LinkPreview = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let $idValues, $$unsubscribe_idValues;
|
||||
let { positioning = void 0 } = $$props;
|
||||
let { open = void 0 } = $$props;
|
||||
let { onOpenChange = void 0 } = $$props;
|
||||
let { openDelay = 700 } = $$props;
|
||||
let { closeDelay = 300 } = $$props;
|
||||
let { closeOnOutsideClick = void 0 } = $$props;
|
||||
let { closeOnEscape = void 0 } = $$props;
|
||||
let { arrowSize = void 0 } = $$props;
|
||||
let { portal = void 0 } = $$props;
|
||||
const { states: { open: localOpen }, updateOption, ids } = setCtx$1({
|
||||
defaultOpen: open,
|
||||
positioning,
|
||||
openDelay,
|
||||
closeDelay,
|
||||
closeOnOutsideClick,
|
||||
closeOnEscape,
|
||||
arrowSize,
|
||||
portal,
|
||||
onOpenChange: ({ next }) => {
|
||||
if (open !== next) {
|
||||
onOpenChange?.(next);
|
||||
open = next;
|
||||
}
|
||||
return next;
|
||||
}
|
||||
});
|
||||
const idValues = derived([ids.content, ids.trigger], ([$contentId, $triggerId]) => ({ content: $contentId, trigger: $triggerId }));
|
||||
$$unsubscribe_idValues = subscribe(idValues, (value) => $idValues = value);
|
||||
if ($$props.positioning === void 0 && $$bindings.positioning && positioning !== void 0)
|
||||
$$bindings.positioning(positioning);
|
||||
if ($$props.open === void 0 && $$bindings.open && open !== void 0)
|
||||
$$bindings.open(open);
|
||||
if ($$props.onOpenChange === void 0 && $$bindings.onOpenChange && onOpenChange !== void 0)
|
||||
$$bindings.onOpenChange(onOpenChange);
|
||||
if ($$props.openDelay === void 0 && $$bindings.openDelay && openDelay !== void 0)
|
||||
$$bindings.openDelay(openDelay);
|
||||
if ($$props.closeDelay === void 0 && $$bindings.closeDelay && closeDelay !== void 0)
|
||||
$$bindings.closeDelay(closeDelay);
|
||||
if ($$props.closeOnOutsideClick === void 0 && $$bindings.closeOnOutsideClick && closeOnOutsideClick !== void 0)
|
||||
$$bindings.closeOnOutsideClick(closeOnOutsideClick);
|
||||
if ($$props.closeOnEscape === void 0 && $$bindings.closeOnEscape && closeOnEscape !== void 0)
|
||||
$$bindings.closeOnEscape(closeOnEscape);
|
||||
if ($$props.arrowSize === void 0 && $$bindings.arrowSize && arrowSize !== void 0)
|
||||
$$bindings.arrowSize(arrowSize);
|
||||
if ($$props.portal === void 0 && $$bindings.portal && portal !== void 0)
|
||||
$$bindings.portal(portal);
|
||||
open !== void 0 && localOpen.set(open);
|
||||
{
|
||||
updateOption("positioning", positioning);
|
||||
}
|
||||
{
|
||||
updateOption("openDelay", openDelay);
|
||||
}
|
||||
{
|
||||
updateOption("closeDelay", closeDelay);
|
||||
}
|
||||
{
|
||||
updateOption("closeOnOutsideClick", closeOnOutsideClick);
|
||||
}
|
||||
{
|
||||
updateOption("closeOnEscape", closeOnEscape);
|
||||
}
|
||||
{
|
||||
updateOption("arrowSize", arrowSize);
|
||||
}
|
||||
{
|
||||
updateOption("portal", portal);
|
||||
}
|
||||
$$unsubscribe_idValues();
|
||||
return `${slots.default ? slots.default({ ids: $idValues }) : ``}`;
|
||||
});
|
||||
const LinkPreviewContent = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let builder;
|
||||
let $$restProps = compute_rest_props($$props, [
|
||||
"transition",
|
||||
"transitionConfig",
|
||||
"inTransition",
|
||||
"inTransitionConfig",
|
||||
"outTransition",
|
||||
"outTransitionConfig",
|
||||
"asChild",
|
||||
"id"
|
||||
]);
|
||||
let $content, $$unsubscribe_content;
|
||||
let $open, $$unsubscribe_open;
|
||||
let { transition = void 0 } = $$props;
|
||||
let { transitionConfig = void 0 } = $$props;
|
||||
let { inTransition = void 0 } = $$props;
|
||||
let { inTransitionConfig = void 0 } = $$props;
|
||||
let { outTransition = void 0 } = $$props;
|
||||
let { outTransitionConfig = void 0 } = $$props;
|
||||
let { asChild = false } = $$props;
|
||||
let { id = void 0 } = $$props;
|
||||
const { elements: { content }, states: { open }, ids } = getCtx();
|
||||
$$unsubscribe_content = subscribe(content, (value) => $content = value);
|
||||
$$unsubscribe_open = subscribe(open, (value) => $open = value);
|
||||
const attrs = getAttrs$1("content");
|
||||
createDispatcher();
|
||||
if ($$props.transition === void 0 && $$bindings.transition && transition !== void 0)
|
||||
$$bindings.transition(transition);
|
||||
if ($$props.transitionConfig === void 0 && $$bindings.transitionConfig && transitionConfig !== void 0)
|
||||
$$bindings.transitionConfig(transitionConfig);
|
||||
if ($$props.inTransition === void 0 && $$bindings.inTransition && inTransition !== void 0)
|
||||
$$bindings.inTransition(inTransition);
|
||||
if ($$props.inTransitionConfig === void 0 && $$bindings.inTransitionConfig && inTransitionConfig !== void 0)
|
||||
$$bindings.inTransitionConfig(inTransitionConfig);
|
||||
if ($$props.outTransition === void 0 && $$bindings.outTransition && outTransition !== void 0)
|
||||
$$bindings.outTransition(outTransition);
|
||||
if ($$props.outTransitionConfig === void 0 && $$bindings.outTransitionConfig && outTransitionConfig !== void 0)
|
||||
$$bindings.outTransitionConfig(outTransitionConfig);
|
||||
if ($$props.asChild === void 0 && $$bindings.asChild && asChild !== void 0)
|
||||
$$bindings.asChild(asChild);
|
||||
if ($$props.id === void 0 && $$bindings.id && id !== void 0)
|
||||
$$bindings.id(id);
|
||||
{
|
||||
if (id) {
|
||||
ids.content.set(id);
|
||||
}
|
||||
}
|
||||
builder = $content;
|
||||
$$unsubscribe_content();
|
||||
$$unsubscribe_open();
|
||||
return ` ${asChild && $open ? `${slots.default ? slots.default({ builder, attrs }) : ``}` : `${transition && $open ? `<div${spread([escape_object(builder), escape_object($$restProps), escape_object(attrs)], {})}>${slots.default ? slots.default({ builder, attrs }) : ``}</div>` : `${inTransition && outTransition && $open ? `<div${spread([escape_object(builder), escape_object($$restProps), escape_object(attrs)], {})}>${slots.default ? slots.default({ builder, attrs }) : ``}</div>` : `${inTransition && $open ? `<div${spread(
|
||||
[
|
||||
escape_object(builder),
|
||||
escape_object($$restProps),
|
||||
escape_object(attrs)
|
||||
],
|
||||
{}
|
||||
)}>${slots.default ? slots.default({ builder, attrs }) : ``}</div>` : `${outTransition && $open ? `<div${spread(
|
||||
[
|
||||
escape_object(builder),
|
||||
escape_object($$restProps),
|
||||
escape_object(attrs)
|
||||
],
|
||||
{}
|
||||
)}>${slots.default ? slots.default({ builder, attrs }) : ``}</div>` : `${$open ? `<div${spread(
|
||||
[
|
||||
escape_object(builder),
|
||||
escape_object($$restProps),
|
||||
escape_object(attrs)
|
||||
],
|
||||
{}
|
||||
)}>${slots.default ? slots.default({ builder, attrs }) : ``}</div>` : ``}`}`}`}`}`}`;
|
||||
});
|
||||
const LinkPreviewTrigger = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let builder;
|
||||
let $$restProps = compute_rest_props($$props, ["asChild", "id"]);
|
||||
let $trigger, $$unsubscribe_trigger;
|
||||
let { asChild = false } = $$props;
|
||||
let { id = void 0 } = $$props;
|
||||
const { elements: { trigger }, ids } = getCtx();
|
||||
$$unsubscribe_trigger = subscribe(trigger, (value) => $trigger = value);
|
||||
createDispatcher();
|
||||
const attrs = getAttrs$1("trigger");
|
||||
if ($$props.asChild === void 0 && $$bindings.asChild && asChild !== void 0)
|
||||
$$bindings.asChild(asChild);
|
||||
if ($$props.id === void 0 && $$bindings.id && id !== void 0)
|
||||
$$bindings.id(id);
|
||||
{
|
||||
if (id) {
|
||||
ids.trigger.set(id);
|
||||
}
|
||||
}
|
||||
builder = $trigger;
|
||||
$$unsubscribe_trigger();
|
||||
return `${asChild ? `${slots.default ? slots.default({ attrs, builder }) : ``}` : (() => {
|
||||
let builder2 = $trigger;
|
||||
return ` ${((tag) => {
|
||||
return tag ? `<a${spread(
|
||||
[
|
||||
escape_object(builder2),
|
||||
escape_object($$restProps),
|
||||
escape_object(attrs)
|
||||
],
|
||||
{}
|
||||
)}>${is_void(tag) ? "" : `${slots.default ? slots.default({ builder: builder2, attrs }) : ``}`}</a>` : "";
|
||||
})("a")}`;
|
||||
})()}`;
|
||||
});
|
||||
const Button = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let $$restProps = compute_rest_props($$props, ["class", "variant", "size", "builders"]);
|
||||
let { class: className = void 0 } = $$props;
|
||||
let { variant = "default" } = $$props;
|
||||
let { size = "default" } = $$props;
|
||||
let { builders = [] } = $$props;
|
||||
if ($$props.class === void 0 && $$bindings.class && className !== void 0)
|
||||
$$bindings.class(className);
|
||||
if ($$props.variant === void 0 && $$bindings.variant && variant !== void 0)
|
||||
$$bindings.variant(variant);
|
||||
if ($$props.size === void 0 && $$bindings.size && size !== void 0)
|
||||
$$bindings.size(size);
|
||||
if ($$props.builders === void 0 && $$bindings.builders && builders !== void 0)
|
||||
$$bindings.builders(builders);
|
||||
return `${validate_component(Button$1, "ButtonPrimitive.Root").$$render(
|
||||
$$result,
|
||||
Object.assign(
|
||||
{},
|
||||
{ builders },
|
||||
{
|
||||
class: cn(buttonVariants({ variant, size, className }))
|
||||
},
|
||||
{ type: "button" },
|
||||
$$restProps
|
||||
),
|
||||
{},
|
||||
{
|
||||
default: () => {
|
||||
return `${slots.default ? slots.default({}) : ``}`;
|
||||
}
|
||||
}
|
||||
)}`;
|
||||
});
|
||||
const Card_description = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let $$restProps = compute_rest_props($$props, ["class"]);
|
||||
let { class: className = void 0 } = $$props;
|
||||
if ($$props.class === void 0 && $$bindings.class && className !== void 0)
|
||||
$$bindings.class(className);
|
||||
return `<p${spread(
|
||||
[
|
||||
{
|
||||
class: escape_attribute_value(cn("text-sm text-muted-foreground", className))
|
||||
},
|
||||
escape_object($$restProps)
|
||||
],
|
||||
{}
|
||||
)}>${slots.default ? slots.default({}) : ``}</p>`;
|
||||
});
|
||||
const Card_header = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let $$restProps = compute_rest_props($$props, ["class"]);
|
||||
let { class: className = void 0 } = $$props;
|
||||
if ($$props.class === void 0 && $$bindings.class && className !== void 0)
|
||||
$$bindings.class(className);
|
||||
return `<div${spread(
|
||||
[
|
||||
{
|
||||
class: escape_attribute_value(cn("flex flex-col space-y-1.5 p-6", className))
|
||||
},
|
||||
escape_object($$restProps)
|
||||
],
|
||||
{}
|
||||
)}>${slots.default ? slots.default({}) : ``}</div>`;
|
||||
});
|
||||
const Card_title = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let $$restProps = compute_rest_props($$props, ["class", "tag"]);
|
||||
let { class: className = void 0 } = $$props;
|
||||
let { tag = "h3" } = $$props;
|
||||
if ($$props.class === void 0 && $$bindings.class && className !== void 0)
|
||||
$$bindings.class(className);
|
||||
if ($$props.tag === void 0 && $$bindings.tag && tag !== void 0)
|
||||
$$bindings.tag(tag);
|
||||
return `${((tag$1) => {
|
||||
return tag$1 ? `<${tag}${spread(
|
||||
[
|
||||
{
|
||||
class: escape_attribute_value(cn("text-lg font-semibold leading-none tracking-tight", className))
|
||||
},
|
||||
escape_object($$restProps)
|
||||
],
|
||||
{}
|
||||
)}>${is_void(tag$1) ? "" : `${slots.default ? slots.default({}) : ``}`}${is_void(tag$1) ? "" : `</${tag$1}>`}` : "";
|
||||
})(tag)}`;
|
||||
});
|
||||
const Badge = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let $$restProps = compute_rest_props($$props, ["class", "href", "variant"]);
|
||||
let { class: className = void 0 } = $$props;
|
||||
let { href = void 0 } = $$props;
|
||||
let { variant = "default" } = $$props;
|
||||
if ($$props.class === void 0 && $$bindings.class && className !== void 0)
|
||||
$$bindings.class(className);
|
||||
if ($$props.href === void 0 && $$bindings.href && href !== void 0)
|
||||
$$bindings.href(href);
|
||||
if ($$props.variant === void 0 && $$bindings.variant && variant !== void 0)
|
||||
$$bindings.variant(variant);
|
||||
return `${((tag) => {
|
||||
return tag ? `<${href ? "a" : "span"}${spread(
|
||||
[
|
||||
{ href: escape_attribute_value(href) },
|
||||
{
|
||||
class: escape_attribute_value(cn(badgeVariants({ variant, className })))
|
||||
},
|
||||
escape_object($$restProps)
|
||||
],
|
||||
{}
|
||||
)}>${is_void(tag) ? "" : `${slots.default ? slots.default({}) : ``}`}${is_void(tag) ? "" : `</${tag}>`}` : "";
|
||||
})(href ? "a" : "span")}`;
|
||||
});
|
||||
const badgeVariants = tv({
|
||||
base: "inline-flex items-center border rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none select-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
||||
variants: {
|
||||
variant: {
|
||||
default: "bg-primary hover:bg-primary/80 border-transparent text-primary-foreground",
|
||||
secondary: "bg-secondary hover:bg-secondary/80 border-transparent text-secondary-foreground",
|
||||
destructive: "bg-destructive hover:bg-destructive/80 border-transparent text-destructive-foreground",
|
||||
outline: "text-foreground"
|
||||
}
|
||||
},
|
||||
defaultVariants: {
|
||||
variant: "default"
|
||||
}
|
||||
});
|
||||
const Hover_card_content = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let $$restProps = compute_rest_props($$props, ["class", "transition", "transitionConfig"]);
|
||||
let { class: className = void 0 } = $$props;
|
||||
let { transition = flyAndScale } = $$props;
|
||||
let { transitionConfig = void 0 } = $$props;
|
||||
if ($$props.class === void 0 && $$bindings.class && className !== void 0)
|
||||
$$bindings.class(className);
|
||||
if ($$props.transition === void 0 && $$bindings.transition && transition !== void 0)
|
||||
$$bindings.transition(transition);
|
||||
if ($$props.transitionConfig === void 0 && $$bindings.transitionConfig && transitionConfig !== void 0)
|
||||
$$bindings.transitionConfig(transitionConfig);
|
||||
return `${validate_component(LinkPreviewContent, "HoverCardPrimitive.Content").$$render(
|
||||
$$result,
|
||||
Object.assign(
|
||||
{},
|
||||
{ transition },
|
||||
{ transitionConfig },
|
||||
{
|
||||
class: cn("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none mt-3", className)
|
||||
},
|
||||
$$restProps
|
||||
),
|
||||
{},
|
||||
{
|
||||
default: () => {
|
||||
return `${slots.default ? slots.default({}) : ``}`;
|
||||
}
|
||||
}
|
||||
)}`;
|
||||
});
|
||||
const Root = LinkPreview;
|
||||
const Trigger = LinkPreviewTrigger;
|
||||
const Chevron_up = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
const iconNode = [["path", { "d": "m18 15-6-6-6 6" }]];
|
||||
return `${validate_component(Icon$1, "Icon").$$render($$result, Object.assign({}, { name: "chevron-up" }, $$props, { iconNode }), {}, {
|
||||
default: () => {
|
||||
return `${slots.default ? slots.default({}) : ``}`;
|
||||
}
|
||||
})}`;
|
||||
});
|
||||
const ChevronUp = Chevron_up;
|
||||
const Incident = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let { incident } = $$props;
|
||||
let { variant = "title+body+comments+monitor" } = $$props;
|
||||
let { state = "open" } = $$props;
|
||||
let { monitor } = $$props;
|
||||
let blinker = "bg-transparent";
|
||||
let incidentPriority = "";
|
||||
if (incident.labels.includes("incident-down")) {
|
||||
blinker = "bg-red-500";
|
||||
incidentPriority = "DOWN";
|
||||
} else if (incident.labels.includes("incident-degraded")) {
|
||||
blinker = "bg-yellow-500";
|
||||
incidentPriority = "DEGRADED";
|
||||
}
|
||||
let incidentState = incident.state;
|
||||
let incidentClosedAt = incident.incident_end_time;
|
||||
let incidentCreatedAt = incident.incident_start_time;
|
||||
let incidentMessage = "";
|
||||
if (!!incidentClosedAt && !!incidentCreatedAt) {
|
||||
let diff = moment(incidentClosedAt * 1e3).diff(moment(incidentCreatedAt * 1e3), "minutes");
|
||||
if (diff > 0) {
|
||||
incidentMessage = `. Was <span class="text-${StatusObj[incidentPriority]}">${incidentPriority}</span> for ${diff} minutes`;
|
||||
}
|
||||
} else if (!!incidentCreatedAt) {
|
||||
let diff = moment().diff(moment(incidentCreatedAt * 1e3), "minutes");
|
||||
incidentMessage = `. Has been <span class="text-${StatusObj[incidentPriority]}">${incidentPriority}</span> for ${diff} minutes`;
|
||||
}
|
||||
incident.body = incident.body.replace(/\[start_datetime:(\d+)\]/g, "");
|
||||
incident.body = incident.body.replace(/\[end_datetime:(\d+)\]/g, "");
|
||||
if ($$props.incident === void 0 && $$bindings.incident && incident !== void 0)
|
||||
$$bindings.incident(incident);
|
||||
if ($$props.variant === void 0 && $$bindings.variant && variant !== void 0)
|
||||
$$bindings.variant(variant);
|
||||
if ($$props.state === void 0 && $$bindings.state && state !== void 0)
|
||||
$$bindings.state(state);
|
||||
if ($$props.monitor === void 0 && $$bindings.monitor && monitor !== void 0)
|
||||
$$bindings.monitor(monitor);
|
||||
return `<div class="grid grid-cols-3 gap-4 mb-4 w-full"><div class="col-span-3">${validate_component(Card, "Card.Root").$$render($$result, {}, {}, {
|
||||
default: () => {
|
||||
return `${validate_component(Card_header, "Card.Header").$$render($$result, {}, {}, {
|
||||
default: () => {
|
||||
return `${validate_component(Card_title, "Card.Title").$$render($$result, { class: "relative" }, {}, {
|
||||
default: () => {
|
||||
return `${variant.includes("monitor") ? `<div class="pb-4"><div class="scroll-m-20 text-2xl font-semibold tracking-tight">${monitor.image ? `<img${add_attribute("src", monitor.image, 0)} class="w-6 h-6 inline" alt="" srcset="">` : ``} ${escape(monitor.name)} ${monitor.description ? `${validate_component(Root, "HoverCard.Root").$$render($$result, {}, {}, {
|
||||
default: () => {
|
||||
return `${validate_component(Trigger, "HoverCard.Trigger").$$render($$result, {}, {}, {
|
||||
default: () => {
|
||||
return `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide inline lucide-info"><circle cx="12" cy="12" r="10"></circle><path d="M12 16v-4"></path><path d="M12 8h.01"></path></svg>`;
|
||||
}
|
||||
})} ${validate_component(Hover_card_content, "HoverCard.Content").$$render($$result, { class: "dark:invert" }, {}, {
|
||||
default: () => {
|
||||
return `${escape(monitor.description)}`;
|
||||
}
|
||||
})}`;
|
||||
}
|
||||
})}` : ``}</div></div>` : ``} ${variant.includes("title") ? `${escape(incident.title)}` : ``} ${incidentState == "open" ? `<span class="${"animate-ping absolute -left-[24px] -top-[24px] w-[8px] h-[8px] inline-flex rounded-full " + escape(blinker, true) + " opacity-75"}"></span>` : ``} ${variant.includes("body") || variant.includes("comments") ? `${state == "close" ? `${validate_component(Button, "Button").$$render(
|
||||
$$result,
|
||||
{
|
||||
variant: "outline",
|
||||
class: "absolute right-0",
|
||||
size: "icon"
|
||||
},
|
||||
{},
|
||||
{
|
||||
default: () => {
|
||||
return `${validate_component(ChevronDown, "ChevronDown").$$render($$result, { class: "", size: 32 }, {}, {})}`;
|
||||
}
|
||||
}
|
||||
)}` : `${validate_component(Button, "Button").$$render(
|
||||
$$result,
|
||||
{
|
||||
variant: "outline",
|
||||
class: "absolute right-0",
|
||||
size: "icon"
|
||||
},
|
||||
{},
|
||||
{
|
||||
default: () => {
|
||||
return `${validate_component(ChevronUp, "ChevronUp").$$render($$result, { class: "", size: 32 }, {}, {})}`;
|
||||
}
|
||||
}
|
||||
)}`}` : ``}`;
|
||||
}
|
||||
})} ${validate_component(Card_description, "Card.Description").$$render($$result, {}, {}, {
|
||||
default: () => {
|
||||
return `${escape(moment(incident.created_at).format("MMMM Do YYYY, h:mm:ss a"))} <!-- HTML_TAG_START -->${incidentMessage}<!-- HTML_TAG_END --> <p class="mt-2">${incident.labels.includes("identified") ? `<span class="bg-yellow-100 text-yellow-800 mt-1 text-sm font-medium me-2 px-2.5 py-0.5 rounded dark:bg-yellow-900 dark:text-yellow-300" data-svelte-h="svelte-1shyy7e">Identified</span>` : ``} ${incident.labels.includes("resolved") ? `<span class="bg-green-100 text-green-800 text-sm font-medium me-2 px-2.5 py-0.5 rounded dark:bg-green-900 dark:text-green-300" data-svelte-h="svelte-h35mlk">Resolved</span>` : ``}</p>`;
|
||||
}
|
||||
})}`;
|
||||
}
|
||||
})} ${(variant.includes("body") || variant.includes("comments")) && state == "open" ? `${validate_component(Card_content, "Card.Content").$$render($$result, {}, {}, {
|
||||
default: () => {
|
||||
return `${variant.includes("body") ? `<div class="prose prose-stone dark:prose-invert max-w-none prose-code:px-[0.3rem] prose-code:py-[0.2rem] prose-code:font-mono prose-code:text-sm prose-code:rounded"><!-- HTML_TAG_START -->${incident.body}<!-- HTML_TAG_END --></div>` : ``} ${variant.includes("comments") && incident.comments.length > 0 ? `<div class="ml-4 mt-8"><ol class="relative border-s border-secondary">${each(incident.comments, (comment) => {
|
||||
return `<li class="mb-10 ms-4"><div class="absolute w-3 h-3 rounded-full mt-1.5 -start-1.5 border bg-secondary border-secondary"></div> <time class="mb-1 text-sm font-normal leading-none text-muted-foreground">${escape(moment(comment.created_at).format("MMMM Do YYYY, h:mm:ss a"))}</time> <div class="mb-4 text-base font-normal wysiwyg dark:prose-invert prose prose-stone max-w-none prose-code:px-[0.3rem] prose-code:py-[0.2rem] prose-code:font-mono prose-code:text-sm prose-code:rounded"><!-- HTML_TAG_START -->${comment.body}<!-- HTML_TAG_END --></div> </li>`;
|
||||
})}</ol></div>` : ``}`;
|
||||
}
|
||||
})}` : ``}`;
|
||||
}
|
||||
})}</div></div>`;
|
||||
});
|
||||
|
||||
export { Badge as B, Hover_card_content as H, Incident as I, Root as R, Trigger as T };
|
||||
//# sourceMappingURL=incident-e1bd1794.js.map
|
||||
@@ -1,78 +0,0 @@
|
||||
class HttpError {
|
||||
/**
|
||||
* @param {number} status
|
||||
* @param {{message: string} extends App.Error ? (App.Error | string | undefined) : App.Error} body
|
||||
*/
|
||||
constructor(status, body) {
|
||||
this.status = status;
|
||||
if (typeof body === "string") {
|
||||
this.body = { message: body };
|
||||
} else if (body) {
|
||||
this.body = body;
|
||||
} else {
|
||||
this.body = { message: `Error: ${status}` };
|
||||
}
|
||||
}
|
||||
toString() {
|
||||
return JSON.stringify(this.body);
|
||||
}
|
||||
}
|
||||
class Redirect {
|
||||
/**
|
||||
* @param {300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308} status
|
||||
* @param {string} location
|
||||
*/
|
||||
constructor(status, location) {
|
||||
this.status = status;
|
||||
this.location = location;
|
||||
}
|
||||
}
|
||||
class ActionFailure {
|
||||
/**
|
||||
* @param {number} status
|
||||
* @param {T} [data]
|
||||
*/
|
||||
constructor(status, data) {
|
||||
this.status = status;
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
function error(status, body) {
|
||||
if (isNaN(status) || status < 400 || status > 599) {
|
||||
throw new Error(`HTTP error status codes must be between 400 and 599 — ${status} is invalid`);
|
||||
}
|
||||
return new HttpError(status, body);
|
||||
}
|
||||
function json(data, init) {
|
||||
const body = JSON.stringify(data);
|
||||
const headers = new Headers(init?.headers);
|
||||
if (!headers.has("content-length")) {
|
||||
headers.set("content-length", encoder.encode(body).byteLength.toString());
|
||||
}
|
||||
if (!headers.has("content-type")) {
|
||||
headers.set("content-type", "application/json");
|
||||
}
|
||||
return new Response(body, {
|
||||
...init,
|
||||
headers
|
||||
});
|
||||
}
|
||||
const encoder = new TextEncoder();
|
||||
function text(body, init) {
|
||||
const headers = new Headers(init?.headers);
|
||||
if (!headers.has("content-length")) {
|
||||
const encoded = encoder.encode(body);
|
||||
headers.set("content-length", encoded.byteLength.toString());
|
||||
return new Response(encoded, {
|
||||
...init,
|
||||
headers
|
||||
});
|
||||
}
|
||||
return new Response(body, {
|
||||
...init,
|
||||
headers
|
||||
});
|
||||
}
|
||||
|
||||
export { ActionFailure as A, HttpError as H, Redirect as R, error as e, json as j, text as t };
|
||||
//# sourceMappingURL=index-2b68e648.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"index-2b68e648.js","sources":["../../../.svelte-kit/adapter-node/chunks/index.js"],"sourcesContent":["class HttpError {\n /**\n * @param {number} status\n * @param {{message: string} extends App.Error ? (App.Error | string | undefined) : App.Error} body\n */\n constructor(status, body) {\n this.status = status;\n if (typeof body === \"string\") {\n this.body = { message: body };\n } else if (body) {\n this.body = body;\n } else {\n this.body = { message: `Error: ${status}` };\n }\n }\n toString() {\n return JSON.stringify(this.body);\n }\n}\nclass Redirect {\n /**\n * @param {300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308} status\n * @param {string} location\n */\n constructor(status, location) {\n this.status = status;\n this.location = location;\n }\n}\nclass ActionFailure {\n /**\n * @param {number} status\n * @param {T} [data]\n */\n constructor(status, data) {\n this.status = status;\n this.data = data;\n }\n}\nfunction error(status, body) {\n if (isNaN(status) || status < 400 || status > 599) {\n throw new Error(`HTTP error status codes must be between 400 and 599 — ${status} is invalid`);\n }\n return new HttpError(status, body);\n}\nfunction json(data, init) {\n const body = JSON.stringify(data);\n const headers = new Headers(init?.headers);\n if (!headers.has(\"content-length\")) {\n headers.set(\"content-length\", encoder.encode(body).byteLength.toString());\n }\n if (!headers.has(\"content-type\")) {\n headers.set(\"content-type\", \"application/json\");\n }\n return new Response(body, {\n ...init,\n headers\n });\n}\nconst encoder = new TextEncoder();\nfunction text(body, init) {\n const headers = new Headers(init?.headers);\n if (!headers.has(\"content-length\")) {\n const encoded = encoder.encode(body);\n headers.set(\"content-length\", encoded.byteLength.toString());\n return new Response(encoded, {\n ...init,\n headers\n });\n }\n return new Response(body, {\n ...init,\n headers\n });\n}\nexport {\n ActionFailure as A,\n HttpError as H,\n Redirect as R,\n error as e,\n json as j,\n text as t\n};\n"],"names":[],"mappings":"AAAA,MAAM,SAAS,CAAC;AAChB;AACA;AACA;AACA;AACA,EAAE,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE;AAC5B,IAAI,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;AACzB,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;AAClC,MAAM,IAAI,CAAC,IAAI,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AACpC,KAAK,MAAM,IAAI,IAAI,EAAE;AACrB,MAAM,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;AACvB,KAAK,MAAM;AACX,MAAM,IAAI,CAAC,IAAI,GAAG,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;AAClD,KAAK;AACL,GAAG;AACH,EAAE,QAAQ,GAAG;AACb,IAAI,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACrC,GAAG;AACH,CAAC;AACD,MAAM,QAAQ,CAAC;AACf;AACA;AACA;AACA;AACA,EAAE,WAAW,CAAC,MAAM,EAAE,QAAQ,EAAE;AAChC,IAAI,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;AACzB,IAAI,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC7B,GAAG;AACH,CAAC;AACD,MAAM,aAAa,CAAC;AACpB;AACA;AACA;AACA;AACA,EAAE,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE;AAC5B,IAAI,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;AACzB,IAAI,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;AACrB,GAAG;AACH,CAAC;AACD,SAAS,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE;AAC7B,EAAE,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,GAAG,IAAI,MAAM,GAAG,GAAG,EAAE;AACrD,IAAI,MAAM,IAAI,KAAK,CAAC,CAAC,sDAAsD,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC;AAClG,GAAG;AACH,EAAE,OAAO,IAAI,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AACrC,CAAC;AACD,SAAS,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE;AAC1B,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AACpC,EAAE,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC7C,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE;AACtC,IAAI,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC;AAC9E,GAAG;AACH,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE;AACpC,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC;AACpD,GAAG;AACH,EAAE,OAAO,IAAI,QAAQ,CAAC,IAAI,EAAE;AAC5B,IAAI,GAAG,IAAI;AACX,IAAI,OAAO;AACX,GAAG,CAAC,CAAC;AACL,CAAC;AACD,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;AAClC,SAAS,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE;AAC1B,EAAE,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC7C,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE;AACtC,IAAI,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACzC,IAAI,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,OAAO,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC;AACjE,IAAI,OAAO,IAAI,QAAQ,CAAC,OAAO,EAAE;AACjC,MAAM,GAAG,IAAI;AACb,MAAM,OAAO;AACb,KAAK,CAAC,CAAC;AACP,GAAG;AACH,EAAE,OAAO,IAAI,QAAQ,CAAC,IAAI,EAAE;AAC5B,IAAI,GAAG,IAAI;AACX,IAAI,OAAO;AACX,GAAG,CAAC,CAAC;AACL;;;;"}
|
||||
@@ -1,105 +0,0 @@
|
||||
import { q as noop, t as safe_not_equal, d as subscribe, r as run_all, u as is_function } from './ssr-c85d451a.js';
|
||||
|
||||
const subscriber_queue = [];
|
||||
function readable(value, start) {
|
||||
return {
|
||||
subscribe: writable(value, start).subscribe
|
||||
};
|
||||
}
|
||||
function writable(value, start = noop) {
|
||||
let stop;
|
||||
const subscribers = /* @__PURE__ */ new Set();
|
||||
function set(new_value) {
|
||||
if (safe_not_equal(value, new_value)) {
|
||||
value = new_value;
|
||||
if (stop) {
|
||||
const run_queue = !subscriber_queue.length;
|
||||
for (const subscriber of subscribers) {
|
||||
subscriber[1]();
|
||||
subscriber_queue.push(subscriber, value);
|
||||
}
|
||||
if (run_queue) {
|
||||
for (let i = 0; i < subscriber_queue.length; i += 2) {
|
||||
subscriber_queue[i][0](subscriber_queue[i + 1]);
|
||||
}
|
||||
subscriber_queue.length = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function update(fn) {
|
||||
set(fn(value));
|
||||
}
|
||||
function subscribe2(run, invalidate = noop) {
|
||||
const subscriber = [run, invalidate];
|
||||
subscribers.add(subscriber);
|
||||
if (subscribers.size === 1) {
|
||||
stop = start(set, update) || noop;
|
||||
}
|
||||
run(value);
|
||||
return () => {
|
||||
subscribers.delete(subscriber);
|
||||
if (subscribers.size === 0 && stop) {
|
||||
stop();
|
||||
stop = null;
|
||||
}
|
||||
};
|
||||
}
|
||||
return { set, update, subscribe: subscribe2 };
|
||||
}
|
||||
function derived(stores, fn, initial_value) {
|
||||
const single = !Array.isArray(stores);
|
||||
const stores_array = single ? [stores] : stores;
|
||||
if (!stores_array.every(Boolean)) {
|
||||
throw new Error("derived() expects stores as input, got a falsy value");
|
||||
}
|
||||
const auto = fn.length < 2;
|
||||
return readable(initial_value, (set, update) => {
|
||||
let started = false;
|
||||
const values = [];
|
||||
let pending = 0;
|
||||
let cleanup = noop;
|
||||
const sync = () => {
|
||||
if (pending) {
|
||||
return;
|
||||
}
|
||||
cleanup();
|
||||
const result = fn(single ? values[0] : values, set, update);
|
||||
if (auto) {
|
||||
set(result);
|
||||
} else {
|
||||
cleanup = is_function(result) ? result : noop;
|
||||
}
|
||||
};
|
||||
const unsubscribers = stores_array.map(
|
||||
(store, i) => subscribe(
|
||||
store,
|
||||
(value) => {
|
||||
values[i] = value;
|
||||
pending &= ~(1 << i);
|
||||
if (started) {
|
||||
sync();
|
||||
}
|
||||
},
|
||||
() => {
|
||||
pending |= 1 << i;
|
||||
}
|
||||
)
|
||||
);
|
||||
started = true;
|
||||
sync();
|
||||
return function stop() {
|
||||
run_all(unsubscribers);
|
||||
cleanup();
|
||||
started = false;
|
||||
};
|
||||
});
|
||||
}
|
||||
function readonly(store) {
|
||||
return {
|
||||
subscribe: store.subscribe.bind(store)
|
||||
};
|
||||
}
|
||||
|
||||
export { readonly as a, derived as d, readable as r, writable as w };
|
||||
//# sourceMappingURL=index2-d9c461ad.js.map
|
||||
@@ -1,30 +0,0 @@
|
||||
import './ctx-168edc6f.js';
|
||||
import 'clsx';
|
||||
import { tv } from 'tailwind-variants';
|
||||
|
||||
const buttonVariants = tv({
|
||||
base: "inline-flex items-center justify-center rounded-md text-sm font-medium whitespace-nowrap ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
||||
variants: {
|
||||
variant: {
|
||||
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
||||
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
||||
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
||||
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
||||
ghost: "hover:bg-accent hover:text-accent-foreground",
|
||||
link: "text-primary underline-offset-4 hover:underline"
|
||||
},
|
||||
size: {
|
||||
default: "h-10 px-4 py-2",
|
||||
sm: "h-9 rounded-md px-3",
|
||||
lg: "h-11 rounded-md px-8",
|
||||
icon: "h-10 w-10"
|
||||
}
|
||||
},
|
||||
defaultVariants: {
|
||||
variant: "default",
|
||||
size: "default"
|
||||
}
|
||||
});
|
||||
|
||||
export { buttonVariants as b };
|
||||
//# sourceMappingURL=index3-58d8c192.js.map
|
||||