Compare commits

..

231 Commits

Author SHA1 Message Date
Raj Nandan Sharma f91d65b7a4 docs: fix docs for npm deploy 2024-12-05 09:54:35 +05:30
Raj Nandan Sharma c8d4920cd3 docs: fix docs for npm deploy 2024-12-05 08:55:37 +05:30
Raj Nandan Sharma 27625bc31a docs: fix docs for npm deploy 2024-12-05 08:47:32 +05:30
Raj Nandan Sharma 67e22e4339 docs: fix docs for npm deploy 2024-12-04 23:49:18 +05:30
Raj Nandan Sharma b4ed5cffd6 docs: fix docs for npm deploy 2024-12-04 23:48:27 +05:30
Raj Nandan Sharma 6209ff12bb fix: fix the build 2024-12-04 23:38:45 +05:30
Raj Nandan Sharma 392a0e85be Merge pull request #176 from rajnandan1/release/2.0.0
Release/2.0.0 retry
2024-12-04 23:02:51 +05:30
Raj Nandan Sharma a7abf37781 fix: fix build 2024-12-04 22:58:46 +05:30
Raj Nandan Sharma c09f87daa7 fix: fix build 2024-12-04 22:53:16 +05:30
Raj Nandan Sharma 43072d2777 fix: fix build 2024-12-04 22:48:33 +05:30
Raj Nandan Sharma ed52f28743 Merge pull request #175 from rajnandan1/release/2.0.0
Release/2.0.0
2024-12-04 18:32:36 +05:30
Raj Nandan Sharma fe953b6b36 fix: fixed docs 2024-12-04 18:30:50 +05:30
Raj Nandan Sharma d931f3ec6d fix: fixed docs 2024-12-04 17:52:14 +05:30
Raj Nandan Sharma 2fbf404bf3 docs: monitor example alerting 2024-12-04 16:19:10 +05:30
Raj Nandan Sharma 49064e4e25 fix: fix embeds 2024-12-04 16:10:01 +05:30
Raj Nandan Sharma 2c4004d91f fix: as reported in #103 changing timezone to UTC 2024-12-04 15:33:01 +05:30
Raj Nandan Sharma 37706b87c4 docs: updated docs and docker file 2024-12-04 15:21:13 +05:30
Raj Nandan Sharma c8a98a745d docs: added docs for pull request #112 2024-12-04 12:39:52 +05:30
Raj Nandan Sharma abae472545 docs: added postgres database also 2024-12-04 12:33:00 +05:30
Raj Nandan Sharma 749593f1af refactor: remove dependency on github addresses #94 2024-11-29 10:57:31 +05:30
Raj Nandan Sharma a824a5dcf2 docs: added docs for alerting to address #49 2024-11-29 09:57:28 +05:30
Raj Nandan Sharma 8b2fe90eb7 docs: added a feature to address #53 2024-11-28 23:07:42 +05:30
Raj Nandan Sharma e6370fab66 feat: added daily view for each day on click 2024-11-28 22:54:21 +05:30
Raj Nandan Sharma 92ea4b64f9 feat: first commit for the release of version 2.0.0 2024-11-27 11:41:00 +05:30
Raj Nandan Sharma 9f6d071f25 Update README.md 2024-11-24 16:30:35 +05:30
Raj Nandan Sharma 274536eafa Update README.md 2024-11-23 22:53:21 +05:30
Raj Nandan Sharma 5b0ad39526 Update README.md 2024-11-23 22:52:28 +05:30
Raj Nandan Sharma 01d54f504b Update README.md 2024-11-23 21:57:31 +05:30
Raj Nandan Sharma e413fb7ecd Update README.md 2024-11-23 21:51:10 +05:30
Raj Nandan Sharma dc665ec581 Merge pull request #124 from rajnandan1/fix-issue-123
fix: fixed theme settings as reported in issue #123
2024-11-20 09:49:10 +05:30
Raj Nandan Sharma f7fa0452cd fix: fixed theme settings as reported in issue #123 2024-11-20 09:47:32 +05:30
Raj Nandan Sharma 47253cc54b Update README.md 2024-11-19 19:03:53 +05:30
Raj Nandan Sharma 71b56db909 docs: added api reference 2024-11-19 11:11:58 +05:30
Raj Nandan Sharma ad41edc972 Update FUNDING.yml 2024-11-16 12:47:42 +05:30
Raj Nandan Sharma 9076561644 Update FUNDING.yml 2024-11-16 12:46:29 +05:30
Raj Nandan Sharma ff5601aad2 Create FUNDING.yml 2024-11-16 12:45:24 +05:30
Raj Nandan Sharma 21629b7bed Update README.md 2024-11-16 12:33:05 +05:30
Raj Nandan Sharma 052e38a292 fix: fixed responsiveness for language selector 2024-11-16 12:19:04 +05:30
Raj Nandan Sharma 38c44396b0 Merge pull request #120 from rajnandan1/release-candidate/0.0.16
Release candidate/0.0.16
2024-11-16 11:02:00 +05:30
Raj Nandan Sharma f80e19e18a docs: added docs for pm2 deployment 2024-11-16 11:00:57 +05:30
Raj Nandan Sharma ebdda050f8 docs: added docs for pm2 deployment 2024-11-16 10:59:20 +05:30
Raj Nandan Sharma 110fb1c180 docs: added docs for pm2 deployment 2024-11-16 10:57:53 +05:30
Raj Nandan Sharma fd361f9482 feat: added sitemap again, fixed #59 also 2024-11-15 22:56:31 +05:30
Raj Nandan Sharma 1b8e05ad1f feat: added sitemap again, fixed #59 also 2024-11-15 22:52:36 +05:30
Raj Nandan Sharma 28184d2a52 refactor: deployment refactor 2024-11-15 21:54:43 +05:30
Raj Nandan Sharma 9a14a81956 refactor: deployment refactor 2024-11-15 21:46:29 +05:30
Raj Nandan Sharma 3312bbe8e4 refactor: deployment refactor 2024-11-15 21:28:03 +05:30
Raj Nandan Sharma a9602f5576 fix: respnsiveness 2024-11-15 12:13:41 +05:30
Raj Nandan Sharma 0f5dd0fd31 feat: added analytics 2024-11-14 23:58:22 +05:30
Raj Nandan Sharma e45b016cca docs: updated docs 2024-11-14 09:23:28 +05:30
Raj Nandan Sharma e1fe07cf26 build: new docker build 2024-11-13 21:44:57 +05:30
Raj Nandan Sharma 18e851a205 build: new docker build 2024-11-13 21:28:46 +05:30
Raj Nandan Sharma c992ec22ca fixed docker file 2024-11-13 10:33:29 +05:30
Raj Nandan Sharma c57f75d1ea push 0.0.16 to git 2024-11-12 21:32:29 +05:30
Raj Nandan Sharma 5abfafe2fa new doc site 2024-11-11 08:40:44 +05:30
Raj Nandan Sharma bd87aded67 changes gitignore 2024-11-08 23:10:25 +05:30
Raj Nandan Sharma c0332fe035 revamp kener 2.0 2024-11-08 22:56:35 +05:30
Raj Nandan Sharma 3941cc4e9b Merge pull request #98 from rajnandan1/release/0.0.15
Release/0.0.15
2024-08-11 07:37:33 -07:00
Raj Nandan Sharma 6ebaec5c3b cleanup 2024-08-11 20:03:42 +05:30
Raj Nandan Sharma 4b8aebdc1b increase package.json version 2024-08-11 20:01:48 +05:30
Raj Nandan Sharma 10afb34921 improve hi locale 2024-08-11 20:01:08 +05:30
Raj Nandan Sharma 068a3b9c5e moving theme to site.yaml 2024-08-11 19:58:02 +05:30
Raj Nandan Sharma 94ac704582 added dotenv 2024-08-11 19:32:57 +05:30
Raj Nandan Sharma fd677396ee dotenv 2024-08-11 18:45:16 +05:30
Raj Nandan Sharma 06d81fb419 Added Vietnamese support 2024-08-10 21:54:13 +05:30
Raj Nandan Sharma 3264e86426 Merge pull request #89 from rajnandan1/nav-responsive
fix(nav): made nav bar responsive
2024-05-27 11:03:54 +05:30
Raj Nandan Sharma 5767f2d2c3 fix(nav): made nav bar responsive 2024-05-27 11:02:52 +05:30
Raj Nandan Sharma a267c4028a Merge pull request #82 from rajnandan1/ip_api_fixes
feat(api): Added API_IP_REGEX to match incoming IPs.
2024-05-16 09:31:38 +05:30
Raj Nandan Sharma 4916a6b380 feat(api): Added API_IP_REGEX to match incoming IPs.
CHANGE: Solves Issue #80

Commit message generate with [okgit](https://github.com/rajnandan1/okgit)
2024-05-16 09:30:09 +05:30
Raj Nandan Sharma 55550ade86 Update README.md 2024-05-13 16:56:28 +05:30
Raj Nandan Sharma 8a30906bd4 docs(readme): added example for custom thresholds 2024-05-11 14:07:59 +05:30
Raj Nandan Sharma e049ec7782 Merge pull request #79 from rajnandan1/support-ping
feat(monitor): added ping monitor
2024-05-11 14:03:42 +05:30
Raj Nandan Sharma fab2a2aed7 feat(monitor): added ping monitor 2024-05-11 14:02:27 +05:30
Raj Nandan Sharma 3abc8b730f feat(monitor): added ping monitor 2024-05-11 13:48:18 +05:30
Raj Nandan Sharma 80bf60e75d Update README.md 2024-05-08 08:52:21 +05:30
Raj Nandan Sharma d0095d3e31 Update README.md 2024-05-08 08:50:47 +05:30
Raj Nandan Sharma 04a9e85bd2 Merge pull request #78 from rajnandan1/pretty
refactor: added prettier config
2024-05-04 12:03:15 +05:30
Raj Nandan Sharma 5bab933364 refactor: added prettier config 2024-05-04 12:01:35 +05:30
Raj Nandan Sharma ad768296c3 Merge pull request #77 from rajnandan1/custom-threshold-bars
feat(kener): supports custom threshold for calculations of day uptime
2024-04-30 11:16:14 +05:30
Raj Nandan Sharma cc830827bb feat(kener): supports custom threshold for calculations of day uptime
CHANGE: monitors now get three new optional parameter dayDegradedMinimumCount, dayDownMinimumCount and includeDegradedInDowntime

Requestd on issue #54
2024-04-30 11:13:45 +05:30
Raj Nandan Sharma 0c24507bb2 docs(readme): added base path support in feature list in readme 2024-04-29 10:59:06 +05:30
Raj Nandan Sharma be1ecf1af6 docs(readme): added base path support in feature list in readme 2024-04-29 10:55:57 +05:30
Raj Nandan Sharma 1f449258ab Merge pull request #76 from rajnandan1/subpath-support
feat(kener): added support for base path
2024-04-29 10:44:58 +05:30
Raj Nandan Sharma 3e7579852b feat(kener): added support for base path 2024-04-29 10:42:13 +05:30
Raj Nandan Sharma b58af80552 feat(kener): added support for base path 2024-04-29 10:15:02 +05:30
Raj Nandan Sharma e17ccd1519 fix(i18n): renamed zh_CN to zh-CN inside locales 2024-04-28 12:52:20 +05:30
Raj Nandan Sharma 780d053871 Merge pull request #75 from PearsSauce/main 2024-04-28 12:36:52 +05:30
青桔气球 a25ce58ebf feat:Updated Chinese language to make it more reasonable. 2024-04-28 14:47:23 +08:00
Raj Nandan Sharma fa1a16ad30 Merge pull request #74 from PearsSauce/main
Create zh_CN.json
2024-04-27 22:48:53 +05:30
Gil Schneider 0c9073aa6f Create zh_CN.json
fix:Add Chinese language
2024-04-27 20:13:40 +08:00
Raj Nandan Sharma e8a39cbe19 Merge pull request #73 from fetus-hina/japanese
Add Japanese translation
2024-04-27 11:50:22 +05:30
Raj Nandan Sharma c3d3ff39f0 Merge pull request #72 from fetus-hina/en-indent
Fix indents in locale file for English
2024-04-27 08:34:23 +05:30
AIZAWA Hina 240f3b0380 add Japanese locale file 2024-04-27 03:46:29 +09:00
AIZAWA Hina 1238b379ce fix indent in locale file for en 2024-04-27 03:24:28 +09:00
Raj Nandan Sharma c580472282 chore(build): new build for version 13 2024-04-26 19:16:57 +05:30
Raj Nandan Sharma 07d9aab45f chore(version): updated version to 13 2024-04-26 19:06:18 +05:30
Raj Nandan Sharma 6bb9808d0c fix(dockerfile): updates docker file for locales 2024-04-26 19:01:48 +05:30
Raj Nandan Sharma 283c38c9a5 Merge pull request #71 from rajnandan1/i18n-en
I18n en
2024-04-26 18:59:28 +05:30
Raj Nandan Sharma c0084a5d61 docs(i18n): code clean up 2024-04-26 18:53:05 +05:30
Raj Nandan Sharma f0ccb32b51 chore(i18n): code clean up 2024-04-26 18:50:02 +05:30
Raj Nandan Sharma f6e2fb3e89 docs(i18n): added documentation of i18n support in site.yaml 2024-04-26 17:43:00 +05:30
Raj Nandan Sharma 6114e2693d feat(i18n): completed incident page translation for hindi 2024-04-26 17:24:41 +05:30
Raj Nandan Sharma 9dde9b0763 feat(i18n): added en and hi 2024-04-26 12:06:38 +05:30
Raj Nandan Sharma 4fed2f32ae feat(i18n): setting base for i18n 2024-04-23 17:26:30 +05:30
Raj Nandan Sharma 2885cd621c chore(version): updated version to 12 2024-04-22 22:06:52 +05:30
Raj Nandan Sharma 3c91ff2860 fix(docker): updated docs to make it work using docker 2024-04-22 21:53:08 +05:30
Raj Nandan Sharma 68ca90e52e added linux/arm64 2024-04-12 18:38:40 +05:30
Raj Nandan Sharma dd592dc684 docs(api): added documentation for incident search api 2024-04-12 10:02:59 +05:30
Raj Nandan Sharma 75d6a271bf docs(api): added documentation for incident search api 2024-04-12 10:01:19 +05:30
Raj Nandan Sharma 090b24079a docs(api): added documentation for incident search api 2024-04-12 10:00:32 +05:30
Raj Nandan Sharma f5f5d4fdc9 Merge pull request #67 from rajnandan1/release/0.0.11
feat(api): added an incident search api
2024-04-12 09:47:26 +05:30
Raj Nandan Sharma b166df13b0 feat(api): added an incident search api
CHANGE: feature request in https://github.com/rajnandan1/kener/issues/64
2024-04-12 09:46:00 +05:30
Raj Nandan Sharma 1078607805 feat(api): added an incident search api
CHANGE: feature request in https://github.com/rajnandan1/kener/issues/64
2024-04-12 09:40:46 +05:30
Raj Nandan Sharma 94877a056a feat(api): added an incident search api
CHANGE: feature request in https://github.com/rajnandan1/kener/issues/64
2024-04-12 09:38:41 +05:30
Raj Nandan Sharma dbc76a9106 updated package.json 2024-03-22 10:14:44 +05:30
Raj Nandan Sharma 5dc3e6c258 Merge pull request #62 from rajnandan1/release/0.0.10
release 0.0.10 build
2024-03-22 10:13:32 +05:30
Raj Nandan Sharma 8f024a853f release 0.0.10 build 2024-03-22 10:12:10 +05:30
Raj Nandan Sharma f921df0e97 fixed bug in docker file 2024-03-03 14:19:47 +05:30
Raj Nandan Sharma 73147eee27 fixed bug in docker file 2024-03-03 13:32:03 +05:30
Raj Nandan Sharma 8cdf217a45 fixed bug in docker file 2024-03-03 13:19:33 +05:30
Raj Nandan Sharma 15b48eb622 new release/0.0.8 2024-03-03 12:29:49 +05:30
Raj Nandan Sharma c99f4013fe Merge pull request #51 from rajnandan1/optmize-main-load
Optmize main load
2024-02-19 11:29:01 +05:30
Raj Nandan Sharma 52ff46a1ce new build with pre computed 90day data 2024-02-19 11:28:10 +05:30
Raj Nandan Sharma 72d979abe3 pre compute 90day data 2024-02-19 11:26:51 +05:30
Raj Nandan Sharma 5e5ab9439b updated docs 2024-01-29 22:20:49 +05:30
Raj Nandan Sharma 78c173d215 new release 0.0.7 2024-01-29 19:34:03 +05:30
Raj Nandan Sharma 5d8b5283a6 fixed eval bug 2024-01-29 19:32:57 +05:30
Raj Nandan Sharma 7042caa356 added get status API 2024-01-28 18:44:24 +05:30
Raj Nandan Sharma e6076efd6f added get status API 2024-01-28 18:43:15 +05:30
Raj Nandan Sharma c3d2497965 updated doc 2024-01-27 23:14:19 +05:30
Raj Nandan Sharma 52638a8ca5 solved Issue #45 2024-01-27 23:05:13 +05:30
Raj Nandan Sharma 1840675f26 Merge pull request #47 from rajnandan1/feature-issue-45
added feature requested in Issue #45
2024-01-27 23:00:49 +05:30
Raj Nandan Sharma 9c89634b0b added feature requested in Issue #45 2024-01-27 22:59:23 +05:30
Raj Nandan Sharma 1b4fa02efe added feature requested in Issue #45 2024-01-27 22:51:38 +05:30
Raj Nandan Sharma 8880dfa4c6 Merge pull request #44 from orhun/chore/fix_typo_in_url
Fix typo in the URL
2024-01-27 20:25:56 +05:30
Orhun Parmaksız 7bea01dbb6 Fix typo in the URL 2024-01-27 16:22:10 +03:00
Raj Nandan Sharma a85820ed2b Optimize Page load 2024-01-27 15:02:44 +05:30
Raj Nandan Sharma 0e136afd61 Optimize layout.svelte 2024-01-26 22:49:41 +05:30
Raj Nandan Sharma 231ec66d5e Revert layout 2024-01-26 22:26:14 +05:30
Raj Nandan Sharma 1ebd40f922 Revert layout 2024-01-26 20:26:01 +05:30
Raj Nandan Sharma d4a919c1d7 Revert layout 2024-01-26 20:22:07 +05:30
Raj Nandan Sharma 70b80cac62 CSS cleanup and performance improvement 2024-01-26 20:09:01 +05:30
Raj Nandan Sharma ffc3055aec updated readme 2024-01-25 12:17:43 +05:30
Raj Nandan Sharma 471c6ddd33 version 0.0.6 2024-01-25 12:13:44 +05:30
Raj Nandan Sharma b7abe28c57 Merge pull request #42 from rajnandan1/api-fixes
fixed api: reopen issue if updated, added footer optional, responsive…
2024-01-25 12:10:39 +05:30
Raj Nandan Sharma 905fbc2bc3 incident text changes 2024-01-25 12:00:00 +05:30
Raj Nandan Sharma d3a7116747 fixed api: reopen issue if updated, added footer optional, responsive share menu, update sitemap 2024-01-25 11:57:47 +05:30
Raj Nandan Sharma 7fe340bd5f updated docker action to ignore readme.md 2024-01-24 23:10:04 +05:30
Raj Nandan Sharma 6026369e16 updated docs 2024-01-24 22:43:37 +05:30
Raj Nandan Sharma 321b053538 updated docs 2024-01-24 22:42:06 +05:30
Raj Nandan Sharma cbcdebb06f Merge pull request #39 from FoxxMD/docker
feat: Add dockerfile and docker-compose
2024-01-24 22:30:27 +05:30
FoxxMD 9ae7405166 feat: Add github actions docker image publish workflow 2024-01-24 11:52:28 -05:00
FoxxMD 139da41e28 docs: Add docker install and usage instructions 2024-01-24 11:48:57 -05:00
FoxxMD 4d0147a174 feat: Add dockerfile and docker-compose 2024-01-24 11:28:48 -05:00
Raj Nandan Sharma 6766bec87d updated readme 2024-01-24 19:48:21 +05:30
Raj Nandan Sharma b64f3aea75 updated readme 2024-01-24 19:45:11 +05:30
Raj Nandan Sharma c15ec146b8 updated readme 2024-01-24 19:44:37 +05:30
Raj Nandan Sharma ec9934b3e1 Update issue templates 2024-01-23 22:34:09 +05:30
Raj Nandan Sharma 31e212b869 updated readme 2024-01-23 22:12:10 +05:30
Raj Nandan Sharma 74ea57d6bb optimized pngs 2024-01-22 11:40:50 +05:30
Raj Nandan Sharma b7eb788c26 optimized pngs 2024-01-22 11:39:03 +05:30
Raj Nandan Sharma 18d9589594 optimized pngs 2024-01-22 11:38:13 +05:30
Raj Nandan Sharma 901b942ebf optimized pngs 2024-01-22 11:02:23 +05:30
Raj Nandan Sharma 84cdb43f12 optimized pngs 2024-01-22 11:00:57 +05:30
Raj Nandan Sharma abe75a7207 optimized pngs 2024-01-22 10:59:15 +05:30
Raj Nandan Sharma 32b623d391 optimized pngs 2024-01-22 10:58:56 +05:30
Raj Nandan Sharma 1aa9c5860a optimized pngs 2024-01-22 10:56:53 +05:30
Raj Nandan Sharma 61e4c15c28 optimized pngs 2024-01-22 10:53:16 +05:30
Raj Nandan Sharma 55cb221b52 test 2024-01-22 10:50:44 +05:30
Raj Nandan Sharma ea12920e7e new build 2024-01-21 22:34:17 +05:30
Raj Nandan Sharma 3a845080b4 new build 2024-01-21 22:31:06 +05:30
Raj Nandan Sharma 3e87eb73e9 reverted nav 2024-01-21 22:29:55 +05:30
Raj Nandan Sharma 5add3752b7 bug fix for release/0.0.5 2024-01-21 17:14:53 +05:30
Raj Nandan Sharma 50b88957c9 bug fix for release/0.0.5 2024-01-21 17:13:07 +05:30
Raj Nandan Sharma e38bf074b6 bug fix for release/0.0.5 2024-01-21 17:09:14 +05:30
Raj Nandan Sharma 696e30a581 bug fix for release/0.0.5 2024-01-21 17:04:01 +05:30
Raj Nandan Sharma 4be7f7a325 build for release/0.0.5 2024-01-21 15:47:13 +05:30
Raj Nandan Sharma 80958a4710 updated docs 2024-01-21 15:44:04 +05:30
Raj Nandan Sharma 5c527cdec8 Merge pull request #34 from rajnandan1/release/0.0.5
Release/0.0.5
2024-01-21 13:58:52 +05:30
Raj Nandan Sharma 3dd395626f tag update 2024-01-21 13:52:06 +05:30
Raj Nandan Sharma 6788ded1b3 hide nav in embeded monitor 2024-01-21 13:51:32 +05:30
Raj Nandan Sharma 638b7328bd 90 day uptime percentage now calculates over each minute instead of each day 2024-01-21 13:50:13 +05:30
Raj Nandan Sharma 42e2024d71 Monitors now have their dedicated page 2024-01-21 13:49:26 +05:30
Raj Nandan Sharma e011335287 Monitor Description now supports html. Useful while giving external links 2024-01-21 13:48:37 +05:30
Raj Nandan Sharma b90667966c Introduced embedable monitors 2024-01-21 13:47:29 +05:30
Raj Nandan Sharma 051be76da3 Monitors can now have categories with every category having their dedicated page 2024-01-21 13:46:01 +05:30
Raj Nandan Sharma d38366eed8 Add monitor menus to view description and share monitor 2024-01-21 13:45:00 +05:30
Raj Nandan Sharma 14141a25ff Nav bar is responsive now 2024-01-21 13:43:15 +05:30
Raj Nandan Sharma 1bbd9cbe22 incident now shows start time instead of create time if present 2024-01-21 13:40:29 +05:30
Raj Nandan Sharma ca6e94fc42 Release 0.0.4 2024-01-19 10:09:53 +05:30
Raj Nandan Sharma 12db7649b8 tags to array 2024-01-19 10:07:14 +05:30
Raj Nandan Sharma adbb541585 fix scroll while switch 90day 0Day 2024-01-13 22:03:07 +05:30
Raj Nandan Sharma 4315c0ae70 added support 2024-01-11 08:37:26 +05:30
Raj Nandan Sharma 79aa44ec46 added support 2024-01-11 08:36:52 +05:30
Raj Nandan Sharma 861cf32613 added support 2024-01-11 08:35:43 +05:30
Raj Nandan Sharma 1dd7dff4d3 added support 2024-01-11 08:33:06 +05:30
Raj Nandan Sharma a335bdb835 bug fix hidden 2024-01-11 07:38:38 +05:30
Raj Nandan Sharma 8a22c0d02a update doc 2024-01-10 23:18:59 +05:30
Raj Nandan Sharma b7b225d13a update doc 2024-01-10 23:18:14 +05:30
Raj Nandan Sharma 8b119bf98a added hidden flag for monitor 2024-01-10 20:43:36 +05:30
Raj Nandan Sharma fdc02b206c added hidden flag for monitor 2024-01-10 20:41:26 +05:30
Raj Nandan Sharma 082f33d95d added hidden flag for monitor 2024-01-10 20:30:07 +05:30
Raj Nandan Sharma 3b818fb41f Merge pull request #17 from rajnandan1/seo
added sitemap
2024-01-10 20:17:37 +05:30
Raj Nandan Sharma 8035db3f94 added sitemap 2024-01-10 20:16:09 +05:30
Raj Nandan Sharma d1fbc79ac5 added since last for uptime badge 2024-01-08 22:39:30 +05:30
Raj Nandan Sharma 998e72e8ab Update issue templates 2024-01-08 19:50:26 +05:30
Raj Nandan Sharma bc971a7d10 layout changes 2024-01-08 10:23:15 +05:30
Raj Nandan Sharma f0e0a5a912 readme up 2024-01-07 18:43:41 +05:30
Raj Nandan Sharma 65f1b64d9c readme up 2024-01-07 18:40:33 +05:30
Raj Nandan Sharma 363fd42739 worked on responsiveness 2024-01-06 23:02:29 +05:30
Raj Nandan Sharma e7b7f969b2 customizable badges 2024-01-06 12:29:45 +05:30
Raj Nandan Sharma 2ed022ef24 customizable badges 2024-01-06 12:29:11 +05:30
Raj Nandan Sharma c2253b3a9f customizable badges 2024-01-06 12:28:13 +05:30
Raj Nandan Sharma 18649f9c0c customizable badges 2024-01-06 12:25:43 +05:30
Raj Nandan Sharma f1f5f11c64 customizable badges 2024-01-06 12:22:55 +05:30
Raj Nandan Sharma 686064b5a8 updated readme 2024-01-02 23:31:06 +05:30
Raj Nandan Sharma f5db442eea updated readme 2024-01-02 23:30:32 +05:30
Raj Nandan Sharma ec8f431e35 updated readme 2024-01-02 23:29:37 +05:30
Raj Nandan Sharma 6dd6cf44e2 updated docs 2024-01-01 23:57:46 +05:30
Raj Nandan Sharma c750d0b4e3 added incident management apis 2024-01-01 23:53:08 +05:30
Raj Nandan Sharma b53e270331 updated docs 2023-12-27 17:52:31 +05:30
Raj Nandan Sharma 812c633bee optimized ssr by 100% 2023-12-25 23:38:16 +05:30
Raj Nandan Sharma 92d2c4034b optimized ssr by 100% 2023-12-25 23:30:48 +05:30
Raj Nandan Sharma 0b6de5e3db new doc 2023-12-25 22:49:50 +05:30
Raj Nandan Sharma b9fe4f069f new build 2023-12-25 22:13:27 +05:30
Raj Nandan Sharma d8d04a79d0 Bug fix in uptime percentage 2023-12-24 16:29:30 +05:30
Raj Nandan Sharma 44f813d0a0 Updated readme 2023-12-24 15:45:34 +05:30
Raj Nandan Sharma bdb9f3890d Added Markdown Badges Documentation 2023-12-24 15:36:57 +05:30
Raj Nandan Sharma c12818a979 Added Markdown Badges Documentation 2023-12-24 15:34:58 +05:30
Raj Nandan Sharma 5076407ee6 Added Markdown Badges 2023-12-24 15:31:33 +05:30
Raj Nandan Sharma 6eeedbe5a1 Updated screenshot 2023-12-23 13:39:16 +05:30
284 changed files with 20848 additions and 39310 deletions
+7
View File
@@ -0,0 +1,7 @@
NODE_ENV=production
PORT=3000
GH_TOKEN=your_github_token
API_TOKEN=your_api_token
API_IP=""
API_IP_REGEX=""
KENER_BASE_PATH=""
+2
View File
@@ -0,0 +1,2 @@
github: rajnandan1
buy_me_a_coffee: rajnandan1
+38
View File
@@ -0,0 +1,38 @@
---
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
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.
@@ -0,0 +1,13 @@
---
name: Create Incident Template
about: Create Incident Template
title: Title of Incident
labels: incident
assignees: ''
---
Your Incident Description goes here. Markdown Supported
[start_datetime:utcSeconds]
[end_datetime:utcSeconds]
+20
View File
@@ -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.
+61
View File
@@ -0,0 +1,61 @@
---
name: Publish Docker image to Dockerhub and GHCR
on:
push:
branches:
- main
tags:
- "*.*.*"
paths-ignore:
- '**/*.md'
- 'docs/**'
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
if: ${{ vars.DOCKERHUB_IMAGE_NAME != '' || vars.GHCR_IMAGE_NAME != '' }}
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Log in to Docker Hub
if: ${{ github.event_name != 'pull_request' && vars.DOCKERHUB_IMAGE_NAME != ''
}}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry
if: ${{ github.event_name != 'pull_request' && vars.GHCR_IMAGE_NAME != '' }}
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: |
${{ vars.DOCKERHUB_IMAGE_NAME }}
${{ vars.GHCR_IMAGE_NAME }}
tags: |
type=raw,value=latest,enable=${{ endsWith(github.ref, 'main') }}
type=ref,event=branch,enable=${{ !endsWith(github.ref, 'main') }}
type=semver,pattern={{version}}
flavor: |
latest=false
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name != 'pull_request' && !env.ACT}}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
+9 -1
View File
@@ -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,10 @@ 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
+22
View File
@@ -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/
+9
View File
@@ -0,0 +1,9 @@
{
"useTabs": true,
"semi": true,
"tabWidth": 4,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}
+78
View File
@@ -0,0 +1,78 @@
FROM lsiobase/alpine:3.18 as base
ENV TZ=Etc/UTC
RUN \
echo "**** install build packages ****" && \
apk add --no-cache \
nodejs \
npm \
python3 \
make \
gcc \
g++ \
sqlite \
sqlite-dev \
libc6-compat && \
echo "**** cleanup ****" && \
rm -rf \
/root/.cache \
/tmp/*
# set OS timezone specified by docker ENV
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# ARG data_dir=/config
# VOLUME $data_dir
# ENV CONFIG_DIR=$data_dir
COPY docker/root/ /
# build requires devDependencies which are not used by production deploy
# so build in a stage so we can copy results to clean "deploy" stage later
FROM base as build
WORKDIR /app
COPY --chown=abc:abc . /app
RUN \
npm install node-gyp -g && \
npm_config_build_from_source=true npm install better-sqlite3 && \
npm install \
&& chown -R root:root node_modules \
&& npm run build
FROM base as app
# copy package, required libs (npm,nodejs) results of build, prod entrypoint, and examples to be used to populate config dir
# to clean, new stage
COPY --chown=abc:abc package*.json ./
COPY --from=base /usr/local/bin /usr/local/bin
COPY --from=base /usr/local/lib /usr/local/lib
COPY --chown=abc:abc static /app/static
COPY --chown=abc:abc database /app/database
COPY --chown=abc:abc build.js /app/build.js
COPY --chown=abc:abc sitemap.js /app/sitemap.js
COPY --chown=abc:abc openapi.json /app/openapi.json
COPY --chown=abc:abc src/lib/server /app/src/lib/server
COPY --from=build --chown=abc:abc /app/build /app/build
COPY --from=build --chown=abc:abc /app/main.js /app/main.js
ENV NODE_ENV=production
# install prod dependencies and clean cache
RUN npm install --omit=dev \
&& npm cache clean --force \
&& chown -R abc:abc node_modules
ARG webPort=3000
ENV PORT=$webPort
EXPOSE $PORT
# leave entrypoint blank!
# uses LSIO s6-init entrypoint with scripts
# that populate CONFIG_DIR with static dir, monitor/site.yaml when dir is empty
# and chown's all files so they are owned by proper user based on PUID/GUID env
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2023 Raj Nandan Sharma
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+108 -15
View File
@@ -1,22 +1,115 @@
# 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.
# Kener - A Sveltekit NodeJS Status Page System
It uses files to store the data. Other adapters are coming soon
<p align="center">
<img src="https://kener.ing/newbg.png" width="100%" height="auto" class="rounded-lg shadow-lg" alt="kener example illustration">
</p>
Kener is still under development. There might be bugs. Please report them and I will fix them
<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://hub.docker.com/r/rajnandan1/kener"><img src="https://img.shields.io/docker/pulls/rajnandan1/kener" alt="Docker Kener" /></a>
<img alt="GitHub Repo Updated" src="https://badges.pufler.dev/updated/rajnandan1/kener">
</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>
Visit a live server [here](https://kener.ing)
Read the documentation [here](https://kener.ing/docs)
![alt text](static/ss.png "SS")
#### [👉 Visit a live server](https://kener.ing)
#### [👉 Quick Start](https://kener.ing/docs/quick-start)
#### [👉 Documentation](https://kener.ing/docs/home)
## What is Kener?
Kener: Open-source sveltekit status page system, crafted with lot of thought so that it looks modern.
It does not aim to replace the Datadogs of the world. It simply tries to help someone come with a status page for the world.
Kener name is derived from the word "Kene" which means "how is it going" in Assamese, then .ing is added to make cooler.
<div align="left">
<img alt="Visitor Stats" src="https://widgetbite.com/stats/rajnandan"/>
</div>
## 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
- Real-time monitoring
- Polls HTTP endpoint or Push data to monitor using Rest APIs
- Handles Timezones for visitors
- Categorize Monitors into different Sections
- Cron-based scheduling for monitors. Minimum per minute
- Flexible monitor configuration using YAML. Define your own parsing for monitor being UP/DOWN/DEGRADED
- Construct complex API Polls - Chain, Secrets etc
- Supports a Default Status for Monitors. Example defaultStatus=DOWN if you don't hit API per minute with Status UP
- Supports base path for hosting in k8s
- Pre-built docker image for easy deployment
- Supports webhooks/discord/slack for notifications
### Customization and Branding
- Customizable status page using yaml or code
- Badge generation for status and uptime of Monitors
- Support for custom domains
- Embed Monitor as an iframe or widget
- Light + Dark Theme
- Internationalization support
### Incident Management
- Create Incidents using Github Issues - Rich Text
- Or use APIs to create Incidents
### User Experience and Design
- 100% Accessibility Score
- Easy installation and setup
- User-friendly interface
- Responsive design for various devices
- Auto SEO and Social Media ready
## Technologies used
- [SvelteKit](https://kit.svelte.dev/)
- [shadcn-svelte](https://www.shadcn-svelte.com/)
## Inspired from
- [Upptime](https://upptime.js.org/)
- [SvelteKit](https://kit.svelte.dev/)
- [shadcn-svelte](https://www.shadcn-svelte.com/)
## Roadmap
- [ ] Add notification
- [ ] Add api to create incident
- [ ] Add Mysql adapter
## Inspired from
- [Upptime](https://upptime.js.org/)
## Screenshots
![image](static/marken_90.png)
![image](static/marken_api.png)
![image](static/marken_badge.png)
![image](static/marken_embed.png)
![image](static/marken_inci.png)
![image](static/marken_share.png)
![image](static/marken_td.png)
![image](static/marken_tl.png)
![image](static/marken_theme.png)
## Support Me
If you are using Kener and want to support me, you can do so by sponsoring me on GitHub or buying me a coffee.
[Sponsor Me Using Github](https://github.com/sponsors/rajnandan1)
[Buy Me a Coffee](https://www.buymeacoffee.com/rajnandan1)
![image](https://badges.pufler.dev/visits/rajnandan1/kener)
+460
View File
@@ -0,0 +1,460 @@
import yaml from "js-yaml";
import fs from "fs-extra";
import axios from "axios";
import {
IsValidURL,
checkIfDuplicateExists,
IsValidHTTPMethod,
ValidateIpAddress,
IsValidHost,
IsValidRecordType,
IsValidNameServer
} from "./src/lib/server/tool.js";
import { API_TIMEOUT, AnalyticsProviders } from "./src/lib/server/constants.js";
import { GetAllGHLabels, CreateGHLabel } from "./src/lib/server/github.js";
const configPathFolder = "./config";
const databaseFolder = process.argv[2] || "./database";
const defaultEval = `(function (statusCode, responseTime, responseData) {
let statusCodeShort = Math.floor(statusCode/100);
if(statusCode == 429 || (statusCodeShort >=2 && statusCodeShort <= 3)) {
return {
status: 'UP',
latency: responseTime,
}
}
return {
status: 'DOWN',
latency: responseTime,
}
})`;
function validateServerFile(server) {
//if empty return true
if (Object.keys(server).length === 0) {
return true;
}
//server.triggers is present then it should be an array
if (server.triggers !== undefined && !Array.isArray(server.triggers)) {
console.log("triggers should be an array");
return false;
}
///each trigger should have a name, type, and url
if (server.triggers !== undefined) {
for (let i = 0; i < server.triggers.length; i++) {
const trigger = server.triggers[i];
if (
trigger.name === undefined ||
trigger.type === undefined ||
trigger.url === undefined
) {
console.log("trigger should have name, type, and url");
return false;
}
}
}
//if database is present then it should be an object, and they key can be either postgres or sqlite
if (server.database !== undefined && typeof server.database !== "object") {
console.log("database should be an object");
return false;
}
if (server.database !== undefined) {
let dbtype = Object.keys(server.database);
if (dbtype.length !== 1) {
console.log("database should have only one key");
return false;
}
if (dbtype[0] !== "postgres" && dbtype[0] !== "sqlite") {
console.log("database should be either postgres or sqlite");
return false;
}
}
return true;
}
async function Build() {
console.log("️ Building Kener...");
let site = {};
let server = {};
let monitors = [];
try {
site = yaml.load(fs.readFileSync(configPathFolder + "/site.yaml", "utf8"));
monitors = yaml.load(fs.readFileSync(configPathFolder + "/monitors.yaml", "utf8"));
} catch (error) {
console.log(error);
process.exit(1);
}
try {
server = yaml.load(fs.readFileSync(configPathFolder + "/server.yaml", "utf8"));
if (!validateServerFile(server)) {
process.exit(1);
}
} catch (error) {
console.warn("server.yaml not found");
server = {};
}
if (
site.github === undefined ||
site.github.owner === undefined ||
site.github.repo === undefined
) {
console.log("github owner and repo are required");
site.hasGithub = false;
// process.exit(1);
} else {
site.hasGithub = true;
}
if (site.hasGithub && !!!site.github.incidentSince) {
site.github.incidentSince = 720;
}
if (site.hasGithub && !!!site.github.apiURL) {
site.github.apiURL = "https://api.github.com";
}
const FOLDER_DB = databaseFolder;
const FOLDER_SITE = FOLDER_DB + "/site.json";
const FOLDER_MONITOR = FOLDER_DB + "/monitors.json";
const FOLDER_SERVER = FOLDER_DB + "/server.json";
for (let i = 0; i < monitors.length; i++) {
const monitor = monitors[i];
let name = monitor.name;
let tag = monitor.tag;
let hasAPI = monitor.api !== undefined && monitor.api !== null;
let hasPing = monitor.ping !== undefined && monitor.ping !== null;
let hasDNS = monitor.dns !== undefined && monitor.dns !== null;
let folderName = name.replace(/[^a-z0-9]/gi, "-").toLowerCase();
monitors[i].folderName = folderName;
if (!name || !tag) {
console.log("name, tag are required");
process.exit(1);
}
if (
monitor.dayDegradedMinimumCount &&
(isNaN(monitor.dayDegradedMinimumCount) || monitor.dayDegradedMinimumCount < 1)
) {
console.log("dayDegradedMinimumCount is not a number or it is less than 1");
process.exit(1);
} else if (monitor.dayDegradedMinimumCount === undefined) {
monitors[i].dayDegradedMinimumCount = 1;
}
if (
monitor.dayDownMinimumCount &&
(isNaN(monitor.dayDownMinimumCount) || monitor.dayDownMinimumCount < 1)
) {
console.log("dayDownMinimumCount is not a number or it is less than 1");
process.exit(1);
} else if (monitor.dayDownMinimumCount === undefined) {
monitors[i].dayDownMinimumCount = 1;
}
if (
monitor.includeDegradedInDowntime === undefined ||
monitor.includeDegradedInDowntime !== true
) {
monitors[i].includeDegradedInDowntime = false;
}
if (hasPing) {
let hostsV4 = monitor.ping.hostsV4;
let hostsV6 = monitor.ping.hostsV6;
let hasV4 = false;
let hasV6 = false;
if (hostsV4 && Array.isArray(hostsV4) && hostsV4.length > 0) {
hostsV4.forEach((host) => {
if (ValidateIpAddress(host) == "Invalid") {
console.log(`hostsV4 ${host} is not valid`);
process.exit(1);
}
});
hasV4 = true;
}
if (hostsV6 && Array.isArray(hostsV6) && hostsV6.length > 0) {
hostsV6.forEach((host) => {
if (ValidateIpAddress(host) == "Invalid") {
console.log(`hostsV6 ${host} is not valid`);
process.exit(1);
}
});
hasV6 = true;
}
if (!hasV4 && !hasV6) {
console.log("hostsV4 or hostsV6 is required");
process.exit(1);
}
monitors[i].hasPing = true;
}
if (hasDNS) {
let dnsData = monitor.dns;
let domain = dnsData.host;
//check if domain is valid
if (!!!domain || !IsValidHost(domain)) {
console.log("domain is not valid");
process.exit(1);
}
let recordType = dnsData.lookupRecord;
//check if recordType is valid
if (!!!recordType || !IsValidRecordType(recordType)) {
console.log("recordType is not valid");
process.exit(1);
}
let nameServer = dnsData.nameServer;
//check if nameserver is valid
if (!!nameServer && !IsValidNameServer(nameServer)) {
console.log("nameServer is not valid");
process.exit(1);
}
// matchType: "ANY" # ANY, ALL
let matchType = dnsData.matchType;
if (!!!matchType || (matchType !== "ANY" && matchType !== "ALL")) {
console.log("matchType is not valid");
process.exit(1);
}
//values array of string at least one
let values = dnsData.values;
if (!!!values || !Array.isArray(values) || values.length === 0) {
console.log("values is not valid");
process.exit(1);
}
monitors[i].hasDNS = true;
}
if (hasAPI) {
let url = monitor.api.url;
let method = monitor.api.method;
let headers = monitor.api.headers;
let evaluator = monitor.api.eval;
let body = monitor.api.body;
let timeout = monitor.api.timeout;
let hideURLForGet = !!monitor.api.hideURLForGet;
//url
if (!!url) {
if (!IsValidURL(url)) {
console.log("url is not valid");
process.exit(1);
}
}
if (!!method) {
if (!IsValidHTTPMethod(method)) {
console.log("method is not valid");
process.exit(1);
}
method = method.toUpperCase();
} else {
method = "GET";
}
monitors[i].api.method = method;
//headers
if (headers === undefined || headers === null) {
monitors[i].api.headers = undefined;
} else {
//check if headers is a valid json
try {
JSON.parse(JSON.stringify(headers));
} catch (error) {
console.log("headers are not valid. Quitting");
process.exit(1);
}
}
//eval
if (evaluator === undefined || evaluator === null) {
monitors[i].api.eval = defaultEval;
} else {
let evalResp = eval(evaluator + `(200, 1000, "e30=")`);
if (
evalResp === undefined ||
evalResp === null ||
evalResp.status === undefined ||
evalResp.status === null ||
evalResp.latency === undefined ||
evalResp.latency === null
) {
console.log("eval is not valid ");
process.exit(1);
}
monitors[i].api.eval = evaluator;
}
//body
if (body === undefined || body === null) {
monitors[i].api.body = undefined;
} else {
//check if body is a valid string
if (typeof body !== "string") {
console.log("body is not valid should be a string");
process.exit(1);
}
}
//timeout
if (timeout === undefined || timeout === null) {
monitors[i].api.timeout = API_TIMEOUT;
} else {
//check if timeout is a valid number
if (isNaN(timeout) || timeout < 0) {
console.log("timeout is not valid ");
process.exit(1);
}
}
//add a description to the monitor if it is website using api.url and method = GET and headers == undefined
//call the it to see if received content-type is text/html
//if yes, append to description
if (
!hideURLForGet &&
(headers === undefined || headers === null) &&
url !== undefined &&
method === "GET"
) {
try {
const response = await axios({
method: "GET",
url: url,
timeout: API_TIMEOUT
});
if (response.headers["content-type"].includes("text/html")) {
let link = `<a href="${url}" class="font-medium underline underline-offset-4" target="_blank">${url}</a>`;
if (monitors[i].description === undefined) {
monitors[i].description = link;
} else {
monitors[i].description = monitors[i].description?.trim() + " " + link;
}
}
} catch (error) {
console.log(`error while fetching ${url}`);
}
}
}
monitors[i].hasAPI = hasAPI;
}
if (site.siteName === undefined) {
site.siteName = site.title;
}
if (site.theme === undefined) {
site.theme = "system";
}
if (site.themeToggle === undefined) {
site.themeToggle = true;
}
if (site.barStyle === undefined) {
site.barStyle = "FULL";
}
if (site.barRoundness === undefined) {
site.barRoundness = "ROUNDED";
} else {
site.barRoundness = site.barRoundness.toLowerCase();
}
if (site.summaryStyle === undefined) {
site.summaryStyle = "DAY";
}
site.colors = {
UP: site.colors?.UP || "#4ead94",
DOWN: site.colors?.DOWN || "#ca3038",
DEGRADED: site.colors?.DEGRADED || "#e6ca61"
};
if (!!site.analytics) {
const providers = {};
for (let i = 0; i < site.analytics.length; i++) {
const element = site.analytics[i];
if (!!AnalyticsProviders[element.type]) {
if (providers[element.type] === undefined) {
providers[element.type] = {};
providers[element.type].measurementIds = [];
providers[element.type].script = AnalyticsProviders[element.type];
}
providers[element.type].measurementIds.push(element.id);
}
}
site.analytics = providers;
}
if (!!!site.font || !!!site.font.cssSrc || !!!site.font.family) {
site.font = {
cssSrc: "https://fonts.googleapis.com/css2?family=Albert+Sans:ital,wght@0,100..900;1,100..900&display=swap",
family: "Albert Sans"
};
}
if (checkIfDuplicateExists(monitors.map((monitor) => monitor.folderName)) === true) {
console.log("duplicate monitor detected");
process.exit(1);
}
if (checkIfDuplicateExists(monitors.map((monitor) => monitor.tag)) === true) {
console.log("duplicate tag detected");
process.exit(1);
}
fs.ensureFileSync(FOLDER_MONITOR);
fs.ensureFileSync(FOLDER_SITE);
fs.ensureFileSync(FOLDER_SERVER);
try {
fs.writeFileSync(FOLDER_MONITOR, JSON.stringify(monitors, null, 4));
fs.writeFileSync(FOLDER_SITE, JSON.stringify(site, null, 4));
fs.writeFileSync(FOLDER_SERVER, JSON.stringify(server, null, 4));
} catch (error) {
console.log(error);
process.exit(1);
}
console.log("✅ Kener built successfully");
if (site.hasGithub) {
const ghLabels = await GetAllGHLabels(site);
const tagsAndDescription = monitors.map((monitor) => {
return { tag: monitor.tag, description: monitor.name };
});
//add incident label if does not exist
if (ghLabels.indexOf("incident") === -1) {
await CreateGHLabel(site, "incident", "Status of the site");
}
if (ghLabels.indexOf("resolved") === -1) {
await CreateGHLabel(site, "resolved", "Incident is resolved", "65dba6");
}
if (ghLabels.indexOf("identified") === -1) {
await CreateGHLabel(site, "identified", "Incident is Identified", "EBE3D5");
}
if (ghLabels.indexOf("manual") === -1) {
await CreateGHLabel(site, "manual", "Manually Created Incident", "6499E9");
}
if (ghLabels.indexOf("auto") === -1) {
await CreateGHLabel(site, "auto", "Automatically Created Incident", "D6C0B3");
}
if (ghLabels.indexOf("investigating") === -1) {
await CreateGHLabel(site, "investigating", "Incident is investigated", "D4E2D4");
}
if (ghLabels.indexOf("incident-degraded") === -1) {
await CreateGHLabel(
site,
"incident-degraded",
"Status is degraded of the site",
"f5ba60"
);
}
if (ghLabels.indexOf("incident-down") === -1) {
await CreateGHLabel(site, "incident-down", "Status is down of the site", "ea3462");
}
//add tags if does not exist
for (let i = 0; i < tagsAndDescription.length; i++) {
const tag = tagsAndDescription[i].tag;
const description = tagsAndDescription[i].description;
if (ghLabels.indexOf(tag) === -1) {
await CreateGHLabel(site, tag, description);
}
}
console.log("✅ Github labels created successfully");
}
}
Build();
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
const o=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;export{o as g};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
import{n as b,s as w,V as m,I as q,T as x}from"./scheduler.ea4d12df.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},h=o.map((c,g)=>m(c,_=>{e[g]=_,d&=~(1<<g),i&&y()},()=>{d|=1<<g}));return i=!0,y(),function(){q(h),p(),i=!1}})}function I(s){return{subscribe:s.subscribe.bind(s)}}export{I as a,E as d,z as r,A as w};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
import{w as u}from"./index.7ea6c3d8.js";var b;const E=((b=globalThis.__sveltekit_fcreex)==null?void 0:b.base)??"";var h;(h=globalThis.__sveltekit_fcreex)==null||h.assets;const y="sveltekit:snapshot",I="sveltekit:scroll",O="sveltekit:index",c={tap:1,hover:2,viewport:3,eager:4,off:-1},v=location.origin;function T(e){let t=e.baseURI;if(!t){const o=e.getElementsByTagName("base");t=o.length?o[0].href:e.URL}return t}function U(){return{x:pageXOffset,y:pageYOffset}}const d=new WeakSet,p={"preload-code":["","off","tap","hover","viewport","eager"],"preload-data":["","off","tap","hover"],keepfocus:["","true","off","false"],noscroll:["","true","off","false"],reload:["","true","off","false"],replacestate:["","true","off","false"]};function f(e,t){const o=e.getAttribute(`data-sveltekit-${t}`);return S(e,t,o),o}function S(e,t,o){o!==null&&!d.has(e)&&!p[t].includes(o)&&(console.error(`Unexpected value for ${t} — should be one of ${p[t].map(s=>JSON.stringify(s)).join(", ")}`,e),d.add(e))}const _={...c,"":c.hover};function k(e){let t=e.assignedSlot??e.parentNode;return(t==null?void 0:t.nodeType)===11&&(t=t.host),t}function N(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=k(e)}}function L(e,t){let o;try{o=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI)}catch{}const s=e instanceof SVGAElement?e.target.baseVal:e.target,l=!o||!!s||A(o,t)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),r=(o==null?void 0:o.origin)===v&&e.hasAttribute("download");return{url:o,external:l,target:s,download:r}}function P(e){let t=null,o=null,s=null,l=null,r=null,a=null,n=e;for(;n&&n!==document.documentElement;)s===null&&(s=f(n,"preload-code")),l===null&&(l=f(n,"preload-data")),t===null&&(t=f(n,"keepfocus")),o===null&&(o=f(n,"noscroll")),r===null&&(r=f(n,"reload")),a===null&&(a=f(n,"replacestate")),n=k(n);function i(w){switch(w){case"":case"true":return!0;case"off":case"false":return!1;default:return null}}return{preload_code:_[s??"off"],preload_data:_[l??"off"],keep_focus:i(t),noscroll:i(o),reload:i(r),replace_state:i(a)}}function g(e){const t=u(e);let o=!0;function s(){o=!0,t.update(a=>a)}function l(a){o=!1,t.set(a)}function r(a){let n;return t.subscribe(i=>{(n===void 0||o&&i!==n)&&a(n=i)})}return{notify:s,set:l,subscribe:r}}function x(){const{set:e,subscribe:t}=u(!1);return{subscribe:t,check:async()=>!1}}function A(e,t){return e.origin!==v||!e.pathname.startsWith(t)}function V(e){e.client}const Y={url:g({}),page:g({}),navigating:u(null),updated:x()};export{O as I,c as P,I as S,y as a,L as b,P as c,Y as d,E as e,N as f,T as g,V as h,A as i,v as o,U as s};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
import{s as O,z as R,A as q,g as b,l as g,c as z,h as E,i as $,m as w,d as A,k as S,n as k}from"../chunks/scheduler.ea4d12df.js";import{S as B,i as D,d as C,v as H,e as d,a as m,o as j,s as x}from"../chunks/index.12c4b772.js";import{d as N}from"../chunks/singletons.e4f99468.js";const P=()=>{const t=N;return{page:{subscribe:t.page.subscribe},navigating:{subscribe:t.navigating.subscribe},updated:t.updated}},_={subscribe(t){return P().page.subscribe(t)}},y="node_modules/@sveltejs/kit/src/runtime/components/error.svelte";function f(t){var h;let e,i=t[0].status+"",r,l,n,c=((h=t[0].error)==null?void 0:h.message)+"",a;const v={c:function(){e=b("h1"),r=g(i),l=z(),n=b("p"),a=g(c),this.h()},l:function(s){e=E(s,"H1",{});var o=$(e);r=w(o,i),o.forEach(d),l=A(s),n=E(s,"P",{});var p=$(n);a=w(p,c),p.forEach(d),this.h()},h:function(){S(e,y,4,0,57),S(n,y,5,0,81)},m:function(s,o){m(s,e,o),j(e,r),m(s,l,o),m(s,n,o),j(n,a)},p:function(s,[o]){var p;o&1&&i!==(i=s[0].status+"")&&x(r,i),o&1&&c!==(c=((p=s[0].error)==null?void 0:p.message)+"")&&x(a,c)},i:k,o:k,d:function(s){s&&(d(e),d(l),d(n))}};return C("SvelteRegisterBlock",{block:v,id:f.name,type:"component",source:"",ctx:t}),v}function F(t,e,i){let r;R(_,"page"),q(t,_,a=>i(0,r=a));let{$$slots:l={},$$scope:n}=e;H("Error",l,[]);const c=[];return Object.keys(e).forEach(a=>{!~c.indexOf(a)&&a.slice(0,2)!=="$$"&&a!=="slot"&&console.warn(`<Error> was created with unknown prop '${a}'`)}),t.$capture_state=()=>({page:_,$page:r}),[r]}let K=class extends B{constructor(e){super(e),D(this,e,F,f,O,{}),C("SvelteRegisterComponent",{component:this,tagName:"Error",options:e,id:f.name})}};export{K as component};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-1
View File
@@ -1 +0,0 @@
{"version":"1703269613365"}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

-1
View File
@@ -1 +0,0 @@
User-agent: *
Binary file not shown.

Before

Width:  |  Height:  |  Size: 285 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

-7
View File
@@ -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

-37
View File
@@ -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 };
-1307
View File
File diff suppressed because it is too large Load Diff
-225
View File
@@ -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 };
-31
View File
@@ -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-5d2a766d.js')).default;
const server_id = "src/routes/+layout.server.js";
const imports = ["_app/immutable/nodes/0.c41bf379.js","_app/immutable/chunks/scheduler.ea4d12df.js","_app/immutable/chunks/index.12c4b772.js","_app/immutable/chunks/globals.7f7f1b26.js","_app/immutable/chunks/index.cab2b962.js","_app/immutable/chunks/utils.9739163d.js","_app/immutable/chunks/index.7ea6c3d8.js"];
const stylesheets = ["_app/immutable/assets/0.7f04db4e.css"];
const fonts = [];
export { component, fonts, imports, index, _layout_server as server, server_id, stylesheets };
//# sourceMappingURL=0-8bac6565.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"0-8bac6565.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.c41bf379.js\",\"_app/immutable/chunks/scheduler.ea4d12df.js\",\"_app/immutable/chunks/index.12c4b772.js\",\"_app/immutable/chunks/globals.7f7f1b26.js\",\"_app/immutable/chunks/index.cab2b962.js\",\"_app/immutable/chunks/utils.9739163d.js\",\"_app/immutable/chunks/index.7ea6c3d8.js\"];\nexport const stylesheets = [\"_app/immutable/assets/0.7f04db4e.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,yCAAyC,CAAC,yCAAyC,CAAC,yCAAyC,EAAE;AACpT,MAAC,WAAW,GAAG,CAAC,sCAAsC,EAAE;AACxD,MAAC,KAAK,GAAG;;;;"}
-9
View File
@@ -1,9 +0,0 @@
const index = 1;
let component_cache;
const component = async () => component_cache ??= (await import('./error.svelte-f1948e50.js')).default;
const imports = ["_app/immutable/nodes/1.ae816ce0.js","_app/immutable/chunks/scheduler.ea4d12df.js","_app/immutable/chunks/index.12c4b772.js","_app/immutable/chunks/singletons.e4f99468.js","_app/immutable/chunks/index.7ea6c3d8.js"];
const stylesheets = [];
const fonts = [];
export { component, fonts, imports, index, stylesheets };
//# sourceMappingURL=1-54dc7c70.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"1-54dc7c70.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.ae816ce0.js\",\"_app/immutable/chunks/scheduler.ea4d12df.js\",\"_app/immutable/chunks/index.12c4b772.js\",\"_app/immutable/chunks/singletons.e4f99468.js\",\"_app/immutable/chunks/index.7ea6c3d8.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;;;;"}
-151
View File
@@ -1,151 +0,0 @@
import { G as GetIncidents, M as Mapper } from './github-3ae10cb0.js';
import fs from 'fs-extra';
import { G as GetMinuteStartNowTimestampUTC, B as BeginingOfDay } from './tool-5bef1c33.js';
import { S as StatusObj } from './helpers-fc56b344.js';
import { p as public_env } from './shared-server-58a5f352.js';
import 'axios';
import '@markdoc/markdoc';
function parseUptime(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));
}
function parsePercentage(n) {
if (isNaN(n))
return "-";
if (n == 0) {
return "0";
}
if (n == 100) {
return "100";
}
return n.toFixed(4);
}
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];
if (element.message == "No Data")
continue;
percentage90DaysBuildUp.push(parseFloat(element.uptimePercentage));
}
uptime0Day = parseUptime(dailyUps + dailyDegraded, dailyUps + dailyDown + dailyDegraded);
return {
_0Day,
_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");
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-5fa31107.js')).default;
const server_id = "src/routes/+page.server.js";
const imports = ["_app/immutable/nodes/2.1c032969.js","_app/immutable/chunks/scheduler.ea4d12df.js","_app/immutable/chunks/index.12c4b772.js","_app/immutable/chunks/globals.7f7f1b26.js","_app/immutable/chunks/index.b3676155.js","_app/immutable/chunks/utils.9739163d.js","_app/immutable/chunks/incident.07f56014.js","_app/immutable/chunks/index.cab2b962.js","_app/immutable/chunks/index.7ea6c3d8.js"];
const stylesheets = [];
const fonts = [];
export { component, fonts, imports, index, _page_server as server, server_id, stylesheets };
//# sourceMappingURL=2-a75cfff7.js.map
File diff suppressed because one or more lines are too long
-24
View File
@@ -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-7ccd3c5c.js')).default;
const server_id = "src/routes/docs/+page.server.js";
const imports = ["_app/immutable/nodes/3.48942a71.js","_app/immutable/chunks/scheduler.ea4d12df.js","_app/immutable/chunks/index.12c4b772.js","_app/immutable/chunks/index.b3676155.js","_app/immutable/chunks/utils.9739163d.js"];
const stylesheets = [];
const fonts = [];
export { component, fonts, imports, index, _page_server as server, server_id, stylesheets };
//# sourceMappingURL=3-17bd4bcd.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"3-17bd4bcd.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.48942a71.js\",\"_app/immutable/chunks/scheduler.ea4d12df.js\",\"_app/immutable/chunks/index.12c4b772.js\",\"_app/immutable/chunks/index.b3676155.js\",\"_app/immutable/chunks/utils.9739163d.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,yCAAyC,CAAC,yCAAyC,EAAE;AAC9N,MAAC,WAAW,GAAG,GAAG;AAClB,MAAC,KAAK,GAAG;;;;"}
-43
View File
@@ -1,43 +0,0 @@
import { p as public_env } from './shared-server-58a5f352.js';
import { G as GetIncidents, M as Mapper } from './github-3ae10cb0.js';
import fs from 'fs-extra';
import 'axios';
import './tool-5bef1c33.js';
import '@markdoc/markdoc';
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-9a970c64.js')).default;
const server_id = "src/routes/incident/[id]/+page.server.js";
const imports = ["_app/immutable/nodes/4.0e597a8c.js","_app/immutable/chunks/scheduler.ea4d12df.js","_app/immutable/chunks/index.12c4b772.js","_app/immutable/chunks/index.b3676155.js","_app/immutable/chunks/utils.9739163d.js","_app/immutable/chunks/incident.07f56014.js","_app/immutable/chunks/index.cab2b962.js","_app/immutable/chunks/index.7ea6c3d8.js"];
const stylesheets = [];
const fonts = [];
export { component, fonts, imports, index, _page_server as server, server_id, stylesheets };
//# sourceMappingURL=4-7b9a345a.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"4-7b9a345a.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 { G 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.0e597a8c.js\",\"_app/immutable/chunks/scheduler.ea4d12df.js\",\"_app/immutable/chunks/index.12c4b772.js\",\"_app/immutable/chunks/index.b3676155.js\",\"_app/immutable/chunks/utils.9739163d.js\",\"_app/immutable/chunks/incident.07f56014.js\",\"_app/immutable/chunks/index.cab2b962.js\",\"_app/immutable/chunks/index.7ea6c3d8.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,yCAAyC,CAAC,yCAAyC,CAAC,4CAA4C,CAAC,yCAAyC,CAAC,yCAAyC,EAAE;AAC/V,MAAC,WAAW,GAAG,GAAG;AAClB,MAAC,KAAK,GAAG;;;;"}
@@ -1,25 +0,0 @@
import { c as create_ssr_component, v as validate_component, e as escape, a as each, b as add_attribute } from './ssr-3ed108ea.js';
import './index3-cffb6b6f.js';
import './index2-d2b6b2d2.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-5 w-5" alt="" 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-5d2a766d.js.map
@@ -1 +0,0 @@
{"version":3,"file":"_layout.svelte-5d2a766d.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-5 w-5\" alt=\"\" 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,kCAAkC,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;AAC7mB,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,127 +0,0 @@
import { c as create_ssr_component, b as add_attribute, e as escape, v as validate_component, a as each } from './ssr-3ed108ea.js';
import { C as Card, a as Card_content } from './card-content-bc70344f.js';
import 'clsx';
import { B as Badge, I as Incident, R as Root, T as Trigger, H as Hover_card_content, a as Icon$1 } from './incident-3b230fb3.js';
import { b as buttonVariants } from './index3-cffb6b6f.js';
import { tv } from 'tailwind-variants';
import 'tailwind-merge';
import './index2-d2b6b2d2.js';
import './helpers-fc56b344.js';
import 'moment';
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;
tv({
base: "relative w-full rounded-lg border p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11",
variants: {
variant: {
default: "bg-background text-foreground",
destructive: "text-destructive border-destructive/50 dark:border-destructive [&>svg]:text-destructive text-destructive"
}
},
defaultVariants: {
variant: "default"
}
});
const Monitor = create_ssr_component(($$result, $$props, $$bindings, slots) => {
let { monitor } = $$props;
monitor.pageData._0Day;
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);
return `<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: "pb-4 pt-2" }, {}, {
default: () => {
return `<div class="grid grid-cols-12 gap-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]"><a href="javascript:void(0);">${validate_component(Badge, "Badge").$$render(
$$result,
{
variant: ""
},
{},
{
default: () => {
return `90 Day ► ${escape(uptime90Day)}%`;
}
}
)}</a> <a href="javascript:void(0);">${validate_component(Badge, "Badge").$$render($$result, { variant: "outline" }, {}, {
default: () => {
return `Today ► ${escape(uptime0Day)}%`;
}
})}</a></div> <div class="col-span-12 md:col-span-4 text-right h-[32px]">${_90Day[todayDD] ? `<div class="${"text-api-up 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 flex-wrap">${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>`;
}
})}`;
}
})}</section>`;
});
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> ${each(data.monitors, (monitor) => {
return `${validate_component(Monitor, "Monitor").$$render($$result, { monitor }, {}, {})}`;
})}` : ``}`;
});
export { Page as default };
//# sourceMappingURL=_page.svelte-5fa31107.js.map
File diff suppressed because one or more lines are too long
@@ -1,29 +0,0 @@
import { c as create_ssr_component, v as validate_component, a as each, e as escape, b as add_attribute } from './ssr-3ed108ea.js';
import Markdoc from '@markdoc/markdoc';
import { C as Card, a as Card_content } from './card-content-bc70344f.js';
import 'clsx';
import 'tailwind-merge';
const Page = create_ssr_component(($$result, $$props, $$bindings, slots) => {
let { data } = $$props;
const ast = Markdoc.parse(data.md);
const content = Markdoc.transform(ast);
let html = Markdoc.renderers.html(content);
let sideBar = [];
if ($$props.data === void 0 && $$bindings.data && data !== void 0)
$$bindings.data(data);
return `<section class="mx-auto container rounded-3xl mt-8">${validate_component(Card, "Card.Root").$$render($$result, {}, {}, {
default: () => {
return `${validate_component(Card_content, "Card.Content").$$render($$result, {}, {}, {
default: () => {
return `<div class="grid grid-cols-5 gap-4"><div class="col-span-5 md:col-span-1 pt-2 hidden md:block border-r-2 border-secondary"><ul class="w-full text-sm font-medium sticky top-0 overflow-y-auto max-h-screen">${each(sideBar, (item) => {
return `<li class="w-full py-2"><a href="${"#" + escape(item.id, true)}"${add_attribute("class", item.type == "h2" ? "pl-5" : "", 0)}>${escape(item.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:px-[0.3rem] dark:prose-code:bg-yellow-100 dark:prose-code:text-primary-foreground 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-7ccd3c5c.js.map
@@ -1 +0,0 @@
{"version":3,"file":"_page.svelte-7ccd3c5c.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/docs/_page.svelte.js"],"sourcesContent":["import { c as create_ssr_component, v as validate_component, b as each, e as escape, a as add_attribute } from \"../../../chunks/ssr.js\";\nimport Markdoc from \"@markdoc/markdoc\";\nimport { C as Card, a as Card_content } from \"../../../chunks/card-content.js\";\nimport \"clsx\";\nconst Page = create_ssr_component(($$result, $$props, $$bindings, slots) => {\n let { data } = $$props;\n const ast = Markdoc.parse(data.md);\n const content = Markdoc.transform(ast);\n let html = Markdoc.renderers.html(content);\n let sideBar = [];\n if ($$props.data === void 0 && $$bindings.data && data !== void 0)\n $$bindings.data(data);\n return `<section class=\"mx-auto container rounded-3xl mt-8\">${validate_component(Card, \"Card.Root\").$$render($$result, {}, {}, {\n default: () => {\n return `${validate_component(Card_content, \"Card.Content\").$$render($$result, {}, {}, {\n default: () => {\n return `<div class=\"grid grid-cols-5 gap-4\"><div class=\"col-span-5 md:col-span-1 pt-2 hidden md:block border-r-2 border-secondary\"><ul class=\"w-full text-sm font-medium sticky top-0 overflow-y-auto max-h-screen\">${each(sideBar, (item) => {\n return `<li class=\"w-full py-2\"><a href=\"${\"#\" + escape(item.id, true)}\"${add_attribute(\"class\", item.type == \"h2\" ? \"pl-5\" : \"\", 0)}>${escape(item.text)}</a> </li>`;\n })}</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:px-[0.3rem] dark:prose-code:bg-yellow-100 dark:prose-code:text-primary-foreground 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>`;\n }\n })}`;\n }\n })}</section>`;\n});\nexport {\n Page as default\n};\n"],"names":[],"mappings":";;;;;;AAIK,MAAC,IAAI,GAAG,oBAAoB,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,KAAK;AAC5E,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;AACzB,EAAE,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACrC,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;AACzC,EAAE,IAAI,IAAI,GAAG,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC7C,EAAE,IAAI,OAAO,GAAG,EAAE,CAAC;AACnB,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,oDAAoD,EAAE,kBAAkB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,EAAE;AACjI,IAAI,OAAO,EAAE,MAAM;AACnB,MAAM,OAAO,CAAC,EAAE,kBAAkB,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,EAAE;AAC5F,QAAQ,OAAO,EAAE,MAAM;AACvB,UAAU,OAAO,CAAC,4MAA4M,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,IAAI,KAAK;AACxP,YAAY,OAAO,CAAC,iCAAiC,EAAE,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI,GAAG,MAAM,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC;AAClL,WAAW,CAAC,CAAC,yZAAyZ,EAAE,IAAI,CAAC,iDAAiD,CAAC,CAAC;AAChe,SAAS;AACT,OAAO,CAAC,CAAC,CAAC,CAAC;AACX,KAAK;AACL,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC;AACjB,CAAC;;;;"}
@@ -1,109 +0,0 @@
import { c as create_ssr_component, e as escape, v as validate_component, a as each, h as compute_rest_props, d as validate_store, f as subscribe, i as spread, j as escape_object } from './ssr-3ed108ea.js';
import 'clsx';
import { B as Badge, I as Incident } from './incident-3b230fb3.js';
import { s as setCtx, g as getAttrs } from './index3-cffb6b6f.js';
import { c as cn } from './card-content-bc70344f.js';
import 'moment';
import './index2-d2b6b2d2.js';
import './helpers-fc56b344.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 });
validate_store(root, "root");
$$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 `<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 text-2xl bg-red-500" }, {}, {
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"><p class="text-xl" data-svelte-h="svelte-18j567b">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 text-2xl bg-red-500" }, {}, {
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"><p class="text-xl" data-svelte-h="svelte-1q310fe">No recent incidents</p></div>`}</div></section>`;
});
export { Page as default };
//# sourceMappingURL=_page.svelte-9a970c64.js.map
File diff suppressed because one or more lines are too long
-140
View File
@@ -1,140 +0,0 @@
import { j as json } from './index-2b68e648.js';
import fs from 'fs-extra';
import moment from 'moment-timezone';
let statusObj = {
UP: "api-up",
DEGRADED: "api-degraded",
DOWN: "api-down",
NO_DATA: "api-nodata"
};
function parseUptime(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));
}
function parsePercentage(n) {
if (isNaN(n))
return "-";
if (n == 0) {
return "0";
}
if (n == 100) {
return "100";
}
return n.toFixed(4);
}
async function POST({ request }) {
const payload = await request.json();
const tz = payload.tz;
let _0Day = {};
let _90Day = {};
let uptime0Day = "0";
let dailyUps = 0;
let dailyDown = 0;
let percentage90DaysBuildUp = [];
let latency90DaysBuildUp = [];
let dailyDegraded = 0;
let dailyLatencyBuildUp = [];
const now = moment.tz(tz);
let minuteFromMidnightTillNow = now.diff(now.clone().startOf("day"), "minutes");
const midnight90DaysAgo = now.clone().subtract(90, "days").startOf("day");
for (let i = 0; i <= minuteFromMidnightTillNow; i++) {
let eachMin = moment.tz(tz).startOf("day").add(i, "minutes").format("YYYY-MM-DD HH:mm:00");
_0Day[eachMin] = {
timestamp: eachMin,
status: "NO_DATA",
cssClass: statusObj.NO_DATA,
latency: "NA",
index: i
};
}
for (let i = 0; i <= 90; i++) {
let eachDay = midnight90DaysAgo.clone().add(i, "days").format("YYYY-MM-DD");
_90Day[eachDay] = {
timestamp: eachDay,
UP: 0,
DEGRADED: 0,
DOWN: 0,
uptimePercentage: 0,
avgLatency: 0,
latency: 0,
cssClass: statusObj.NO_DATA,
message: "No Data"
};
}
let day0 = JSON.parse(fs.readFileSync(payload.day0, "utf8"));
let _90DayFileData = JSON.parse(fs.readFileSync(payload.day90, "utf8"));
for (const timestampISO in _90DayFileData) {
let cssClass = statusObj.UP;
let message = "OK";
const element = _90DayFileData[timestampISO];
if (element === void 0)
continue;
let currentDay = moment.tz(timestampISO, tz).format("YYYY-MM-DD");
if (_90Day[currentDay] === void 0)
continue;
_90Day[currentDay].UP = element.UP;
_90Day[currentDay].DEGRADED = element.DEGRADED;
_90Day[currentDay].DOWN = element.DOWN;
_90Day[currentDay].avgLatency = element.avgLatency;
_90Day[currentDay].latency = element.latency;
_90Day[currentDay].uptimePercentage = parseUptime(element.UP + element.DEGRADED, element.UP + element.DEGRADED + element.DOWN);
if (element.DEGRADED > 0) {
cssClass = statusObj.DEGRADED;
message = "Degraded for " + element.DEGRADED + " minutes";
}
if (element.DOWN > 0) {
cssClass = statusObj.DOWN;
message = "Down for " + element.DOWN + " minutes";
}
_90Day[currentDay].cssClass = cssClass;
_90Day[currentDay].message = message;
}
for (const timestampISO in day0) {
if (Object.hasOwnProperty.call(day0, timestampISO)) {
const element = day0[timestampISO];
let min = moment.tz(timestampISO, tz).format("YYYY-MM-DD HH:mm:00");
let status = element.status;
let latency = element.latency;
if (_0Day[min] !== void 0) {
_0Day[min].status = status;
_0Day[min].cssClass = statusObj[status];
_0Day[min].latency = latency;
dailyUps = status == "UP" ? dailyUps + 1 : dailyUps;
dailyDown = status == "DOWN" ? dailyDown + 1 : dailyDown;
dailyDegraded = status == "DEGRADED" ? dailyDegraded + 1 : dailyDegraded;
dailyLatencyBuildUp.push(latency);
}
}
}
for (const key in _90Day) {
if (Object.hasOwnProperty.call(_90Day, key)) {
const element = _90Day[key];
if (element.message == "No Data")
continue;
percentage90DaysBuildUp.push(parseFloat(element.uptimePercentage));
latency90DaysBuildUp.push(parseFloat(element.avgLatency));
}
}
uptime0Day = parseUptime(dailyUps + dailyDegraded, dailyUps + dailyDown + dailyDegraded);
return json({
_0Day,
_90Day,
uptime0Day,
uptime90Day: parsePercentage(percentage90DaysBuildUp.reduce((a, b) => a + b, 0) / percentage90DaysBuildUp.length),
avgLatency90Day: latency90DaysBuildUp.length > 0 ? (latency90DaysBuildUp.reduce((a, b) => a + b, 0) / latency90DaysBuildUp.length).toFixed(0) : "-",
avgLatency0Day: dailyLatencyBuildUp.length > 0 ? (dailyLatencyBuildUp.reduce((a, b) => a + b, 0) / dailyLatencyBuildUp.length).toFixed(0) : "-",
dailyUps,
dailyDown,
dailyDegraded
});
}
export { POST };
//# sourceMappingURL=_server-22de44cc.js.map
File diff suppressed because one or more lines are too long
-87
View File
@@ -1,87 +0,0 @@
import { j as json } from './index-2b68e648.js';
import fs from 'fs-extra';
import { p as public_env } from './shared-server-58a5f352.js';
import 'moment';
import { a as GetNowTimestampUTC, b as GetMinuteStartTimestampUTC, G as GetMinuteStartNowTimestampUTC } from './tool-5bef1c33.js';
import Randomstring from 'randomstring';
const API_TOKEN = process.env.API_TOKEN;
const API_IP = process.env.API_IP;
const checkIfValidTag = function(tag) {
let tags = [];
let monitors = [];
try {
monitors = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/monitors.json", "utf8"));
tags = monitors.map((monitor) => monitor.tag);
if (tags.indexOf(tag) == -1) {
throw new Error("not a valid tag");
}
} catch (err) {
return false;
}
return true;
};
const store = function(data, authHeader, ip) {
const tag = data.tag;
const authToken = authHeader.replace("Bearer ", "");
if (authToken !== API_TOKEN) {
return { error: "invalid token", status: 401 };
}
if (API_IP !== void 0 && ip != "" && ip !== API_IP) {
return { error: "invalid ip", status: 401 };
}
const resp = {};
if (data.status === void 0 || ["UP", "DOWN", "DEGRADED"].indexOf(data.status) === -1) {
return { error: "status missing", status: 400 };
}
if (data.latency === void 0 || isNaN(data.latency)) {
return { error: "latency missing or not a number", status: 400 };
}
if (data.timestampInSeconds !== void 0 && isNaN(data.timestampInSeconds)) {
return { error: "timestampInSeconds not a number", status: 400 };
}
if (data.timestampInSeconds === void 0) {
data.timestampInSeconds = GetNowTimestampUTC();
}
data.timestampInSeconds = GetMinuteStartTimestampUTC(data.timestampInSeconds);
resp.status = data.status;
resp.latency = data.latency;
resp.type = "webhook";
let timestamp = GetMinuteStartNowTimestampUTC();
try {
if (data.timestampInSeconds > timestamp) {
throw new Error("timestampInSeconds is in future");
}
if (timestamp - data.timestampInSeconds > 90 * 24 * 60 * 60) {
throw new Error("timestampInSeconds is older than 90days");
}
} catch (err) {
return { error: err.message, status: 400 };
}
if (!checkIfValidTag(tag)) {
return { error: "invalid tag", status: 400 };
}
let monitors = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/monitors.json", "utf8"));
const monitor = monitors.find((monitor2) => monitor2.tag === tag);
let day0 = {};
day0[data.timestampInSeconds] = resp;
fs.writeFileSync(public_env.PUBLIC_KENER_FOLDER + `/${monitor.folderName}.webhook.${Randomstring.generate()}.json`, JSON.stringify(day0, null, 2));
return { status: 200, message: "success at " + data.timestampInSeconds };
};
async function POST({ request }) {
const payload = await request.json();
const authorization = request.headers.get("authorization");
let ip = "";
try {
ip = request.headers.get("x-forwarded-for") || request.socket.remoteAddress || request.headers.get("x-real-ip");
} catch (err) {
console.log("IP Not Found " + err.message);
}
let resp = store(payload, authorization, ip);
return json(resp, {
status: resp.status
});
}
export { POST };
//# sourceMappingURL=_server-c18b5fdd.js.map
File diff suppressed because one or more lines are too long
@@ -1,76 +0,0 @@
import { c as create_ssr_component, h as compute_rest_props, i as spread, k as escape_attribute_value, j as escape_object } from './ssr-3ed108ea.js';
import { clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';
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>`;
});
export { Card as C, Card_content as a, cn as c, flyAndScale as f };
//# sourceMappingURL=card-content-bc70344f.js.map
File diff suppressed because one or more lines are too long
@@ -1,33 +0,0 @@
import { c as create_ssr_component, d as validate_store, f as subscribe, e as escape, g as getContext } from './ssr-3ed108ea.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;
validate_store(page, "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-f1948e50.js.map
@@ -1 +0,0 @@
{"version":3,"file":"error.svelte-f1948e50.js","sources":["../../../.svelte-kit/adapter-node/entries/fallbacks/error.svelte.js"],"sourcesContent":["import { g as getContext, c as create_ssr_component, d as validate_store, f 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 validate_store(page, \"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,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC/B,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;;;;"}
-114
View File
@@ -1,114 +0,0 @@
import axios from 'axios';
import { G as GetMinuteStartNowTimestampUTC } from './tool-5bef1c33.js';
import Markdoc from '@markdoc/markdoc';
const GH_TOKEN = process.env.GH_TOKEN;
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;
}
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 GetIncidents = async function(tagName, githubConfig, state = "all") {
if (tagName === void 0) {
return [];
}
if (githubConfig === 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 ast = Markdoc.parse(issue.body);
const content = Markdoc.transform(ast);
const html = Markdoc.renderers.html(content);
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 ast2 = Markdoc.parse(comment.body);
const content2 = Markdoc.transform(ast2);
const html2 = Markdoc.renderers.html(content2);
return {
body: html2,
created_at: comment.created_at,
updated_at: comment.updated_at,
html_url: comment.html_url
};
})
};
}
async function GetCommentsForIssue(issueID, githubConfig) {
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 [];
}
}
export { GetIncidents as G, Mapper as M };
//# sourceMappingURL=github-3ae10cb0.js.map
File diff suppressed because one or more lines are too long
-9
View File
@@ -1,9 +0,0 @@
const StatusObj = {
UP: "api-up",
DEGRADED: "api-degraded",
DOWN: "api-down",
NO_DATA: "api-nodata"
};
export { StatusObj as S };
//# sourceMappingURL=helpers-fc56b344.js.map
@@ -1 +0,0 @@
{"version":3,"file":"helpers-fc56b344.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};\nexport {\n StatusObj as S\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;;;;"}
-621
View File
@@ -1,621 +0,0 @@
import { c as create_ssr_component, h as compute_rest_props, i as spread, k as escape_attribute_value, j as escape_object, v as validate_component, b as add_attribute, e as escape, a as each, d as validate_store, f as subscribe, l as createEventDispatcher } from './ssr-3ed108ea.js';
import { c as cn, C as Card, a as Card_content, f as flyAndScale } from './card-content-bc70344f.js';
import 'clsx';
import { b as buttonVariants, a as setCtx$1, c as getCtx, d as getAttrs$1 } from './index3-cffb6b6f.js';
import { d as derived } from './index2-d2b6b2d2.js';
import { S as StatusObj } from './helpers-fc56b344.js';
import moment from 'moment';
import { tv } from 'tailwind-variants';
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 validate_dynamic_element(tag) {
const is_string = typeof tag === "string";
if (tag && !is_string) {
throw new Error('<svelte:element> expects "this" attribute to be a string.');
}
}
function validate_void_dynamic_element(tag) {
if (tag && is_void(tag)) {
console.warn(`<svelte:element this="${tag}"> is self-closing and cannot have content.`);
}
}
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 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) => {
validate_dynamic_element(tag);
return tag ? (() => {
validate_void_dynamic_element(tag);
return `<${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) => {
validate_dynamic_element(tag);
return tag ? (() => {
validate_void_dynamic_element(tag);
return `<${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 }));
validate_store(idValues, "idValues");
$$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();
validate_store(content, "content");
$$unsubscribe_content = subscribe(content, (value) => $content = value);
validate_store(open, "open");
$$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();
validate_store(trigger, "trigger");
$$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) => {
validate_dynamic_element(tag);
return tag ? (() => {
validate_void_dynamic_element(tag);
return `<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) => {
validate_dynamic_element(tag$1);
return tag$1 ? (() => {
validate_void_dynamic_element(tag$1);
return `<${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) => {
validate_dynamic_element(tag);
return tag ? (() => {
validate_void_dynamic_element(tag);
return `<${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 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) => {
validate_dynamic_element(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;
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 -->`;
}
})}`;
}
})} ${(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, Icon$1 as a };
//# sourceMappingURL=incident-3b230fb3.js.map
File diff suppressed because one or more lines are too long
-78
View File
@@ -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;;;;"}
-105
View File
@@ -1,105 +0,0 @@
import { t as noop, u as safe_not_equal, f as subscribe, r as run_all, w as is_function } from './ssr-3ed108ea.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-d2b6b2d2.js.map
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
@@ -1,9 +0,0 @@
let public_env = {};
function set_private_env(environment) {
}
function set_public_env(environment) {
public_env = environment;
}
export { set_public_env as a, public_env as p, set_private_env as s };
//# sourceMappingURL=shared-server-58a5f352.js.map
@@ -1 +0,0 @@
{"version":3,"file":"shared-server-58a5f352.js","sources":["../../../.svelte-kit/adapter-node/chunks/shared-server.js"],"sourcesContent":["let public_env = {};\nfunction set_private_env(environment) {\n}\nfunction set_public_env(environment) {\n public_env = environment;\n}\nexport {\n set_public_env as a,\n public_env as p,\n set_private_env as s\n};\n"],"names":[],"mappings":"AAAG,IAAC,UAAU,GAAG,GAAG;AACpB,SAAS,eAAe,CAAC,WAAW,EAAE;AACtC,CAAC;AACD,SAAS,cAAc,CAAC,WAAW,EAAE;AACrC,EAAE,UAAU,GAAG,WAAW,CAAC;AAC3B;;;;"}
-276
View File
@@ -1,276 +0,0 @@
function noop() {
}
function run(fn) {
return fn();
}
function blank_object() {
return /* @__PURE__ */ Object.create(null);
}
function run_all(fns) {
fns.forEach(run);
}
function is_function(thing) {
return typeof thing === "function";
}
function safe_not_equal(a, b) {
return a != a ? b == b : a !== b || a && typeof a === "object" || typeof a === "function";
}
function validate_store(store, name) {
if (store != null && typeof store.subscribe !== "function") {
throw new Error(`'${name}' is not a store with a 'subscribe' method`);
}
}
function subscribe(store, ...callbacks) {
if (store == null) {
for (const callback of callbacks) {
callback(void 0);
}
return noop;
}
const unsub = store.subscribe(...callbacks);
return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;
}
function get_store_value(store) {
let value;
subscribe(store, (_) => value = _)();
return value;
}
function compute_rest_props(props, keys) {
const rest = {};
keys = new Set(keys);
for (const k in props)
if (!keys.has(k) && k[0] !== "$")
rest[k] = props[k];
return rest;
}
function custom_event(type, detail, { bubbles = false, cancelable = false } = {}) {
return new CustomEvent(type, { detail, bubbles, cancelable });
}
let current_component;
function set_current_component(component) {
current_component = component;
}
function get_current_component() {
if (!current_component)
throw new Error("Function called outside component initialization");
return current_component;
}
function onDestroy(fn) {
get_current_component().$$.on_destroy.push(fn);
}
function createEventDispatcher() {
const component = get_current_component();
return (type, detail, { cancelable = false } = {}) => {
const callbacks = component.$$.callbacks[type];
if (callbacks) {
const event = custom_event(
/** @type {string} */
type,
detail,
{ cancelable }
);
callbacks.slice().forEach((fn) => {
fn.call(component, event);
});
return !event.defaultPrevented;
}
return true;
};
}
function setContext(key, context) {
get_current_component().$$.context.set(key, context);
return context;
}
function getContext(key) {
return get_current_component().$$.context.get(key);
}
function ensure_array_like(array_like_or_iterator) {
return array_like_or_iterator?.length !== void 0 ? array_like_or_iterator : Array.from(array_like_or_iterator);
}
const _boolean_attributes = (
/** @type {const} */
[
"allowfullscreen",
"allowpaymentrequest",
"async",
"autofocus",
"autoplay",
"checked",
"controls",
"default",
"defer",
"disabled",
"formnovalidate",
"hidden",
"inert",
"ismap",
"loop",
"multiple",
"muted",
"nomodule",
"novalidate",
"open",
"playsinline",
"readonly",
"required",
"reversed",
"selected"
]
);
const boolean_attributes = /* @__PURE__ */ new Set([..._boolean_attributes]);
const invalid_attribute_name_character = /[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u;
function spread(args, attrs_to_add) {
const attributes = Object.assign({}, ...args);
if (attrs_to_add) {
const classes_to_add = attrs_to_add.classes;
const styles_to_add = attrs_to_add.styles;
if (classes_to_add) {
if (attributes.class == null) {
attributes.class = classes_to_add;
} else {
attributes.class += " " + classes_to_add;
}
}
if (styles_to_add) {
if (attributes.style == null) {
attributes.style = style_object_to_string(styles_to_add);
} else {
attributes.style = style_object_to_string(
merge_ssr_styles(attributes.style, styles_to_add)
);
}
}
}
let str = "";
Object.keys(attributes).forEach((name) => {
if (invalid_attribute_name_character.test(name))
return;
const value = attributes[name];
if (value === true)
str += " " + name;
else if (boolean_attributes.has(name.toLowerCase())) {
if (value)
str += " " + name;
} else if (value != null) {
str += ` ${name}="${value}"`;
}
});
return str;
}
function merge_ssr_styles(style_attribute, style_directive) {
const style_object = {};
for (const individual_style of style_attribute.split(";")) {
const colon_index = individual_style.indexOf(":");
const name = individual_style.slice(0, colon_index).trim();
const value = individual_style.slice(colon_index + 1).trim();
if (!name)
continue;
style_object[name] = value;
}
for (const name in style_directive) {
const value = style_directive[name];
if (value) {
style_object[name] = value;
} else {
delete style_object[name];
}
}
return style_object;
}
const ATTR_REGEX = /[&"]/g;
const CONTENT_REGEX = /[&<]/g;
function escape(value, is_attr = false) {
const str = String(value);
const pattern = is_attr ? ATTR_REGEX : CONTENT_REGEX;
pattern.lastIndex = 0;
let escaped = "";
let last = 0;
while (pattern.test(str)) {
const i = pattern.lastIndex - 1;
const ch = str[i];
escaped += str.substring(last, i) + (ch === "&" ? "&amp;" : ch === '"' ? "&quot;" : "&lt;");
last = i + 1;
}
return escaped + str.substring(last);
}
function escape_attribute_value(value) {
const should_escape = typeof value === "string" || value && typeof value === "object";
return should_escape ? escape(value, true) : value;
}
function escape_object(obj) {
const result = {};
for (const key in obj) {
result[key] = escape_attribute_value(obj[key]);
}
return result;
}
function each(items, fn) {
items = ensure_array_like(items);
let str = "";
for (let i = 0; i < items.length; i += 1) {
str += fn(items[i], i);
}
return str;
}
const missing_component = {
$$render: () => ""
};
function validate_component(component, name) {
if (!component || !component.$$render) {
if (name === "svelte:component")
name += " this={...}";
throw new Error(
`<${name}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules. Otherwise you may need to fix a <${name}>.`
);
}
return component;
}
let on_destroy;
function create_ssr_component(fn) {
function $$render(result, props, bindings, slots, context) {
const parent_component = current_component;
const $$ = {
on_destroy,
context: new Map(context || (parent_component ? parent_component.$$.context : [])),
// these will be immediately discarded
on_mount: [],
before_update: [],
after_update: [],
callbacks: blank_object()
};
set_current_component({ $$ });
const html = fn(result, props, bindings, slots);
set_current_component(parent_component);
return html;
}
return {
render: (props = {}, { $$slots = {}, context = /* @__PURE__ */ new Map() } = {}) => {
on_destroy = [];
const result = { title: "", head: "", css: /* @__PURE__ */ new Set() };
const html = $$render(result, props, {}, $$slots, context);
run_all(on_destroy);
return {
html,
css: {
code: Array.from(result.css).map((css) => css.code).join("\n"),
map: null
// TODO
},
head: result.title + result.head
};
},
$$render
};
}
function add_attribute(name, value, boolean) {
if (value == null || boolean && !value)
return "";
const assignment = boolean && value === true ? "" : `="${escape(value, true)}"`;
return ` ${name}${assignment}`;
}
function style_object_to_string(style_object) {
return Object.keys(style_object).filter((key) => style_object[key]).map((key) => `${key}: ${escape_attribute_value(style_object[key])};`).join(" ");
}
export { each as a, add_attribute as b, create_ssr_component as c, validate_store as d, escape as e, subscribe as f, getContext as g, compute_rest_props as h, spread as i, escape_object as j, escape_attribute_value as k, createEventDispatcher as l, missing_component as m, get_store_value as n, onDestroy as o, set_current_component as p, current_component as q, run_all as r, setContext as s, noop as t, safe_not_equal as u, validate_component as v, is_function as w };
//# sourceMappingURL=ssr-3ed108ea.js.map
File diff suppressed because one or more lines are too long
-36
View File
@@ -1,36 +0,0 @@
process.env.PUBLIC_KENER_FOLDER;
const GetNowTimestampUTC = function() {
const now = /* @__PURE__ */ new Date();
const timestamp = now.getTime();
return Math.floor(timestamp / 1e3);
};
const GetMinuteStartTimestampUTC = function(timestamp) {
const now = new Date(timestamp * 1e3);
const minuteStart = new Date(now.getFullYear(), now.getMonth(), now.getDate(), now.getHours(), now.getMinutes(), 0, 0);
const minuteStartTimestamp = minuteStart.getTime();
return Math.floor(minuteStartTimestamp / 1e3);
};
const GetMinuteStartNowTimestampUTC = function() {
const now = /* @__PURE__ */ new Date();
const minuteStart = new Date(now.getFullYear(), now.getMonth(), now.getDate(), now.getHours(), now.getMinutes(), 0, 0);
const minuteStartTimestamp = minuteStart.getTime();
return Math.floor(minuteStartTimestamp / 1e3);
};
const BeginingOfDay = (options = {}) => {
const { date = /* @__PURE__ */ new Date(), timeZone } = options;
const parts = Intl.DateTimeFormat("en-US", {
timeZone,
hourCycle: "h23",
hour: "numeric",
minute: "numeric",
second: "numeric"
}).formatToParts(date);
const hour = parseInt(parts.find((i) => i.type === "hour").value);
const minute = parseInt(parts.find((i) => i.type === "minute").value);
const second = parseInt(parts.find((i) => i.type === "second").value);
const dt = new Date(1e3 * Math.floor((date - hour * 36e5 - minute * 6e4 - second * 1e3) / 1e3));
return dt.getTime() / 1e3;
};
export { BeginingOfDay as B, GetMinuteStartNowTimestampUTC as G, GetNowTimestampUTC as a, GetMinuteStartTimestampUTC as b };
//# sourceMappingURL=tool-5bef1c33.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"tool-5bef1c33.js","sources":["../../../.svelte-kit/adapter-node/chunks/tool.js"],"sourcesContent":["process.env.PUBLIC_KENER_FOLDER;\nconst GetNowTimestampUTC = function() {\n const now = /* @__PURE__ */ new Date();\n const timestamp = now.getTime();\n return Math.floor(timestamp / 1e3);\n};\nconst GetMinuteStartTimestampUTC = function(timestamp) {\n const now = new Date(timestamp * 1e3);\n const minuteStart = new Date(now.getFullYear(), now.getMonth(), now.getDate(), now.getHours(), now.getMinutes(), 0, 0);\n const minuteStartTimestamp = minuteStart.getTime();\n return Math.floor(minuteStartTimestamp / 1e3);\n};\nconst GetMinuteStartNowTimestampUTC = function() {\n const now = /* @__PURE__ */ new Date();\n const minuteStart = new Date(now.getFullYear(), now.getMonth(), now.getDate(), now.getHours(), now.getMinutes(), 0, 0);\n const minuteStartTimestamp = minuteStart.getTime();\n return Math.floor(minuteStartTimestamp / 1e3);\n};\nconst BeginingOfDay = (options = {}) => {\n const { date = /* @__PURE__ */ new Date(), timeZone } = options;\n const parts = Intl.DateTimeFormat(\"en-US\", {\n timeZone,\n hourCycle: \"h23\",\n hour: \"numeric\",\n minute: \"numeric\",\n second: \"numeric\"\n }).formatToParts(date);\n const hour = parseInt(parts.find((i) => i.type === \"hour\").value);\n const minute = parseInt(parts.find((i) => i.type === \"minute\").value);\n const second = parseInt(parts.find((i) => i.type === \"second\").value);\n const dt = new Date(1e3 * Math.floor((date - hour * 36e5 - minute * 6e4 - second * 1e3) / 1e3));\n return dt.getTime() / 1e3;\n};\nexport {\n BeginingOfDay as B,\n GetNowTimestampUTC as G,\n GetMinuteStartTimestampUTC as a,\n GetMinuteStartNowTimestampUTC as b\n};\n"],"names":[],"mappings":"AAAA,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC;AAC3B,MAAC,kBAAkB,GAAG,WAAW;AACtC,EAAE,MAAM,GAAG,mBAAmB,IAAI,IAAI,EAAE,CAAC;AACzC,EAAE,MAAM,SAAS,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;AAClC,EAAE,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,GAAG,CAAC,CAAC;AACrC,EAAE;AACG,MAAC,0BAA0B,GAAG,SAAS,SAAS,EAAE;AACvD,EAAE,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC,CAAC;AACxC,EAAE,MAAM,WAAW,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,GAAG,CAAC,QAAQ,EAAE,EAAE,GAAG,CAAC,OAAO,EAAE,EAAE,GAAG,CAAC,QAAQ,EAAE,EAAE,GAAG,CAAC,UAAU,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACzH,EAAE,MAAM,oBAAoB,GAAG,WAAW,CAAC,OAAO,EAAE,CAAC;AACrD,EAAE,OAAO,IAAI,CAAC,KAAK,CAAC,oBAAoB,GAAG,GAAG,CAAC,CAAC;AAChD,EAAE;AACG,MAAC,6BAA6B,GAAG,WAAW;AACjD,EAAE,MAAM,GAAG,mBAAmB,IAAI,IAAI,EAAE,CAAC;AACzC,EAAE,MAAM,WAAW,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,GAAG,CAAC,QAAQ,EAAE,EAAE,GAAG,CAAC,OAAO,EAAE,EAAE,GAAG,CAAC,QAAQ,EAAE,EAAE,GAAG,CAAC,UAAU,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACzH,EAAE,MAAM,oBAAoB,GAAG,WAAW,CAAC,OAAO,EAAE,CAAC;AACrD,EAAE,OAAO,IAAI,CAAC,KAAK,CAAC,oBAAoB,GAAG,GAAG,CAAC,CAAC;AAChD,EAAE;AACG,MAAC,aAAa,GAAG,CAAC,OAAO,GAAG,EAAE,KAAK;AACxC,EAAE,MAAM,EAAE,IAAI,mBAAmB,IAAI,IAAI,EAAE,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;AAClE,EAAE,MAAM,KAAK,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE;AAC7C,IAAI,QAAQ;AACZ,IAAI,SAAS,EAAE,KAAK;AACpB,IAAI,IAAI,EAAE,SAAS;AACnB,IAAI,MAAM,EAAE,SAAS;AACrB,IAAI,MAAM,EAAE,SAAS;AACrB,GAAG,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;AACzB,EAAE,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC;AACpE,EAAE,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC;AACxE,EAAE,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC;AACxE,EAAE,MAAM,EAAE,GAAG,IAAI,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,GAAG,GAAG,GAAG,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC;AAClG,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,GAAG,GAAG,CAAC;AAC5B;;;;"}
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
-69
View File
@@ -1,69 +0,0 @@
const manifest = (() => {
function __memo(fn) {
let value;
return () => value ??= (value = fn());
}
return {
appDir: "_app",
appPath: "_app",
assets: new Set([".DS_Store","confetti.gif","earth.png","google.png","kener/cashfree-payments.0day.utc.json","kener/cashfree-payouts.0day.utc.json","kener/earth.0day.utc.json","kener/google-search.0day.utc.json","kener/monitors.json","kener/site.json","kener/svelte-website.0day.utc.json","logo.png","logo96.png","robots.txt","ss.png","ss2.png","ss3.png","svelte.svg"]),
mimeTypes: {".gif":"image/gif",".png":"image/png",".json":"application/json",".txt":"text/plain",".svg":"image/svg+xml"},
_: {
client: {"start":"_app/immutable/entry/start.0227d5dd.js","app":"_app/immutable/entry/app.016ea590.js","imports":["_app/immutable/entry/start.0227d5dd.js","_app/immutable/chunks/scheduler.ea4d12df.js","_app/immutable/chunks/singletons.e4f99468.js","_app/immutable/chunks/index.7ea6c3d8.js","_app/immutable/entry/app.016ea590.js","_app/immutable/chunks/scheduler.ea4d12df.js","_app/immutable/chunks/index.12c4b772.js"],"stylesheets":[],"fonts":[]},
nodes: [
__memo(() => import('./chunks/0-8bac6565.js')),
__memo(() => import('./chunks/1-54dc7c70.js')),
__memo(() => import('./chunks/2-a75cfff7.js')),
__memo(() => import('./chunks/3-17bd4bcd.js')),
__memo(() => import('./chunks/4-7b9a345a.js'))
],
routes: [
{
id: "/",
pattern: /^\/$/,
params: [],
page: { layouts: [0,], errors: [1,], leaf: 2 },
endpoint: null
},
{
id: "/api/status",
pattern: /^\/api\/status\/?$/,
params: [],
page: null,
endpoint: __memo(() => import('./chunks/_server-c18b5fdd.js'))
},
{
id: "/api/today",
pattern: /^\/api\/today\/?$/,
params: [],
page: null,
endpoint: __memo(() => import('./chunks/_server-22de44cc.js'))
},
{
id: "/docs",
pattern: /^\/docs\/?$/,
params: [],
page: { layouts: [0,], errors: [1,], leaf: 3 },
endpoint: null
},
{
id: "/incident/[id]",
pattern: /^\/incident\/([^/]+?)\/?$/,
params: [{"name":"id","optional":false,"rest":false,"chained":false}],
page: { layouts: [0,], errors: [1,], leaf: 4 },
endpoint: null
}
],
matchers: async () => {
return { };
}
}
}
})();
const prerendered = new Set([]);
export { manifest, prerendered };
//# sourceMappingURL=manifest.js.map
File diff suppressed because one or more lines are too long
-20414
View File
File diff suppressed because one or more lines are too long
+12 -12
View File
@@ -1,13 +1,13 @@
{
"$schema": "https://shadcn-svelte.com/schema.json",
"style": "default",
"tailwind": {
"config": "tailwind.config.js",
"css": "src/app.postcss",
"baseColor": "slate"
},
"aliases": {
"components": "$lib/components",
"utils": "$lib/utils"
}
}
"$schema": "https://shadcn-svelte.com/schema.json",
"style": "default",
"tailwind": {
"config": "tailwind.config.js",
"css": "src/app.postcss",
"baseColor": "slate"
},
"aliases": {
"components": "$lib/components",
"utils": "$lib/utils"
}
}
+43 -14
View File
@@ -1,19 +1,48 @@
- name: Google Search
description: Search the world's information, including webpages, images, videos and more.
tag: "google-search"
image: "/google.png"
- name: OkBookmarks
description: A free bookmark manager that lets you save and search your bookmarks in the cloud.
tag: "okbookmarks"
image: "https://okbookmarks.com/assets/img/extension_icon128.png"
api:
method: GET
url: https://www.google.com/webhp
- name: Svelte Website
description: Cybernetically enhanced web apps
tag: "svelte-website"
api:
method: GET
url: https://svelte.dev/
image: "/svelte.svg"
method: GET
url: https://okbookmarks.com
- name: Earth
description: Our blue planet
tag: "earth"
defaultStatus: "UP"
image: "/earth.png"
image: "/earth.png"
- name: Frogment
description: A free openAPI spec editor and linter that breaks down your spec into fragments to make editing easier and more intuitive. Visit https://www.frogment.com
tag: "frogment"
image: "/frogment.png"
api:
method: GET
url: https://www.frogment.com
alerts:
DOWN:
failureThreshold: 5
successThreshold: 2
createIncident: false
description: "Write a description here please"
triggers:
- MyWebhook
- Discord Test
- name: CNAME Lookup
description: Monitor example showing how to lookup CNAME record for a domain. The site www.rajnandan.com is hosted on GitHub Pages.
tag: "cname-rajnandan"
image: "https://www.rajnandan.com/assets/images/me.jpg"
defaultStatus: "UP"
dns:
host: "www.rajnandan.com"
lookupRecord: "CNAME"
nameServer: "8.8.8.8"
matchType: "ANY" # ANY, ALL
values:
- "rajnandan1.github.io"
- name: "Frogment APP Ping"
description: "Ping www.frogment.app"
image: https://www.frogment.app/icons/Square107x107Logo.png
tag: "pingFrogmentApp"
defaultStatus: "UP"
ping:
hostsV4:
- "www.frogment.app"
+13
View File
@@ -0,0 +1,13 @@
triggers:
- name: MyWebhook
type: webhook
url: https://kener.requestcatcher.com/test
method: POST
headers:
Authorization: Bearer SomeToken
- name: Discord Test
type: discord
url: https://discord.com/api/webhooks/1310641119767302164/XJvq4MO2lz5yp9XRCJgfc4dbUfcQdHsttFUKTFJx4y_Oo1jNkUXf-CS3RSnamnNNv4Lx
database:
sqlite:
dbName: kener.db
+52 -24
View File
@@ -1,30 +1,58 @@
title: "Kener"
title: "Kener - Open-Source and Modern looking Node.js Status Page for Effortless Incident Management"
siteName: "Kener.ing"
home: "/"
logo: "/logo.png"
siteURL: "https://kener.ing"
favicon: "/logo96.png"
github:
owner: "rajnandan1"
repo: "kener"
incidentSince: 48
owner: "rajnandan1"
repo: "kener"
incidentSince: 720
metaTags:
description: "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."
keywords: "Node.js status page, Incident management tool, Service monitoring, Service outage tracking, Real-time status updates, GitHub integration for incidents, Open-source status page, Node.js monitoring application, Service reliability, User-friendly incident management, Collaborative incident resolution, Seamless outage communication, Service disruption tracker, Real-time incident alerts, Node.js status reporting"
og:description: "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."
og:image: "/ss.png"
og:title: "Kener - Open-Source Node.js Status Page: Kener: Streamlined Node.js Status Page for Effortless Incident Management"
og:type: "website"
og:site_name: "Kener"
twitter:card: "summary_large_image"
twitter:site: "@_rajnandan_"
twitter:creator: "@_rajnandan_"
twitter:image: "/ss.png"
twitter:title: "Kener: Streamlined Node.js Status Page for Effortless Incident Management"
twitter:description: "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."
description: "Kener: Open-source modern looking 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."
keywords: "Node.js status page, Incident management tool, Service monitoring, Service outage tracking, Real-time status updates, GitHub integration for incidents, Open-source status page, Node.js monitoring application, Service reliability, User-friendly incident management, Collaborative incident resolution, Seamless outage communication, Service disruption tracker, Real-time incident alerts, Node.js status reporting"
og:description: "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."
og:image: "https://kener.ing/ss.png"
og:title: "Kener - Open-Source and Modern looking Node.js Status Page for Effortless Incident Management"
og:type: "website"
og:site_name: "Kener"
twitter:card: "summary_large_image"
twitter:site: "@_rajnandan_"
twitter:creator: "@_rajnandan_"
twitter:image: "https://kener.ing/ss.png"
twitter:title: "Kener: Open-Source and Modern looking Node.js Status Page for Effortless Incident Management"
twitter:description: "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."
nav:
- name: "Documentation"
url: "/docs"
- name: "Github"
url: "https://github.com/rajnandan1/kener"
- name: "Documentation"
url: "/docs/home"
- name: "Github"
iconURL: "/github.svg"
url: "https://github.com/rajnandan1/kener"
- name: "Buy me a coffee"
iconURL: "/buymeacoffee.svg"
url: "https://buymeacoffee.com/rajnandan1"
hero:
title: Kener is a Open-Source Status Page System
subtitle: Let your users know what's going on.
title: Kener is an Modern Open-Source Status Page System
subtitle: Let your users know what's going on.
footerHTML: |
Made using
<a href="https://github.com/rajnandan1/kener" target="_blank" rel="noreferrer" class="font-medium underline underline-offset-4">
Kener
</a>
an open source status page system built with Svelte and TailwindCSS.
i18n:
defaultLocale: "en"
locales:
en: "English"
hi: "हिन्दी"
zh-CN: "中文"
ja: "日本語"
vi: "Tiếng Việt"
pattern: "squares"
analytics:
- id: "G-Q3MLRXCBFT"
type: "GA"
barRoundness: SHARP
summaryStyle: CURRENT
barStyle: PARTIAL
+1
View File
@@ -0,0 +1 @@
database folder
+1
View File
@@ -0,0 +1 @@
.kener

Some files were not shown because too many files have changed in this diff Show More