PageSourceSearch

https://linuxos.ovh/yunohost/admin/assets/AppCatalog-D_BDNJ68.js

js linuxos.ovh collected 2026-10-08 03:34:43 UTC 8,972 bytes, 1 lines download raw bytes

1import{I as me,u as _e,f as fe,J as pe,a as ge,d as ye,_ as ve,V as he,p as be}from"./index-mGgJqOFQ.js";import{d as X,W as ke,E as I,b1 as $e,bG as we,K as xe,o as r,a as m,P as Ve,aM as Be,aI as Z,y as Ce,S as Se,bo as qe,i as Y,w as t,b as n,aa as z,u,g as P,q as _,t as f,c as S,F as H,a4 as J,ae as Ie,ag as Ee,a2 as Ue,j as y,bH as Fe,a8 as Pe,bI as Qe,af as Ae,bx as Re,a1 as Le,a0 as Te,aj as He,I as q,ar as Me,f as je,bJ as Ge,bl as Ne,bK as W,_ as De}from"./core-Cu1dlvv4.js";import{u as Oe}from"./useAutoModal-CaK8mTFj.js";import{u as Ke}from"./useSearch-BI9R3Mbd.js";import{f as Ye}from"./appData-B2bTUKZe.js";const ze=X({__name:"CardDeckFeed",props:{stacks:{default:21}},setup(Q){const k=Q,x=ke(),i=I(!1),c=I(k.stacks),B=I(x.default()[0].children.length),w=I(null);function E(a){var v;return a.parentElement===((v=w.value)==null?void 0:v.$el)?a:E(a.parentElement)}function $(){var v;const a=(v=w.value)==null?void 0:v.$el;window.innerHeight>a.clientHeight+a.getBoundingClientRect().top-200&&(i.value=!0,c.value=Math.min(c.value+k.stacks,B.value),Ve().then(()=>{i.value=!1}))}function V(a){if(["PageUp","PageDown"].includes(a.code)){a.preventDefault();const v=a.code==="PageUp"?"previous":"next",g=E(a.target)[`${v}ElementSibling`];g==null||g.focus(),g==null||g.scrollIntoView({block:"center"})}}$e(()=>{var a;window.addEventListener("scroll",$),(a=w.value)==null||a.$el.addEventListener("keydown",V),$()}),we(()=>{const a=x.default()[0].children;B.value!==a.length&&(c.value=k.stacks,B.value=a.length)}),xe(()=>{var a;window.removeEventListener("scroll",$),(a=w.value)==null||a.$el.removeEventListener("keydown",V)});const h=()=>Be(Z,{deck:!0,role:"feed","aria-busy":i.value,ref:w},{default:()=>x.default()[0].children.slice(0,c.value)});return(a,v)=>(r(),m(h))}}),Je={id:"view-top-bar"},We=["id"],Xe={key:0,class:"d-flex align-items-center ms-2 position-relative"},Ze={class:"alert-warning p-1"},et={key:0},tt={class:"alert alert-warning"},at=X({__name:"AppCatalog",props:{search:{default:""},quality:{default:"decentQuality"},category:{default:null},subtag:{default:"all"}},async setup(Q){let k,x;const i=Q,{t:c}=Ce(),B=Se(),w=Oe(),[E,$]=([k,x]=qe(()=>Ne.get({uri:"apps/catalog?full&with_categories&with_antifeatures",initial:!0}).then(s=>{const e=Object.values(s.apps).map(o=>{const b=o.state==="working";return{...W(o,["id","category","subtags","maintained"]),...W(o.manifest,["name","description"]),quality:Ye({level:o.level,state:o.state}),working:b,decentQuality:b&&o.level>4,highQuality:b&&o.level>=8,logoHash:o.logo_hash,searchValues:[o.id,o.state,o.manifest.name,o.manifest.description,o.potential_alternative_to.join(" ")].join(" ").toLowerCase()}}).sort((o,b)=>o.id>b.id?1:-1),p=[{text:c("app_choose_category"),value:null,subtags:[]},{text:c("all_apps"),value:"all",icon:"search",subtags:[]},...s.categories.map(({title:o,id:b,...C})=>({text:o,value:b,...C}))];return[e,p]})),k=await k,x(),k),{quality:V,category:h,subtag:a,search:v}=me(i,()=>{if(i.category===null)return{...i,category:"all"}}),[g,U]=Ke(E,(s,e)=>i.quality!=="all"&&!e[i.quality]||i.category!=="all"&&e.category!==i.category||i.subtag!=="all"&&!(i.subtag==="others"?e.subtags.length===0:e.subtags.includes(i.subtag))?!1:!!(s===""||e.searchValues.includes(s)),{externalSearch:v,filterIfNoSearch:!0,filterAllFn(s){if(i.category===null)return!1;if(i.quality==="all"&&i.category==="all"&&s==="")return!0}}),M=Y(()=>!["quality","category","subtag"].every(s=>i[s]==="all")),F=I({url:""}),j={url:{component:"InputItem",label:c("url"),rules:{required:ge,appRepoUrl:pe},cProps:{id:"custom-install",placeholder:"https://some.git.forge.tld/USER/REPOSITORY"}}},{v:ee,onSubmit:te}=_e(F,j),ae=[{value:"highQuality",text:c("only_highquality_apps")},{value:"decentQuality",text:c("only_decent_quality_apps")},{value:"working",text:c("only_working_apps")},{value:"all",text:c("all_apps")}],A=Y(()=>{if(i.category&&$.length>2){const s=$.find(e=>e.value===i.category);if(s.subtags.length){const e=[{text:c("all"),value:"all"}];return s.subtags.forEach(p=>{e.push({text:p.title,value:p.id})}),e.push({text:c("others"),value:"others"}),e}}return null}),le=te(async()=>
1{if(!await w(c("confirm_install_custom_app")))return;const e=F.value.url;B.push({name:"app-install-custom",params:{id:e.endsWith("/")?e:e+"/"}})});return(s,e)=>{const p=ye,o=Te,b=He,C=Me,R=Le,ne=je,se=Ge,G=Ue,N=Ee,L=Fe,D=Ie,oe=Z,ie=Qe,re=Re,T=Ae,ue=Pe,O=ve,ce=fe,de=be;return r(),m(de,{items:u(U),"items-name":"apps"},{"top-bar":t(()=>[P("div",Je,[n(R,null,{default:t(()=>[n(o,null,{default:t(()=>[n(p,{iname:"search"})]),_:1}),n(b,{id:"search-input",modelValue:u(g),"onUpdate:modelValue":e[0]||(e[0]=d=>q(g)?g.value=d:null),placeholder:s.$t("search.for",{items:s.$t("items.apps",2)})},null,8,["modelValue","placeholder"]),n(C,{modelValue:u(V),"onUpdate:modelValue":e[1]||(e[1]=d=>q(V)?V.value=d:null),options:ae},null,8,["modelValue"])]),_:1}),n(R,{class:"mt-3"},{default:t(()=>[n(o,null,{default:t(()=>[n(p,{iname:"filter"})]),_:1}),n(C,{modelValue:u(h),"onUpdate:modelValue":e[2]||(e[2]=d=>q(h)?h.value=d:null),options:u($)},null,8,["modelValue","options"]),n(ne,{variant:"primary",disabled:u(h)===null,onClick:e[3]||(e[3]=d=>h.value=null)},{default:t(()=>[_(f(s.$t("app_show_categories")),1)]),_:1},8,["disabled"])]),_:1}),A.value?(r(),m(R,{key:0,class:"mt-3 subtags"},{default:t(()=>[n(o,null,{default:t(()=>e[7]||(e[7]=[_("Subtags")])),_:1}),n(se,{id:"subtags-radio",modelValue:u(a),"onUpdate:modelValue":e[4]||(e[4]=d=>q(a)?a.value=d:null),name:"subtags",options:A.value,buttons:"","button-variant":"outline-secondary"},null,8,["modelValue","options"]),n(C,{id:"subtags-select",modelValue:u(a),"onUpdate:modelValue":e[5]||(e[5]=d=>q(a)?a.value=d:null),options:A.value},null,8,["modelValue","options"])]),_:1})):y("",!0)])]),"forced-default":t(({noItemsMessage:d})=>[u(h)===null?(r(),m(oe,{key:0,deck:"",tag:"ul",class:"p-0 m-0"},{default:t(()=>[(r(!0),S(H,null,J(u($).slice(1),l=>(r(),m(D,{key:l.text,tag:"li",class:"category-card"},{default:t(()=>[n(N,null,{default:t(()=>[n(G,{class:"card-link",onClick:z(K=>h.value=l.value,["prevent"])},{default:t(()=>[l.icon?(r(),m(p,{key:0,iname:l.icon},null,8,["iname"])):y("",!0),_(" "+f(l.text),1)]),_:2},1032,["onClick"])]),_:2},1024),"description"in l?(r(),m(L,{key:0},{default:t(()=>[_(f(l.description),1)]),_:2},1024)):y("",!0)]),_:2},1024))),128))]),_:1})):u(U)?(r(),m(ze,{key:1},{default:t(()=>[(r(!0),S(H,null,J(u(U),(l,K)=>(r(),m(D,{key:l.id,tag:"article","aria-labelledby":`${l.id}-title`,"aria-describedby":`${l.id}-desc`,tabindex:"0","aria-posinset":K+1,"aria-setsize":u(U).length,"no-body":"",class:"app-card"},{default:t(()=>[n(ue,{class:"d-flex"},{default:t(()=>[l.logoHash?(r(),m(ie,{key:0,class:"app-logo rounded",src:`./applogos/${l.logoHash}.png`},null,8,["src"])):y("",!0),P("div",{id:`${l.id}-card`},[n(N,{id:`${l.id}-title`,class:"d-flex mb-2"},{default:t(()=>[n(G,{to:{name:"app-install",params:{id:l.id}},class:"card-link"},{default:t(()=>[_(f(l.name),1)]),_:2},1032,["to"]),l.quality.state!=="working"||l.highQuality?(r(),S("small",Xe,[l.quality.state!=="working"?(r(),m(T,{key:0,click:!1,strategy:"fixed"},{target:t(()=>[n(re,{variant:l.quality.variant,tabindex:"0"},{default:t(()=>[_(f(s.$t(`app_state_${l.quality.state}`)),1)]),_:2},1032,["variant"])]),default:t(()=>[_(" "+f(s.$t(`app_state_${l.quality.state}_explanation`)),1)]),_:2},1024)):y("",!0),l.highQuality?(r(),m(T,{key:1,click:!1,strategy:"fixed"},{target:t(()=>[n(p,{iname:"star",class:"star",tabindex:"0"})]),default:t(()=>[_(" "+f(s.$t("app_state_highquality_explanation")),1)]),_:1})):y("",!0)])):y("",!0)]),_:2},1032,["id"]),n(L,{id:`${l.id}-desc`},{default:t(()=>[_(f(l.description),1)]),_:2},1032,["id"]),l.maintained?y("",!0):(r(),m(L,{key:0,class:"align-self-end position-relative mt-auto"},{default:t(()=>[n(T,{click:!1,strategy:"fixed"},{target:t(()=>[P("span",Ze,[n(p,{iname:"warning"}),_(" "+f(s.$t("orphaned")),1)])]),default:t(()=>[_(" "+f(s.$t("orphaned_details")),1)]),_:1})]),_:1}))],8,We)]),_:2},1024)]),_:2},1032,["aria-labelledby","aria-describedby","aria-posinset","aria-setsize"]))),128))]),_:1})):(r(),S(H,{key:2},[d?(r(),m(O,{key:0,alert:"",icon:"exclamation-triangle",variant:"warning"},{default:t(()=>[_(f(d)+" ",1),M.value?(r(),S("div",et,f(u(c)("catalog_partial_search")),1)):y("",!0)]),_:2},1024)):y("",!0),M.value?y("",!0):(r(),m(O,{key:1},{default:t(()=>[n(u(he),{markdown:u(c)("catalog_wishlist",{search:u(g)})},null,8,["markdown"])]),_:1}))],64))]),bot:t(()=>[n(ce,{modelValue:F.value,"onUpdate:modelValue":e[6]||(e[6]=d=>F.value=d),icon:"download",fields:j,"submit-text":s.$t("install"),title:s.$t("custom_app_install"),validations:u(ee),class:"mt-5",onSubmit:z(u(le),["prevent"])},{disclaimer:t(()=>[P("div",tt,[n(p,{iname:"exclamation-triangle"}),_(" "+f(s.$t("confirm_install_custom_app")),1)])]),_:1},8,["modelValue","submit-text","title","validations","onSubmit"])]),_:1},8,["items"])}}}),rt=De(at,[["__scopeId","data-v-72f074dd"]]);export{rt 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.