2025-08-21 20:35:10 +00:00
|
|
|
import"../chunks/DsnmJJEf.js";import{i as ze}from"../chunks/zNh6Oe5P.js";import{p as He,o as je,A as Ge,l as Oe,a as Ve,f as S,h as Je,b as C,t as H,c as w,d as Ke,u as s,n as de,v as ce,g as e,m as l,j as u,k as d,s as r,$ as Qe,r as f,y as Xe,B as pe,q as m}from"../chunks/sWNKMed7.js";import{i as g,s as Ye,a as Ze}from"../chunks/Ccl3fNd2.js";import{d as A,c as et,g as h}from"../chunks/D30EsFKH.js";import{p as tt}from"../chunks/DubtptHG.js";import{g as ue}from"../chunks/CeO1pnaq.js";import{U as ot}from"../chunks/DAUYzF7s.js";import{D as fe}from"../chunks/B6BdCO3z.js";import{E as at,P as rt,a as st}from"../chunks/B-C7pZX9.js";import{D as nt,I as it}from"../chunks/MZdleLKl.js";import{g as me}from"../chunks/DyvUHRqW.js";import{e as j}from"../chunks/BZiHL9L3.js";import{W as lt}from"../chunks/CHldIK8x.js";import{C as dt}from"../chunks/CLrK9xMi.js";import{w as G}from"../chunks/BuuPrWMc.js";import{t as R}from"../chunks/BZUCTtPY.js";var ct=S('<div class="p-6 text-center"><div class="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600 mx-auto"></div> <p class="mt-2 text-sm text-gray-500 dark:text-gray-400">Loading repository...</p></div>'),pt=S('<div class="rounded-md bg-red-50 dark:bg-red-900 p-4"><p class="text-sm font-medium text-red-800 dark:text-red-200"> </p></div>'),ut=S("<!> <!> <!> <!> <!> <!>",1),ft=S('<div class="space-y-6"><nav class="flex" aria-label="Breadcrumb"><ol class="inline-flex items-center space-x-1 md:space-x-3"><li class="inline-flex items-center"><a class="inline-flex items-center text-sm font-medium text-gray-700 hover:text-blue-600 dark:text-gray-400 dark:hover:text-white"><svg class="w-3 h-3 mr-2.5" fill="currentColor" viewBox="0 0 20 20"><path d="M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z"></path></svg> Repositories</a></li> <li><div class="flex items-center"><svg class="w-3 h-3 text-gray-400 mx-1" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"></path></svg> <span class="ml-1 text-sm font-medium text-gray-500 md:ml-2 dark:text-gray-400"> </span></div></li></ol></nav> <!></div> <!> <!> <!> <!>',1);function kt(ye,ve){He(ve,!1);const[ge,he]=Ye(),O=()=>Ze(tt,"$page",ge),x=l();let t=l(null),c=l([]),y=l([]),B=l(!0),E=l(""),D=l(!1),T=l(!1),I=l(!1),P=l(!1),p=l(null),M=null,_=l();async function V(){if(e(x))try{r(B,!0),r(E,"");const[o,a,n]=await Promise.all([h.getRepository(e(x)),h.listRepositoryPools(e(x)).catch(()=>[]),h.listRepositoryInstances(e(x)).catch(()=>[])]);r(t,o),r(c,a),r(y,n)}catch(o){r(E,j(o))}finally{r(B,!1)}}function _e(o,a){const{events:n}=o;return{...a,events:n}}async function $e(o){if(e(t))try{await h.updateRepository(e(t).id,o),await V(),R.success("Repository Updated",`Repository ${e(t).owner}/${e(t).name} has been updated successfully.`),r(D,!1)}catch(a){throw a}}async function be(){if(e(t)){try{await h.deleteRepository(e(t).id),ue(A("/repositories"))}catch(o){const a=j(o);R.error("Delete Failed",a)}r(T,!1)}}async function we(){if(e(p))try{await h.deleteInstance(e(p).name),R.success("Instance Deleted",`Instance ${e(p).name} has been deleted successfully.`),r(I,!1),r(p,null)}catch(o){const a=j(o);R.error("Delete Failed",a),r(I,!1),r(p,null)}}function xe(o){r(p,o),r(I,!0)}function Ie(){r(P,!0)}async function Re(o){try{if(!e(t))return;await h.createRepositoryPool(e(t).id,o.detail),R.success("Pool Created",`Pool has been created successfully for repository ${e(t).owner}/${e(t).name}.`),r(P,!1)}catch(a){throw a}}function J(){e(_)&&Xe(_,e(_).scrollTop=e(_).scrollHeight)}function Ee(o){if(o.operation==="update"){const a=o.payload;if(e(t)&&a.id===e(t).id){const n=e(t).events?.length||0,i=a.events?.length||0;r(t,_e(e(t),a)),i>n&&setTimeout(()=>{J()},100)}}else if(o.operation==="delete"){const a=o.payload.id||o.payload;e(t)&&e(t).id===a&&ue(A("/repositories"))}}function De(o){if(!e(t))re
|