2025-08-21 20:35:10 +00:00
|
|
|
import"../chunks/DsnmJJEf.js";import{i as jt}from"../chunks/zNh6Oe5P.js";import{p as Gt,g as e,o as Ut,l as Q,a as qt,f as E,e as f,h as zt,b as Fe,c as $,d as Bt,$ as St,m as y,s as n,i as Lt,j as o,k as a,r as i,u,n as be,q as Le,t as se,v as W,w as rt,x as Nt,y as _,z as X}from"../chunks/sWNKMed7.js";import{i as G,s as Kt,a as Vt}from"../chunks/Ccl3fNd2.js";import{e as Ht,i as Rt}from"../chunks/BuuPrWMc.js";import{h as Yt,r as L,s as je,b as Ot,a as Jt,g as ve}from"../chunks/D30EsFKH.js";import{b as N,a as Qt}from"../chunks/CLagxtgo.js";import{p as at}from"../chunks/D4Caz1gY.js";import{P as Wt}from"../chunks/BAf75JIA.js";import{F as Xt}from"../chunks/6R-adehd.js";import{D as Zt,A as ot,G as it,a as er}from"../chunks/I29fo47B.js";import{e as tr,a as Ne}from"../chunks/DWynKlcl.js";import{t as ke}from"../chunks/BZUCTtPY.js";import{f as rr,p as ar,g as Ke,B as nt,c as or}from"../chunks/DyvUHRqW.js";import{e as Ve}from"../chunks/BZiHL9L3.js";import"../chunks/CWoVlqr_.js";import{E as ir}from"../chunks/BLz-7_AQ.js";import{S as nr}from"../chunks/CE4EvFNL.js";var dr=E('<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 space-x-3"><div class="flex items-center"><!> <span class="ml-1 text-xs text-gray-500 dark:text-gray-400"> </span></div></div></div></div> <div class="flex items-center space-x-3 ml-4"><!> <div class="flex space-x-2"><!> <!></div></div></div>'),sr=E("<option> </option>"),lr=E('<p class="text-xs text-gray-500 dark:text-gray-400 mt-1"> </p>'),cr=E('<p class="text-xs text-gray-500 dark:text-gray-400 mt-1">Gitea only supports PAT authentication</p>'),ur=E('<div><label for="oauth2_token" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">Personal Access Token <span class="text-red-500">*</span></label> <input type="password" id="oauth2_token" 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="ghp_xxxxxxxxxxxxxxxxxxxx"/></div>'),pr=E('<div><label for="app_id" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">App ID <span class="text-red-500">*</span></label> <input type="text" id="app_id" 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="123456"/></div> <div><label for="installation_id" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">App Installation ID <span class="text-red-500">*</span></label> <input type="text" id="installation_id" 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="12345678"/></div> <div><label for="private_key" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">Private Key <span class="text-red-500">*</span></label> <div class="border-2 border-dashed border-gray-300 dark:border-gray-600 rounded-lg p-4 text-center hover:border-blue-400 dark:hover:border-blue-400 transition-colors"><input type="file" id="private_key" accept=".pem,.key" class="hidden"/> <div class="space-y-2"><svg class="mx-auto h-8 w-8 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="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"></path></svg> <p class="text-sm text-gray-600 dark:text-gray-400"><button type="button" class="text-gray-900 dark:text-white hover:text-gray-700 dark:hover:text-gray-300 hover:underline cursor-pointer">Choose a file</button> or drag and drop</p> <p class="text-xs text-gr
|
|
|
|
|
${v??""}`)},[()=>(e(t),u(()=>(e(t).endpoint&&_t(e(t).endpoint),""))),()=>u(()=>!Je()),()=>u(()=>Je()?"bg-blue-600 hover:bg-blue-700 focus:ring-blue-500 cursor-pointer":"bg-gray-400 cursor-not-allowed")]),f("click",b,P),f("click",h,P),N(F,()=>e(t).name,s=>_(t,e(t).name=s)),N(V,()=>e(t).description,s=>_(t,e(t).description=s)),Ot(B,()=>e(t).endpoint,s=>_(t,e(t).endpoint=s)),f("click",R,()=>Ye(p.PAT)),f("click",Y,()=>Ye(p.APP)),f("click",ne,P),f("submit",A,at(vt)),$(r,d)};G(Ze,r=>{e(Ae)&&r(Et)})}var et=a(Ze,2);{var Dt=r=>{var d=fr(),b=o(d),m=a(b,2),l=o(m),h=o(l),A=a(o(h),2),q=o(A);i(A),i(h);var I=a(h,2);i(l);var F=a(l,2),k=o(F),V=a(o(k),2);L(V),i(k);var z=a(k,2),B=a(o(z),2);rt(B),i(z);var S=a(z,2),te=a(o(S),2);L(te),X(2),i(S);var re=a(S,2),ae=a(o(re),2),H=o(ae),oe=o(H,!0);i(H),i(ae),X(2),i(re);var R=a(re,2),Y=o(R),ie=o(Y);L(ie),X(2),i(Y),X(2),i(R);var pe=a(R,2);{var j=w=>{var ne=vr(),me=Fe(ne);{var s=C=>{var T=yr(),O=a(o(T),2);L(O),i(T),N(O,()=>e(t).oauth2_token,de=>_(t,e(t).oauth2_token=de)),$(C,T)};G(me,C=>{e(g),u(()=>e(g)["auth-type"]===p.PAT)&&C(s)})}var c=a(me,2);{var v=C=>{var T=br(),O=Fe(T),de=a(o(O),2);L(de),i(O);var ge=a(O,2),xe=a(o(ge),2);L(xe),i(ge);var _e=a(ge,2),he=a(o(_e),2),Ie=o(he),ye=a(Ie,2),tt=a(o(ye),2),Ft=o(tt);X(),i(tt),X(2),i(ye),i(he),i(_e),N(de,()=>e(t).app_id,Se=>_(t,e(t).app_id=Se)),N(xe,()=>e(t).installation_id,Se=>_(t,e(t).installation_id=Se)),f("change",Ie,Oe),f("click",Ft,()=>document.getElementById("edit_private_key")?.click()),$(C,T)};G(c,C=>{e(g),u(()=>e(g)["auth-type"]===p.APP)&&C(v)})}$(w,ne)};G(pe,w=>{e(ee)&&w(j)})}var De=a(pe,2),fe=o(De),Me=a(fe,2);i(De),i(F),i(m),i(d),se((w,ne)=>{W(q,`Update credentials for ${e(g),u(()=>e(g)?.name||"Unknown")??""}`),Jt(te,(e(t),u(()=>e(t).endpoint))),W(oe,(e(g),u(()=>(e(g)?.["auth-type"]||p.PAT)===p.PAT?"Personal Access Token (PAT)":"GitHub App"))),Me.disabled=w,je(Me,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
|
|
|
|
|
${ne??""}`)},[()=>u(()=>!Qe()),()=>u(()=>Qe()?"bg-blue-600 hover:bg-blue-700 focus:ring-blue-500 cursor-pointer":"bg-gray-400 cursor-not-allowed")]),f("click",b,P),f("click",I,P),N(V,()=>e(t).name,w=>_(t,e(t).name=w)),N(B,()=>e(t).description,w=>_(t,e(t).description=w)),Qt(ie,()=>e(ee),w=>n(ee,w)),f("click",fe,P),f("submit",F,at(ft)),$(r,d)};G(et,r=>{e(Te)&&e(g)&&r(Dt)})}var Mt=a(et,2);{var It=r=>{var d=mr(),b=o(d),m=a(b,2),l=o(m),h=o(l),A=a(o(h),2),q=a(o(A),2),I=o(q);i(q),i(A),i(h),i(l);var F=a(l,2),k=o(F),V=a(k,2);i(F),i(m),i(d),se(()=>W(I,`Are you sure you want to delete the credentials "${e(M),u(()=>e(M)?.name||"Unknown")??""}"? This action cannot be undone.`)),f("click",b,P),f("click",k,P),f("click",V,mt),$(r,d)};G(Mt,r=>{e($e)&&e(M)&&r(It)})}$(dt,We),Bt(),ct()}export{zr as component};
|