Compare commits
29 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6dd6cf44e2 | |||
| c750d0b4e3 | |||
| b53e270331 | |||
| 812c633bee | |||
| 92d2c4034b | |||
| 0b6de5e3db | |||
| b9fe4f069f | |||
| d8d04a79d0 | |||
| 44f813d0a0 | |||
| bdb9f3890d | |||
| c12818a979 | |||
| 5076407ee6 | |||
| 6eeedbe5a1 | |||
| 617c594c80 | |||
| e842e1172f | |||
| 2852245fbb | |||
| 702b273fe5 | |||
| c8327cdb03 | |||
| 1624839c35 | |||
| 9825745578 | |||
| be8e49183c | |||
| a0d8f437a5 | |||
| 1399f76591 | |||
| 037cba7b3e | |||
| 397dd4a971 | |||
| f0f51aeb6f | |||
| 3f32605afd | |||
| 6d4f43e921 | |||
| 9fb136882b |
@@ -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.
|
||||
@@ -1,10 +1,48 @@
|
||||
# Kener - Status Page System
|
||||
Kener: An open-source Node.js status page application for real-time service monitoring, incident management, and customizable reporting. Simplify service outage tracking, enhance incident communication, and ensure a seamless user experience.
|
||||
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.
|
||||
|
||||
It uses files to store the data. Other adapters are coming soon
|
||||
|
||||
|
||||
|
||||
> **Warning**
|
||||
> Kener is still under development. There might be bugs. Please report them by raising a github issue and I will fix them.
|
||||
|
||||
Visit a live server [here](https://kener.ing)
|
||||
Read the documentation [here](https://kener.ing/docs)
|
||||

|
||||
|
||||
## Features
|
||||
|
||||
- Real-time monitoring
|
||||
- Customizable status page
|
||||
- Easy installation and setup
|
||||
- Automated incident management
|
||||
- GitHub integration for issue tracking
|
||||
- Environment variable configuration
|
||||
- Production and custom deployment options
|
||||
- API for status updates
|
||||
- Badge generation for status and uptime display
|
||||
- Branding and theme customization
|
||||
- Flexible monitor configuration using YAML
|
||||
- Cron-based scheduling for monitors
|
||||
- Secrets management for headers and bodies
|
||||
- Evaluators for HTTP response parsing
|
||||
- Incident tagging and labeling
|
||||
- Meta tag customization for SEO
|
||||
- User-friendly interface
|
||||
- Support for light and dark themes
|
||||
- Responsive design for various devices
|
||||
|
||||
|
||||
## Technologies used
|
||||
- [SvelteKit](https://kit.svelte.dev/)
|
||||
- [shadcn-svelte](https://www.shadcn-svelte.com/)
|
||||
|
||||
## Inspired from
|
||||
- [Upptime](https://upptime.js.org/)
|
||||
|
||||
## Roadmap
|
||||
- [ ] Add notification
|
||||
- [ ] Add api to create incident
|
||||
- [ ] Add Mysql adapter
|
||||
|
||||
@@ -1 +1 @@
|
||||
import{C as b,s as w,V as m,G as q,N as x}from"./scheduler.b29f3093.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 C(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 E(s){return{subscribe:s.subscribe.bind(s)}}export{E as a,C as d,z as r,A as w};
|
||||
import{u as b,s as w,_ as m,J as q,T as x}from"./scheduler.0e55af49.js";const a=[];function z(s,u){return{subscribe:A(s,u).subscribe}}function A(s,u=b){let t;const r=new Set;function o(n){if(w(s,n)&&(s=n,t)){const i=!a.length;for(const e of r)e[1](),a.push(e,s);if(i){for(let e=0;e<a.length;e+=2)a[e][0](a[e+1]);a.length=0}}}function f(n){o(n(s))}function l(n,i=b){const e=[n,i];return r.add(e),r.size===1&&(t=u(o,f)||b),n(s),()=>{r.delete(e),r.size===0&&t&&(t(),t=null)}}return{set:o,update:f,subscribe:l}}function E(s,u,t){const r=!Array.isArray(s),o=r?[s]:s;if(!o.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const f=u.length<2;return z(t,(l,n)=>{let i=!1;const e=[];let d=0,p=b;const y=()=>{if(d)return;p();const c=u(r?e[0]:e,l,n);f?l(c):p=x(c)?c:b},_=o.map((c,g)=>m(c,h=>{e[g]=h,d&=~(1<<g),i&&y()},()=>{d|=1<<g}));return i=!0,y(),function(){q(_),p(),i=!1}})}function J(s){return{subscribe:s.subscribe.bind(s)}}export{J as a,E as d,z as r,A as w};
|
||||
@@ -0,0 +1,4 @@
|
||||
var K=Object.defineProperty;var Q=(t,e,n)=>e in t?K(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var I=(t,e,n)=>(Q(t,typeof e!="symbol"?e+"":e,n),n);import{u as x,$ as W,d as V,a0 as X,J as E,T as j,O,a1 as Y,a2 as N,a3 as T,h as Z,a4 as tt,a5 as et,a6 as nt,a7 as it,a8 as U,a9 as st,aa as rt,ab as at,ac as ot,ad as ft}from"./scheduler.0e55af49.js";const q=typeof window<"u";let B=q?()=>window.performance.now():()=>Date.now(),D=q?t=>requestAnimationFrame(t):x;const k=new Set;function G(t){k.forEach(e=>{e.c(t)||(k.delete(e),e.f())}),k.size!==0&&D(G)}function F(t){let e;return k.size===0&&D(G),{promise:new Promise(n=>{k.add(e={c:t,f:n})}),abort(){k.delete(e)}}}const P=new Map;let R=0;function ut(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}function lt(t,e){const n={stylesheet:X(e),rules:{}};return P.set(t,n),n}function z(t,e,n,r,u,a,l,i=0){const c=16.666/r;let s=`{
|
||||
`;for(let $=0;$<=1;$+=c){const g=e+(n-e)*a($);s+=$*100+`%{${l(g,1-g)}}
|
||||
`}const _=s+`100% {${l(n,1-n)}}
|
||||
}`,f=`__svelte_${ut(_)}_${i}`,m=W(t),{stylesheet:h,rules:o}=P.get(m)||lt(m,t);o[f]||(o[f]=!0,h.insertRule(`@keyframes ${f} ${_}`,h.cssRules.length));const d=t.style.animation||"";return t.style.animation=`${d?`${d}, `:""}${f} ${r}ms linear ${u}ms 1 both`,R+=1,f}function A(t,e){const n=(t.style.animation||"").split(", "),r=n.filter(e?a=>a.indexOf(e)<0:a=>a.indexOf("__svelte")===-1),u=n.length-r.length;u&&(t.style.animation=r.join(", "),R-=u,R||ct())}function ct(){D(()=>{R||(P.forEach(t=>{const{ownerNode:e}=t.stylesheet;e&&V(e)}),P.clear())})}let S;function J(){return S||(S=Promise.resolve(),S.then(()=>{S=null})),S}function w(t,e,n){t.dispatchEvent(Y(`${e?"intro":"outro"}${n}`))}const M=new Set;let p;function yt(){p={r:0,c:[],p}}function vt(){p.r||E(p.c),p=p.p}function _t(t,e){t&&t.i&&(M.delete(t),t.i(e))}function wt(t,e,n,r){if(t&&t.o){if(M.has(t))return;M.add(t),p.c.push(()=>{M.delete(t),r&&(n&&t.d(1),r())}),t.o(e)}else r&&r()}const L={duration:0};function xt(t,e,n){const r={direction:"in"};let u=e(t,n,r),a=!1,l,i,c=0;function s(){l&&A(t,l)}function _(){const{delay:m=0,duration:h=300,easing:o=N,tick:d=x,css:$}=u||L;$&&(l=z(t,0,1,h,m,o,$,c++)),d(0,1);const g=B()+m,y=g+h;i&&i.abort(),a=!0,O(()=>w(t,!0,"start")),i=F(v=>{if(a){if(v>=y)return d(1,0),w(t,!0,"end"),s(),a=!1;if(v>=g){const b=o((v-g)/h);d(b,1-b)}}return a})}let f=!1;return{start(){f||(f=!0,A(t),j(u)?(u=u(r),J().then(_)):_())},invalidate(){f=!1},end(){a&&(s(),a=!1)}}}function bt(t,e,n){const r={direction:"out"};let u=e(t,n,r),a=!0,l;const i=p;i.r+=1;let c;function s(){const{delay:_=0,duration:f=300,easing:m=N,tick:h=x,css:o}=u||L;o&&(l=z(t,1,0,f,_,m,o));const d=B()+_,$=d+f;O(()=>w(t,!1,"start")),"inert"in t&&(c=t.inert,t.inert=!0),F(g=>{if(a){if(g>=$)return h(0,1),w(t,!1,"end"),--i.r||E(i.c),!1;if(g>=d){const y=m((g-d)/f);h(1-y,y)}}return a})}return j(u)?J().then(()=>{u=u(r),s()}):s(),{end(_){_&&"inert"in t&&(t.inert=c),_&&u.tick&&u.tick(1,0),a&&(l&&A(t,l),a=!1)}}}function kt(t,e,n,r){let a=e(t,n,{direction:"both"}),l=r?0:1,i=null,c=null,s=null,_;function f(){s&&A(t,s)}function m(o,d){const $=o.b-l;return d*=Math.abs($),{a:l,b:o.b,d:$,duration:d,start:o.start,end:o.start+d,group:o.group}}function h(o){const{delay:d=0,duration:$=300,easing:g=N,tick:y=x,css:v}=a||L,b={start:B()+d,b:o};o||(b.group=p,p.r+=1),"inert"in t&&(o?_!==void 0&&(t.inert=_):(_=t.inert,t.inert=!0)),i||c?c=b:(v&&(f(),s=z(t,l,o,$,d,g,v)),o&&y(0,1),i=m(b,$),O(()=>w(t,o,"start")),F(C=>{if(c&&C>c.start&&(i=m(c,$),c=null,w(t,i.b,"start"),v&&(f(),s=z(t,l,i.b,i.duration,0,g,a.css))),i){if(C>=i.end)y(l=i.b,1-l),w(t,i.b,"end"),c||(i.b?f():--i.group.r||E(i.group.c)),i=null;else if(C>=i.start){const H=C-i.start;l=i.a+i.d*g(H/i.duration),y(l,1-l)}}return!!(i||c)}))}return{run(o){j(a)?J().then(()=>{a=a({direction:o?"in":"out"}),h(o)}):h(o)},end(){f(),i=c=null}}}function Et(t){t&&t.c()}function St(t,e){t&&t.l(e)}function dt(t,e,n){const{fragment:r,after_update:u}=t.$$;r&&r.m(e,n),O(()=>{const a=t.$$.on_mount.map(st).filter(j);t.$$.on_destroy?t.$$.on_destroy.push(...a):E(a),t.$$.on_mount=[]}),u.forEach(O)}function $t(t,e){const n=t.$$;n.fragment!==null&&(nt(n.after_update),E(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function ht(t,e){t.$$.dirty[0]===-1&&(rt.push(t),at(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function Ot(t,e,n,r,u,a,l=null,i=[-1]){const c=it;U(t);const s=t.$$={fragment:null,ctx:[],props:a,update:x,not_equal:u,bound:T(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:T(),dirty:i,skip_bound:!1,root:e.target||c.$$.root};l&&l(s.root);let _=!1;if(s.ctx=n?n(t,e.props||{},(f,m,...h)=>{const o=h.length?h[0]:m;return s.ctx&&u(s.ctx[f],s.ctx[f]=o)&&(!s.skip_bound&&s.bound[f]&&s.bound[f](o),_&&ht(t,f)),m}):[],s.update(),_=!0,E(s.before_update),s.fragment=r?r(s.ctx):!1,e.target){if(e.hydrate){ot();const f=Z(e.target);s.fragment&&s.fragment.l(f),f.forEach(V)}else s.fragment&&s.fragment.c();e.intro&&_t(t.$$.fragment),dt(t,e.target,e.anchor),ft(),tt()}U(c)}class jt{constructor(){I(this,"$$");I(this,"$$set")}$destroy(){$t(this,1),this.$destroy=x}$on(e,n){if(!j(n))return x;const r=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return r.push(n),()=>{const u=r.indexOf(n);u!==-1&&r.splice(u,1)}}$set(e){this.$$set&&!et(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const mt="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(mt);export{jt as S,_t as a,Et as b,vt as c,St as d,$t as e,bt as f,yt as g,xt as h,Ot as i,kt as j,dt as m,wt as t};
|
||||
@@ -1 +0,0 @@
|
||||
import{w as u}from"./index.2f161581.js";var b;const y=((b=globalThis.__sveltekit_12t8kyc)==null?void 0:b.base)??"";var h;(h=globalThis.__sveltekit_12t8kyc)==null||h.assets;const I="sveltekit:snapshot",x="sveltekit:scroll",O="sveltekit:index",c={tap:1,hover:2,viewport:3,eager:4,off:-1},k=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 E(e,t,o),o}function E(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 v(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=v(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)===k&&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=v(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 S(){const{set:e,subscribe:t}=u(!1);return{subscribe:t,check:async()=>!1}}function A(e,t){return e.origin!==k||!e.pathname.startsWith(t)}function V(e){e.client}const Y={url:g({}),page:g({}),navigating:u(null),updated:S()};export{O as I,c as P,x as S,I as a,L as b,P as c,Y as d,y as e,N as f,T as g,V as h,A as i,k as o,U as s};
|
||||
@@ -0,0 +1 @@
|
||||
import{w as u}from"./index.3cd3e9b4.js";var _;const k=((_=globalThis.__sveltekit_lh8nh9)==null?void 0:_.base)??"";var h;const m=((h=globalThis.__sveltekit_lh8nh9)==null?void 0:h.assets)??k,w="1704133631953",T="sveltekit:snapshot",y="sveltekit:scroll",I="sveltekit:index",f={tap:1,hover:2,viewport:3,eager:4,off:-1},g=location.origin;function S(e){let t=e.baseURI;if(!t){const n=e.getElementsByTagName("base");t=n.length?n[0].href:e.URL}return t}function x(){return{x:pageXOffset,y:pageYOffset}}function c(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const d={...f,"":f.hover};function b(e){let t=e.assignedSlot??e.parentNode;return(t==null?void 0:t.nodeType)===11&&(t=t.host),t}function O(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=b(e)}}function U(e,t){let n;try{n=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI)}catch{}const o=e instanceof SVGAElement?e.target.baseVal:e.target,r=!n||!!o||A(n,t)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),l=(n==null?void 0:n.origin)===g&&e.hasAttribute("download");return{url:n,external:r,target:o,download:l}}function L(e){let t=null,n=null,o=null,r=null,l=null,a=null,s=e;for(;s&&s!==document.documentElement;)o===null&&(o=c(s,"preload-code")),r===null&&(r=c(s,"preload-data")),t===null&&(t=c(s,"keepfocus")),n===null&&(n=c(s,"noscroll")),l===null&&(l=c(s,"reload")),a===null&&(a=c(s,"replacestate")),s=b(s);function i(v){switch(v){case"":case"true":return!0;case"off":case"false":return!1;default:return null}}return{preload_code:d[o??"off"],preload_data:d[r??"off"],keep_focus:i(t),noscroll:i(n),reload:i(l),replace_state:i(a)}}function p(e){const t=u(e);let n=!0;function o(){n=!0,t.update(a=>a)}function r(a){n=!1,t.set(a)}function l(a){let s;return t.subscribe(i=>{(s===void 0||n&&i!==s)&&a(s=i)})}return{notify:o,set:r,subscribe:l}}function E(){const{set:e,subscribe:t}=u(!1);let n;async function o(){clearTimeout(n);try{const r=await fetch(`${m}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!r.ok)return!1;const a=(await r.json()).version!==w;return a&&(e(!0),clearTimeout(n)),a}catch{return!1}}return{subscribe:t,check:o}}function A(e,t){return e.origin!==g||!e.pathname.startsWith(t)}function N(e){e.client}const P={url:p({}),page:p({}),navigating:u(null),updated:E()};export{I,f as P,y as S,T as a,U as b,L as c,P as d,k as e,O as f,S as g,N as h,A as i,g as o,x as s};
|
||||
@@ -0,0 +1 @@
|
||||
import{s as S,f as _,l as d,a as x,g as f,h as g,m as h,d as u,c as q,i as m,r as v,n as $,u as E,D as y}from"../chunks/scheduler.0e55af49.js";import{S as C,i as D}from"../chunks/index.7fa4eb0f.js";import{d as H}from"../chunks/singletons.6ce7b922.js";const P=()=>{const s=H;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},j={subscribe(s){return P().page.subscribe(s)}};function k(s){var b;let t,r=s[0].status+"",o,n,i,c=((b=s[0].error)==null?void 0:b.message)+"",l;return{c(){t=_("h1"),o=d(r),n=x(),i=_("p"),l=d(c)},l(e){t=f(e,"H1",{});var a=g(t);o=h(a,r),a.forEach(u),n=q(e),i=f(e,"P",{});var p=g(i);l=h(p,c),p.forEach(u)},m(e,a){m(e,t,a),v(t,o),m(e,n,a),m(e,i,a),v(i,l)},p(e,[a]){var p;a&1&&r!==(r=e[0].status+"")&&$(o,r),a&1&&c!==(c=((p=e[0].error)==null?void 0:p.message)+"")&&$(l,c)},i:E,o:E,d(e){e&&(u(t),u(n),u(i))}}}function w(s,t,r){let o;return y(s,j,n=>r(0,o=n)),[o]}let F=class extends C{constructor(t){super(),D(this,t,w,k,S,{})}};export{F as component};
|
||||
@@ -1 +0,0 @@
|
||||
import{s as B,A as O,B as R,g as b,l as g,c as q,h as E,i as $,m as w,d as A,k as S,C as k}from"../chunks/scheduler.b29f3093.js";import{S as D,i as H,d as y,v as N,e as d,a as m,o as C,s as j}from"../chunks/index.7aebdd36.js";import{d as P}from"../chunks/singletons.222cc637.js";const z=()=>{const t=P;return{page:{subscribe:t.page.subscribe},navigating:{subscribe:t.navigating.subscribe},updated:t.updated}},_={subscribe(t){return z().page.subscribe(t)}},x="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=q(),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,x,4,0,57),S(n,x,5,0,81)},m:function(s,o){m(s,e,o),C(e,r),m(s,l,o),m(s,n,o),C(n,a)},p:function(s,[o]){var p;o&1&&i!==(i=s[0].status+"")&&j(r,i),o&1&&c!==(c=((p=s[0].error)==null?void 0:p.message)+"")&&j(a,c)},i:k,o:k,d:function(s){s&&(d(e),d(l),d(n))}};return y("SvelteRegisterBlock",{block:v,id:f.name,type:"component",source:"",ctx:t}),v}function F(t,e,i){let r;O(_,"page"),R(t,_,a=>i(0,r=a));let{$$slots:l={},$$scope:n}=e;N("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 D{constructor(e){super(e),H(this,e,F,f,B,{}),y("SvelteRegisterComponent",{component:this,tagName:"Error",options:e,id:f.name})}};export{K as component};
|
||||
@@ -1 +1 @@
|
||||
{"version":"1702750261938"}
|
||||
{"version":"1704133631953"}
|
||||
|
After Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 20 KiB |
@@ -1,6 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" fill="#FF6F61" viewBox="2 6 28 24.1">
|
||||
<g>
|
||||
<path
|
||||
d="M24.66,26a3.83,3.83,0,0,1-2.86-1.32,1.81,1.81,0,0,0-2.95,0,3.76,3.76,0,0,1-5.72,0,1.8,1.8,0,0,0-2.94,0,3.76,3.76,0,0,1-5.72,0A1.9,1.9,0,0,0,3,24a1,1,0,0,1,0-2,3.82,3.82,0,0,1,2.86,1.32A1.9,1.9,0,0,0,7.33,24a1.9,1.9,0,0,0,1.47-.76,3.76,3.76,0,0,1,5.72,0A1.9,1.9,0,0,0,16,24a1.94,1.94,0,0,0,1.48-.76,3.76,3.76,0,0,1,5.72,0,1.81,1.81,0,0,0,2.95,0A3.82,3.82,0,0,1,29,22a1,1,0,0,1,0,2,1.94,1.94,0,0,0-1.48.76A3.82,3.82,0,0,1,24.66,26Zm2.86,2.68A1.94,1.94,0,0,1,29,28a1,1,0,0,0,0-2,3.82,3.82,0,0,0-2.86,1.32,1.81,1.81,0,0,1-2.95,0,3.76,3.76,0,0,0-5.72,0A1.94,1.94,0,0,1,16,28a1.9,1.9,0,0,1-1.47-.76,3.76,3.76,0,0,0-5.72,0A1.9,1.9,0,0,1,7.33,28a1.9,1.9,0,0,1-1.47-.76A3.82,3.82,0,0,0,3,26a1,1,0,0,0,0,2,1.9,1.9,0,0,1,1.47.76,3.76,3.76,0,0,0,5.72,0,1.8,1.8,0,0,1,2.94,0,3.76,3.76,0,0,0,5.72,0,1.81,1.81,0,0,1,2.95,0,3.76,3.76,0,0,0,5.72,0ZM26,6a1,1,0,0,0-1,1c0,.55-1.83,1.08-3.17,1.47-2,.57-4.34,1.25-5.83,2.82C14.51,9.72,12.14,9,10.17,8.47,8.83,8.08,7,7.55,7,7A1,1,0,0,0,5,7a11,11,0,0,0,7.28,10.35,1,1,0,0,1,.72,1V20a1,1,0,0,0,1,1h4a1,1,0,0,0,1-1V18.31a1,1,0,0,1,.72-1A11,11,0,0,0,27,7,1,1,0,0,0,26,6Z"></path>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 313 KiB |
|
Before Width: | Height: | Size: 216 KiB After Width: | Height: | Size: 420 KiB |
@@ -0,0 +1,31 @@
|
||||
import fs from 'fs-extra';
|
||||
import { p as public_env } from './shared-server-58a5f352.js';
|
||||
|
||||
async function load({ params, route, url, cookies }) {
|
||||
let site = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/site.json", "utf8"));
|
||||
let localTz = "GMT";
|
||||
const localTzCookie = cookies.get("localTz");
|
||||
if (!!localTzCookie) {
|
||||
localTz = localTzCookie;
|
||||
}
|
||||
return {
|
||||
site,
|
||||
localTz
|
||||
};
|
||||
}
|
||||
|
||||
var _layout_server = /*#__PURE__*/Object.freeze({
|
||||
__proto__: null,
|
||||
load: load
|
||||
});
|
||||
|
||||
const index = 0;
|
||||
let component_cache;
|
||||
const component = async () => component_cache ??= (await import('./_layout.svelte-69122555.js')).default;
|
||||
const server_id = "src/routes/+layout.server.js";
|
||||
const imports = ["_app/immutable/nodes/0.98d1626a.js","_app/immutable/chunks/scheduler.0e55af49.js","_app/immutable/chunks/index.7fa4eb0f.js","_app/immutable/chunks/ctx.b7ea881a.js","_app/immutable/chunks/index.3cd3e9b4.js","_app/immutable/chunks/index.8cfb104d.js"];
|
||||
const stylesheets = ["_app/immutable/assets/0.399360ef.css"];
|
||||
const fonts = [];
|
||||
|
||||
export { component, fonts, imports, index, _layout_server as server, server_id, stylesheets };
|
||||
//# sourceMappingURL=0-cb0211dd.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"0-cb0211dd.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.98d1626a.js\",\"_app/immutable/chunks/scheduler.0e55af49.js\",\"_app/immutable/chunks/index.7fa4eb0f.js\",\"_app/immutable/chunks/ctx.b7ea881a.js\",\"_app/immutable/chunks/index.3cd3e9b4.js\",\"_app/immutable/chunks/index.8cfb104d.js\"];\nexport const stylesheets = [\"_app/immutable/assets/0.399360ef.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,uCAAuC,CAAC,yCAAyC,CAAC,yCAAyC,EAAE;AACtQ,MAAC,WAAW,GAAG,CAAC,sCAAsC,EAAE;AACxD,MAAC,KAAK,GAAG;;;;"}
|
||||
@@ -1,33 +0,0 @@
|
||||
import fs from 'fs-extra';
|
||||
import { p as public_env } from './shared-server-58a5f352.js';
|
||||
|
||||
async function load({ params, route, url, cookies }) {
|
||||
const tzOffsetCookie = cookies.get("tzOffset");
|
||||
var dt = /* @__PURE__ */ new Date();
|
||||
let tzOffset = dt.getTimezoneOffset();
|
||||
if (!!tzOffsetCookie) {
|
||||
tzOffset = Number(tzOffsetCookie);
|
||||
}
|
||||
let site = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/site.json", "utf8"));
|
||||
console.log("Rendering page with " + tzOffset);
|
||||
return {
|
||||
site,
|
||||
tzOffset
|
||||
};
|
||||
}
|
||||
|
||||
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-d281ddab.js')).default;
|
||||
const server_id = "src/routes/+layout.server.js";
|
||||
const imports = ["_app/immutable/nodes/0.a42378a7.js","_app/immutable/chunks/scheduler.b29f3093.js","_app/immutable/chunks/index.7aebdd36.js","_app/immutable/chunks/index.eede6470.js","_app/immutable/chunks/index.ed2d54e5.js","_app/immutable/chunks/index.2f161581.js"];
|
||||
const stylesheets = ["_app/immutable/assets/0.d2e53a0b.css"];
|
||||
const fonts = [];
|
||||
|
||||
export { component, fonts, imports, index, _layout_server as server, server_id, stylesheets };
|
||||
//# sourceMappingURL=0-d2d5f55c.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"0-d2d5f55c.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 const tzOffsetCookie = cookies.get(\"tzOffset\");\n var dt = /* @__PURE__ */ new Date();\n let tzOffset = dt.getTimezoneOffset();\n if (!!tzOffsetCookie) {\n tzOffset = Number(tzOffsetCookie);\n }\n let site = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + \"/site.json\", \"utf8\"));\n console.log(\"Rendering page with \" + tzOffset);\n return {\n site,\n tzOffset\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.a42378a7.js\",\"_app/immutable/chunks/scheduler.b29f3093.js\",\"_app/immutable/chunks/index.7aebdd36.js\",\"_app/immutable/chunks/index.eede6470.js\",\"_app/immutable/chunks/index.ed2d54e5.js\",\"_app/immutable/chunks/index.2f161581.js\"];\nexport const stylesheets = [\"_app/immutable/assets/0.d2e53a0b.css\"];\nexport const fonts = [];\n"],"names":[],"mappings":";;;AAEA,eAAe,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE;AACrD,EAAE,MAAM,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AACjD,EAAE,IAAI,EAAE,mBAAmB,IAAI,IAAI,EAAE,CAAC;AACtC,EAAE,IAAI,QAAQ,GAAG,EAAE,CAAC,iBAAiB,EAAE,CAAC;AACxC,EAAE,IAAI,CAAC,CAAC,cAAc,EAAE;AACxB,IAAI,QAAQ,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;AACtC,GAAG;AACH,EAAE,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,mBAAmB,GAAG,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;AAChG,EAAE,OAAO,CAAC,GAAG,CAAC,sBAAsB,GAAG,QAAQ,CAAC,CAAC;AACjD,EAAE,OAAO;AACT,IAAI,IAAI;AACR,IAAI,QAAQ;AACZ,GAAG,CAAC;AACJ;;;;;;;ACbY,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,yCAAyC,CAAC,yCAAyC,CAAC,yCAAyC,EAAE;AACxQ,MAAC,WAAW,GAAG,CAAC,sCAAsC,EAAE;AACxD,MAAC,KAAK,GAAG;;;;"}
|
||||
@@ -1,9 +0,0 @@
|
||||
const index = 1;
|
||||
let component_cache;
|
||||
const component = async () => component_cache ??= (await import('./error.svelte-c2f5f995.js')).default;
|
||||
const imports = ["_app/immutable/nodes/1.f67c7e5a.js","_app/immutable/chunks/scheduler.b29f3093.js","_app/immutable/chunks/index.7aebdd36.js","_app/immutable/chunks/singletons.222cc637.js","_app/immutable/chunks/index.2f161581.js"];
|
||||
const stylesheets = [];
|
||||
const fonts = [];
|
||||
|
||||
export { component, fonts, imports, index, stylesheets };
|
||||
//# sourceMappingURL=1-b7fabb6f.js.map
|
||||
@@ -0,0 +1,9 @@
|
||||
const index = 1;
|
||||
let component_cache;
|
||||
const component = async () => component_cache ??= (await import('./error.svelte-9dc5c501.js')).default;
|
||||
const imports = ["_app/immutable/nodes/1.a14c742b.js","_app/immutable/chunks/scheduler.0e55af49.js","_app/immutable/chunks/index.7fa4eb0f.js","_app/immutable/chunks/singletons.6ce7b922.js","_app/immutable/chunks/index.3cd3e9b4.js"];
|
||||
const stylesheets = [];
|
||||
const fonts = [];
|
||||
|
||||
export { component, fonts, imports, index, stylesheets };
|
||||
//# sourceMappingURL=1-cdd1950c.js.map
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"1-b7fabb6f.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.f67c7e5a.js\",\"_app/immutable/chunks/scheduler.b29f3093.js\",\"_app/immutable/chunks/index.7aebdd36.js\",\"_app/immutable/chunks/singletons.222cc637.js\",\"_app/immutable/chunks/index.2f161581.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;;;;"}
|
||||
{"version":3,"file":"1-cdd1950c.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.a14c742b.js\",\"_app/immutable/chunks/scheduler.0e55af49.js\",\"_app/immutable/chunks/index.7fa4eb0f.js\",\"_app/immutable/chunks/singletons.6ce7b922.js\",\"_app/immutable/chunks/index.3cd3e9b4.js\"];\nexport const stylesheets = [];\nexport const fonts = [];\n"],"names":[],"mappings":"AAEY,MAAC,KAAK,GAAG,EAAE;AACvB,IAAI,eAAe,CAAC;AACR,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,4BAAsC,CAAC,EAAE,QAAQ;AAC5G,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,6CAA6C,CAAC,yCAAyC,CAAC,8CAA8C,CAAC,yCAAyC,EAAE;AACnO,MAAC,WAAW,GAAG,GAAG;AAClB,MAAC,KAAK,GAAG;;;;"}
|
||||
@@ -1,33 +0,0 @@
|
||||
import { h as hasActiveIncident } from './incident-f316d011.js';
|
||||
import { p as public_env } from './shared-server-58a5f352.js';
|
||||
import fs from 'fs-extra';
|
||||
import 'axios';
|
||||
|
||||
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++) {
|
||||
monitors[i].hasActiveIncident = await hasActiveIncident(monitors[i].tag, 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-2442d3a2.js')).default;
|
||||
const server_id = "src/routes/+page.server.js";
|
||||
const imports = ["_app/immutable/nodes/2.34ad5b96.js","_app/immutable/chunks/scheduler.b29f3093.js","_app/immutable/chunks/index.7aebdd36.js","_app/immutable/chunks/index.eede6470.js","_app/immutable/chunks/index.ed2d54e5.js","_app/immutable/chunks/index.2f161581.js","_app/immutable/chunks/separator.4ff811e2.js"];
|
||||
const stylesheets = [];
|
||||
const fonts = [];
|
||||
|
||||
export { component, fonts, imports, index, _page_server as server, server_id, stylesheets };
|
||||
//# sourceMappingURL=2-503244ba.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"2-503244ba.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/_page.server.js","../../../.svelte-kit/adapter-node/nodes/2.js"],"sourcesContent":["import { h as hasActiveIncident } from \"../../chunks/incident.js\";\nimport { p as public_env } from \"../../chunks/shared-server.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 parentData = await parent();\n const siteData = parentData.site;\n const github = siteData.github;\n for (let i = 0; i < monitors.length; i++) {\n monitors[i].hasActiveIncident = await hasActiveIncident(monitors[i].tag, github);\n }\n return {\n monitors\n };\n}\nexport {\n load\n};\n","import * as server from '../entries/pages/_page.server.js';\n\nexport const index = 2;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/_page.svelte.js')).default;\nexport { server };\nexport const server_id = \"src/routes/+page.server.js\";\nexport const imports = [\"_app/immutable/nodes/2.34ad5b96.js\",\"_app/immutable/chunks/scheduler.b29f3093.js\",\"_app/immutable/chunks/index.7aebdd36.js\",\"_app/immutable/chunks/index.eede6470.js\",\"_app/immutable/chunks/index.ed2d54e5.js\",\"_app/immutable/chunks/index.2f161581.js\",\"_app/immutable/chunks/separator.4ff811e2.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,UAAU,GAAG,MAAM,MAAM,EAAE,CAAC;AACpC,EAAE,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC;AACnC,EAAE,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;AACjC,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC5C,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,iBAAiB,GAAG,MAAM,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;AACrF,GAAG;AACH,EAAE,OAAO;AACT,IAAI,QAAQ;AACZ,GAAG,CAAC;AACJ;;;;;;;ACZY,MAAC,KAAK,GAAG,EAAE;AACvB,IAAI,eAAe,CAAC;AACR,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,4BAAkC,CAAC,EAAE,QAAQ;AAExG,MAAC,SAAS,GAAG,6BAA6B;AAC1C,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,6CAA6C,CAAC,yCAAyC,CAAC,yCAAyC,CAAC,yCAAyC,CAAC,yCAAyC,CAAC,6CAA6C,EAAE;AACtT,MAAC,WAAW,GAAG,GAAG;AAClB,MAAC,KAAK,GAAG;;;;"}
|
||||
@@ -0,0 +1,136 @@
|
||||
import { G as GetIncidents, M as Mapper } from './github-54c09baa.js';
|
||||
import fs from 'fs-extra';
|
||||
import { G as GetMinuteStartNowTimestampUTC, B as BeginingOfDay } from './tool-153dc604.js';
|
||||
import { S as StatusObj, P as ParseUptime, a as ParsePercentage } from './helpers-eac5677c.js';
|
||||
import { p as public_env } from './shared-server-58a5f352.js';
|
||||
import 'axios';
|
||||
import 'marked';
|
||||
|
||||
const secondsInDay = 24 * 60 * 60;
|
||||
function getDayData(day0, startTime, endTime) {
|
||||
let dayData = {
|
||||
UP: 0,
|
||||
DEGRADED: 0,
|
||||
DOWN: 0,
|
||||
timestamp: startTime,
|
||||
cssClass: StatusObj.NO_DATA,
|
||||
message: "No Data"
|
||||
};
|
||||
for (let i = startTime; i <= endTime; i += 60) {
|
||||
if (day0[i] === void 0) {
|
||||
continue;
|
||||
}
|
||||
if (day0[i].status == "UP") {
|
||||
dayData.UP++;
|
||||
} else if (day0[i].status == "DEGRADED") {
|
||||
dayData.DEGRADED++;
|
||||
} else if (day0[i].status == "DOWN") {
|
||||
dayData.DOWN++;
|
||||
}
|
||||
}
|
||||
dayData.uptimePercentage = ParseUptime(dayData.UP + dayData.DEGRADED, dayData.UP + dayData.DEGRADED + dayData.DOWN);
|
||||
let cssClass = StatusObj.UP;
|
||||
let message = "Status OK";
|
||||
if (dayData.DEGRADED > 0) {
|
||||
cssClass = StatusObj.DEGRADED;
|
||||
message = "Degraded for " + dayData.DEGRADED + " minutes";
|
||||
}
|
||||
if (dayData.DOWN > 0) {
|
||||
cssClass = StatusObj.DOWN;
|
||||
message = "Down for " + dayData.DOWN + " minutes";
|
||||
}
|
||||
if (dayData.DEGRADED + dayData.DOWN + dayData.UP > 0) {
|
||||
dayData.message = message;
|
||||
dayData.cssClass = cssClass;
|
||||
}
|
||||
return dayData;
|
||||
}
|
||||
const FetchData = async function(monitor, localTz) {
|
||||
let _0Day = {};
|
||||
let _90Day = {};
|
||||
let uptime0Day = "0";
|
||||
let dailyUps = 0;
|
||||
let dailyDown = 0;
|
||||
let percentage90DaysBuildUp = [];
|
||||
let dailyDegraded = 0;
|
||||
const now = GetMinuteStartNowTimestampUTC();
|
||||
const midnight = BeginingOfDay({ timeZone: localTz });
|
||||
const midnight90DaysAgo = midnight - 90 * 24 * 60 * 60;
|
||||
const midnightTomorrow = midnight + secondsInDay;
|
||||
for (let i = midnight; i <= now; i += 60) {
|
||||
_0Day[i] = {
|
||||
timestamp: i,
|
||||
status: "NO_DATA",
|
||||
cssClass: StatusObj.NO_DATA,
|
||||
index: (i - midnight) / 60
|
||||
};
|
||||
}
|
||||
let day0 = JSON.parse(fs.readFileSync(monitor.path0Day, "utf8"));
|
||||
for (const timestamp in day0) {
|
||||
const element = day0[timestamp];
|
||||
let status = element.status;
|
||||
if (_0Day[timestamp] !== void 0) {
|
||||
_0Day[timestamp].status = status;
|
||||
_0Day[timestamp].cssClass = StatusObj[status];
|
||||
dailyUps = status == "UP" ? dailyUps + 1 : dailyUps;
|
||||
dailyDown = status == "DOWN" ? dailyDown + 1 : dailyDown;
|
||||
dailyDegraded = status == "DEGRADED" ? dailyDegraded + 1 : dailyDegraded;
|
||||
}
|
||||
}
|
||||
for (let i = midnight90DaysAgo; i < midnightTomorrow; i += secondsInDay) {
|
||||
_90Day[i] = getDayData(day0, i, i + secondsInDay - 1);
|
||||
}
|
||||
for (const key in _90Day) {
|
||||
const element = _90Day[key];
|
||||
const uptimePercentage = element.uptimePercentage;
|
||||
delete _90Day[key].UP;
|
||||
delete _90Day[key].DEGRADED;
|
||||
delete _90Day[key].DOWN;
|
||||
delete _90Day[key].uptimePercentage;
|
||||
if (element.message == "No Data")
|
||||
continue;
|
||||
percentage90DaysBuildUp.push(parseFloat(uptimePercentage));
|
||||
}
|
||||
uptime0Day = ParseUptime(dailyUps + dailyDegraded, dailyUps + dailyDown + dailyDegraded);
|
||||
return {
|
||||
_90Day,
|
||||
uptime0Day,
|
||||
uptime90Day: ParsePercentage(percentage90DaysBuildUp.reduce((a, b) => a + b, 0) / percentage90DaysBuildUp.length),
|
||||
dailyUps,
|
||||
dailyDown,
|
||||
dailyDegraded
|
||||
};
|
||||
};
|
||||
async function load({ params, route, url, parent }) {
|
||||
let monitors = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/monitors.json", "utf8"));
|
||||
const parentData = await parent();
|
||||
const siteData = parentData.site;
|
||||
const github = siteData.github;
|
||||
for (let i = 0; i < monitors.length; i++) {
|
||||
const gitHubActiveIssues = await GetIncidents(monitors[i].tag, github, "open");
|
||||
delete monitors[i].api;
|
||||
delete monitors[i].defaultStatus;
|
||||
let data = await FetchData(monitors[i], parentData.localTz);
|
||||
monitors[i].pageData = data;
|
||||
monitors[i].activeIncidents = await Promise.all(gitHubActiveIssues.map(Mapper, { github }));
|
||||
}
|
||||
return {
|
||||
monitors
|
||||
};
|
||||
}
|
||||
|
||||
var _page_server = /*#__PURE__*/Object.freeze({
|
||||
__proto__: null,
|
||||
load: load
|
||||
});
|
||||
|
||||
const index = 2;
|
||||
let component_cache;
|
||||
const component = async () => component_cache ??= (await import('./_page.svelte-51a9cf2a.js')).default;
|
||||
const server_id = "src/routes/+page.server.js";
|
||||
const imports = ["_app/immutable/nodes/2.c3097cef.js","_app/immutable/chunks/scheduler.0e55af49.js","_app/immutable/chunks/index.7fa4eb0f.js","_app/immutable/chunks/ctx.b7ea881a.js","_app/immutable/chunks/index.3cd3e9b4.js","_app/immutable/chunks/chevron-down.2b71fd98.js","_app/immutable/chunks/incident.99422fec.js","_app/immutable/chunks/index.8cfb104d.js"];
|
||||
const stylesheets = [];
|
||||
const fonts = [];
|
||||
|
||||
export { component, fonts, imports, index, _page_server as server, server_id, stylesheets };
|
||||
//# sourceMappingURL=2-6ac0edba.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"3-99004f09.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.c23c022a.js\",\"_app/immutable/chunks/scheduler.b29f3093.js\",\"_app/immutable/chunks/index.7aebdd36.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,EAAE;AAC1I,MAAC,WAAW,GAAG,GAAG;AAClB,MAAC,KAAK,GAAG;;;;"}
|
||||
@@ -14,11 +14,11 @@ var _page_server = /*#__PURE__*/Object.freeze({
|
||||
|
||||
const index = 3;
|
||||
let component_cache;
|
||||
const component = async () => component_cache ??= (await import('./_page.svelte-43dcbc25.js')).default;
|
||||
const component = async () => component_cache ??= (await import('./_page.svelte-a36a0a0c.js')).default;
|
||||
const server_id = "src/routes/docs/+page.server.js";
|
||||
const imports = ["_app/immutable/nodes/3.c23c022a.js","_app/immutable/chunks/scheduler.b29f3093.js","_app/immutable/chunks/index.7aebdd36.js"];
|
||||
const imports = ["_app/immutable/nodes/3.21622bf4.js","_app/immutable/chunks/scheduler.0e55af49.js","_app/immutable/chunks/index.7fa4eb0f.js","_app/immutable/chunks/ctx.b7ea881a.js","_app/immutable/chunks/index.3cd3e9b4.js","_app/immutable/chunks/chevron-down.2b71fd98.js"];
|
||||
const stylesheets = [];
|
||||
const fonts = [];
|
||||
|
||||
export { component, fonts, imports, index, _page_server as server, server_id, stylesheets };
|
||||
//# sourceMappingURL=3-99004f09.js.map
|
||||
//# sourceMappingURL=3-cd691896.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"3-cd691896.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.21622bf4.js\",\"_app/immutable/chunks/scheduler.0e55af49.js\",\"_app/immutable/chunks/index.7fa4eb0f.js\",\"_app/immutable/chunks/ctx.b7ea881a.js\",\"_app/immutable/chunks/index.3cd3e9b4.js\",\"_app/immutable/chunks/chevron-down.2b71fd98.js\"];\nexport const stylesheets = [];\nexport const fonts = [];\n"],"names":[],"mappings":";;AACA,eAAe,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE;AACpD,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,iEAAiE,CAAC,CAAC;AACtG,EAAE,OAAO;AACT,IAAI,EAAE,EAAE,IAAI;AACZ,GAAG,CAAC;AACJ;;;;;;;ACJY,MAAC,KAAK,GAAG,EAAE;AACvB,IAAI,eAAe,CAAC;AACR,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,4BAAuC,CAAC,EAAE,QAAQ;AAE7G,MAAC,SAAS,GAAG,kCAAkC;AAC/C,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,6CAA6C,CAAC,yCAAyC,CAAC,uCAAuC,CAAC,yCAAyC,CAAC,gDAAgD,EAAE;AAC7Q,MAAC,WAAW,GAAG,GAAG;AAClB,MAAC,KAAK,GAAG;;;;"}
|
||||
@@ -1,70 +0,0 @@
|
||||
import { p as public_env } from './shared-server-58a5f352.js';
|
||||
import { a as activeIncident, p as pastIncident, g as getCommentsForIssue } from './incident-f316d011.js';
|
||||
import Markdoc from '@markdoc/markdoc';
|
||||
import fs from 'fs-extra';
|
||||
import 'axios';
|
||||
|
||||
var _page = /*#__PURE__*/Object.freeze({
|
||||
__proto__: null
|
||||
});
|
||||
|
||||
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);
|
||||
return {
|
||||
title: issue.title,
|
||||
number: issue.number,
|
||||
body: html,
|
||||
created_at: issue.created_at,
|
||||
updated_at: issue.updated_at,
|
||||
collapsed: true,
|
||||
comments: issue.comments,
|
||||
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 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 } = monitors.find((monitor) => monitor.folderName === params.id);
|
||||
const gitHubActiveIssues = await activeIncident(tag, github);
|
||||
const gitHubPastIssues = await pastIncident(tag, github);
|
||||
return {
|
||||
issues: params.id,
|
||||
githubConfig: github,
|
||||
monitor: { description, name },
|
||||
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-21cc1492.js')).default;
|
||||
const universal_id = "src/routes/incident/[id]/+page.js";
|
||||
const server_id = "src/routes/incident/[id]/+page.server.js";
|
||||
const imports = ["_app/immutable/nodes/4.9ff9e569.js","_app/immutable/chunks/scheduler.b29f3093.js","_app/immutable/chunks/index.7aebdd36.js","_app/immutable/chunks/separator.4ff811e2.js","_app/immutable/chunks/index.ed2d54e5.js","_app/immutable/chunks/index.2f161581.js"];
|
||||
const stylesheets = [];
|
||||
const fonts = [];
|
||||
|
||||
export { component, fonts, imports, index, _page_server as server, server_id, stylesheets, _page as universal, universal_id };
|
||||
//# sourceMappingURL=4-58c19338.js.map
|
||||
@@ -0,0 +1,43 @@
|
||||
import { p as public_env } from './shared-server-58a5f352.js';
|
||||
import { G as GetIncidents, M as Mapper } from './github-54c09baa.js';
|
||||
import fs from 'fs-extra';
|
||||
import 'axios';
|
||||
import './tool-153dc604.js';
|
||||
import 'marked';
|
||||
|
||||
async function load({ params, route, url, parent }) {
|
||||
let monitors = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/monitors.json", "utf8"));
|
||||
const siteData = await parent();
|
||||
const github = siteData.site.github;
|
||||
const { description, name, tag, image } = monitors.find((monitor) => monitor.folderName === params.id);
|
||||
const allIncidents = await GetIncidents(tag, github, "all");
|
||||
const gitHubActiveIssues = allIncidents.filter((issue) => {
|
||||
return issue.state === "open";
|
||||
});
|
||||
const gitHubPastIssues = allIncidents.filter((issue) => {
|
||||
return issue.state === "closed";
|
||||
});
|
||||
return {
|
||||
issues: params.id,
|
||||
githubConfig: github,
|
||||
monitor: { description, name, image },
|
||||
activeIncidents: await Promise.all(gitHubActiveIssues.map(Mapper, { github })),
|
||||
pastIncidents: await Promise.all(gitHubPastIssues.map(Mapper, { github }))
|
||||
};
|
||||
}
|
||||
|
||||
var _page_server = /*#__PURE__*/Object.freeze({
|
||||
__proto__: null,
|
||||
load: load
|
||||
});
|
||||
|
||||
const index = 4;
|
||||
let component_cache;
|
||||
const component = async () => component_cache ??= (await import('./_page.svelte-ab6ea79c.js')).default;
|
||||
const server_id = "src/routes/incident/[id]/+page.server.js";
|
||||
const imports = ["_app/immutable/nodes/4.b5788dfa.js","_app/immutable/chunks/scheduler.0e55af49.js","_app/immutable/chunks/index.7fa4eb0f.js","_app/immutable/chunks/ctx.b7ea881a.js","_app/immutable/chunks/index.3cd3e9b4.js","_app/immutable/chunks/incident.99422fec.js","_app/immutable/chunks/chevron-down.2b71fd98.js","_app/immutable/chunks/index.8cfb104d.js"];
|
||||
const stylesheets = [];
|
||||
const fonts = [];
|
||||
|
||||
export { component, fonts, imports, index, _page_server as server, server_id, stylesheets };
|
||||
//# sourceMappingURL=4-a823779f.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"4-a823779f.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/incident/_id_/_page.server.js","../../../.svelte-kit/adapter-node/nodes/4.js"],"sourcesContent":["import { p as public_env } from \"../../../../chunks/shared-server.js\";\nimport { e as GetIncidents, M as Mapper } from \"../../../../chunks/github.js\";\nimport fs from \"fs-extra\";\nasync function load({ params, route, url, parent }) {\n let monitors = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + \"/monitors.json\", \"utf8\"));\n const siteData = await parent();\n const github = siteData.site.github;\n const { description, name, tag, image } = monitors.find((monitor) => monitor.folderName === params.id);\n const allIncidents = await GetIncidents(tag, github, \"all\");\n const gitHubActiveIssues = allIncidents.filter((issue) => {\n return issue.state === \"open\";\n });\n const gitHubPastIssues = allIncidents.filter((issue) => {\n return issue.state === \"closed\";\n });\n return {\n issues: params.id,\n githubConfig: github,\n monitor: { description, name, image },\n activeIncidents: await Promise.all(gitHubActiveIssues.map(Mapper, { github })),\n pastIncidents: await Promise.all(gitHubPastIssues.map(Mapper, { github }))\n };\n}\nexport {\n load\n};\n","import * as server from '../entries/pages/incident/_id_/_page.server.js';\n\nexport const index = 4;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/incident/_id_/_page.svelte.js')).default;\nexport { server };\nexport const server_id = \"src/routes/incident/[id]/+page.server.js\";\nexport const imports = [\"_app/immutable/nodes/4.b5788dfa.js\",\"_app/immutable/chunks/scheduler.0e55af49.js\",\"_app/immutable/chunks/index.7fa4eb0f.js\",\"_app/immutable/chunks/ctx.b7ea881a.js\",\"_app/immutable/chunks/index.3cd3e9b4.js\",\"_app/immutable/chunks/incident.99422fec.js\",\"_app/immutable/chunks/chevron-down.2b71fd98.js\",\"_app/immutable/chunks/index.8cfb104d.js\"];\nexport const stylesheets = [];\nexport const fonts = [];\n"],"names":[],"mappings":";;;;;;;AAGA,eAAe,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE;AACpD,EAAE,IAAI,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,mBAAmB,GAAG,gBAAgB,EAAE,MAAM,CAAC,CAAC,CAAC;AACxG,EAAE,MAAM,QAAQ,GAAG,MAAM,MAAM,EAAE,CAAC;AAClC,EAAE,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;AACtC,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,UAAU,KAAK,MAAM,CAAC,EAAE,CAAC,CAAC;AACzG,EAAE,MAAM,YAAY,GAAG,MAAM,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAC9D,EAAE,MAAM,kBAAkB,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,KAAK,KAAK;AAC5D,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,MAAM,CAAC;AAClC,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,gBAAgB,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,KAAK,KAAK;AAC1D,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,CAAC;AACpC,GAAG,CAAC,CAAC;AACL,EAAE,OAAO;AACT,IAAI,MAAM,EAAE,MAAM,CAAC,EAAE;AACrB,IAAI,YAAY,EAAE,MAAM;AACxB,IAAI,OAAO,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,EAAE;AACzC,IAAI,eAAe,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;AAClF,IAAI,aAAa,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;AAC9E,GAAG,CAAC;AACJ;;;;;;;ACpBY,MAAC,KAAK,GAAG,EAAE;AACvB,IAAI,eAAe,CAAC;AACR,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,4BAAgD,CAAC,EAAE,QAAQ;AAEtH,MAAC,SAAS,GAAG,2CAA2C;AACxD,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,6CAA6C,CAAC,yCAAyC,CAAC,uCAAuC,CAAC,yCAAyC,CAAC,4CAA4C,CAAC,gDAAgD,CAAC,yCAAyC,EAAE;AACpW,MAAC,WAAW,GAAG,GAAG;AAClB,MAAC,KAAK,GAAG;;;;"}
|
||||
@@ -1,60 +0,0 @@
|
||||
import { c as create_ssr_component, h as compute_rest_props, i as spread, k as escape_object, j as escape_attribute_value, b as each } from './ssr-72fe14f2.js';
|
||||
import { v as validate_dynamic_element, i as is_void } from './ctx-ae09ff2a.js';
|
||||
|
||||
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;
|
||||
|
||||
export { Icon$1 as I };
|
||||
//# sourceMappingURL=Icon-17c26744.js.map
|
||||
@@ -0,0 +1,26 @@
|
||||
import { c as create_ssr_component, v as validate_component, e as escape, a as each, b as add_attribute } from './ssr-c85d451a.js';
|
||||
import './index3-58d8c192.js';
|
||||
import './ctx-168edc6f.js';
|
||||
import './index2-d9c461ad.js';
|
||||
import 'clsx';
|
||||
import 'tailwind-variants';
|
||||
|
||||
const Nav = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let { data } = $$props;
|
||||
if ($$props.data === void 0 && $$bindings.data && data !== void 0)
|
||||
$$bindings.data(data);
|
||||
return `<div class="one"></div> <header class="relative z-50 w-full"><div class="container flex h-14 items-center"><div class="mr-4 flex blurry-bg"><a${add_attribute("href", data.site.home ? data.site.home : "/", 0)} class="mr-6 flex items-center space-x-2">${data.site.logo ? `<img${add_attribute("src", data.site.logo, 0)} class="h-9 w-9"${add_attribute("alt", data.site.title, 0)} srcset="">` : ``} ${data.site.title ? `<span class="hidden font-bold sm:inline-block text-[15px] lg:text-base">${escape(data.site.title)}</span>` : ``}</a> ${data.site.nav ? `<nav class="flex items-center space-x-6 text-sm font-medium">${each(data.site.nav, (navItem) => {
|
||||
return `<a${add_attribute("href", navItem.url, 0)}>${escape(navItem.name)} </a>`;
|
||||
})}</nav>` : ``}</div></div></header>`;
|
||||
});
|
||||
const Layout = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let { data } = $$props;
|
||||
if ($$props.data === void 0 && $$bindings.data && data !== void 0)
|
||||
$$bindings.data(data);
|
||||
return `${validate_component(Nav, "Nav").$$render($$result, { data }, {}, {})} ${$$result.head += `<!-- HEAD_svelte-xs6o1m_START -->${$$result.title = `<title>${escape(data.site.title)}</title>`, ""}${each(Object.entries(data.site.metaTags), ([key, value]) => {
|
||||
return `<meta${add_attribute("name", key, 0)}${add_attribute("content", value, 0)}>`;
|
||||
})}<!-- HEAD_svelte-xs6o1m_END -->`, ""} ${slots.default ? slots.default({}) : ``}`;
|
||||
});
|
||||
|
||||
export { Layout as default };
|
||||
//# sourceMappingURL=_layout.svelte-69122555.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"_layout.svelte-69122555.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/_layout.svelte.js"],"sourcesContent":["import { c as create_ssr_component, a as add_attribute, e as escape, b as each, v as validate_component } from \"../../chunks/ssr.js\";\nimport \"../../chunks/index3.js\";\nconst app = \"\";\nconst kener = \"\";\nconst Nav = create_ssr_component(($$result, $$props, $$bindings, slots) => {\n let { data } = $$props;\n if ($$props.data === void 0 && $$bindings.data && data !== void 0)\n $$bindings.data(data);\n return `<div class=\"one\"></div> <header class=\"relative z-50 w-full\"><div class=\"container flex h-14 items-center\"><div class=\"mr-4 flex blurry-bg\"><a${add_attribute(\"href\", data.site.home ? data.site.home : \"/\", 0)} class=\"mr-6 flex items-center space-x-2\">${data.site.logo ? `<img${add_attribute(\"src\", data.site.logo, 0)} class=\"h-9 w-9\"${add_attribute(\"alt\", data.site.title, 0)} srcset=\"\">` : ``} ${data.site.title ? `<span class=\"hidden font-bold sm:inline-block text-[15px] lg:text-base\">${escape(data.site.title)}</span>` : ``}</a> ${data.site.nav ? `<nav class=\"flex items-center space-x-6 text-sm font-medium\">${each(data.site.nav, (navItem) => {\n return `<a${add_attribute(\"href\", navItem.url, 0)}>${escape(navItem.name)} </a>`;\n })}</nav>` : ``}</div></div></header>`;\n});\nconst Layout = create_ssr_component(($$result, $$props, $$bindings, slots) => {\n let { data } = $$props;\n if ($$props.data === void 0 && $$bindings.data && data !== void 0)\n $$bindings.data(data);\n return `${validate_component(Nav, \"Nav\").$$render($$result, { data }, {}, {})} ${$$result.head += `<!-- HEAD_svelte-xs6o1m_START -->${$$result.title = `<title>${escape(data.site.title)}</title>`, \"\"}${each(Object.entries(data.site.metaTags), ([key, value]) => {\n return `<meta${add_attribute(\"name\", key, 0)}${add_attribute(\"content\", value, 0)}>`;\n })}<!-- HEAD_svelte-xs6o1m_END -->`, \"\"} ${slots.default ? slots.default({}) : ``}`;\n});\nexport {\n Layout as default\n};\n"],"names":[],"mappings":";;;;;;;AAIA,MAAM,GAAG,GAAG,oBAAoB,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,KAAK;AAC3E,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;AACzB,EAAE,IAAI,OAAO,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,UAAU,CAAC,IAAI,IAAI,IAAI,KAAK,KAAK,CAAC;AACnE,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,EAAE,OAAO,CAAC,8IAA8I,EAAE,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,0CAA0C,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,gBAAgB,EAAE,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,wEAAwE,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,6DAA6D,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,KAAK;AACjpB,IAAI,OAAO,CAAC,EAAE,EAAE,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC;AACrF,GAAG,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC;AACzC,CAAC,CAAC,CAAC;AACE,MAAC,MAAM,GAAG,oBAAoB,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,KAAK;AAC9E,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;AACzB,EAAE,IAAI,OAAO,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,UAAU,CAAC,IAAI,IAAI,IAAI,KAAK,KAAK,CAAC;AACnE,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,EAAE,OAAO,CAAC,EAAE,kBAAkB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,IAAI,IAAI,CAAC,iCAAiC,EAAE,QAAQ,CAAC,KAAK,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK;AACtQ,IAAI,OAAO,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACzF,GAAG,CAAC,CAAC,+BAA+B,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACtF,CAAC;;;;"}
|
||||
@@ -1,51 +0,0 @@
|
||||
import { c as create_ssr_component, a as add_attribute, v as validate_component, e as escape, b as each } from './ssr-72fe14f2.js';
|
||||
import { b as buttonVariants } from './index2-39686446.js';
|
||||
import { I as Icon$1 } from './Icon-17c26744.js';
|
||||
import './ctx-ae09ff2a.js';
|
||||
import './index3-1a2d4d4c.js';
|
||||
import 'clsx';
|
||||
import 'tailwind-variants';
|
||||
|
||||
const Github = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
const iconNode = [
|
||||
[
|
||||
"path",
|
||||
{
|
||||
"d": "M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"
|
||||
}
|
||||
],
|
||||
["path", { "d": "M9 18c-4.51 2-5-2-7-2" }]
|
||||
];
|
||||
return `${validate_component(Icon$1, "Icon").$$render($$result, Object.assign({}, { name: "github" }, $$props, { iconNode }), {}, {
|
||||
default: () => {
|
||||
return `${slots.default ? slots.default({}) : ``}`;
|
||||
}
|
||||
})}`;
|
||||
});
|
||||
const Github$1 = Github;
|
||||
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, 0)} class="mr-6 flex items-center space-x-2"><img${add_attribute("src", data.site.logo, 0)} class="h-5 w-5" alt="" srcset=""> <span class="hidden font-bold sm:inline-block text-[15px] lg:text-base">${escape(data.site.title)}</span></a> <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> ${data.site.github && data.site.github.visible ? `<div class="flex flex-1 items-center justify-between space-x-2 sm:space-x-4 md:justify-end"><div class="w-full flex-1 md:w-auto md:flex-none"><a href="${"https://github.com/" + escape(data.site.github.owner, true) + "/" + escape(data.site.github.repo, true)}" class="${escape(buttonVariants({ variant: "ghost" }), true) + " blurry-bg"}">${validate_component(Github$1, "Github").$$render(
|
||||
$$result,
|
||||
{
|
||||
class: "h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all"
|
||||
},
|
||||
{},
|
||||
{}
|
||||
)}</a></div></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 `<input type="hidden"${add_attribute("value", data.tzOffset, 0)}> ${validate_component(Nav, "Nav").$$render($$result, { data }, {}, {})} ${$$result.head += `<!-- HEAD_svelte-3shchj_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-3shchj_END -->`, ""} ${slots.default ? slots.default({}) : ``}`;
|
||||
});
|
||||
|
||||
export { Layout as default };
|
||||
//# sourceMappingURL=_layout.svelte-d281ddab.js.map
|
||||
@@ -1,412 +0,0 @@
|
||||
import { c as create_ssr_component, e as escape, v as validate_component, b as each, h as compute_rest_props, i as spread, j as escape_attribute_value, k as escape_object, d as validate_store, f as subscribe } from './ssr-72fe14f2.js';
|
||||
import { C as Card, a as Card_content, c as cn, d as badgeVariants, b as createDispatcher, e as cubicOut } from './index4-353b5e33.js';
|
||||
import 'clsx';
|
||||
import { v as validate_dynamic_element, a as validate_void_dynamic_element, i as is_void, c as setCtx$2, d as getCtx$1, e as setCtx, f as getAttrs$2, h as getAttrs } from './ctx-ae09ff2a.js';
|
||||
import moment from 'moment';
|
||||
import { I as Icon$1 } from './Icon-17c26744.js';
|
||||
import 'tailwind-merge';
|
||||
import 'tailwind-variants';
|
||||
import './index3-1a2d4d4c.js';
|
||||
|
||||
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 Collapsible = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let builder;
|
||||
let $$restProps = compute_rest_props($$props, ["forceVisible", "disabled", "open", "onOpenChange", "asChild"]);
|
||||
let $root, $$unsubscribe_root;
|
||||
let { forceVisible = false } = $$props;
|
||||
let { disabled = void 0 } = $$props;
|
||||
let { open = void 0 } = $$props;
|
||||
let { onOpenChange = void 0 } = $$props;
|
||||
let { asChild = false } = $$props;
|
||||
const { elements: { root }, states: { open: localOpen }, updateOption } = setCtx$2({
|
||||
disabled,
|
||||
forceVisible,
|
||||
defaultOpen: open,
|
||||
onOpenChange: ({ next }) => {
|
||||
if (open !== next) {
|
||||
onOpenChange?.(next);
|
||||
open = next;
|
||||
}
|
||||
return next;
|
||||
}
|
||||
});
|
||||
validate_store(root, "root");
|
||||
$$unsubscribe_root = subscribe(root, (value) => $root = value);
|
||||
const attrs = getAttrs$2("root");
|
||||
if ($$props.forceVisible === void 0 && $$bindings.forceVisible && forceVisible !== void 0)
|
||||
$$bindings.forceVisible(forceVisible);
|
||||
if ($$props.disabled === void 0 && $$bindings.disabled && disabled !== void 0)
|
||||
$$bindings.disabled(disabled);
|
||||
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.asChild === void 0 && $$bindings.asChild && asChild !== void 0)
|
||||
$$bindings.asChild(asChild);
|
||||
open !== void 0 && localOpen.set(open);
|
||||
{
|
||||
updateOption("disabled", disabled);
|
||||
}
|
||||
{
|
||||
updateOption("forceVisible", forceVisible);
|
||||
}
|
||||
builder = $root;
|
||||
$$unsubscribe_root();
|
||||
return `${asChild ? `${slots.default ? slots.default({ builder, attrs }) : ``}` : `<div${spread([escape_object(builder), escape_object($$restProps), escape_object(attrs)], {})}>${slots.default ? slots.default({ builder, attrs }) : ``}</div>`}`;
|
||||
});
|
||||
const CollapsibleContent = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let builder;
|
||||
let $$restProps = compute_rest_props($$props, [
|
||||
"transition",
|
||||
"transitionConfig",
|
||||
"inTransition",
|
||||
"inTransitionConfig",
|
||||
"outTransition",
|
||||
"outTransitionConfig",
|
||||
"asChild"
|
||||
]);
|
||||
let $content, $$unsubscribe_content;
|
||||
let $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;
|
||||
const { elements: { content }, states: { open } } = getCtx$1();
|
||||
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$2("content");
|
||||
if ($$props.transition === void 0 && $$bindings.transition && transition !== void 0)
|
||||
$$bindings.transition(transition);
|
||||
if ($$props.transitionConfig === void 0 && $$bindings.transitionConfig && transitionConfig !== void 0)
|
||||
$$bindings.transitionConfig(transitionConfig);
|
||||
if ($$props.inTransition === void 0 && $$bindings.inTransition && inTransition !== void 0)
|
||||
$$bindings.inTransition(inTransition);
|
||||
if ($$props.inTransitionConfig === void 0 && $$bindings.inTransitionConfig && inTransitionConfig !== void 0)
|
||||
$$bindings.inTransitionConfig(inTransitionConfig);
|
||||
if ($$props.outTransition === void 0 && $$bindings.outTransition && outTransition !== void 0)
|
||||
$$bindings.outTransition(outTransition);
|
||||
if ($$props.outTransitionConfig === void 0 && $$bindings.outTransitionConfig && outTransitionConfig !== void 0)
|
||||
$$bindings.outTransitionConfig(outTransitionConfig);
|
||||
if ($$props.asChild === void 0 && $$bindings.asChild && asChild !== void 0)
|
||||
$$bindings.asChild(asChild);
|
||||
builder = $content;
|
||||
$$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 CollapsibleTrigger = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let builder;
|
||||
let $$restProps = compute_rest_props($$props, ["asChild"]);
|
||||
let $trigger, $$unsubscribe_trigger;
|
||||
let { asChild = false } = $$props;
|
||||
const { elements: { trigger } } = getCtx$1();
|
||||
validate_store(trigger, "trigger");
|
||||
$$unsubscribe_trigger = subscribe(trigger, (value) => $trigger = value);
|
||||
createDispatcher();
|
||||
const attrs = getAttrs$2("trigger");
|
||||
if ($$props.asChild === void 0 && $$bindings.asChild && asChild !== void 0)
|
||||
$$bindings.asChild(asChild);
|
||||
builder = $trigger;
|
||||
$$unsubscribe_trigger();
|
||||
return `${asChild ? `${slots.default ? slots.default({ builder, attrs }) : ``}` : `<button${spread(
|
||||
[
|
||||
escape_object(builder),
|
||||
{ type: "button" },
|
||||
escape_object($$restProps),
|
||||
escape_object(attrs)
|
||||
],
|
||||
{}
|
||||
)}>${slots.default ? slots.default({ builder, attrs }) : ``}</button>`}`;
|
||||
});
|
||||
const 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 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 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
|
||||
),
|
||||
{},
|
||||
{}
|
||||
)}`;
|
||||
});
|
||||
function slide(node, { delay = 0, duration = 400, easing = cubicOut, axis = "y" } = {}) {
|
||||
const style = getComputedStyle(node);
|
||||
const opacity = +style.opacity;
|
||||
const primary_property = axis === "y" ? "height" : "width";
|
||||
const primary_property_value = parseFloat(style[primary_property]);
|
||||
const secondary_properties = axis === "y" ? ["top", "bottom"] : ["left", "right"];
|
||||
const capitalized_secondary_properties = secondary_properties.map(
|
||||
(e) => `${e[0].toUpperCase()}${e.slice(1)}`
|
||||
);
|
||||
const padding_start_value = parseFloat(style[`padding${capitalized_secondary_properties[0]}`]);
|
||||
const padding_end_value = parseFloat(style[`padding${capitalized_secondary_properties[1]}`]);
|
||||
const margin_start_value = parseFloat(style[`margin${capitalized_secondary_properties[0]}`]);
|
||||
const margin_end_value = parseFloat(style[`margin${capitalized_secondary_properties[1]}`]);
|
||||
const border_width_start_value = parseFloat(
|
||||
style[`border${capitalized_secondary_properties[0]}Width`]
|
||||
);
|
||||
const border_width_end_value = parseFloat(
|
||||
style[`border${capitalized_secondary_properties[1]}Width`]
|
||||
);
|
||||
return {
|
||||
delay,
|
||||
duration,
|
||||
easing,
|
||||
css: (t) => `overflow: hidden;opacity: ${Math.min(t * 20, 1) * opacity};${primary_property}: ${t * primary_property_value}px;padding-${secondary_properties[0]}: ${t * padding_start_value}px;padding-${secondary_properties[1]}: ${t * padding_end_value}px;margin-${secondary_properties[0]}: ${t * margin_start_value}px;margin-${secondary_properties[1]}: ${t * margin_end_value}px;border-${secondary_properties[0]}-width: ${t * border_width_start_value}px;border-${secondary_properties[1]}-width: ${t * border_width_end_value}px;`
|
||||
};
|
||||
}
|
||||
const Collapsible_content = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let $$restProps = compute_rest_props($$props, ["transition", "transitionConfig"]);
|
||||
let { transition = slide } = $$props;
|
||||
let { transitionConfig = { duration: 150 } } = $$props;
|
||||
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(CollapsibleContent, "CollapsiblePrimitive.Content").$$render($$result, Object.assign({}, { transition }, { transitionConfig }, $$restProps), {}, {
|
||||
default: () => {
|
||||
return `${slots.default ? slots.default({}) : ``}`;
|
||||
}
|
||||
})}`;
|
||||
});
|
||||
const Root = Collapsible;
|
||||
const Trigger = CollapsibleTrigger;
|
||||
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) => {
|
||||
return `<div class="grid grid-cols-3 gap-4 mb-4"><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 `${escape(incident.title)} <span class="animate-ping absolute -left-[24px] -top-[24px] w-[8px] h-[8px] inline-flex rounded-full h-3 w-3 bg-red-500 opacity-75"></span> `;
|
||||
}
|
||||
})} ${validate_component(Card_description, "Card.Description").$$render($$result, {}, {}, {
|
||||
default: () => {
|
||||
return `${escape(moment(incident.created_at).format("MMMM Do YYYY, h:mm:ss a"))} `;
|
||||
}
|
||||
})} `;
|
||||
}
|
||||
})} ${validate_component(Card_content, "Card.Content").$$render($$result, {}, {}, {
|
||||
default: () => {
|
||||
return `<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> ${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>`;
|
||||
})}` : `<div class="flex items-center justify-left"><p class="text-xl" data-svelte-h="svelte-18j567b">No active incidents</p> <picture><source srcset="https://fonts.gstatic.com/s/e/notoemoji/latest/1f91e_1f3fb/512.webp" type="image/webp"> <img src="https://fonts.gstatic.com/s/e/notoemoji/latest/1f91e_1f3fb/512.gif" alt="🤞" width="32" height="32"></picture></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="past_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 `Past Incidents`;
|
||||
}
|
||||
})}</h1> ${data.pastIncidents.length > 0 ? `${each(data.pastIncidents, (incident, i) => {
|
||||
return `<div class="grid grid-cols-3 gap-4 mb-4"><div class="col-span-3">${validate_component(Card, "Card.Root").$$render($$result, {}, {}, {
|
||||
default: () => {
|
||||
return `${validate_component(Root, "Collapsible.Root").$$render($$result, {}, {}, {
|
||||
default: () => {
|
||||
return `${validate_component(Trigger, "Collapsible.Trigger").$$render($$result, { class: "w-full text-left" }, {}, {
|
||||
default: () => {
|
||||
return `${validate_component(Card_header, "Card.Header").$$render($$result, { class: "relative" }, {}, {
|
||||
default: () => {
|
||||
return `${validate_component(Card_title, "Card.Title").$$render($$result, { class: "relative" }, {}, {
|
||||
default: () => {
|
||||
return `${escape(incident.title)} `;
|
||||
}
|
||||
})} ${validate_component(Card_description, "Card.Description").$$render($$result, {}, {}, {
|
||||
default: () => {
|
||||
return `${escape(moment(incident.created_at).format("MMMM Do YYYY, h:mm:ss a"))} `;
|
||||
}
|
||||
})} ${validate_component(ChevronDown, "ChevronDown").$$render($$result, { class: "absolute right-5", size: 32 }, {}, {})} `;
|
||||
}
|
||||
})} `;
|
||||
}
|
||||
})} ${validate_component(Collapsible_content, "Collapsible.Content").$$render($$result, {}, {}, {
|
||||
default: () => {
|
||||
return `${validate_component(Card_content, "Card.Content").$$render($$result, {}, {}, {
|
||||
default: () => {
|
||||
return `<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> ${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 border-secondary bg-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 wysiwyg text-base font-normal prose dark:prose-invert 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>`;
|
||||
})}` : `<div class="flex items-center justify-left"><p class="text-xl" data-svelte-h="svelte-ak4fah">No past incidents</p> <picture><source srcset="https://fonts.gstatic.com/s/e/notoemoji/latest/270c_1f3fb/512.webp" type="image/webp"> <img src="https://fonts.gstatic.com/s/e/notoemoji/latest/270c_1f3fb/512.gif" alt="✌" width="32" height="32"></picture></div>`}</div></section>`;
|
||||
});
|
||||
|
||||
export { Page as default };
|
||||
//# sourceMappingURL=_page.svelte-21cc1492.js.map
|
||||
@@ -1,310 +0,0 @@
|
||||
import { c as create_ssr_component, a as add_attribute, e as escape, b as each, v as validate_component, h as compute_rest_props, i as spread, j as escape_attribute_value, k as escape_object, d as validate_store, f as subscribe } from './ssr-72fe14f2.js';
|
||||
import { C as Card, a as Card_content, c as cn, b as createDispatcher, f as flyAndScale } from './index4-353b5e33.js';
|
||||
import 'clsx';
|
||||
import { s as setCtx$1, g as getCtx, v as validate_dynamic_element, a as validate_void_dynamic_element, i as is_void, b as getAttrs$1 } from './ctx-ae09ff2a.js';
|
||||
import { d as derived } from './index3-1a2d4d4c.js';
|
||||
import './index2-39686446.js';
|
||||
import { tv } from 'tailwind-variants';
|
||||
import 'tailwind-merge';
|
||||
|
||||
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 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 Skeleton = 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("animate-pulse rounded-md bg-muted", className))
|
||||
},
|
||||
escape_object($$restProps)
|
||||
],
|
||||
{}
|
||||
)}></div>`;
|
||||
});
|
||||
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"
|
||||
}
|
||||
});
|
||||
function getTodayDD() {
|
||||
let yourDate = /* @__PURE__ */ new Date();
|
||||
const offset = yourDate.getTimezoneOffset();
|
||||
yourDate = new Date(yourDate.getTime() - offset * 60 * 1e3);
|
||||
return yourDate.toISOString().split("T")[0];
|
||||
}
|
||||
function getminuteFromMidnightTillNow() {
|
||||
var date = /* @__PURE__ */ new Date();
|
||||
var hours = date.getHours();
|
||||
var minutes = date.getMinutes();
|
||||
var totalMinutes = hours * 60 + minutes;
|
||||
return totalMinutes;
|
||||
}
|
||||
const Monitor = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let { monitor } = $$props;
|
||||
getTodayDD();
|
||||
getminuteFromMidnightTillNow();
|
||||
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, {}, {}, {
|
||||
default: () => {
|
||||
return `<div class="grid grid-cols-12 gap-4"><div class="col-span-12 md:col-span-4"><div class="pt-3"><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, {}, {}, {
|
||||
default: () => {
|
||||
return `${escape(monitor.description)}`;
|
||||
}
|
||||
})}`;
|
||||
}
|
||||
})}` : ``}</div></div> ${``}</div> <div class="col-span-12 md:col-span-8 pt-4">${`${validate_component(Skeleton, "Skeleton").$$render($$result, { class: "w-full h-[40px] mt-[7px]" }, {}, {})}`}</div></div>`;
|
||||
}
|
||||
})}`;
|
||||
}
|
||||
})}</section>`;
|
||||
});
|
||||
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 `${data.site.hero ? `<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">${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>` : ``} ${each(data.monitors, (monitor) => {
|
||||
return `${validate_component(Monitor, "Monitor").$$render($$result, { monitor }, {}, {})}`;
|
||||
})}`;
|
||||
});
|
||||
|
||||
export { Page as default };
|
||||
//# sourceMappingURL=_page.svelte-2442d3a2.js.map
|
||||
@@ -1,18 +0,0 @@
|
||||
import { c as create_ssr_component, b as each, e as escape, a as add_attribute } from './ssr-72fe14f2.js';
|
||||
import Markdoc from '@markdoc/markdoc';
|
||||
|
||||
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 bg-white mt-32"><div class="grid grid-cols-5 gap-4"><div class="col-span-5 md:col-span-1 hidden md:block border-r-2 border-gray-500"><ul class="w-full text-sm font-medium text-gray-900 bg-white mt-8 rounded-lg">${each(sideBar, (item) => {
|
||||
return `<li class="w-full px-4 py-2"><a href="${"#" + escape(item.id, true)}"${add_attribute("class", item.type == "h2" ? "pl-5" : "", 0)}>${escape(item.text)}</a> </li>`;
|
||||
})} <li class="w-full px-4 py-2 rounded-b-lg" data-svelte-h="svelte-1fk2cyx">Download</li></ul></div> <div class="col-span-5 md:col-span-4"><div class="bg-white pt-6 p-0 md:p-10"><article id="markdown" class="prose prose-stone max-w-none prose-code:bg-gray-200 prose-code:px-[0.3rem] prose-code:py-[0.2rem] 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-43dcbc25.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"_page.svelte-43dcbc25.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/docs/_page.svelte.js"],"sourcesContent":["import { c as create_ssr_component, e as each, a as escape, b as add_attribute } from \"../../../chunks/ssr.js\";\nimport Markdoc from \"@markdoc/markdoc\";\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 bg-white mt-32\"><div class=\"grid grid-cols-5 gap-4\"><div class=\"col-span-5 md:col-span-1 hidden md:block border-r-2 border-gray-500\"><ul class=\"w-full text-sm font-medium text-gray-900 bg-white mt-8 rounded-lg\">${each(sideBar, (item) => {\n return `<li class=\"w-full px-4 py-2\"><a href=\"${\"#\" + escape(item.id, true)}\"${add_attribute(\"class\", item.type == \"h2\" ? \"pl-5\" : \"\", 0)}>${escape(item.text)}</a> </li>`;\n })} <li class=\"w-full px-4 py-2 rounded-b-lg\" data-svelte-h=\"svelte-1fk2cyx\">Download</li></ul></div> <div class=\"col-span-5 md:col-span-4\"><div class=\"bg-white pt-6 p-0 md:p-10\"><article id=\"markdown\" class=\"prose prose-stone max-w-none prose-code:bg-gray-200 prose-code:px-[0.3rem] prose-code:py-[0.2rem] prose-code:font-mono prose-code:text-sm prose-code:rounded\"><!-- HTML_TAG_START -->${html}<!-- HTML_TAG_END --></article></div></div></div></section>`;\n});\nexport {\n Page as default\n};\n"],"names":[],"mappings":";;;AAEK,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,iQAAiQ,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,IAAI,KAAK;AACrS,IAAI,OAAO,CAAC,sCAAsC,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;AAC/K,GAAG,CAAC,CAAC,mYAAmY,EAAE,IAAI,CAAC,2DAA2D,CAAC,CAAC;AAC5c,CAAC;;;;"}
|
||||
@@ -0,0 +1,118 @@
|
||||
import { c as create_ssr_component, b as add_attribute, e as escape, v as validate_component, a as each } from './ssr-c85d451a.js';
|
||||
import { C as Card, a as Card_content, I as Icon$1 } from './chevron-down-226abe3e.js';
|
||||
import 'clsx';
|
||||
import { B as Badge, I as Incident, R as Root, T as Trigger, H as Hover_card_content } from './incident-3b62e478.js';
|
||||
import './ctx-168edc6f.js';
|
||||
import { b as buttonVariants } from './index3-58d8c192.js';
|
||||
import 'tailwind-merge';
|
||||
import './index2-d9c461ad.js';
|
||||
import './helpers-eac5677c.js';
|
||||
import 'moment';
|
||||
import 'tailwind-variants';
|
||||
|
||||
const Arrow_right = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
const iconNode = [["path", { "d": "M5 12h14" }], ["path", { "d": "m12 5 7 7-7 7" }]];
|
||||
return `${validate_component(Icon$1, "Icon").$$render($$result, Object.assign({}, { name: "arrow-right" }, $$props, { iconNode }), {}, {
|
||||
default: () => {
|
||||
return `${slots.default ? slots.default({}) : ``}`;
|
||||
}
|
||||
})}`;
|
||||
});
|
||||
const ArrowRight = Arrow_right;
|
||||
const Monitor = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let { monitor } = $$props;
|
||||
let { localTz } = $$props;
|
||||
let _90Day = monitor.pageData._90Day;
|
||||
let uptime0Day = monitor.pageData.uptime0Day;
|
||||
let uptime90Day = monitor.pageData.uptime90Day;
|
||||
monitor.pageData.dailyUps;
|
||||
monitor.pageData.dailyDown;
|
||||
monitor.pageData.dailyDegraded;
|
||||
let todayDD = Object.keys(_90Day)[Object.keys(_90Day).length - 1];
|
||||
if ($$props.monitor === void 0 && $$bindings.monitor && monitor !== void 0)
|
||||
$$bindings.monitor(monitor);
|
||||
if ($$props.localTz === void 0 && $$bindings.localTz && localTz !== void 0)
|
||||
$$bindings.localTz(localTz);
|
||||
return `<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-5 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]"><button class="inline-block">${validate_component(Badge, "Badge").$$render(
|
||||
$$result,
|
||||
{
|
||||
variant: ""
|
||||
},
|
||||
{},
|
||||
{
|
||||
default: () => {
|
||||
return `90 Day ► ${escape(uptime90Day)}%`;
|
||||
}
|
||||
}
|
||||
)}</button> <button>${validate_component(Badge, "Badge").$$render($$result, { variant: "outline" }, {}, {
|
||||
default: () => {
|
||||
return `Today ► ${escape(uptime0Day)}%`;
|
||||
}
|
||||
})}</button></div> <div class="col-span-12 md:col-span-4 text-right h-[32px]">${_90Day[todayDD] ? `<div class="${"text-api-up 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, localTz: data.localTz }, {}, {})}`;
|
||||
})}` : ``}`;
|
||||
});
|
||||
|
||||
export { Page as default };
|
||||
//# sourceMappingURL=_page.svelte-51a9cf2a.js.map
|
||||
@@ -0,0 +1,324 @@
|
||||
import { c as create_ssr_component, v as validate_component, a as each, e as escape, f as compute_rest_props, d as subscribe, h as spread, i as escape_object } from './ssr-c85d451a.js';
|
||||
import { marked } from 'marked';
|
||||
import { C as Card, a as Card_content, c as cn, b as ChevronDown, d as createDispatcher, e as cubicOut } from './chevron-down-226abe3e.js';
|
||||
import 'clsx';
|
||||
import { s as setCtx$2, a as setItem, g as getCtx$1, b as getTrigger, c as getContent, d as getAttrs$2 } from './ctx-168edc6f.js';
|
||||
import 'tailwind-merge';
|
||||
import './index2-d9c461ad.js';
|
||||
|
||||
const Accordion = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let builder;
|
||||
let $$restProps = compute_rest_props($$props, ["multiple", "value", "onValueChange", "disabled", "asChild"]);
|
||||
let $root, $$unsubscribe_root;
|
||||
let { multiple = false } = $$props;
|
||||
let { value = void 0 } = $$props;
|
||||
let { onValueChange = void 0 } = $$props;
|
||||
let { disabled = false } = $$props;
|
||||
let { asChild = false } = $$props;
|
||||
const { elements: { root }, states: { value: localValue }, updateOption } = setCtx$2({
|
||||
multiple,
|
||||
disabled,
|
||||
defaultValue: value,
|
||||
onValueChange: ({ next }) => {
|
||||
if (value !== next) {
|
||||
onValueChange?.(next);
|
||||
value = next;
|
||||
}
|
||||
return next;
|
||||
}
|
||||
});
|
||||
$$unsubscribe_root = subscribe(root, (value2) => $root = value2);
|
||||
const attrs = getAttrs$2("root");
|
||||
if ($$props.multiple === void 0 && $$bindings.multiple && multiple !== void 0)
|
||||
$$bindings.multiple(multiple);
|
||||
if ($$props.value === void 0 && $$bindings.value && value !== void 0)
|
||||
$$bindings.value(value);
|
||||
if ($$props.onValueChange === void 0 && $$bindings.onValueChange && onValueChange !== void 0)
|
||||
$$bindings.onValueChange(onValueChange);
|
||||
if ($$props.disabled === void 0 && $$bindings.disabled && disabled !== void 0)
|
||||
$$bindings.disabled(disabled);
|
||||
if ($$props.asChild === void 0 && $$bindings.asChild && asChild !== void 0)
|
||||
$$bindings.asChild(asChild);
|
||||
{
|
||||
localValue.set(value);
|
||||
}
|
||||
{
|
||||
updateOption("multiple", multiple);
|
||||
}
|
||||
{
|
||||
updateOption("disabled", disabled);
|
||||
}
|
||||
builder = $root;
|
||||
$$unsubscribe_root();
|
||||
return `${asChild ? `${slots.default ? slots.default({ builder, attrs }) : ``}` : `<div${spread([escape_object(builder), escape_object($$restProps), escape_object(attrs)], {})}>${slots.default ? slots.default({ builder, attrs }) : ``}</div>`}`;
|
||||
});
|
||||
const AccordionItem = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let builder;
|
||||
let $$restProps = compute_rest_props($$props, ["value", "disabled", "asChild"]);
|
||||
let $item, $$unsubscribe_item;
|
||||
let { value } = $$props;
|
||||
let { disabled = void 0 } = $$props;
|
||||
let { asChild = false } = $$props;
|
||||
const { item, props } = setItem({ value, disabled });
|
||||
$$unsubscribe_item = subscribe(item, (value2) => $item = value2);
|
||||
const attrs = getAttrs$2("item");
|
||||
if ($$props.value === void 0 && $$bindings.value && value !== void 0)
|
||||
$$bindings.value(value);
|
||||
if ($$props.disabled === void 0 && $$bindings.disabled && disabled !== void 0)
|
||||
$$bindings.disabled(disabled);
|
||||
if ($$props.asChild === void 0 && $$bindings.asChild && asChild !== void 0)
|
||||
$$bindings.asChild(asChild);
|
||||
builder = $item(props);
|
||||
$$unsubscribe_item();
|
||||
return `${asChild ? `${slots.default ? slots.default({ builder, attrs }) : ``}` : `<div${spread([escape_object(builder), escape_object($$restProps), escape_object(attrs)], {})}>${slots.default ? slots.default({ builder, attrs }) : ``}</div>`}`;
|
||||
});
|
||||
const AccordionHeader = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let builder;
|
||||
let $$restProps = compute_rest_props($$props, ["level", "asChild"]);
|
||||
let $header, $$unsubscribe_header;
|
||||
let { level = 3 } = $$props;
|
||||
let { asChild = false } = $$props;
|
||||
const { elements: { heading: header } } = getCtx$1();
|
||||
$$unsubscribe_header = subscribe(header, (value) => $header = value);
|
||||
const attrs = getAttrs$2("header");
|
||||
if ($$props.level === void 0 && $$bindings.level && level !== void 0)
|
||||
$$bindings.level(level);
|
||||
if ($$props.asChild === void 0 && $$bindings.asChild && asChild !== void 0)
|
||||
$$bindings.asChild(asChild);
|
||||
builder = $header(level);
|
||||
$$unsubscribe_header();
|
||||
return `${asChild ? `${slots.default ? slots.default({ builder, attrs }) : ``}` : `<div${spread([escape_object(builder), escape_object($$restProps), escape_object(attrs)], {})}>${slots.default ? slots.default({ builder, attrs }) : ``}</div>`}`;
|
||||
});
|
||||
const AccordionTrigger = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let builder;
|
||||
let $$restProps = compute_rest_props($$props, ["asChild"]);
|
||||
let $trigger, $$unsubscribe_trigger;
|
||||
let { asChild = false } = $$props;
|
||||
const { trigger, props } = getTrigger();
|
||||
$$unsubscribe_trigger = subscribe(trigger, (value) => $trigger = value);
|
||||
createDispatcher();
|
||||
const attrs = getAttrs$2("trigger");
|
||||
if ($$props.asChild === void 0 && $$bindings.asChild && asChild !== void 0)
|
||||
$$bindings.asChild(asChild);
|
||||
builder = $trigger(props);
|
||||
$$unsubscribe_trigger();
|
||||
return `${asChild ? `${slots.default ? slots.default({ builder, attrs }) : ``}` : `<button${spread(
|
||||
[
|
||||
escape_object(builder),
|
||||
{ type: "button" },
|
||||
escape_object($$restProps),
|
||||
escape_object(attrs)
|
||||
],
|
||||
{}
|
||||
)}>${slots.default ? slots.default({ builder, attrs }) : ``}</button>`}`;
|
||||
});
|
||||
const AccordionContent = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let builder;
|
||||
let $$restProps = compute_rest_props($$props, [
|
||||
"transition",
|
||||
"transitionConfig",
|
||||
"inTransition",
|
||||
"inTransitionConfig",
|
||||
"outTransition",
|
||||
"outTransitionConfig",
|
||||
"asChild"
|
||||
]);
|
||||
let $content, $$unsubscribe_content;
|
||||
let $isSelected, $$unsubscribe_isSelected;
|
||||
let { transition = void 0 } = $$props;
|
||||
let { transitionConfig = void 0 } = $$props;
|
||||
let { inTransition = void 0 } = $$props;
|
||||
let { inTransitionConfig = void 0 } = $$props;
|
||||
let { outTransition = void 0 } = $$props;
|
||||
let { outTransitionConfig = void 0 } = $$props;
|
||||
let { asChild = false } = $$props;
|
||||
const { content, isSelected, props } = getContent();
|
||||
$$unsubscribe_content = subscribe(content, (value) => $content = value);
|
||||
$$unsubscribe_isSelected = subscribe(isSelected, (value) => $isSelected = value);
|
||||
const attrs = getAttrs$2("content");
|
||||
if ($$props.transition === void 0 && $$bindings.transition && transition !== void 0)
|
||||
$$bindings.transition(transition);
|
||||
if ($$props.transitionConfig === void 0 && $$bindings.transitionConfig && transitionConfig !== void 0)
|
||||
$$bindings.transitionConfig(transitionConfig);
|
||||
if ($$props.inTransition === void 0 && $$bindings.inTransition && inTransition !== void 0)
|
||||
$$bindings.inTransition(inTransition);
|
||||
if ($$props.inTransitionConfig === void 0 && $$bindings.inTransitionConfig && inTransitionConfig !== void 0)
|
||||
$$bindings.inTransitionConfig(inTransitionConfig);
|
||||
if ($$props.outTransition === void 0 && $$bindings.outTransition && outTransition !== void 0)
|
||||
$$bindings.outTransition(outTransition);
|
||||
if ($$props.outTransitionConfig === void 0 && $$bindings.outTransitionConfig && outTransitionConfig !== void 0)
|
||||
$$bindings.outTransitionConfig(outTransitionConfig);
|
||||
if ($$props.asChild === void 0 && $$bindings.asChild && asChild !== void 0)
|
||||
$$bindings.asChild(asChild);
|
||||
builder = $content(props);
|
||||
$$unsubscribe_content();
|
||||
$$unsubscribe_isSelected();
|
||||
return `${asChild && $isSelected(props) ? `${slots.default ? slots.default({ builder, attrs }) : ``}` : `${transition && $isSelected(props) ? `<div${spread([escape_object(builder), escape_object($$restProps), escape_object(attrs)], {})}>${slots.default ? slots.default({ builder, attrs }) : ``}</div>` : `${inTransition && outTransition && $isSelected(props) ? `<div${spread([escape_object(builder), escape_object($$restProps), escape_object(attrs)], {})}>${slots.default ? slots.default({ builder, attrs }) : ``}</div>` : `${inTransition && $isSelected(props) ? `<div${spread(
|
||||
[
|
||||
escape_object(builder),
|
||||
escape_object($$restProps),
|
||||
escape_object(attrs)
|
||||
],
|
||||
{}
|
||||
)}>${slots.default ? slots.default({ builder, attrs }) : ``}</div>` : `${outTransition && $isSelected(props) ? `<div${spread(
|
||||
[
|
||||
escape_object(builder),
|
||||
escape_object($$restProps),
|
||||
escape_object(attrs)
|
||||
],
|
||||
{}
|
||||
)}>${slots.default ? slots.default({ builder, attrs }) : ``}</div>` : `${$isSelected(props) ? `<div${spread(
|
||||
[
|
||||
escape_object(builder),
|
||||
escape_object($$restProps),
|
||||
escape_object(attrs)
|
||||
],
|
||||
{}
|
||||
)}>${slots.default ? slots.default({ builder, attrs }) : ``}</div>` : ``}`}`}`}`}`}`;
|
||||
});
|
||||
function slide(node, { delay = 0, duration = 400, easing = cubicOut, axis = "y" } = {}) {
|
||||
const style = getComputedStyle(node);
|
||||
const opacity = +style.opacity;
|
||||
const primary_property = axis === "y" ? "height" : "width";
|
||||
const primary_property_value = parseFloat(style[primary_property]);
|
||||
const secondary_properties = axis === "y" ? ["top", "bottom"] : ["left", "right"];
|
||||
const capitalized_secondary_properties = secondary_properties.map(
|
||||
(e) => `${e[0].toUpperCase()}${e.slice(1)}`
|
||||
);
|
||||
const padding_start_value = parseFloat(style[`padding${capitalized_secondary_properties[0]}`]);
|
||||
const padding_end_value = parseFloat(style[`padding${capitalized_secondary_properties[1]}`]);
|
||||
const margin_start_value = parseFloat(style[`margin${capitalized_secondary_properties[0]}`]);
|
||||
const margin_end_value = parseFloat(style[`margin${capitalized_secondary_properties[1]}`]);
|
||||
const border_width_start_value = parseFloat(
|
||||
style[`border${capitalized_secondary_properties[0]}Width`]
|
||||
);
|
||||
const border_width_end_value = parseFloat(
|
||||
style[`border${capitalized_secondary_properties[1]}Width`]
|
||||
);
|
||||
return {
|
||||
delay,
|
||||
duration,
|
||||
easing,
|
||||
css: (t) => `overflow: hidden;opacity: ${Math.min(t * 20, 1) * opacity};${primary_property}: ${t * primary_property_value}px;padding-${secondary_properties[0]}: ${t * padding_start_value}px;padding-${secondary_properties[1]}: ${t * padding_end_value}px;margin-${secondary_properties[0]}: ${t * margin_start_value}px;margin-${secondary_properties[1]}: ${t * margin_end_value}px;border-${secondary_properties[0]}-width: ${t * border_width_start_value}px;border-${secondary_properties[1]}-width: ${t * border_width_end_value}px;`
|
||||
};
|
||||
}
|
||||
const Accordion_content = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let $$restProps = compute_rest_props($$props, ["class", "transition", "transitionConfig"]);
|
||||
let { class: className = void 0 } = $$props;
|
||||
let { transition = slide } = $$props;
|
||||
let { transitionConfig = { duration: 200 } } = $$props;
|
||||
if ($$props.class === void 0 && $$bindings.class && className !== void 0)
|
||||
$$bindings.class(className);
|
||||
if ($$props.transition === void 0 && $$bindings.transition && transition !== void 0)
|
||||
$$bindings.transition(transition);
|
||||
if ($$props.transitionConfig === void 0 && $$bindings.transitionConfig && transitionConfig !== void 0)
|
||||
$$bindings.transitionConfig(transitionConfig);
|
||||
return `${validate_component(AccordionContent, "AccordionPrimitive.Content").$$render(
|
||||
$$result,
|
||||
Object.assign(
|
||||
{},
|
||||
{
|
||||
class: cn("overflow-hidden text-sm transition-all", className)
|
||||
},
|
||||
{ transition },
|
||||
{ transitionConfig },
|
||||
$$restProps
|
||||
),
|
||||
{},
|
||||
{
|
||||
default: () => {
|
||||
return `<div class="pb-4 pt-0">${slots.default ? slots.default({}) : ``}</div>`;
|
||||
}
|
||||
}
|
||||
)}`;
|
||||
});
|
||||
const Accordion_item = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let $$restProps = compute_rest_props($$props, ["class", "value"]);
|
||||
let { class: className = void 0 } = $$props;
|
||||
let { value } = $$props;
|
||||
if ($$props.class === void 0 && $$bindings.class && className !== void 0)
|
||||
$$bindings.class(className);
|
||||
if ($$props.value === void 0 && $$bindings.value && value !== void 0)
|
||||
$$bindings.value(value);
|
||||
return `${validate_component(AccordionItem, "AccordionPrimitive.Item").$$render($$result, Object.assign({}, { value }, { class: cn("border-b", className) }, $$restProps), {}, {
|
||||
default: () => {
|
||||
return `${slots.default ? slots.default({}) : ``}`;
|
||||
}
|
||||
})}`;
|
||||
});
|
||||
const Accordion_trigger = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let $$restProps = compute_rest_props($$props, ["class", "level"]);
|
||||
let { class: className = void 0 } = $$props;
|
||||
let { level = 3 } = $$props;
|
||||
if ($$props.class === void 0 && $$bindings.class && className !== void 0)
|
||||
$$bindings.class(className);
|
||||
if ($$props.level === void 0 && $$bindings.level && level !== void 0)
|
||||
$$bindings.level(level);
|
||||
return `${validate_component(AccordionHeader, "AccordionPrimitive.Header").$$render($$result, { level, class: "flex" }, {}, {
|
||||
default: () => {
|
||||
return `${validate_component(AccordionTrigger, "AccordionPrimitive.Trigger").$$render(
|
||||
$$result,
|
||||
Object.assign(
|
||||
{},
|
||||
{
|
||||
class: cn("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180", className)
|
||||
},
|
||||
$$restProps
|
||||
),
|
||||
{},
|
||||
{
|
||||
default: () => {
|
||||
return `${slots.default ? slots.default({}) : ``} ${validate_component(ChevronDown, "ChevronDown").$$render(
|
||||
$$result,
|
||||
{
|
||||
class: "h-4 w-4 transition-transform duration-200"
|
||||
},
|
||||
{},
|
||||
{}
|
||||
)}`;
|
||||
}
|
||||
}
|
||||
)}`;
|
||||
}
|
||||
})}`;
|
||||
});
|
||||
const Root = Accordion;
|
||||
const Page = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let { data } = $$props;
|
||||
let html = marked.parse(data.md);
|
||||
let sideBar = [];
|
||||
if ($$props.data === void 0 && $$bindings.data && data !== void 0)
|
||||
$$bindings.data(data);
|
||||
return `<section class="mx-auto container rounded-3xl scroll-smooth mt-8">${validate_component(Card, "Card.Root").$$render($$result, {}, {}, {
|
||||
default: () => {
|
||||
return `${validate_component(Card_content, "Card.Content").$$render($$result, { class: "px-1" }, {}, {
|
||||
default: () => {
|
||||
return `<div class="grid grid-cols-5 gap-4"><div class="col-span-5 md:col-span-1 pt-2 hidden md:block pr-1 border-r-2 border-secondary sticky top-0 overflow-y-auto max-h-screen">${each(sideBar, (item) => {
|
||||
return `${validate_component(Root, "Accordion.Root").$$render($$result, {}, {}, {
|
||||
default: () => {
|
||||
return `${validate_component(Accordion_item, "Accordion.Item").$$render($$result, { value: item.id }, {}, {
|
||||
default: () => {
|
||||
return `${validate_component(Accordion_trigger, "Accordion.Trigger").$$render($$result, { class: "text-sm font-semibold pl-2 pr-3" }, {}, {
|
||||
default: () => {
|
||||
return `<a href="${"#" + escape(item.id, true)}" class="sidebar-a">${escape(item.text)}</a> `;
|
||||
}
|
||||
})} ${validate_component(Accordion_content, "Accordion.Content").$$render($$result, {}, {}, {
|
||||
default: () => {
|
||||
return ` <ul class="text-sm font-medium pl-6">${each(item.children, (child) => {
|
||||
return `<li class="w-full py-2"><a href="${"#" + escape(child.id, true)}" class="sidebar-a">${escape(child.text)}</a> </li>`;
|
||||
})}</ul> `;
|
||||
}
|
||||
})} `;
|
||||
}
|
||||
})} `;
|
||||
}
|
||||
})}`;
|
||||
})}</div> <div class="col-span-5 md:col-span-4"><div class="pt-6 p-0 md:p-10 "><article id="markdown" class="prose prose-stone max-w-none dark:prose-invert dark:prose-pre:bg-neutral-900 prose-code:py-[0.2rem] prose-code:font-normal prose-code:font-mono prose-code:text-sm prose-code:rounded"><!-- HTML_TAG_START -->${html}<!-- HTML_TAG_END --></article></div></div></div>`;
|
||||
}
|
||||
})}`;
|
||||
}
|
||||
})}</section>`;
|
||||
});
|
||||
|
||||
export { Page as default };
|
||||
//# sourceMappingURL=_page.svelte-a36a0a0c.js.map
|
||||
@@ -0,0 +1,109 @@
|
||||
import { c as create_ssr_component, e as escape, v as validate_component, a as each, f as compute_rest_props, d as subscribe, h as spread, i as escape_object } from './ssr-c85d451a.js';
|
||||
import 'clsx';
|
||||
import { B as Badge, I as Incident } from './incident-3b62e478.js';
|
||||
import { e as setCtx, f as getAttrs } from './ctx-168edc6f.js';
|
||||
import { c as cn } from './chevron-down-226abe3e.js';
|
||||
import 'moment';
|
||||
import './index2-d9c461ad.js';
|
||||
import './helpers-eac5677c.js';
|
||||
import './index3-58d8c192.js';
|
||||
import 'tailwind-variants';
|
||||
import 'tailwind-merge';
|
||||
|
||||
const Separator$1 = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let builder;
|
||||
let $$restProps = compute_rest_props($$props, ["orientation", "decorative", "asChild"]);
|
||||
let $root, $$unsubscribe_root;
|
||||
let { orientation = "horizontal" } = $$props;
|
||||
let { decorative = true } = $$props;
|
||||
let { asChild = false } = $$props;
|
||||
const { elements: { root }, updateOption } = setCtx({ orientation, decorative });
|
||||
$$unsubscribe_root = subscribe(root, (value) => $root = value);
|
||||
const attrs = getAttrs("root");
|
||||
if ($$props.orientation === void 0 && $$bindings.orientation && orientation !== void 0)
|
||||
$$bindings.orientation(orientation);
|
||||
if ($$props.decorative === void 0 && $$bindings.decorative && decorative !== void 0)
|
||||
$$bindings.decorative(decorative);
|
||||
if ($$props.asChild === void 0 && $$bindings.asChild && asChild !== void 0)
|
||||
$$bindings.asChild(asChild);
|
||||
{
|
||||
updateOption("orientation", orientation);
|
||||
}
|
||||
{
|
||||
updateOption("decorative", decorative);
|
||||
}
|
||||
builder = $root;
|
||||
$$unsubscribe_root();
|
||||
return `${asChild ? `${slots.default ? slots.default({ builder, attrs }) : ``}` : `<div${spread([escape_object(builder), escape_object($$restProps), escape_object(attrs)], {})}></div>`}`;
|
||||
});
|
||||
const Separator = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let $$restProps = compute_rest_props($$props, ["class", "orientation", "decorative"]);
|
||||
let { class: className = void 0 } = $$props;
|
||||
let { orientation = "horizontal" } = $$props;
|
||||
let { decorative = void 0 } = $$props;
|
||||
if ($$props.class === void 0 && $$bindings.class && className !== void 0)
|
||||
$$bindings.class(className);
|
||||
if ($$props.orientation === void 0 && $$bindings.orientation && orientation !== void 0)
|
||||
$$bindings.orientation(orientation);
|
||||
if ($$props.decorative === void 0 && $$bindings.decorative && decorative !== void 0)
|
||||
$$bindings.decorative(decorative);
|
||||
return `${validate_component(Separator$1, "SeparatorPrimitive.Root").$$render(
|
||||
$$result,
|
||||
Object.assign(
|
||||
{},
|
||||
{
|
||||
class: cn(
|
||||
"shrink-0 bg-border",
|
||||
orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
||||
className
|
||||
)
|
||||
},
|
||||
{ orientation },
|
||||
{ decorative },
|
||||
$$restProps
|
||||
),
|
||||
{},
|
||||
{}
|
||||
)}`;
|
||||
});
|
||||
const Page = create_ssr_component(($$result, $$props, $$bindings, slots) => {
|
||||
let { data } = $$props;
|
||||
if ($$props.data === void 0 && $$bindings.data && data !== void 0)
|
||||
$$bindings.data(data);
|
||||
return `<section class="mx-auto flex w-full max-w-4xl flex-1 flex-col items-start justify-center"><div class="mx-auto max-w-screen-xl px-4 pt-32 pb-16 lg:flex lg:items-center"><div class="mx-auto max-w-3xl text-center blurry-bg"><h1 class="bg-gradient-to-r from-green-300 via-blue-500 to-purple-600 bg-clip-text text-5xl font-extrabold text-transparent leading-snug">${escape(data.monitor.name)}</h1> <p class="mx-auto mt-4 max-w-xl sm:text-xl">${escape(data.monitor.description)}</p></div></div></section> <section class="mx-auto flex-1 mt-8 flex-col mb-4 flex w-full" id="active_incident"><div class="container"><h1 class="mb-4 text-2xl font-bold leading-none">${validate_component(Badge, "Badge").$$render($$result, { variant: "outline" }, {}, {
|
||||
default: () => {
|
||||
return `Active Incidents`;
|
||||
}
|
||||
})}</h1> ${data.activeIncidents.length > 0 ? `${each(data.activeIncidents, (incident, i) => {
|
||||
return `${validate_component(Incident, "Incident").$$render(
|
||||
$$result,
|
||||
{
|
||||
incident,
|
||||
state: i == 0 ? "open" : "close",
|
||||
variant: "title+body+comments",
|
||||
monitor: data.monitor
|
||||
},
|
||||
{},
|
||||
{}
|
||||
)}`;
|
||||
})}` : `<div class="flex items-center justify-left" data-svelte-h="svelte-dr0k6a"><p class="text-xl">No active incidents</p></div>`}</div></section> ${validate_component(Separator, "Separator").$$render($$result, { class: "container mb-4 w-[400px]" }, {}, {})} <section class="mx-auto flex-1 mt-8 flex-col mb-4 flex w-full" id="active_incident"><div class="container"><h1 class="mb-4 text-2xl font-bold leading-none">${validate_component(Badge, "Badge").$$render($$result, { variant: "outline" }, {}, {
|
||||
default: () => {
|
||||
return `Recent Incidents`;
|
||||
}
|
||||
})}</h1> ${data.pastIncidents.length > 0 ? `${each(data.pastIncidents, (incident) => {
|
||||
return `${validate_component(Incident, "Incident").$$render(
|
||||
$$result,
|
||||
{
|
||||
incident,
|
||||
state: "close",
|
||||
variant: "title+body+comments",
|
||||
monitor: data.monitor
|
||||
},
|
||||
{},
|
||||
{}
|
||||
)}`;
|
||||
})}` : `<div class="flex items-center justify-left" data-svelte-h="svelte-b2l9ix"><p class="text-xl">No recent incidents</p></div>`}</div></section>`;
|
||||
});
|
||||
|
||||
export { Page as default };
|
||||
//# sourceMappingURL=_page.svelte-ab6ea79c.js.map
|
||||
@@ -0,0 +1,34 @@
|
||||
import fs from 'fs-extra';
|
||||
import { j as json } from './index-2b68e648.js';
|
||||
import { G as GetMinuteStartNowTimestampUTC, B as BeginingOfDay } from './tool-153dc604.js';
|
||||
import { S as StatusObj } from './helpers-eac5677c.js';
|
||||
|
||||
async function POST({ request }) {
|
||||
const payload = await request.json();
|
||||
const monitor = payload.monitor;
|
||||
const localTz = payload.localTz;
|
||||
let _0Day = {};
|
||||
const now = GetMinuteStartNowTimestampUTC();
|
||||
const midnight = BeginingOfDay({ timeZone: localTz });
|
||||
for (let i = midnight; i <= now; i += 60) {
|
||||
_0Day[i] = {
|
||||
timestamp: i,
|
||||
status: "NO_DATA",
|
||||
cssClass: StatusObj.NO_DATA,
|
||||
index: (i - midnight) / 60
|
||||
};
|
||||
}
|
||||
let day0 = JSON.parse(fs.readFileSync(monitor.path0Day, "utf8"));
|
||||
for (const timestamp in day0) {
|
||||
const element = day0[timestamp];
|
||||
let status = element.status;
|
||||
if (_0Day[timestamp] !== void 0) {
|
||||
_0Day[timestamp].status = status;
|
||||
_0Day[timestamp].cssClass = StatusObj[status];
|
||||
}
|
||||
}
|
||||
return json(_0Day);
|
||||
}
|
||||
|
||||
export { POST };
|
||||
//# sourceMappingURL=_server-17a98c60.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"_server-17a98c60.js","sources":["../../../.svelte-kit/adapter-node/entries/endpoints/api/today/_server.js"],"sourcesContent":["import fs from \"fs-extra\";\nimport { j as json } from \"../../../../chunks/index.js\";\nimport { b as GetMinuteStartNowTimestampUTC, B as BeginingOfDay } from \"../../../../chunks/tool.js\";\nimport { S as StatusObj } from \"../../../../chunks/helpers.js\";\nasync function POST({ request }) {\n const payload = await request.json();\n const monitor = payload.monitor;\n const localTz = payload.localTz;\n let _0Day = {};\n const now = GetMinuteStartNowTimestampUTC();\n const midnight = BeginingOfDay({ timeZone: localTz });\n for (let i = midnight; i <= now; i += 60) {\n _0Day[i] = {\n timestamp: i,\n status: \"NO_DATA\",\n cssClass: StatusObj.NO_DATA,\n index: (i - midnight) / 60\n };\n }\n let day0 = JSON.parse(fs.readFileSync(monitor.path0Day, \"utf8\"));\n for (const timestamp in day0) {\n const element = day0[timestamp];\n let status = element.status;\n if (_0Day[timestamp] !== void 0) {\n _0Day[timestamp].status = status;\n _0Day[timestamp].cssClass = StatusObj[status];\n }\n }\n return json(_0Day);\n}\nexport {\n POST\n};\n"],"names":[],"mappings":";;;;;AAIA,eAAe,IAAI,CAAC,EAAE,OAAO,EAAE,EAAE;AACjC,EAAE,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,IAAI,EAAE,CAAC;AACvC,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;AAClC,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;AAClC,EAAE,IAAI,KAAK,GAAG,EAAE,CAAC;AACjB,EAAE,MAAM,GAAG,GAAG,6BAA6B,EAAE,CAAC;AAC9C,EAAE,MAAM,QAAQ,GAAG,aAAa,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;AACxD,EAAE,KAAK,IAAI,CAAC,GAAG,QAAQ,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE;AAC5C,IAAI,KAAK,CAAC,CAAC,CAAC,GAAG;AACf,MAAM,SAAS,EAAE,CAAC;AAClB,MAAM,MAAM,EAAE,SAAS;AACvB,MAAM,QAAQ,EAAE,SAAS,CAAC,OAAO;AACjC,MAAM,KAAK,EAAE,CAAC,CAAC,GAAG,QAAQ,IAAI,EAAE;AAChC,KAAK,CAAC;AACN,GAAG;AACH,EAAE,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;AACnE,EAAE,KAAK,MAAM,SAAS,IAAI,IAAI,EAAE;AAChC,IAAI,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC;AACpC,IAAI,IAAI,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;AAChC,IAAI,IAAI,KAAK,CAAC,SAAS,CAAC,KAAK,KAAK,CAAC,EAAE;AACrC,MAAM,KAAK,CAAC,SAAS,CAAC,CAAC,MAAM,GAAG,MAAM,CAAC;AACvC,MAAM,KAAK,CAAC,SAAS,CAAC,CAAC,QAAQ,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;AACpD,KAAK;AACL,GAAG;AACH,EAAE,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;AACrB;;;;"}
|
||||
@@ -0,0 +1,74 @@
|
||||
import { j as json } from './index-2b68e648.js';
|
||||
import { a as auth, P as ParseIncidentPayload, G as GHIssueToKenerIncident } from './webhook-bd364d16.js';
|
||||
import { U as UpdateIssue, a as GetIncidentByNumber } from './github-54c09baa.js';
|
||||
import { p as public_env } from './shared-server-58a5f352.js';
|
||||
import fs from 'fs-extra';
|
||||
import './tool-153dc604.js';
|
||||
import 'randomstring';
|
||||
import 'axios';
|
||||
import 'marked';
|
||||
|
||||
async function PATCH({ request, params }) {
|
||||
const authError = auth(request);
|
||||
if (authError !== null) {
|
||||
return json(
|
||||
{ error: authError.message },
|
||||
{
|
||||
status: 401
|
||||
}
|
||||
);
|
||||
}
|
||||
const incidentNumber = params.incidentNumber;
|
||||
const payload = await request.json();
|
||||
if (!incidentNumber || isNaN(incidentNumber)) {
|
||||
return json(
|
||||
{ error: "Invalid incidentNumber" },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
let { title, body, githubLabels, error } = ParseIncidentPayload(payload);
|
||||
if (error) {
|
||||
return json(
|
||||
{ error },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
let site = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/site.json", "utf8"));
|
||||
let github = site.github;
|
||||
let resp = await UpdateIssue(github, incidentNumber, title, body, githubLabels);
|
||||
if (resp === null) {
|
||||
return json(
|
||||
{ error: "github error" },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
return json(GHIssueToKenerIncident(resp), {
|
||||
status: 200
|
||||
});
|
||||
}
|
||||
async function GET({ request, params }) {
|
||||
const incidentNumber = params.incidentNumber;
|
||||
let site = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/site.json", "utf8"));
|
||||
let github = site.github;
|
||||
let issue = await GetIncidentByNumber(github, incidentNumber);
|
||||
if (issue === null) {
|
||||
return json(
|
||||
{ error: "incident not found" },
|
||||
{
|
||||
status: 404
|
||||
}
|
||||
);
|
||||
}
|
||||
return json(GHIssueToKenerIncident(issue), {
|
||||
status: 200
|
||||
});
|
||||
}
|
||||
|
||||
export { GET, PATCH };
|
||||
//# sourceMappingURL=_server-21dfbd18.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"_server-21dfbd18.js","sources":["../../../.svelte-kit/adapter-node/entries/endpoints/api/incident/_incidentNumber_/_server.js"],"sourcesContent":["import { j as json } from \"../../../../../chunks/index.js\";\nimport { a as auth, P as ParseIncidentPayload, G as GHIssueToKenerIncident } from \"../../../../../chunks/webhook.js\";\nimport { U as UpdateIssue, G as GetIncidentByNumber } from \"../../../../../chunks/github.js\";\nimport { p as public_env } from \"../../../../../chunks/shared-server.js\";\nimport fs from \"fs-extra\";\nasync function PATCH({ request, params }) {\n const authError = auth(request);\n if (authError !== null) {\n return json(\n { error: authError.message },\n {\n status: 401\n }\n );\n }\n const incidentNumber = params.incidentNumber;\n const payload = await request.json();\n if (!incidentNumber || isNaN(incidentNumber)) {\n return json(\n { error: \"Invalid incidentNumber\" },\n {\n status: 400\n }\n );\n }\n let { title, body, githubLabels, error } = ParseIncidentPayload(payload);\n if (error) {\n return json(\n { error },\n {\n status: 400\n }\n );\n }\n let site = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + \"/site.json\", \"utf8\"));\n let github = site.github;\n let resp = await UpdateIssue(github, incidentNumber, title, body, githubLabels);\n if (resp === null) {\n return json(\n { error: \"github error\" },\n {\n status: 400\n }\n );\n }\n return json(GHIssueToKenerIncident(resp), {\n status: 200\n });\n}\nasync function GET({ request, params }) {\n const incidentNumber = params.incidentNumber;\n let site = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + \"/site.json\", \"utf8\"));\n let github = site.github;\n let issue = await GetIncidentByNumber(github, incidentNumber);\n if (issue === null) {\n return json(\n { error: \"incident not found\" },\n {\n status: 404\n }\n );\n }\n return json(GHIssueToKenerIncident(issue), {\n status: 200\n });\n}\nexport {\n GET,\n PATCH\n};\n"],"names":[],"mappings":";;;;;;;;;;AAKA,eAAe,KAAK,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;AAC1C,EAAE,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;AAClC,EAAE,IAAI,SAAS,KAAK,IAAI,EAAE;AAC1B,IAAI,OAAO,IAAI;AACf,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,OAAO,EAAE;AAClC,MAAM;AACN,QAAQ,MAAM,EAAE,GAAG;AACnB,OAAO;AACP,KAAK,CAAC;AACN,GAAG;AACH,EAAE,MAAM,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;AAC/C,EAAE,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,IAAI,EAAE,CAAC;AACvC,EAAE,IAAI,CAAC,cAAc,IAAI,KAAK,CAAC,cAAc,CAAC,EAAE;AAChD,IAAI,OAAO,IAAI;AACf,MAAM,EAAE,KAAK,EAAE,wBAAwB,EAAE;AACzC,MAAM;AACN,QAAQ,MAAM,EAAE,GAAG;AACnB,OAAO;AACP,KAAK,CAAC;AACN,GAAG;AACH,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC3E,EAAE,IAAI,KAAK,EAAE;AACb,IAAI,OAAO,IAAI;AACf,MAAM,EAAE,KAAK,EAAE;AACf,MAAM;AACN,QAAQ,MAAM,EAAE,GAAG;AACnB,OAAO;AACP,KAAK,CAAC;AACN,GAAG;AACH,EAAE,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,mBAAmB,GAAG,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;AAChG,EAAE,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAC3B,EAAE,IAAI,IAAI,GAAG,MAAM,WAAW,CAAC,MAAM,EAAE,cAAc,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;AAClF,EAAE,IAAI,IAAI,KAAK,IAAI,EAAE;AACrB,IAAI,OAAO,IAAI;AACf,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE;AAC/B,MAAM;AACN,QAAQ,MAAM,EAAE,GAAG;AACnB,OAAO;AACP,KAAK,CAAC;AACN,GAAG;AACH,EAAE,OAAO,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,EAAE;AAC5C,IAAI,MAAM,EAAE,GAAG;AACf,GAAG,CAAC,CAAC;AACL,CAAC;AACD,eAAe,GAAG,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;AACxC,EAAE,MAAM,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;AAC/C,EAAE,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,mBAAmB,GAAG,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;AAChG,EAAE,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAC3B,EAAE,IAAI,KAAK,GAAG,MAAM,mBAAmB,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AAChE,EAAE,IAAI,KAAK,KAAK,IAAI,EAAE;AACtB,IAAI,OAAO,IAAI;AACf,MAAM,EAAE,KAAK,EAAE,oBAAoB,EAAE;AACrC,MAAM;AACN,QAAQ,MAAM,EAAE,GAAG;AACnB,OAAO;AACP,KAAK,CAAC;AACN,GAAG;AACH,EAAE,OAAO,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC,EAAE;AAC7C,IAAI,MAAM,EAAE,GAAG;AACf,GAAG,CAAC,CAAC;AACL;;;;"}
|
||||
@@ -1,80 +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 from 'moment';
|
||||
import Randomstring from 'randomstring';
|
||||
|
||||
const API_TOKEN = process.env.API_TOKEN;
|
||||
const API_IP = process.env.API_IP;
|
||||
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 = Math.floor(Date.now() / 1e3);
|
||||
}
|
||||
resp.status = data.status;
|
||||
resp.latency = data.latency;
|
||||
resp.type = "webhook";
|
||||
let timestampISO = moment().toISOString();
|
||||
try {
|
||||
timestampISO = moment.unix(data.timestampInSeconds).toISOString();
|
||||
if (moment(timestampISO).isAfter(moment().add(1, "minute"))) {
|
||||
throw new Error("timestampInSeconds is in future");
|
||||
}
|
||||
if (moment(timestampISO).isBefore(moment().subtract(90, "days"))) {
|
||||
throw new Error("timestampInSeconds is older than 90days");
|
||||
}
|
||||
} catch (err) {
|
||||
return { error: err.message, status: 400 };
|
||||
}
|
||||
let tags = [];
|
||||
let monitors = [];
|
||||
try {
|
||||
monitors = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/monitors.json", "utf8"));
|
||||
tags = monitors.map((monitor2) => monitor2.tag);
|
||||
if (tags.indexOf(tag) == -1) {
|
||||
throw new Error("not a valid tag");
|
||||
}
|
||||
} catch (err) {
|
||||
return { error: err.message, status: 400 };
|
||||
}
|
||||
const monitor = monitors.find((monitor2) => monitor2.tag === tag);
|
||||
let day0 = {};
|
||||
let timeStampISOMinute = moment(timestampISO).startOf("minute").toISOString();
|
||||
day0[timeStampISOMinute] = 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 " + timeStampISOMinute };
|
||||
};
|
||||
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-315e3406.js.map
|
||||
@@ -0,0 +1,48 @@
|
||||
import { j as json } from './index-2b68e648.js';
|
||||
import { a as auth, P as ParseIncidentPayload, G as GHIssueToKenerIncident } from './webhook-bd364d16.js';
|
||||
import { C as CreateIssue } from './github-54c09baa.js';
|
||||
import { p as public_env } from './shared-server-58a5f352.js';
|
||||
import fs from 'fs-extra';
|
||||
import './tool-153dc604.js';
|
||||
import 'randomstring';
|
||||
import 'axios';
|
||||
import 'marked';
|
||||
|
||||
async function POST({ request }) {
|
||||
const payload = await request.json();
|
||||
const authError = auth(request);
|
||||
if (authError !== null) {
|
||||
return json(
|
||||
{ error: authError.message },
|
||||
{
|
||||
status: 401
|
||||
}
|
||||
);
|
||||
}
|
||||
let { title, body, githubLabels, error } = ParseIncidentPayload(payload);
|
||||
if (error) {
|
||||
return json(
|
||||
{ error },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
let site = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/site.json", "utf8"));
|
||||
let github = site.github;
|
||||
let resp = await CreateIssue(github, title, body, githubLabels);
|
||||
if (resp === null) {
|
||||
return json(
|
||||
{ error: "github error" },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
return json(GHIssueToKenerIncident(resp), {
|
||||
status: 200
|
||||
});
|
||||
}
|
||||
|
||||
export { POST };
|
||||
//# sourceMappingURL=_server-589e42d1.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"_server-589e42d1.js","sources":["../../../.svelte-kit/adapter-node/entries/endpoints/api/incident/_server.js"],"sourcesContent":["import { j as json } from \"../../../../chunks/index.js\";\nimport { a as auth, P as ParseIncidentPayload, G as GHIssueToKenerIncident } from \"../../../../chunks/webhook.js\";\nimport { C as CreateIssue } from \"../../../../chunks/github.js\";\nimport { p as public_env } from \"../../../../chunks/shared-server.js\";\nimport fs from \"fs-extra\";\nasync function POST({ request }) {\n const payload = await request.json();\n const authError = auth(request);\n if (authError !== null) {\n return json(\n { error: authError.message },\n {\n status: 401\n }\n );\n }\n let { title, body, githubLabels, error } = ParseIncidentPayload(payload);\n if (error) {\n return json(\n { error },\n {\n status: 400\n }\n );\n }\n let site = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + \"/site.json\", \"utf8\"));\n let github = site.github;\n let resp = await CreateIssue(github, title, body, githubLabels);\n if (resp === null) {\n return json(\n { error: \"github error\" },\n {\n status: 400\n }\n );\n }\n return json(GHIssueToKenerIncident(resp), {\n status: 200\n });\n}\nexport {\n POST\n};\n"],"names":[],"mappings":";;;;;;;;;;AAKA,eAAe,IAAI,CAAC,EAAE,OAAO,EAAE,EAAE;AACjC,EAAE,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,IAAI,EAAE,CAAC;AACvC,EAAE,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;AAClC,EAAE,IAAI,SAAS,KAAK,IAAI,EAAE;AAC1B,IAAI,OAAO,IAAI;AACf,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,OAAO,EAAE;AAClC,MAAM;AACN,QAAQ,MAAM,EAAE,GAAG;AACnB,OAAO;AACP,KAAK,CAAC;AACN,GAAG;AACH,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC3E,EAAE,IAAI,KAAK,EAAE;AACb,IAAI,OAAO,IAAI;AACf,MAAM,EAAE,KAAK,EAAE;AACf,MAAM;AACN,QAAQ,MAAM,EAAE,GAAG;AACnB,OAAO;AACP,KAAK,CAAC;AACN,GAAG;AACH,EAAE,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,mBAAmB,GAAG,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;AAChG,EAAE,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAC3B,EAAE,IAAI,IAAI,GAAG,MAAM,WAAW,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;AAClE,EAAE,IAAI,IAAI,KAAK,IAAI,EAAE;AACrB,IAAI,OAAO,IAAI;AACf,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE;AAC/B,MAAM;AACN,QAAQ,MAAM,EAAE,GAAG;AACnB,OAAO;AACP,KAAK,CAAC;AACN,GAAG;AACH,EAAE,OAAO,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,EAAE;AAC5C,IAAI,MAAM,EAAE,GAAG;AACf,GAAG,CAAC,CAAC;AACL;;;;"}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { p as public_env } from './shared-server-58a5f352.js';
|
||||
import fs from 'fs-extra';
|
||||
import { B as Badge, b as StatusColor } from './helpers-eac5677c.js';
|
||||
|
||||
const monitors = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/monitors.json", "utf8"));
|
||||
async function GET({ params, setHeaders }) {
|
||||
const { path0Day, name } = monitors.find((monitor) => monitor.tag === params.tag);
|
||||
const dayData = JSON.parse(fs.readFileSync(path0Day, "utf8"));
|
||||
const lastObj = dayData[Object.keys(dayData)[Object.keys(dayData).length - 1]];
|
||||
return new Response(Badge(name, lastObj.status, StatusColor[lastObj.status]), {
|
||||
headers: {
|
||||
"Content-Type": "image/svg+xml"
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export { GET };
|
||||
//# sourceMappingURL=_server-9b40268b.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"_server-9b40268b.js","sources":["../../../.svelte-kit/adapter-node/entries/endpoints/badge/_tag_/status/_server.js"],"sourcesContent":["import { p as public_env } from \"../../../../../chunks/shared-server.js\";\nimport fs from \"fs-extra\";\nimport { B as Badge, a as StatusColor } from \"../../../../../chunks/helpers.js\";\nconst monitors = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + \"/monitors.json\", \"utf8\"));\nasync function GET({ params, setHeaders }) {\n const { path0Day, name } = monitors.find((monitor) => monitor.tag === params.tag);\n const dayData = JSON.parse(fs.readFileSync(path0Day, \"utf8\"));\n const lastObj = dayData[Object.keys(dayData)[Object.keys(dayData).length - 1]];\n return new Response(Badge(name, lastObj.status, StatusColor[lastObj.status]), {\n headers: {\n \"Content-Type\": \"image/svg+xml\"\n }\n });\n}\nexport {\n GET\n};\n"],"names":[],"mappings":";;;;AAGA,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,mBAAmB,GAAG,gBAAgB,EAAE,MAAM,CAAC,CAAC,CAAC;AACxG,eAAe,GAAG,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE;AAC3C,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,GAAG,KAAK,MAAM,CAAC,GAAG,CAAC,CAAC;AACpF,EAAE,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;AAChE,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;AACjF,EAAE,OAAO,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE;AAChF,IAAI,OAAO,EAAE;AACb,MAAM,cAAc,EAAE,eAAe;AACrC,KAAK;AACL,GAAG,CAAC,CAAC;AACL;;;;"}
|
||||
@@ -0,0 +1,99 @@
|
||||
import { j as json } from './index-2b68e648.js';
|
||||
import { a as auth } from './webhook-bd364d16.js';
|
||||
import { b as GetCommentsForIssue, A as AddComment } from './github-54c09baa.js';
|
||||
import { p as public_env } from './shared-server-58a5f352.js';
|
||||
import fs from 'fs-extra';
|
||||
import './tool-153dc604.js';
|
||||
import 'randomstring';
|
||||
import 'axios';
|
||||
import 'marked';
|
||||
|
||||
async function GET({ request, params }) {
|
||||
const authError = auth(request);
|
||||
if (authError !== null) {
|
||||
return json(
|
||||
{ error: authError.message },
|
||||
{
|
||||
status: 401
|
||||
}
|
||||
);
|
||||
}
|
||||
const incidentNumber = params.incidentNumber;
|
||||
if (!incidentNumber || isNaN(incidentNumber)) {
|
||||
return json(
|
||||
{ error: "Invalid incidentNumber" },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
let site = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/site.json", "utf8"));
|
||||
let github = site.github;
|
||||
let resp = await GetCommentsForIssue(incidentNumber, github);
|
||||
return json(
|
||||
resp.map((comment) => {
|
||||
return {
|
||||
commentID: comment.id,
|
||||
body: comment.body,
|
||||
createdAt: Math.floor(new Date(comment.created_at).getTime() / 1e3)
|
||||
};
|
||||
}),
|
||||
{
|
||||
status: 200
|
||||
}
|
||||
);
|
||||
}
|
||||
async function POST({ request, params }) {
|
||||
const authError = auth(request);
|
||||
if (authError !== null) {
|
||||
return json(
|
||||
{ error: authError.message },
|
||||
{
|
||||
status: 401
|
||||
}
|
||||
);
|
||||
}
|
||||
const incidentNumber = params.incidentNumber;
|
||||
if (!incidentNumber || isNaN(incidentNumber)) {
|
||||
return json(
|
||||
{ error: "Invalid incidentNumber" },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
const payload = await request.json();
|
||||
let body = payload.body;
|
||||
if (!body || typeof body !== "string") {
|
||||
return json(
|
||||
{ error: "Invalid body" },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
let site = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/site.json", "utf8"));
|
||||
let github = site.github;
|
||||
let resp = await AddComment(github, incidentNumber, body);
|
||||
if (resp === null) {
|
||||
return json(
|
||||
{ error: "github error" },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
return json(
|
||||
{
|
||||
commentID: resp.id,
|
||||
body: resp.body,
|
||||
createdAt: Math.floor(new Date(resp.created_at).getTime() / 1e3)
|
||||
},
|
||||
{
|
||||
status: 200
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export { GET, POST };
|
||||
//# sourceMappingURL=_server-d9ce737b.js.map
|
||||
@@ -0,0 +1,89 @@
|
||||
import { j as json } from './index-2b68e648.js';
|
||||
import { a as auth, G as GHIssueToKenerIncident } from './webhook-bd364d16.js';
|
||||
import { a as GetIncidentByNumber, c as UpdateIssueLabels } from './github-54c09baa.js';
|
||||
import { p as public_env } from './shared-server-58a5f352.js';
|
||||
import fs from 'fs-extra';
|
||||
import './tool-153dc604.js';
|
||||
import 'randomstring';
|
||||
import 'axios';
|
||||
import 'marked';
|
||||
|
||||
async function POST({ request, params }) {
|
||||
const payload = await request.json();
|
||||
const incidentNumber = params.incidentNumber;
|
||||
const authError = auth(request);
|
||||
if (authError !== null) {
|
||||
return json(
|
||||
{ error: authError.message },
|
||||
{
|
||||
status: 401
|
||||
}
|
||||
);
|
||||
}
|
||||
let isIdentified = payload.isIdentified;
|
||||
let isResolved = payload.isResolved;
|
||||
let endDatetime = payload.endDatetime;
|
||||
if (!incidentNumber || isNaN(incidentNumber)) {
|
||||
return json(
|
||||
{ error: "Invalid incidentNumber" },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
if (endDatetime && typeof endDatetime !== "number") {
|
||||
return json(
|
||||
{ error: "Invalid endDatetime" },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
let site = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/site.json", "utf8"));
|
||||
let github = site.github;
|
||||
let issue = await GetIncidentByNumber(github, incidentNumber);
|
||||
if (issue === null) {
|
||||
return json(
|
||||
{ error: "github error" },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
let labels = issue.labels.map((label) => {
|
||||
return label.name;
|
||||
});
|
||||
if (isIdentified !== void 0) {
|
||||
labels = labels.filter((label) => label !== "identified");
|
||||
if (isIdentified === true) {
|
||||
labels.push("identified");
|
||||
}
|
||||
}
|
||||
if (isResolved !== void 0) {
|
||||
labels = labels.filter((label) => label !== "resolved");
|
||||
if (isResolved === true) {
|
||||
labels.push("resolved");
|
||||
}
|
||||
}
|
||||
let body = issue.body;
|
||||
if (endDatetime) {
|
||||
body = body.replace(/\[end_datetime:(\d+)\]/g, "");
|
||||
body = body.trim();
|
||||
body = body + ` [end_datetime:${endDatetime}]`;
|
||||
}
|
||||
let resp = await UpdateIssueLabels(github, incidentNumber, labels, body);
|
||||
if (resp === null) {
|
||||
return json(
|
||||
{ error: "github error" },
|
||||
{
|
||||
status: 400
|
||||
}
|
||||
);
|
||||
}
|
||||
return json(GHIssueToKenerIncident(resp), {
|
||||
status: 200
|
||||
});
|
||||
}
|
||||
|
||||
export { POST };
|
||||
//# sourceMappingURL=_server-e0c327de.js.map
|
||||
@@ -0,0 +1,29 @@
|
||||
import { j as json } from './index-2b68e648.js';
|
||||
import { a as auth, s as store } from './webhook-bd364d16.js';
|
||||
import 'fs-extra';
|
||||
import './shared-server-58a5f352.js';
|
||||
import './tool-153dc604.js';
|
||||
import './github-54c09baa.js';
|
||||
import 'axios';
|
||||
import 'marked';
|
||||
import 'randomstring';
|
||||
|
||||
async function POST({ request }) {
|
||||
const payload = await request.json();
|
||||
const authError = auth(request);
|
||||
if (authError !== null) {
|
||||
return json(
|
||||
{ error: authError.message },
|
||||
{
|
||||
status: 401
|
||||
}
|
||||
);
|
||||
}
|
||||
let resp = store(payload);
|
||||
return json(resp, {
|
||||
status: resp.status
|
||||
});
|
||||
}
|
||||
|
||||
export { POST };
|
||||
//# sourceMappingURL=_server-e6873bc7.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"_server-e6873bc7.js","sources":["../../../.svelte-kit/adapter-node/entries/endpoints/api/status/_server.js"],"sourcesContent":["import { j as json } from \"../../../../chunks/index.js\";\nimport { a as auth, s as store } from \"../../../../chunks/webhook.js\";\nasync function POST({ request }) {\n const payload = await request.json();\n const authError = auth(request);\n if (authError !== null) {\n return json(\n { error: authError.message },\n {\n status: 401\n }\n );\n }\n let resp = store(payload);\n return json(resp, {\n status: resp.status\n });\n}\nexport {\n POST\n};\n"],"names":[],"mappings":";;;;;;;;;;AAEA,eAAe,IAAI,CAAC,EAAE,OAAO,EAAE,EAAE;AACjC,EAAE,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,IAAI,EAAE,CAAC;AACvC,EAAE,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;AAClC,EAAE,IAAI,SAAS,KAAK,IAAI,EAAE;AAC1B,IAAI,OAAO,IAAI;AACf,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,OAAO,EAAE;AAClC,MAAM;AACN,QAAQ,MAAM,EAAE,GAAG;AACnB,OAAO;AACP,KAAK,CAAC;AACN,GAAG;AACH,EAAE,IAAI,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;AAC5B,EAAE,OAAO,IAAI,CAAC,IAAI,EAAE;AACpB,IAAI,MAAM,EAAE,IAAI,CAAC,MAAM;AACvB,GAAG,CAAC,CAAC;AACL;;;;"}
|
||||
@@ -1,138 +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 == 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-f49f614c.js.map
|
||||
@@ -0,0 +1,34 @@
|
||||
import { p as public_env } from './shared-server-58a5f352.js';
|
||||
import fs from 'fs-extra';
|
||||
import { P as ParseUptime, B as Badge } from './helpers-eac5677c.js';
|
||||
|
||||
const monitors = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + "/monitors.json", "utf8"));
|
||||
async function GET({ params, setHeaders }) {
|
||||
const { path0Day, name } = monitors.find((monitor) => monitor.tag === params.tag);
|
||||
const dayData = JSON.parse(fs.readFileSync(path0Day, "utf8"));
|
||||
let ups = 0;
|
||||
let downs = 0;
|
||||
let degradeds = 0;
|
||||
for (const timestamp in dayData) {
|
||||
const obj = dayData[timestamp];
|
||||
if (obj.status == "UP") {
|
||||
ups++;
|
||||
} else if (obj.status == "DEGRADED") {
|
||||
degradeds++;
|
||||
} else if (obj.status == "DOWN") {
|
||||
downs++;
|
||||
}
|
||||
}
|
||||
let uptime = ParseUptime(ups + degradeds, ups + degradeds + downs) + "%";
|
||||
setHeaders({
|
||||
"Content-Type": "image/svg+xml"
|
||||
});
|
||||
return new Response(Badge(name, uptime, "0079FF"), {
|
||||
headers: {
|
||||
"Content-Type": "image/svg+xml"
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export { GET };
|
||||
//# sourceMappingURL=_server-fbd83b4f.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"_server-fbd83b4f.js","sources":["../../../.svelte-kit/adapter-node/entries/endpoints/badge/_tag_/uptime/_server.js"],"sourcesContent":["import { p as public_env } from \"../../../../../chunks/shared-server.js\";\nimport fs from \"fs-extra\";\nimport { P as ParseUptime, B as Badge } from \"../../../../../chunks/helpers.js\";\nconst monitors = JSON.parse(fs.readFileSync(public_env.PUBLIC_KENER_FOLDER + \"/monitors.json\", \"utf8\"));\nasync function GET({ params, setHeaders }) {\n const { path0Day, name } = monitors.find((monitor) => monitor.tag === params.tag);\n const dayData = JSON.parse(fs.readFileSync(path0Day, \"utf8\"));\n let ups = 0;\n let downs = 0;\n let degradeds = 0;\n for (const timestamp in dayData) {\n const obj = dayData[timestamp];\n if (obj.status == \"UP\") {\n ups++;\n } else if (obj.status == \"DEGRADED\") {\n degradeds++;\n } else if (obj.status == \"DOWN\") {\n downs++;\n }\n }\n let uptime = ParseUptime(ups + degradeds, ups + degradeds + downs) + \"%\";\n setHeaders({\n \"Content-Type\": \"image/svg+xml\"\n });\n return new Response(Badge(name, uptime, \"0079FF\"), {\n headers: {\n \"Content-Type\": \"image/svg+xml\"\n }\n });\n}\nexport {\n GET\n};\n"],"names":[],"mappings":";;;;AAGA,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,mBAAmB,GAAG,gBAAgB,EAAE,MAAM,CAAC,CAAC,CAAC;AACxG,eAAe,GAAG,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE;AAC3C,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,GAAG,KAAK,MAAM,CAAC,GAAG,CAAC,CAAC;AACpF,EAAE,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;AAChE,EAAE,IAAI,GAAG,GAAG,CAAC,CAAC;AACd,EAAE,IAAI,KAAK,GAAG,CAAC,CAAC;AAChB,EAAE,IAAI,SAAS,GAAG,CAAC,CAAC;AACpB,EAAE,KAAK,MAAM,SAAS,IAAI,OAAO,EAAE;AACnC,IAAI,MAAM,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AACnC,IAAI,IAAI,GAAG,CAAC,MAAM,IAAI,IAAI,EAAE;AAC5B,MAAM,GAAG,EAAE,CAAC;AACZ,KAAK,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,UAAU,EAAE;AACzC,MAAM,SAAS,EAAE,CAAC;AAClB,KAAK,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,MAAM,EAAE;AACrC,MAAM,KAAK,EAAE,CAAC;AACd,KAAK;AACL,GAAG;AACH,EAAE,IAAI,MAAM,GAAG,WAAW,CAAC,GAAG,GAAG,SAAS,EAAE,GAAG,GAAG,SAAS,GAAG,KAAK,CAAC,GAAG,GAAG,CAAC;AAC3E,EAAE,UAAU,CAAC;AACb,IAAI,cAAc,EAAE,eAAe;AACnC,GAAG,CAAC,CAAC;AACL,EAAE,OAAO,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE;AACrD,IAAI,OAAO,EAAE;AACb,MAAM,cAAc,EAAE,eAAe;AACrC,KAAK;AACL,GAAG,CAAC,CAAC;AACL;;;;"}
|
||||