2025-08-25 15:29:50 +00:00
|
|
|
import"../chunks/DsnmJJEf.js";import{i as bt}from"../chunks/zNh6Oe5P.js";import{p as gt,g as e,o as ft,l as Z,a as _t,f as j,e as b,h as mt,b as Ce,c as I,d as yt,m as p,i as vt,$ as xt,j as o,q as Ee,k as a,t as ye,u as C,s,r as i,n as ie,v as se,w as Ie,z as V,y as g}from"../chunks/sWNKMed7.js";import{i as ne,s as ht,a as kt}from"../chunks/Ccl3fNd2.js";import{h as wt,r as U,c as je,s as Ge,g as ee}from"../chunks/DVl4ZBgx.js";import{b as E}from"../chunks/CLagxtgo.js";import{p as ze}from"../chunks/D4Caz1gY.js";import{P as Ct}from"../chunks/qfys27k5.js";import{F as Et}from"../chunks/z0u7Z3zm.js";import{D as Pt,A as qe,G as Pe,a as $t}from"../chunks/DCYYzf48.js";import{e as At,a as He}from"../chunks/DA-798Ko.js";import{t as de}from"../chunks/BZUCTtPY.js";import{g as $e,c as Rt,a as Bt,p as Ut}from"../chunks/cjRLNre3.js";import{e as Ae}from"../chunks/BZiHL9L3.js";import"../chunks/C6O4o7G1.js";import{E as Lt}from"../chunks/CARsAFuo.js";var Mt=j('<div class="flex items-center justify-between"><div class="flex-1 min-w-0"><div class="block"><p class="text-sm font-medium text-gray-900 dark:text-white truncate"> </p> <p class="text-sm text-gray-500 dark:text-gray-400 truncate mt-1"> </p> <div class="flex items-center mt-2"><!> <span class="ml-2 text-xs text-gray-500 dark:text-gray-400 capitalize"> </span></div></div></div> <div class="flex space-x-2 ml-4"><!> <!></div></div>'),Tt=j('<div><label for="api_base_url" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">API Base URL <span class="text-red-500">*</span></label> <input type="url" id="api_base_url" required class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:text-white" placeholder="https://api.github.com or https://github.example.com/api/v3"/></div> <div><label for="upload_base_url" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">Upload Base URL</label> <input type="url" id="upload_base_url" class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:text-white" placeholder="https://uploads.github.com"/></div>',1),Dt=j('<div><label for="api_base_url" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">API Base URL <span class="text-xs text-gray-500">(optional)</span></label> <input type="url" id="api_base_url" class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:text-white" placeholder="https://gitea.example.com/api/v1 (leave empty to use Base URL)"/> <p class="text-xs text-gray-500 dark:text-gray-400 mt-1">If empty, Base URL will be used as API Base URL</p></div>'),Ft=j('<div class="fixed inset-0 flex items-center justify-center z-50" role="dialog" aria-modal="true"><button class="fixed inset-0 w-full h-full bg-black/30 dark:bg-black/50 cursor-default" aria-label="Close modal"></button> <div class="bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-2xl w-full mx-4 max-h-screen overflow-y-auto relative z-10" role="document"><div class="px-6 py-4 border-b border-gray-200 dark:border-gray-700 flex justify-between items-center"><div><h3 class="text-lg font-semibold text-gray-900 dark:text-white">Add Endpoint</h3> <p class="text-sm text-gray-600 dark:text-gray-400 mt-1">Connect to GitHub or Gitea for runner management</p></div> <button class="text-gray-400 hover:text-gray-600 dark:text-gray-300 dark:hover:text-gray-100 cursor-pointer" aria-label="Close modal"><svg class="w-6 h-6" 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> <form class="p-6 space-y-4"><!> <div><label for="name" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">Endpoint Name <span class="text-red-500">*</span></label> <input type="text" id
|
2025-08-17 07:34:40 +00:00
|
|
|
${$??""}`)},[()=>C(()=>!fe()),()=>C(()=>fe()?"bg-blue-600 hover:bg-blue-700 focus:ring-blue-500 cursor-pointer":"bg-gray-400 cursor-not-allowed")]),b("click",c,y),b("click",f,y),E(w,()=>e(r).name,u=>g(r,e(r).name=u)),E(M,()=>e(r).description,u=>g(r,e(r).description=u)),E(T,()=>e(r).base_url,u=>g(r,e(r).base_url=u)),b("change",X,Ue),b("click",_e,()=>document.getElementById("ca_cert_file")?.click()),b("click",me,y),b("submit",x,ze(it)),I(t,n)};ne(Te,t=>{e(pe)&&t(lt)})}var De=a(Te,2);{var ut=t=>{var n=Gt(),c=o(n),v=a(c,2),d=o(v),f=o(d),x=o(f),R=o(x);i(x),V(2),i(f);var P=a(f,2);i(d);var w=a(d,2),_=o(w),M=a(o(_),2);U(M),i(_);var B=a(_,2),T=a(o(B),2);Ie(T),i(B);var D=a(B,2),Q=a(o(D),2);U(Q),i(D);var N=a(D,2);{var z=l=>{var h=It(),F=Ce(h),S=a(o(F),2);U(S),i(F);var Y=a(F,2),Fe=a(o(Y),2);U(Fe),i(Y),E(S,()=>e(r).api_base_url,we=>g(r,e(r).api_base_url=we)),E(Fe,()=>e(r).upload_base_url,we=>g(r,e(r).upload_base_url=we)),I(l,h)},W=l=>{var h=jt(),F=a(o(h),2);U(F),V(2),i(h),E(F,()=>e(r).api_base_url,S=>g(r,e(r).api_base_url=S)),I(l,h)};ne(N,l=>{e(m),C(()=>e(m).endpoint_type==="github")?l(z):l(W,!1)})}var X=a(N,2),te=a(o(X),2),re=o(te),_e=a(re,2),ae=a(o(_e),2),me=o(ae);V(),i(ae),V(2),i(_e),i(te),i(X);var oe=a(X,2),u=o(oe),$=a(u,2);i(oe),i(w),i(v),i(n),ye((l,h)=>{se(R,`Edit ${e(m),C(()=>e(m).endpoint_type==="github"?"GitHub":"Gitea")??""} Endpoint`),$.disabled=l,Ge($,1,`px-4 py-2 text-sm font-medium text-white rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 transition-colors
|
|
|
|
|
${h??""}`)},[()=>C(()=>!fe()),()=>C(()=>fe()?"bg-blue-600 hover:bg-blue-700 focus:ring-blue-500 cursor-pointer":"bg-gray-400 cursor-not-allowed")]),b("click",c,y),b("click",P,y),E(M,()=>e(r).name,l=>g(r,e(r).name=l)),E(T,()=>e(r).description,l=>g(r,e(r).description=l)),E(Q,()=>e(r).base_url,l=>g(r,e(r).base_url=l)),b("change",re,Ue),b("click",me,()=>document.getElementById("edit_ca_cert_file")?.click()),b("click",u,y),b("submit",w,ze(st)),I(t,n)};ne(De,t=>{e(be)&&e(m)&&t(ut)})}var ct=a(De,2);{var pt=t=>{var n=zt(),c=o(n),v=a(c,2),d=o(v),f=o(d),x=a(o(f),2),R=a(o(x),2),P=o(R);i(R),i(x),i(f),i(d);var w=a(d,2),_=o(w),M=a(_,2);i(w),i(v),i(n),ye(()=>se(P,`Are you sure you want to delete the endpoint "${e(A),C(()=>e(A).name)??""}"? This action cannot be undone.`)),b("click",c,y),b("click",_,y),b("click",M,nt),I(t,n)};ne(ct,t=>{e(ge)&&e(A)&&t(pt)})}I(Ne,Le),yt(),Oe()}export{or as component};
|