1import{ad as B,ag as a,A as o,w as s,ar as n,H as x,b6 as k,av as r,n as z,G as c,y as d,x as f,a as S,am as A,ak as h,ao as N,v as O,a8 as E}from"./index-Bjy5XtNX.js";import{L as R}from"./LoadingText-Zmbt-QPh.js";import{_ as v}from"./Badge.vue_vue_type_script_setup_true_lang-DPlTgLIq.js";const V={class:"flex flex-col gap-4"},q={class:"flex items-center justify-between"},D={class:"text-xs text-ink-gray-5"},F={key:0,class:"rounded border border-outline-amber-2 bg-surface-amber-1 px-3 py-2 text-xs text-ink-amber-3"},P={key:1,class:"rounded border border-outline-amber-2 bg-surface-amber-1 px-3 py-2 text-xs text-ink-amber-3"},K={class:"flex items-start justify-between gap-3"},M={class:"min-w-0"},W={class:"flex items-center gap-2 flex-wrap"},J=["href"],Q={class:"text-xs text-ink-gray-5"},U={class:"mt-1 text-[11px] text-ink-gray-4 font-mono truncate"},X={key:0},Y={key:0,class:"text-ink-amber-3"},Z={key:0,class:"mt-1 text-[11px] text-ink-gray-5"},ee={class:"font-mono"},te={class:"flex flex-col items-end gap-1 shrink-0"},ae={key:0,class:"mt-3 flex flex-col gap-1"},se={class:"flex items-center gap-2 min-w-0"},oe={class:"font-mono truncate"},ne=["disabled","onClick"],ie={key:2,class:"mt-2 text-xs text-ink-gray-5"},me={__name:"Repos",setup(le){const g=h([]),p=h(!0),y=h(!1),m=h(""),l=h({});async function _(i=!1){p.value=!0;try{const t=await(await fetch(`/api/repos/${i?"?refresh=1":""}`)).json();g.value=t.repos||[],y.value=!!t.github_configured}finally{p.value=!1}}const w=O(()=>g.value.reduce((i,t)=>{var b;return i+((((b=t.github)==null?void 0:b.workflows)||[]).filter(e=>e.auto).length?1:0)},0));async function G(i){m.value=i.name+":test",l.value={...l.value,[i.name]:null};try{const t=await(await fetch(`/api/repos/${i.name}/test`,{method:"POST"})).json();l.value={...l.value,[i.name]:t}}finally{m.value=""}}async function H(i,t){const b=t.state==="active"?"disable":"enable";m.value=i.name+":"+t.id;try{const e=await(await fetch(`/api/repos/${i.name}/workflow/${t.id}/${b}`,{method:"POST"})).json();if(!e.ok){alert(e.error||"Errore");return}await _(!0)}finally{m.value=""}}const I={local:"green",dev:"blue",github:"gray"};return B(()=>_()),(i,t)=>{const b=N("RouterLink");return a(),o("div",V,[s("div",q,[s("div",null,[t[1]||(t[1]=s("div",{class:"text-base font-semibold"},"Repos / CI",-1)),s("div",D,n(g.value.length)+" repo first-party · test in locale, niente crediti GitHub Actions ",1)]),x(r(z),{variant:"subtle",onClick:t[0]||(t[0]=e=>_(!0))},{default:k(()=>[...t[2]||(t[2]=[c("Aggiorna",-1)])]),_:1})]),y.value?w.value?(a(),o("div",P," â "+n(w.value)+" repo hanno workflow che partono in automatico su push (consumano crediti). Disabilitali qui sotto per testare solo in locale. ",1)):d("",!0):(a(),o("div",F,[t[4]||(t[4]=c(" Token GitHub non configurato â lo stato Actions non è visibile. Inseriscilo in ",-1)),x(b,{to:"/secrets",class:"underline font-medium"},{default:k(()=>[...t[3]||(t[3]=[c("Secrets â GitHub â Token push",-1)])]),_:1}),t[5]||(t[5]=c(". Il registro e i test locali funzionano comunque. ",-1))])),p.value?(a(),f(r(R),{key:2})):(a(!0),o(S,{key:3},A(g.value,e=>{var T,C,$,L,j;return a(),o("div",{key:e.name,class:"rounded border border-outline-gray-2 p-4"},[s("div",K,[s("div",M,[s("div",W,[s("a",{href:`https://github.com/michelemilazzo/${e.repo}`,target:"_blank",class:"text-sm font-medium text-ink-blue-5 hover:underline"},n(e.name),9,J),x(r(v),{label:e.host,theme:I[e.host]||"gray",variant:"subtle"},null,8,["label","theme"]),s("span",Q,n(e.desc),1)]),s("div",U,[c(n(e.host==="github"?"solo GitHub":e.path)+" ",1),(T=e.local)!=null&&T.present&&((C=e.local)!=null&&C.branch)?(a(),o("span",X,[c(" · "+n(e.local.branch),1),e.local.dirty?(a(),o("span",Y," (modifiche locali)")):d("",!0)])):d("",!0)]),($=e.github)!=null&&$.last_commit?(a(),o("div",Z,[s("span",ee,n(e.github.last_commit.sha),1),c(" · "+n(e.github.last_commit.date)+" · "+n(e.github.last_commit.msg),1)])):d("",!0)]),s("div",te,[(L=e.github)!=null&&L.last_run?(a(),f(r(v),{key:0,label:`run: ${e.github.last_run.conclusion||e.github.last_run.status}`,theme:e.github.last_run.conclusion==="success"?"green":e.github.last_run.c
1onclusion==="failure"?"red":"gray",variant:"subtle"},null,8,["label","theme"])):d("",!0),(j=e.local)!=null&&j.has_test?(a(),f(r(z),{key:1,size:"sm",variant:"solid",loading:m.value===e.name+":test",onClick:u=>G(e)},{default:k(()=>[...t[6]||(t[6]=[c("Test locale",-1)])]),_:1},8,["loading","onClick"])):d("",!0)])]),e.github&&e.github.workflows.length?(a(),o("div",ae,[(a(!0),o(S,null,A(e.github.workflows,u=>(a(),o("div",{key:u.id,class:"flex items-center justify-between rounded border border-outline-gray-1 px-2 py-1 text-xs"},[s("div",se,[s("span",oe,n(u.file),1),u.auto?(a(),f(r(v),{key:0,label:"auto su push",theme:"amber",variant:"subtle"})):u.state==="active"?(a(),f(r(v),{key:1,label:"solo manuale",theme:"gray",variant:"subtle"})):(a(),f(r(v),{key:2,label:"disabilitato",theme:"gray",variant:"outline"}))]),s("button",{class:E(["shrink-0 hover:underline",u.state==="active"?"text-ink-red-5":"text-ink-green-6"]),disabled:m.value===e.name+":"+u.id,onClick:ue=>H(e,u)},n(u.state==="active"?"disabilita":"riabilita"),11,ne)]))),128))])):d("",!0),l.value[e.name]?(a(),o("pre",{key:1,class:E(["mt-3 max-h-56 overflow-auto rounded p-2 text-[10px]",l.value[e.name].ok?"bg-surface-green-1 text-ink-green-7":"bg-surface-red-1 text-ink-red-7"])},n(l.value[e.name].ok?`â TEST OK 2`:"â TEST FALLITI (exit "+(l.value[e.name].exit??"?")+`) 3`)+n(l.value[e.name].output||l.value[e.name].error||""),3)):m.value===e.name+":test"?(a(),o("div",ie,"Esecuzione testâ¦")):d("",!0)])}),128))])}}};export{me as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.