This change fixes the creation of pools though the UI. Both the modal and the page were sending a request to create the pool, leading to double pool. Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
13 lines
21 KiB
JavaScript
13 lines
21 KiB
JavaScript
import"../chunks/DsnmJJEf.js";import{i as Le}from"../chunks/zNh6Oe5P.js";import{p as Be,o as qe,s as h,m as F,g as e,l as X,a as Ae,f as g,b as E,j as s,k as l,r as t,u as o,t as P,v as ge,c as i,B as U,C as Y,n as fe,e as R,d as $e,q as gr,h as hr,$ as ur}from"../chunks/sWNKMed7.js";import{a as xe,i as M,s as Ve}from"../chunks/Ccl3fNd2.js";import{d as n,c as w,s as Q,h as fr,B as mr,e as Oe}from"../chunks/DVl4ZBgx.js";import{p as Ne}from"../chunks/CJwphPxi.js";import{g as me}from"../chunks/CPCsbdkz.js";import{b as Ue,a as xr}from"../chunks/CVQRp8zk.js";import{e as ne,i as ce,w as pr}from"../chunks/BuuPrWMc.js";import{t as De}from"../chunks/BZUCTtPY.js";const kr=async({url:Z})=>({url:Z.pathname}),br=!1,yr=!1,va=Object.freeze(Object.defineProperty({__proto__:null,load:kr,prerender:br,ssr:yr},Symbol.toStringTag,{value:"Module"}));var _r=g('<div class="flex items-center text-green-600 dark:text-green-400"><div class="w-2.5 h-2.5 bg-green-500 rounded-full mr-2 animate-pulse shadow-sm"></div> <span class="text-xs font-medium">Live Updates</span></div>'),wr=g('<div class="flex items-center text-yellow-600 dark:text-yellow-400"><div class="w-2.5 h-2.5 bg-yellow-500 rounded-full mr-2 animate-pulse shadow-sm"></div> <span class="text-xs font-medium">Connecting</span></div>'),Mr=g('<div class="flex items-center text-red-600 dark:text-red-400"><div class="w-2.5 h-2.5 bg-red-500 rounded-full mr-2 shadow-sm"></div> <span class="text-xs font-medium">Updates Unavailable</span></div>'),jr=g('<div class="flex items-center text-gray-500 dark:text-gray-400"><div class="w-2.5 h-2.5 bg-gray-400 rounded-full mr-2 shadow-sm"></div> <span class="text-xs font-medium">Manual Refresh</span></div>'),zr=Y('<svg class="h-4 w-4 text-yellow-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"></path></svg>'),Cr=Y('<svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"></path></svg>'),Hr=Y('<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"></path>'),Sr=Y('<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"></path>'),Lr=g('<a><svg class="mr-3 h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor"><!></svg> </a>'),Br=g('<a><svg class="mr-3 h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"></path></svg> </a>'),Ar=g('<div class="flex items-center"><div class="w-2 h-2 bg-green-500 rounded-full animate-pulse shadow-sm" title="Live updates enabled"></div></div>'),$r=g('<div class="flex items-center"><div class="w-2 h-2 bg-yellow-500 rounded-full animate-pulse shadow-sm" title="Connecting to live updates"></div></div>'),Vr=g('<div class="flex items-center"><div class="w-2 h-2 bg-red-500 rounded-full shadow-sm" title="Live updates unavailable"></div></div>'),Ir=g('<div class="flex items-center"><div class="w-2 h-2 bg-gray-400 rounded-full shadow-sm" title="Manual refresh mode"></div></div>'),Rr=Y('<svg class="w-5 h-5 text-yellow-400 hover:text-yellow-300" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"></path></svg>'),Tr=Y('<svg class="w-5 h-5 text-black hover:text-gray-800" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"></path></svg>'),Pr=Y('<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"></path>'),Er=Y('<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"></path>'),Gr=g('<a><svg class="mr-4 flex-shrink-0 h-6 w-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><!></svg> </a>'),Or=g('<a><svg class="mr-4 flex-shrink-0 h-6 w-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"></path></svg> </a>'),Dr=g('<div class="fixed inset-0 flex z-50 lg:hidden"><div class="fixed inset-0 bg-black/30" role="button" tabindex="0" aria-label="Close menu"></div> <div class="relative flex-1 flex flex-col max-w-xs w-full bg-white dark:bg-gray-800"><div class="absolute top-0 right-0 -mr-12 pt-2"><button aria-label="Close menu" class="ml-1 flex items-center justify-center h-10 w-10 rounded-full focus:outline-none focus:ring-2 focus:ring-inset focus:ring-white cursor-pointer"><svg class="h-6 w-6 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg></button></div> <div class="flex-1 h-0 pt-5 pb-4 overflow-y-auto"><nav class="px-2 space-y-1"><!> <div class="border-t border-gray-200 dark:border-gray-600 mt-4 pt-4"></div> <div class="border-t border-gray-200 dark:border-gray-600 mt-4 pt-4"><button class="group flex items-center px-2 py-2 text-base font-medium rounded-md w-full text-left text-gray-600 hover:bg-gray-50 hover:text-gray-900 dark:text-gray-300 dark:hover:bg-gray-700 dark:hover:text-white cursor-pointer"><svg class="mr-4 flex-shrink-0 h-6 w-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"></path></svg> Logout</button></div></nav></div></div></div>'),qr=g('<div class="fixed inset-0 z-10" role="button" tabindex="0" aria-label="Close user menu"></div>'),Nr=g('<div class="hidden lg:fixed lg:inset-y-0 lg:flex lg:w-64 lg:flex-col"><div class="flex min-h-0 flex-1 flex-col bg-white dark:bg-gray-800 border-r border-gray-200 dark:border-gray-700"><div class="flex-shrink-0 border-b border-gray-200 dark:border-gray-700"><div class="px-6 py-3 bg-gradient-to-r from-gray-50 to-white dark:from-gray-800 dark:to-gray-700"><a class="flex justify-center"><img alt="GARM" class="h-24 w-auto dark:hidden transition-transform hover:scale-105"/> <img alt="GARM" class="h-24 w-auto hidden dark:block transition-transform hover:scale-105"/></a></div> <div class="px-4 py-3 bg-gray-50 dark:bg-gray-800/50 border-t border-gray-100 dark:border-gray-700"><div class="flex items-center justify-between"><div class="flex items-center space-x-2"><!></div> <button class="p-2 rounded-lg bg-white dark:bg-gray-700 shadow-sm border border-gray-200 dark:border-gray-600 text-gray-600 hover:bg-gray-50 hover:text-gray-900 dark:text-gray-300 dark:hover:bg-gray-600 dark:hover:text-white transition-all duration-200 hover:shadow-md cursor-pointer"><!></button></div></div></div> <nav class="mt-5 flex-1 px-2 space-y-1"><!> <div class="border-t border-gray-200 dark:border-gray-600 mt-4 pt-4"></div> <div class="border-t border-gray-200 dark:border-gray-600 mt-4 pt-4"><button class="group flex items-center px-2 py-2 text-sm font-medium rounded-md w-full text-left text-gray-600 hover:bg-gray-50 hover:text-gray-900 dark:text-gray-300 dark:hover:bg-gray-700 dark:hover:text-white cursor-pointer"><svg class="mr-3 h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"></path></svg> Logout</button></div></nav></div></div> <div class="lg:hidden"><div class="fixed top-0 left-0 right-0 z-40 flex items-center justify-between h-16 bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700 px-4"><button aria-label="Open main menu" class="text-gray-500 hover:text-gray-600 dark:text-gray-400 dark:hover:text-gray-300 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-500 cursor-pointer"><svg class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path></svg></button> <div class="flex items-center space-x-3"><img alt="GARM"/> <img alt="GARM"/> <h1 class="text-xl font-bold text-gray-900 dark:text-white">GARM</h1> <div class="flex items-center ml-2"><!></div></div> <button class="p-2 rounded-lg bg-white dark:bg-gray-800 shadow-sm border border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors cursor-pointer" title="Toggle theme"><!></button></div> <!></div> <!>',1);function Ur(Z,ee){Be(ee,!1);const[re,he]=Ve(),j=()=>xe(pr,"$websocketStore",re),m=()=>xe(Ne,"$page",re),u=F(),y=F();let z=F(!1),G=F(!1),f=F(!1);qe(()=>{C(),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",v)});function C(){const a=localStorage.getItem("theme");a==="dark"?h(f,!0):a==="light"?h(f,!1):h(f,window.matchMedia("(prefers-color-scheme: dark)").matches),p()}function v(a){(!localStorage.getItem("theme")||localStorage.getItem("theme")==="system")&&(h(f,a.matches),p())}function O(){h(f,!e(f)),localStorage.setItem("theme",e(f)?"dark":"light"),p()}function p(){e(f)?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")}function H(){Ue.logout(),h(G,!1)}const le=[{href:n("/"),label:"Dashboard",icon:["M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2H5a2 2 0 00-2-2z","M8 5a2 2 0 012-2h4a2 2 0 012 2v2H8V5z"]},{href:n("/repositories"),label:"Repositories",icon:["M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2H5a2 2 0 00-2-2z","M8 5a2 2 0 012-2h4a2 2 0 012 2v2H8V5z"]},{href:n("/organizations"),label:"Organizations",icon:"M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"},{href:n("/enterprises"),label:"Enterprises",icon:"M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"},{href:n("/pools"),label:"Pools",icon:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"},{href:n("/scalesets"),label:"Scale Sets",icon:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"},{href:n("/instances"),label:"Runners",icon:"M9 3v2m6-2v2M9 19v2m6-2v2M5 9H3m2 6H3m18-6h-2m2 6h-2M7 19h10a2 2 0 002-2V7a2 2 0 00-2-2H7a2 2 0 00-2 2v10a2 2 0 002 2zM9 9h6v6H9V9z"}],J=[{href:n("/credentials"),label:"Credentials",icon:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1721 9z"},{href:n("/endpoints"),label:"Endpoints",icon:"M13 10V3L4 14h7v7l9-11h-7z"}];X(()=>j(),()=>{h(u,j())}),X(()=>m(),()=>{m().url.pathname&&h(z,!1)}),X(()=>m(),()=>{h(y,m().url.pathname)}),Ae(),Le();var D=Nr(),I=E(D),q=s(I),ae=s(q),K=s(ae),te=s(K),b=s(te),S=l(b,2);t(te),t(K);var N=l(K,2),oe=s(N),de=s(oe),pe=s(de);{var be=a=>{var r=_r();i(a,r)},Qe=a=>{var r=U(),c=E(r);{var _=x=>{var L=wr();i(x,L)},B=x=>{var L=U(),W=E(L);{var A=k=>{var T=Mr();i(k,T)},$=k=>{var T=jr();i(k,T)};M(W,k=>{e(u),o(()=>e(u).error)?k(A):k($,!1)},!0)}i(x,L)};M(c,x=>{e(u),o(()=>e(u).connecting)?x(_):x(B,!1)},!0)}i(a,r)};M(pe,a=>{e(u),o(()=>e(u).connected)?a(be):a(Qe,!1)})}t(de);var ke=l(de,2),Fe=s(ke);{var Je=a=>{var r=zr();i(a,r)},Ke=a=>{var r=Cr();i(a,r)};M(Fe,a=>{e(f)?a(Je):a(Ke,!1)})}t(ke),t(oe),t(N),t(ae);var Ie=l(ae,2),Re=s(Ie);ne(Re,1,()=>le,ce,(a,r)=>{var c=Lr(),_=s(c),B=s(_);{var x=A=>{var $=U(),k=E($);ne(k,1,()=>(e(r),o(()=>e(r).icon)),ce,(T,se)=>{var d=Hr();P(()=>w(d,"d",e(se))),i(T,d)}),i(A,$)},L=A=>{var $=Sr();P(()=>w($,"d",(e(r),o(()=>e(r).icon)))),i(A,$)};M(B,A=>{e(r),o(()=>Array.isArray(e(r).icon))?A(x):A(L,!1)})}t(_);var W=l(_);t(c),P(()=>{w(c,"href",(e(r),o(()=>e(r).href))),Q(c,1,`group flex items-center px-2 py-2 text-sm font-medium rounded-md transition-colors duration-200
|
|
${e(y),e(r),o(()=>e(y)===e(r).href?"bg-gray-100 text-gray-900 dark:bg-gray-700 dark:text-white":"text-gray-600 hover:bg-gray-50 hover:text-gray-900 dark:text-gray-300 dark:hover:bg-gray-700 dark:hover:text-white")??""}`),ge(W,` ${e(r),o(()=>e(r).label)??""}`)}),i(a,c)});var ye=l(Re,2);ne(ye,5,()=>J,ce,(a,r)=>{var c=Br(),_=s(c),B=s(_);t(_);var x=l(_);t(c),P(()=>{w(c,"href",(e(r),o(()=>e(r).href))),Q(c,1,`group flex items-center px-2 py-2 text-sm font-medium rounded-md transition-colors duration-200
|
|
${e(y),e(r),o(()=>e(y)===e(r).href?"bg-gray-100 text-gray-900 dark:bg-gray-700 dark:text-white":"text-gray-600 hover:bg-gray-50 hover:text-gray-900 dark:text-gray-300 dark:hover:bg-gray-700 dark:hover:text-white")??""}`),w(B,"d",(e(r),o(()=>e(r).icon))),ge(x,` ${e(r),o(()=>e(r).label)??""}`)}),i(a,c)}),t(ye);var Te=l(ye,2),We=s(Te);t(Te),t(Ie),t(q),t(I);var _e=l(I,2),we=s(_e),Pe=s(we),Me=l(Pe,2),je=s(Me),ze=l(je,2),Ee=l(ze,4),Xe=s(Ee);{var Ye=a=>{var r=Ar();i(a,r)},Ze=a=>{var r=U(),c=E(r);{var _=x=>{var L=$r();i(x,L)},B=x=>{var L=U(),W=E(L);{var A=k=>{var T=Vr();i(k,T)},$=k=>{var T=Ir();i(k,T)};M(W,k=>{e(u),o(()=>e(u).error)?k(A):k($,!1)},!0)}i(x,L)};M(c,x=>{e(u),o(()=>e(u).connecting)?x(_):x(B,!1)},!0)}i(a,r)};M(Xe,a=>{e(u),o(()=>e(u).connected)?a(Ye):a(Ze,!1)})}t(Ee),t(Me);var Ce=l(Me,2),er=s(Ce);{var rr=a=>{var r=Rr();i(a,r)},ar=a=>{var r=Tr();i(a,r)};M(er,a=>{e(f)?a(rr):a(ar,!1)})}t(Ce),t(we);var tr=l(we,2);{var or=a=>{var r=Dr(),c=s(r),_=l(c,2),B=s(_),x=s(B);t(B);var L=l(B,2),W=s(L),A=s(W);ne(A,1,()=>le,ce,(se,d)=>{var V=Gr(),ie=s(V),He=s(ie);{var Se=ve=>{var ue=U(),dr=E(ue);ne(dr,1,()=>(e(d),o(()=>e(d).icon)),ce,(vr,cr)=>{var Ge=Pr();P(()=>w(Ge,"d",e(cr))),i(vr,Ge)}),i(ve,ue)},nr=ve=>{var ue=Er();P(()=>w(ue,"d",(e(d),o(()=>e(d).icon)))),i(ve,ue)};M(He,ve=>{e(d),o(()=>Array.isArray(e(d).icon))?ve(Se):ve(nr,!1)})}t(ie);var lr=l(ie);t(V),P(()=>{w(V,"href",(e(d),o(()=>e(d).href))),Q(V,1,`group flex items-center px-2 py-2 text-base font-medium rounded-md transition-colors duration-200
|
|
${e(y),e(d),o(()=>e(y)===e(d).href?"bg-gray-100 dark:bg-gray-700 text-gray-900 dark:text-white":"text-gray-600 hover:bg-gray-50 hover:text-gray-900 dark:text-gray-300 dark:hover:bg-gray-700 dark:hover:text-white")??""}`),ge(lr,` ${e(d),o(()=>e(d).label)??""}`)}),R("click",V,()=>h(z,!1)),i(se,V)});var $=l(A,2);ne($,5,()=>J,ce,(se,d)=>{var V=Or(),ie=s(V),He=s(ie);t(ie);var Se=l(ie);t(V),P(()=>{w(V,"href",(e(d),o(()=>e(d).href))),Q(V,1,`group flex items-center px-2 py-2 text-base font-medium rounded-md transition-colors duration-200
|
|
${e(y),e(d),o(()=>e(y)===e(d).href?"bg-gray-100 dark:bg-gray-700 text-gray-900 dark:text-white":"text-gray-600 hover:bg-gray-50 hover:text-gray-900 dark:text-gray-300 dark:hover:bg-gray-700 dark:hover:text-white")??""}`),w(He,"d",(e(d),o(()=>e(d).icon))),ge(Se,` ${e(d),o(()=>e(d).label)??""}`)}),R("click",V,()=>h(z,!1)),i(se,V)}),t($);var k=l($,2),T=s(k);t(k),t(W),t(L),t(_),t(r),R("click",c,()=>h(z,!1)),R("keydown",c,se=>{se.key==="Escape"&&h(z,!1)}),R("click",x,()=>h(z,!1)),R("click",T,H),i(a,r)};M(tr,a=>{e(z)&&a(or)})}t(_e);var sr=l(_e,2);{var ir=a=>{var r=qr();R("click",r,()=>h(G,!1)),R("keydown",r,c=>{c.key==="Escape"&&h(G,!1)}),i(a,r)};M(sr,a=>{e(G)&&a(ir)})}P((a,r,c,_,B)=>{w(te,"href",a),w(b,"src",r),w(S,"src",c),w(ke,"title",e(f)?"Switch to Light Mode":"Switch to Dark Mode"),w(je,"src",_),Q(je,1,`${e(f)?"hidden":"block"} h-8 w-8`),w(ze,"src",B),Q(ze,1,`${e(f)?"block":"hidden"} h-8 w-8`)},[()=>(fe(n),o(()=>n("/"))),()=>(fe(n),o(()=>n("/assets/garm-light.svg"))),()=>(fe(n),o(()=>n("/assets/garm-dark.svg"))),()=>(fe(n),o(()=>n("/assets/garm-light.svg"))),()=>(fe(n),o(()=>n("/assets/garm-dark.svg")))]),R("click",ke,O),R("click",We,H),R("click",Pe,()=>h(z,!e(z))),R("click",Ce,O),i(Z,D),$e(),he()}var Qr=g("<div> </div>"),Fr=g('<div><div class="flex"><div class="flex-shrink-0"><!></div> <div class="ml-3 flex-1"><h3> </h3> <!></div> <div class="ml-4 flex-shrink-0"><!></div></div></div>'),Jr=g('<div class="fixed top-4 right-4 z-[60] space-y-4 max-w-sm"></div>');function Kr(Z,ee){Be(ee,!1);const[re,he]=Ve(),j=()=>xe(De,"$toastStore",re),m=F();function u(C){switch(C){case"success":return`<svg class="h-5 w-5 text-green-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/>
|
|
</svg>`;case"error":return`<svg class="h-5 w-5 text-red-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"/>
|
|
</svg>`;case"warning":return`<svg class="h-5 w-5 text-yellow-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"/>
|
|
</svg>`;case"info":default:return`<svg class="h-5 w-5 text-blue-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
|
|
</svg>`}}function y(C){switch(C){case"success":return"bg-green-50 dark:bg-green-900 border-green-200 dark:border-green-700";case"error":return"bg-red-50 dark:bg-red-900 border-red-200 dark:border-red-700";case"warning":return"bg-yellow-50 dark:bg-yellow-900 border-yellow-200 dark:border-yellow-700";case"info":default:return"bg-blue-50 dark:bg-blue-900 border-blue-200 dark:border-blue-700"}}function z(C){switch(C){case"success":return"text-green-800 dark:text-green-200";case"error":return"text-red-800 dark:text-red-200";case"warning":return"text-yellow-800 dark:text-yellow-200";case"info":default:return"text-blue-800 dark:text-blue-200"}}function G(C){switch(C){case"success":return"text-green-700 dark:text-green-300";case"error":return"text-red-700 dark:text-red-300";case"warning":return"text-yellow-700 dark:text-yellow-300";case"info":default:return"text-blue-700 dark:text-blue-300"}}X(()=>j(),()=>{h(m,j())}),Ae(),Le();var f=Jr();ne(f,5,()=>e(m),C=>C.id,(C,v)=>{var O=Fr(),p=s(O),H=s(p),le=s(H);fr(le,()=>(e(v),o(()=>u(e(v).type)))),t(H);var J=l(H,2),D=s(J),I=s(D,!0);t(D);var q=l(D,2);{var ae=b=>{var S=Qr(),N=s(S,!0);t(S),P(oe=>{Q(S,1,`mt-1 text-sm ${oe??""}`),ge(N,(e(v),o(()=>e(v).message)))},[()=>(e(v),o(()=>G(e(v).type)))]),i(b,S)};M(q,b=>{e(v),o(()=>e(v).message)&&b(ae)})}t(J);var K=l(J,2),te=s(K);{let b=gr(()=>(e(v),o(()=>e(v).type==="success"?"text-green-400 hover:text-green-500 focus:ring-green-500":e(v).type==="error"?"text-red-400 hover:text-red-500 focus:ring-red-500":e(v).type==="warning"?"text-yellow-400 hover:text-yellow-500 focus:ring-yellow-500":"text-blue-400 hover:text-blue-500 focus:ring-blue-500")));mr(te,{variant:"ghost",size:"sm","aria-label":"Dismiss notification",icon:"<path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M6 18L18 6M6 6l12 12'/>",get class(){return e(b)},$$events:{click:()=>De.remove(e(v).id)}})}t(K),t(p),t(O),P((b,S)=>{Q(O,1,`relative rounded-lg border p-4 shadow-lg transition-all duration-300 ease-in-out ${b??""}`),Q(D,1,`text-sm font-medium ${S??""}`),ge(I,(e(v),o(()=>e(v).title)))},[()=>(e(v),o(()=>y(e(v).type))),()=>(e(v),o(()=>z(e(v).type)))]),i(C,O)}),t(f),i(Z,f),$e(),he()}var Wr=g('<div class="min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900"><div class="text-center"><div class="animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto"></div> <p class="mt-4 text-gray-500 dark:text-gray-400">Loading...</p></div></div>'),Xr=g('<div class="min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900"><div class="text-center"><p class="text-gray-600 dark:text-gray-400">Redirecting to login...</p></div></div>'),Yr=g('<div class="min-h-screen bg-gray-100 dark:bg-gray-900"><!> <div class="lg:pl-64"><main class="py-6 pt-20 lg:pt-6"><div class="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8"><!></div></main></div></div>'),Zr=g("<!> <!>",1);function ca(Z,ee){Be(ee,!1);const[re,he]=Ve(),j=()=>xe(Ne,"$page",re),m=()=>xe(xr,"$authStore",re),u=F(),y=F(),z=F();qe(()=>{Ue.init(),setTimeout(()=>{const p=j().url.pathname===n("/login"),H=j().url.pathname===n("/init");!p&&!H&&!m().isAuthenticated&&!m().loading&&(m().needsInitialization?me(n("/init")):me(n("/login")))},200)}),X(()=>(m(),j(),me),()=>{if(!m().loading){const p=j().url.pathname===n("/login"),H=j().url.pathname===n("/init");!p&&!H&&!m().isAuthenticated&&(m().needsInitialization?me(n("/init")):me(n("/login")))}}),X(()=>(j(),n),()=>{h(u,j().url.pathname===n("/login"))}),X(()=>(j(),n),()=>{h(y,j().url.pathname===n("/init"))}),X(()=>(e(u),e(y)),()=>{h(z,!e(u)&&!e(y))}),Ae(),Le();var G=Zr();hr(p=>{ur.title="GARM - GitHub Actions Runner Manager"});var f=E(G);{var C=p=>{var H=Wr();i(p,H)},v=p=>{var H=U(),le=E(H);{var J=I=>{var q=Xr();i(I,q)},D=I=>{var q=U(),ae=E(q);{var K=b=>{var S=U(),N=E(S);Oe(N,ee,"default",{}),i(b,S)},te=b=>{var S=Yr(),N=s(S);Ur(N,{});var oe=l(N,2),de=s(oe),pe=s(de),be=s(pe);Oe(be,ee,"default",{}),t(pe),t(de),t(oe),t(S),i(b,S)};M(ae,b=>{e(u)||e(y)?b(K):b(te,!1)},!0)}i(I,q)};M(le,I=>{e(z),m(),o(()=>e(z)&&!m().isAuthenticated)?I(J):I(D,!1)},!0)}i(p,H)};M(f,p=>{m(),o(()=>m().loading)?p(C):p(v,!1)})}var O=l(f,2);Kr(O,{}),i(Z,G),$e(),he()}export{ca as component,va as universal};
|