feat: integrate SvelteKit for seamless navigation and improved data loading

This commit is contained in:
2025-12-20 22:41:23 +03:00
parent 58831c536a
commit 9b7b743319
106 changed files with 16217 additions and 123 deletions

View File

@@ -0,0 +1 @@
import{s as e}from"./CHnJS4Dz.js";const r=()=>{const s=e;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},b={subscribe(s){return r().page.subscribe(s)}};export{b as p};

View File

@@ -0,0 +1 @@
import{h as v,Z as S,a5 as T,a6 as b,a7 as C,a8 as P,a9 as I,aa as w,ab as N,e as $,ac as p,J as i,ad as L}from"./CQO205-B.js";import{a as m}from"./CsANhQOh.js";const M=Symbol("is custom element"),q=Symbol("is html");function F(e){if(v){var t=!1,r=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var s=e.value;k(e,"value",null),e.value=s}if(e.hasAttribute("checked")){var a=e.checked;k(e,"checked",null),e.checked=a}}};e.__on_r=r,S(r),T()}}function k(e,t,r,s){var a=j(e);v&&(a[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||a[t]!==(a[t]=r)&&(t==="loading"&&(e[b]=r),r==null?e.removeAttribute(t):typeof r!="string"&&O(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function j(e){return e.__attributes??={[M]:e.nodeName.includes("-"),[q]:e.namespaceURI===C}}var y=new Map;function O(e){var t=e.getAttribute("is")||e.nodeName,r=y.get(t);if(r)return r;y.set(t,r=[]);for(var s,a=e,o=Element.prototype;o!==a;){s=I(a);for(var n in s)s[n].set&&r.push(n);a=P(a)}return r}function U(e,t,r=t){var s=new WeakSet;w(e,"input",async a=>{var o=a?e.defaultValue:e.value;if(o=u(e)?h(o):o,r(o),i!==null&&s.add(i),await N(),o!==(o=t())){var n=e.selectionStart,f=e.selectionEnd,A=e.value.length;if(e.value=o??"",f!==null){var d=e.value.length;n===f&&f===A&&d>A?(e.selectionStart=d,e.selectionEnd=d):(e.selectionStart=n,e.selectionEnd=Math.min(f,d))}}}),(v&&e.defaultValue!==e.value||$(t)==null&&e.value)&&(r(u(e)?h(e.value):e.value),i!==null&&s.add(i)),p(()=>{var a=t();if(e===document.activeElement){var o=L??i;if(s.has(o))return}u(e)&&a===h(e.value)||e.type==="date"&&!a&&!e.value||a!==e.value&&(e.value=a??"")})}function B(e,t,r=t){w(e,"change",s=>{var a=s?e.defaultChecked:e.checked;r(a)}),(v&&e.defaultChecked!==e.checked||$(t)==null)&&r(e.checked),p(()=>{var s=t();e.checked=!!s})}function u(e){var t=e.type;return t==="number"||t==="range"}function h(e){return e===""?null:+e}const E="/api";async function c(e){try{console.log(`[api.fetchApi][Action] Fetching from context={{'endpoint': '${e}'}}`);const t=await fetch(`${E}${e}`);if(!t.ok)throw new Error(`API request failed with status ${t.status}`);return await t.json()}catch(t){throw console.error(`[api.fetchApi][Coherence:Failed] Error fetching from ${e}:`,t),m(t.message,"error"),t}}async function _(e,t){try{console.log(`[api.postApi][Action] Posting to context={{'endpoint': '${e}'}}`);const r=await fetch(`${E}${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!r.ok)throw new Error(`API request failed with status ${r.status}`);return await r.json()}catch(r){throw console.error(`[api.postApi][Coherence:Failed] Error posting to ${e}:`,r),m(r.message,"error"),r}}async function g(e,t="GET",r=null){try{console.log(`[api.requestApi][Action] ${t} to context={{'endpoint': '${e}'}}`);const s={method:t,headers:{"Content-Type":"application/json"}};r&&(s.body=JSON.stringify(r));const a=await fetch(`${E}${e}`,s);if(!a.ok){const o=await a.json().catch(()=>({}));throw new Error(o.detail||`API request failed with status ${a.status}`)}return await a.json()}catch(s){throw console.error(`[api.requestApi][Coherence:Failed] Error ${t} to ${e}:`,s),m(s.message,"error"),s}}const l={getPlugins:()=>c("/plugins/"),getTasks:()=>c("/tasks/"),getTask:e=>c(`/tasks/${e}`),createTask:(e,t)=>_("/tasks/",{plugin_id:e,params:t}),getSettings:()=>c("/settings/"),updateGlobalSettings:e=>g("/settings/global","PATCH",e),getEnvironments:()=>c("/settings/environments"),addEnvironment:e=>_("/settings/environments",e),updateEnvironment:(e,t)=>g(`/settings/environments/${e}`,"PUT",t),deleteEnvironment:e=>g(`/settings/environments/${e}`,"DELETE"),testEnvironmentConnection:e=>_(`/settings/environments/${e}/test`,{})},D=l.updateGlobalSettings,H=l.addEnvironment,J=l.updateEnvironment,R=l.deleteEnvironment,V=l.testEnvironmentConnection;export{l as a,U as b,B as c,J as d,H as e,R as f,F as r,k as s,V as t,D as u};

View File

@@ -0,0 +1 @@
import{J as E,S as y,X as S,T as L,v as P,L as T,h as g,E as M,ae as k,M as w,w as B,z as N,af as x,B as Y,H as C,C as F,x as U,D as R,ag as j,ah as q,j as b,ai as z,o as H,aj as $,ak as G,A as J,d as X,al as Z,am as K,an as Q,ao as V,ap as W,a3 as ee,e as te,aq as ae,ar as se,as as re}from"./CQO205-B.js";import{d as ie}from"./CWb4Vnhz.js";class ne{anchor;#t=new Map;#a=new Map;#e=new Map;#s=new Set;#r=!0;constructor(e,a=!0){this.anchor=e,this.#r=a}#i=()=>{var e=E;if(this.#t.has(e)){var a=this.#t.get(e),t=this.#a.get(a);if(t)y(t),this.#s.delete(a);else{var n=this.#e.get(a);n&&(this.#a.set(a,n.effect),this.#e.delete(a),n.fragment.lastChild.remove(),this.anchor.before(n.fragment),t=n.effect)}for(const[s,i]of this.#t){if(this.#t.delete(s),s===e)break;const r=this.#e.get(i);r&&(S(r.effect),this.#e.delete(i))}for(const[s,i]of this.#a){if(s===a||this.#s.has(s))continue;const r=()=>{if(Array.from(this.#t.values()).includes(s)){var h=document.createDocumentFragment();k(i,h),h.append(P()),this.#e.set(s,{effect:i,fragment:h})}else S(i);this.#s.delete(s),this.#a.delete(s)};this.#r||!t?(this.#s.add(s),L(i,r,!1)):r()}}};#n=e=>{this.#t.delete(e);const a=Array.from(this.#t.values());for(const[t,n]of this.#e)a.includes(t)||(S(n.effect),this.#e.delete(t))};ensure(e,a){var t=E,n=w();if(a&&!this.#a.has(e)&&!this.#e.has(e))if(n){var s=document.createDocumentFragment(),i=P();s.append(i),this.#e.set(e,{effect:T(()=>a(i)),fragment:s})}else this.#a.set(e,T(()=>a(this.anchor)));if(this.#t.set(t,e),n){for(const[r,f]of this.#a)r===e?t.skipped_effects.delete(f):t.skipped_effects.add(f);for(const[r,f]of this.#e)r===e?t.skipped_effects.delete(f.effect):t.skipped_effects.add(f.effect);t.oncommit(this.#i),t.ondiscard(this.#n)}else g&&(this.anchor=M),this.#i()}}function de(d,e,a=!1){g&&N();var t=new ne(d),n=a?x:0;function s(i,r){if(g){const h=Y(d)===C;if(i===h){var f=F();U(f),t.anchor=f,R(!1),t.ensure(i,r),R(!0);return}}t.ensure(i,r)}B(()=>{var i=!1;e((r,f=!0)=>{i=!0,s(f,r)}),i||s(!1,null)},n)}function he(d,e,a,t){var n=!X||(a&Z)!==0,s=(a&K)!==0,i=(a&re)!==0,r=t,f=!0,h=()=>(f&&(f=!1,r=i?te(t):t),r),o;if(s){var I=V in d||W in d;o=j(d,e)?.set??(I&&e in d?c=>d[e]=c:void 0)}var _,p=!1;s?[_,p]=ie(()=>d[e]):_=d[e],_===void 0&&t!==void 0&&(_=h(),o&&(n&&ae(),o(_)));var u;if(n?u=()=>{var c=d[e];return c===void 0?h():(f=!0,c)}:u=()=>{var c=d[e];return c!==void 0&&(r=void 0),c===void 0?r:c},n&&(a&q)===0)return u;if(o){var D=d.$$legacy;return(function(c,v){return arguments.length>0?((!n||!v||D||p)&&o(v?u():c),c):u()})}var m=!1,l=((a&se)!==0?ee:J)(()=>(m=!1,u()));s&&b(l);var O=$;return(function(c,v){if(arguments.length>0){const A=v?b(l):n&&s?z(c):c;return H(l,A),m=!0,r!==void 0&&(r=A),c}return Q&&m||(O.f&G)!==0?l.v:b(l)})}export{ne as B,de as i,he as p};

View File

@@ -0,0 +1 @@
import{b as d,a0 as g,u as c,e as b,a1 as i,a2 as m,j as p,k,a3 as v,a4 as h}from"./CQO205-B.js";function x(a=!1){const s=d,e=s.l.u;if(!e)return;let f=()=>k(s.s);if(a){let n=0,t={};const _=v(()=>{let l=!1;const r=s.s;for(const o in r)r[o]!==t[o]&&(t[o]=r[o],l=!0);return l&&n++,n});f=()=>p(_)}e.b.length&&g(()=>{u(s,f),i(e.b)}),c(()=>{const n=b(()=>e.m.map(m));return()=>{for(const t of n)typeof t=="function"&&t()}}),e.a.length&&c(()=>{u(s,f),i(e.a)})}function u(a,s){if(a.l.s)for(const e of a.l.s)p(e);s()}h();export{x as i};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
import{l as a,u as i,b as t,d as _,e as l,i as m}from"./CQO205-B.js";function p(e){t===null&&a(),_&&t.l!==null?d(t).m.push(e):i(()=>{const n=l(e);if(typeof n=="function")return n})}function x(e){t===null&&a(),p(()=>()=>l(e))}function v(e,n,{bubbles:o=!1,cancelable:s=!1}={}){return new CustomEvent(e,{detail:n,bubbles:o,cancelable:s})}function y(){const e=t;return e===null&&a(),(n,o,s)=>{const c=e.s.$$events?.[n];if(c){const r=m(c)?c.slice():[c],u=v(n,o,s);for(const f of r)f.call(e.x,u);return!u.defaultPrevented}return!0}}function d(e){var n=e.l;return n.u??={a:[],b:[],m:[]}}export{x as a,y as c,p as o};

View File

@@ -0,0 +1 @@
import{v as H,w as W,x as O,h as R,y as Z,z as y,j as V,A as j,B as ee,H as ne,C as Y,D as k,E as D,F as re,G as fe,I as q,J as ae,K as m,L as F,M as ie,N as B,m as se,O as $,i as le,P as oe,Q as te,R as ue,S as X,T as G,U as z,V as de,W as ve,X as ce,Y as J,Z as pe,_ as ge,$ as he}from"./CQO205-B.js";function Se(e,r){return r}function _e(e,r,f){for(var t=[],g=r.length,o,l=r.length,p=0;p<g;p++){let _=r[p];G(_,()=>{if(o){if(o.pending.delete(_),o.done.add(_),o.pending.size===0){var u=e.outrogroups;L($(o.done)),u.delete(o),u.size===0&&(e.outrogroups=null)}}else l-=1},!1)}if(l===0){var i=t.length===0&&f!==null;if(i){var d=f,a=d.parentNode;ve(a),a.append(d),e.items.clear()}L(r,!i)}else o={pending:new Set(r),done:new Set},(e.outrogroups??=new Set).add(o)}function L(e,r=!0){for(var f=0;f<e.length;f++)ce(e[f],r)}var U;function we(e,r,f,t,g,o=null){var l=e,p=new Map,i=(r&J)!==0;if(i){var d=e;l=R?O(Z(d)):d.appendChild(H())}R&&y();var a=null,_=j(()=>{var s=f();return le(s)?s:s==null?[]:$(s)}),u,c=!0;function A(){n.fallback=a,Ee(n,u,l,r,t),a!==null&&(u.length===0?(a.f&m)===0?X(a):(a.f^=m,b(a,null,l)):G(a,()=>{a=null}))}var C=W(()=>{u=V(_);var s=u.length;let I=!1;if(R){var x=ee(l)===ne;x!==(s===0)&&(l=Y(),O(l),k(!1),I=!0)}for(var E=new Set,S=ae,N=ie(),h=0;h<s;h+=1){R&&D.nodeType===re&&D.data===fe&&(l=D,I=!0,k(!1));var w=u[h],M=t(w,h),v=c?null:p.get(M);v?(v.v&&q(v.v,w),v.i&&q(v.i,h),N&&S.skipped_effects.delete(v.e)):(v=me(p,c?l:U??=H(),w,M,h,g,r,f),c||(v.e.f|=m),p.set(M,v)),E.add(M)}if(s===0&&o&&!a&&(c?a=F(()=>o(l)):(a=F(()=>o(U??=H())),a.f|=m)),R&&s>0&&O(Y()),!c)if(N){for(const[P,Q]of p)E.has(P)||S.skipped_effects.add(Q.e);S.oncommit(A),S.ondiscard(()=>{})}else A();I&&k(!0),V(_)}),n={effect:C,items:p,outrogroups:null,fallback:a};c=!1,R&&(l=D)}function Ee(e,r,f,t,g){var o=(t&ge)!==0,l=r.length,p=e.items,i=e.effect.first,d,a=null,_,u=[],c=[],A,C,n,s;if(o)for(s=0;s<l;s+=1)A=r[s],C=g(A,s),n=p.get(C).e,(n.f&m)===0&&(n.nodes?.a?.measure(),(_??=new Set).add(n));for(s=0;s<l;s+=1){if(A=r[s],C=g(A,s),n=p.get(C).e,e.outrogroups!==null)for(const v of e.outrogroups)v.pending.delete(n),v.done.delete(n);if((n.f&m)!==0)if(n.f^=m,n===i)b(n,null,f);else{var I=a?a.next:i;n===e.effect.last&&(e.effect.last=n.prev),n.prev&&(n.prev.next=n.next),n.next&&(n.next.prev=n.prev),T(e,a,n),T(e,n,I),b(n,I,f),a=n,u=[],c=[],i=a.next;continue}if((n.f&z)!==0&&(X(n),o&&(n.nodes?.a?.unfix(),(_??=new Set).delete(n))),n!==i){if(d!==void 0&&d.has(n)){if(u.length<c.length){var x=c[0],E;a=x.prev;var S=u[0],N=u[u.length-1];for(E=0;E<u.length;E+=1)b(u[E],x,f);for(E=0;E<c.length;E+=1)d.delete(c[E]);T(e,S.prev,N.next),T(e,a,S),T(e,N,x),i=x,a=N,s-=1,u=[],c=[]}else d.delete(n),b(n,i,f),T(e,n.prev,n.next),T(e,n,a===null?e.effect.first:a.next),T(e,a,n),a=n;continue}for(u=[],c=[];i!==null&&i!==n;)(d??=new Set).add(i),c.push(i),i=i.next;if(i===null)continue}(n.f&m)===0&&u.push(n),a=n,i=n.next}if(e.outrogroups!==null){for(const v of e.outrogroups)v.pending.size===0&&(L($(v.done)),e.outrogroups?.delete(v));e.outrogroups.size===0&&(e.outrogroups=null)}if(i!==null||d!==void 0){var h=[];if(d!==void 0)for(n of d)(n.f&z)===0&&h.push(n);for(;i!==null;)(i.f&z)===0&&i!==e.fallback&&h.push(i),i=i.next;var w=h.length;if(w>0){var M=(t&J)!==0&&l===0?f:null;if(o){for(s=0;s<w;s+=1)h[s].nodes?.a?.measure();for(s=0;s<w;s+=1)h[s].nodes?.a?.fix()}_e(e,h,M)}}o&&pe(()=>{if(_!==void 0)for(n of _)n.nodes?.a?.apply()})}function me(e,r,f,t,g,o,l,p){var i=(l&oe)!==0?(l&te)===0?se(f,!1,!1):B(f):null,d=(l&ue)!==0?B(g):null;return{v:i,i:d,e:F(()=>(o(r,i??f,d??g,p),()=>{e.delete(t)}))}}function b(e,r,f){if(e.nodes)for(var t=e.nodes.start,g=e.nodes.end,o=r&&(r.f&m)===0?r.nodes.start:f;t!==null;){var l=de(t);if(o.before(t),t===g)return;t=l}}function T(e,r,f){r===null?e.effect.first=f:r.next=f,f===null?e.effect.last=r:f.prev=r}const K=he([]);function Ce(e,r="info",f=3e3){const t=Math.random().toString(36).substr(2,9);console.log(`[toasts.addToast][Action] Adding toast context={{'id': '${t}', 'type': '${r}', 'message': '${e}'}}`),K.update(g=>[...g,{id:t,message:e,type:r}]),setTimeout(()=>Te(t),f)}function Te(e){console.log(`[toasts.removeToast][Action] Removing toast context={{'id': '${e}'}}`),K.update(r=>r.filter(f=>f.id!==e))}export{Ce as a,we as e,Se as i,K as t};

View File

@@ -0,0 +1 @@
import{h as i}from"./CQO205-B.js";function n(s,l,r){var t=s==null?"":""+s;return t===""?null:t}function u(s,l,r,t,f,c){var a=s.__className;if(i||a!==r||a===void 0){var e=n(r);(!i||e!==s.getAttribute("class"))&&(e==null?s.removeAttribute("class"):s.className=e),s.__className=r}return c}export{u as s};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
import{l as o,a as r}from"../chunks/CHnJS4Dz.js";export{o as load_css,r as start};

View File

@@ -0,0 +1,5 @@
import{f as u,a as c,s as b,c as g,b as x}from"../chunks/CWb4Vnhz.js";import{i as _}from"../chunks/CCsGeFPC.js";import{h as $,z as y,p as w,t as h,a as S,s as d,c as v,r as l,j as p,at as j}from"../chunks/CQO205-B.js";import{s as m}from"../chunks/DKg_yD9X.js";import{p as T}from"../chunks/BEiADdeo.js";import{e as z,t as O}from"../chunks/CsANhQOh.js";function k(r,a,s,o,n){$&&y();var e=a.$$slots?.[s],t=!1;e===!0&&(e=a.children,t=!0),e===void 0||e(r,t?()=>o:o)}const A=!1,D=!1,Q=Object.freeze(Object.defineProperty({__proto__:null,prerender:D,ssr:A},Symbol.toStringTag,{value:"Module"}));var F=u('<header class="bg-white shadow-md p-4 flex justify-between items-center"><a href="/" class="text-3xl font-bold text-gray-800 focus:outline-none">Superset Tools</a> <nav class="space-x-4"><a href="/">Dashboard</a> <a href="/settings">Settings</a></nav></header>');function M(r,a){w(a,!1);const s=()=>g(T,"$page",o),[o,n]=b();_();var e=F(),t=d(v(e),2),i=v(t),f=d(i,2);l(t),l(e),h(()=>{m(i,1,`text-gray-600 hover:text-blue-600 font-medium ${s().url.pathname==="/"?"text-blue-600 border-b-2 border-blue-600":""}`),m(f,1,`text-gray-600 hover:text-blue-600 font-medium ${s().url.pathname==="/settings"?"text-blue-600 border-b-2 border-blue-600":""}`)}),c(r,e),S(),n()}var N=u('<footer class="bg-white border-t p-4 mt-8 text-center text-gray-500 text-sm">&copy; 2025 Superset Tools. All rights reserved.</footer>');function P(r){var a=N();c(r,a)}var q=u("<div> </div>"),B=u('<div class="fixed bottom-0 right-0 p-4 space-y-2"></div>');function C(r){const a=()=>g(O,"$toasts",s),[s,o]=b();var n=B();z(n,5,a,e=>e.id,(e,t)=>{var i=q(),f=v(i,!0);l(i),h(()=>{m(i,1,`p-4 rounded-md shadow-lg text-white
${p(t).type==="info"&&"bg-blue-500"}
${p(t).type==="success"&&"bg-green-500"}
${p(t).type==="error"&&"bg-red-500"}
`),x(f,p(t).message)}),c(e,i)}),l(n),c(r,n),o()}var E=u('<!> <main class="bg-gray-50 min-h-screen flex flex-col"><!> <div class="p-4 flex-grow"><!></div> <!></main>',1);function R(r,a){var s=E(),o=j(s);C(o);var n=d(o,2),e=v(n);M(e,{});var t=d(e,2),i=v(t);k(i,a,"default",{}),l(t);var f=d(t,2);P(f),l(n),c(r,s)}export{R as component,Q as universal};

View File

@@ -0,0 +1 @@
import{f,a as g,s as u,b as p,c as b}from"../chunks/CWb4Vnhz.js";import{i as d}from"../chunks/CCsGeFPC.js";import{p as h,t as v,a as _,c as e,r as s,s as $,n as y}from"../chunks/CQO205-B.js";import{p as k}from"../chunks/BEiADdeo.js";var w=f('<div class="container mx-auto p-4 text-center mt-20"><h1 class="text-6xl font-bold text-gray-800 mb-4"> </h1> <p class="text-2xl text-gray-600 mb-8"> </p> <a href="/" class="bg-blue-500 text-white px-6 py-3 rounded-lg hover:bg-blue-600 transition-colors">Back to Dashboard</a></div>');function q(n,i){h(i,!1);const r=()=>b(k,"$page",c),[c,l]=u();d();var t=w(),a=e(t),m=e(a,!0);s(a);var o=$(a,2),x=e(o,!0);s(o),y(2),s(t),v(()=>{p(m,r().status),p(x,r().error?.message||"Page not found")}),g(n,t),_(),l()}export{q as component};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long