PageSourceSearch

https://veeso.ai/_nuxt/DFAb2WXj.js

js veeso.ai collected 2026-09-25 21:03:28 UTC 14,236 bytes, 2 lines download raw bytes

1import{w as P,p as ge,Q as ke,g as o,e as a,b as c,u,j as L,v as M,h as S,a as _,L as x,F as U,K as H,i as K,c as E,r as v,l as N,al as we,ad as ye,o as n,t as g,f as _e,a8 as j,n as Ce,ac as $e}from"#entry";import{_ as Pe}from"./BXFPFDDs.js";import{f as X}from"./tHLCO_10.js";import{a as Se,b as je,c as Te,d as Fe,_ as Le}from"./Dp9yocqG.js";import{r as Y,g as Me,a as Ue,b as Ne,p as ee}from"./BqUEdAed.js";import{p as Ve}from"./DA_XgWze.js";import{S as q}from"./Buciwe9X.js";import{X as V}from"./B1rDLfiH.js";import{U as te}from"./CXB4RFAC.js";import{L as Be}from"./Dr27PAHd.js";import"./C2fQiChb.js";import"./BSqbKfrp.js";import"./CxaXaSD0.js";import"./BNe0Xlio.js";import"./BSBRDFHK.js";import"./Bq7X3pZ-.js";import"./Bc5Znn20.js";import"./C606gEwv.js";const De={class:"flex flex-col select-none min-h-screen"},Ie={class:"sticky top-0 z-10 bg-[#fafafa]"},Ae={class:"md:hidden px-3 py-3 space-y-3"},Re={class:"relative flex items-center h-9 rounded-full bg-black/5"},He={class:"relative flex items-center h-9 rounded-full bg-black/5 px-3"},Ee={class:"flex items-center gap-2"},qe={class:"font-normal text-sm text-black/80 whitespace-nowrap truncate"},Oe={class:"flex items-center gap-1.5 bg-black/5 rounded-full p-1 w-fit"},ze={class:"hidden md:block px-6 lg:px-8 py-3"},Ge={class:"flex items-center justify-between gap-3"},Je={class:"flex items-center gap-1.5 overflow-x-auto scrollbar-hide flex-1 min-w-0"},Qe=["onClick"],We={class:"flex items-center gap-2 shrink-0"},Ze={class:"flex items-center gap-1.5 bg-black/5 rounded-full p-1"},Ke={class:"relative flex items-center h-8 bg-black/5 rounded-full px-3 w-48 hover:bg-black/10 transition-colors"},Xe={class:"flex-1 relative"},Ye={key:0,width:"60",height:"60",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"text-black/20"},et={key:1,width:"60",height:"60",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"text-black/20"},tt={class:"px-2 sm:px-3 lg:px-8 pb-12"},lt={class:"grid grid-cols-2 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5 gap-4 sm:gap-8"},at={class:"mt-2 flex flex-wrap items-center gap-1.5 px-1"},st={class:"inline-flex items-center rounded-full bg-black/5 px-2 py-0.5 text-[11px] font-normal text-black/60"},nt=["onClick"],ot=["src"],rt={key:1,class:"w-5 h-5 rounded-full bg-black/10 flex items-center justify-center text-[10px] text-black/50"},it={class:"text-xs text-black/60 truncate max-w-[120px]"},ut={key:0,class:"flex justify-center my-8"},ct={key:1,class:"flex justify-center my-12"},Tt={__name:"designs",props:{debug:Boolean,publicPath:String},setup(O){const le=we(),ae=ye(),C=v(null),h=v(1),T=v(20),m=v(!0),$=v(!1),B=v(!1),r=v([]),D=v(!1),b=v("all"),d=v(""),f=v(""),k=v(!1),z=v(null),p=v("all"),se=t=>{const e=t.nameText?j(t.nameText):"",l=t.title?j(t.title):"";return e&&!e.startsWith("products.")?e:l&&!l.startsWith("products.")?l:t.name.split("-").map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join(" ")},w=N(()=>{const t=Ve.filter(e=>e.visibility!=="hidden");return[{value:"all",label:j("workspace.filters.all","All"),tag:null},...t.map(e=>({value:e.name,label:se(e),tag:e.tag}))]}),ne=N(()=>w.value.find(t=>t.value===p.value)||w.value[0]),G=t=>{p.value=t,r.value=[],h.value=1,m.value=!0,I()},J=()=>{B.value=!1},oe=()=>{d.value||(k.value=!1)};let F=null;const Q=()=>{clearTimeout(F),F=setTimeout(()=>{r.value=[],h.value=1,m.value=!0,I()},500)};P(d,t=>{t!==void 0&&Q()}),P(f,t=>{t!==void 0&&Q()}),P(k,async t=>{t&&(await Ce(),z.value?.focus())}),P(()=>C.value,(t,e)=>{e?.removeEventListener("scroll",A),t?.addEventListener("scroll",A)});const y=(t,e={})=>{const{force:l=!1}=e,s=l||b.value!==t;b.value=t,s&&(r.value=[],h.value=1,m.value=!0,I())};$e("container",C);async function I(){D.value=!0;try{const t={page:h.value,limit:T.value};if(p.value&&p.value!=="all"){const i=w.value.find(xe=>xe.value===p.value);i?.tag&&(t.category=i.tag)}d.value&&(t.q=d.value),f.value&&(t.userId=f.value),b.value==="not_success"&&(t.first_generation_completed="not_success");const s=((await Y("/_/admin/projects",{query:t})).data||[]).map(i=>(i.createdAt=i.created_at,i.updatedAt=i.updated_at,i));h.value===1?r.value=s:r.value=[...r.value,...s],m.value=s.length>=T.value}finally{D.value=!1}}async function re(){if(!($.value||!m.value)){$.value=!0;try{h.value+=1;const t={page:h.value,limit:T.value};if(p.value&&p.value!=="all"){const s=w.value.find(i=>i.value===p.value);s?.tag&&(t.category=s.tag)}d.value&&(t.q=d.value),f.value&&(t.userId=f.value),b.value==="not_success"&&(t.first_generation_completed="not_success");const l=(await Y("/_/admin/projects",{query:t})).data||[];if(l.length===0)m.value=!1;else{const s=l.map(i=>(i.createdAt=i.created_at,i.updatedAt=i.updated_at,i));r.value=[...r.value,...s],m.value=l.length>=T.value}}finally{$.value=!1}}}const A=()=>{if($.value||!m.value)return;const t=C.value;if(!t)return;const e=t.scrollHeight,l=t.scrollTop,s=t.clientHeight;l+s>=e-200&&re()};ge(()=>{J(),y("all",{force:!0})}),P(()=>ae.name,(t,e)=>{if(t===e)return;const l=B.value;
1J(),l!==B.value&&y(b.value,{force:!0})}),ke(()=>{C.value?.removeEventListener("scroll",A),F&&clearTimeout(F)});async function ie(t,e){e&&JSON.stringify(e||{});const l=le.resolve({path:`/design/${t.id}`});window.open(l.href,"_blank")}async function ue(t,e){const l=await ee(t,e);r.value=r.value.map(s=>s.id===l.id?l:s)}const ce=t=>JSON.parse(JSON.stringify(t)),R=N(()=>r.value),W=N(()=>!!d.value),Z=t=>{const e=t?.meta?.first_generation_completed;return e===!0?"success":e===!1?"failed":"unknown"},de=t=>{const e=Z(t);return e==="success"?"成功":e==="failed"?"失败":"未生成"},fe=t=>{const e=Z(t);return e==="success"?"bg-emerald-500/10 text-emerald-700":e==="failed"?"bg-red-500/10 text-red-700":"bg-black/5 text-black/50"},ve=t=>{if(typeof t!="number"||!Number.isFinite(t)||t<0)return"--";if(t<1e3)return`${Math.round(t)}ms`;if(t<6e4)return`${(t/1e3).toFixed(1)}s`;const e=Math.floor(t/6e4),l=Math.round(t%6e4/1e3);return`${e}m${l}s`},pe=t=>ve(t?.meta?.first_generation_duration_ms);async function me(t){const e=Math.random().toString(36).substr(2,9),l=await Me(t.id),s={name:l.name+"_"+e,description:l.description,thumbnail:l.thumbnail,data:ce(l.data),createdAt:Date.now(),updatedAt:Date.now()},i=await Ue(s);r.value.unshift(i)}async function be(t){const{id:e}=t;await Ne(e),r.value=r.value.filter(l=>l.id!==e)}async function he({id:t,starred:e}){const l=[...r.value];r.value=r.value.map(s=>s.id===t?{...s,starred:e}:s);try{await ee(t,{starred:e})}catch{r.value=l}}return(t,e)=>(n(),o("div",De,[a("div",Ie,[e[14]||(e[14]=a("div",{class:"px-6 lg:px-8 py-4 border-b border-black/5 flex items-center justify-between"},[a("h1",{class:"text-xl font-semibold text-black/80"},"Admin Projects")],-1)),a("div",Ae,[a("div",Re,[c(u(q),{class:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-black/40 pointer-events-none"}),L(a("input",{"onUpdate:modelValue":e[0]||(e[0]=l=>d.value=l),type:"text",placeholder:"Search designs...",class:"h-9 pl-9 pr-9 w-full bg-transparent border-none rounded-full text-sm focus:outline-none placeholder:text-black/40"},null,512),[[M,d.value]]),d.value?(n(),o("button",{key:0,onClick:e[1]||(e[1]=l=>d.value=""),class:"absolute right-2 top-1/2 transform -translate-y-1/2 w-5 h-5 flex items-center justify-center hover:bg-black/10 rounded-full transition-colors"},[c(u(V),{class:"w-3.5 h-3.5 text-black/40"})])):S("",!0)]),a("div",He,[c(u(te),{class:"w-4 h-4 text-black/40 mr-2 shrink-0"}),L(a("input",{"onUpdate:modelValue":e[2]||(e[2]=l=>f.value=l),type:"text",placeholder:"Filter by User ID",class:"bg-transparent border-none text-sm w-full focus:outline-none placeholder:text-black/40"},null,512),[[M,f.value]]),f.value?(n(),o("button",{key:0,onClick:e[3]||(e[3]=l=>f.value=""),class:"ml-1 w-5 h-5 flex items-center justify-center hover:bg-black/10 rounded-full transition-colors shrink-0"},[c(u(V),{class:"w-3.5 h-3.5 text-black/40"})])):S("",!0)]),a("div",Ee,[c(u(Le),{modelValue:p.value,"onUpdate:modelValue":[e[4]||(e[4]=l=>p.value=l),G]},{default:_(()=>[c(u(Se),{class:"h-8 px-3 border border-black/5 bg-transparent rounded-full text-sm focus:outline-none focus:ring-1 focus:ring-black/10 hover:bg-black/5 transition-colors flex-1"},{default:_(()=>[a("span",qe,g(ne.value?.label),1)]),_:1}),c(u(je),null,{default:_(()=>[c(u(Te),null,{default:_(()=>[(n(!0),o(U,null,H(w.value,l=>(n(),E(u(Fe),{key:l.value,value:l.value},{default:_(()=>[_e(g(l.label),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1})]),_:1},8,["modelValue"])]),a("div",Oe,[a("button",{onClick:e[5]||(e[5]=l=>y("all")),class:x(["h-7 px-3 rounded-full text-sm font-normal whitespace-nowrap transition-all duration-200",b.value==="all"?"bg-white text-black shadow-sm":"text-black/60 hover:bg-black/5"])}," 全部 ",2),a("button",{onClick:e[6]||(e[6]=l=>y("not_success")),class:x(["h-7 px-3 rounded-full text-sm font-normal whitespace-nowrap transition-all duration-200",b.value==="not_success"?"bg-white text-black shadow-sm":"text-black/60 hover:bg-black/5"])}," 未标记成功 ",2)])]),a("div",ze,[a("div",Ge,[a("div",Je,[(n(!0),o(U,null,H(w.value,l=>(n(),o("button",{key:l.value,onClick:s=>G(l.value),class:x(["h-8 px-3 rounded-full text-sm font-normal whitespace-nowrap transition-all duration-200 shrink-0",p.value===l.value?"bg-black/5 text-black":"bg-transparent text-black/50 hover:bg-black/5 hover:text-black/80"])},g(l.label),11,Qe))),128))]),a("div",We,[a("div",Ze,[a("button",{onClick:e[7]||(e[7]=l=>y("all")),class:x(["h-7 px-3 rounded-full text-sm font-normal whitespace-nowrap transition-all duration-200",b.value==="all"?"bg-white text-black shadow-sm":"text-black/60 hover:bg-black/5"])}," 全部 ",2),a("button",{onClick:e[8]||(e[8]=l=>y("not_success")),class:x(["h-7 px-3 rounded-full text-sm font-normal whitespace-nowrap transition-all duration-200",b.value==="not_success"?"bg-white text-black shadow-sm":"text-black/60 hover:bg-black/5"])}," 未标记成功 ",2)]),a("div",Ke,[c(u(te),{class:"w-4 h-4 text-black/40 mr-2 shrink-0"}),L(a("input",{"onUpdate:modelValue":e[9]||(e[9]=l=>f.value=l),type:"text",placeholder:"Filter by User ID",class:"bg-transparent border-none text-sm w-full focus:outline-none placeholder:text-black/40"},null,512),[[M,f.value]]),f.value?(n(),o("button",{key:0,onClick:e[10]||(e[10]=l=>f.value=""),class:"ml-1 w-4 h-4 flex items-center justify-center hover:bg-black/10 rounded-full transition-colors shrink-0"},[c(u(V),{class:"w-3 h-3 text-black/40"})])):S("",!0)]),a("div",{class:x(["relative flex items-center h-8 rounded-full transition-all duration-200 ease-out",k.value?"w-64 xl:w-80 bg-black/5":"w-8 bg-transparent hover:bg-black/5"])},[k.value?(n(),o(U,{key:1},[c(u(q),{class:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-black/40 pointer-events-none z-10"}),L(a("input",{ref_key:"searchInput",ref:z,"onUpdate:modelValue":e[12]||(e[12]=l=>d.value=l),type:"text",placeholder:"Search designs...",onBlur:oe,class:"h-8 pl-9 pr-8 w-full bg-transparent border-none rounded-full text-sm focus:outline-none placeholder:text-black/40"},null,544),[[M,d.value]]),a("button",{onMousedown:e[13]||(e[13]=K(l=>{k.value=!1,d.value=""},["prevent"])),class:"absolute right-2 top-1/2 transform -translate-y-1/2 w-5 h-5 flex items-center justify-center hover:bg-black/10 rounded-full transition-colors z-10"},[c(u(V),{class:"w-3.5 h-3.5 text-black/40 hover:text-black/60"})],32)],64)):(n(),o("button",{key:0,onClick:e[11]||(e[11]=l=>k.value=!0),class:"w-8 h-8 rounded-full flex items-center justify-center shrink-0"},[c(u(q),{class:"w-4 h-4 text-black/50"})]))],2)])])])]),a("div",Xe,[D.value?(n(),E(X,{key:0,class:"absolute inset-0",variant:"loading","full-height":!0})):R.value.length===0?(n(),E(X,{key:1,class:"absolute inset-0","full-height":!0,title:W.value?u(j)("workspace.noSearchResults","N
1o search results"):u(j)("workspace.noDesigns","No designs")},{icon:_(()=>[W.value?(n(),o("svg",Ye,[...e[15]||(e[15]=[a("path",{d:"M10.5 18C14.6421 18 18 14.6421 18 10.5C18 6.35786 14.6421 3 10.5 3C6.35786 3 3 6.35786 3 10.5C3 14.6421 6.35786 18 10.5 18Z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),a("path",{d:"M16 16L21 21",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(n(),o("svg",et,[...e[16]||(e[16]=[a("path",{d:"M6.24022 16.5225C5.79589 16.5225 5.63183 16.208 5.70702 15.8389L6.98534 9.33105C7.06737 8.90039 7.42968 8.58594 7.84667 8.58594H7.87401L9.39159 4.06055C9.4873 3.77344 9.69921 3.60938 10.0068 3.60938C10.3008 3.60938 10.4922 3.77344 10.5947 4.06055L12.1123 8.58594H12.1465C12.5635 8.58594 12.9258 8.90039 13.0078 9.33105L14.2861 15.8389C14.3613 16.208 14.2041 16.5225 13.7461 16.5225C13.4248 16.5225 13.2676 16.3516 13.2129 16.0713L11.9687 9.73438H8.01757L6.77343 16.0713C6.71874 16.3516 6.56151 16.5225 6.24022 16.5225Z",fill:"currentColor"},null,-1)])]))]),_:1},8,["title"])):(n(),o("div",{key:2,class:"absolute inset-0 overflow-y-auto py-3 custom-scrollbar",ref_key:"containerRef",ref:C},[a("div",tt,[a("div",lt,[(n(!0),o(U,null,H(R.value,l=>(n(),o("div",{key:l.id,class:"cursor-pointer"},[c(Pe,{project:l,debug:O.debug,publicPath:O.publicPath,onStar:he,onUpdate:ue,onRemove:be,onDuplicate:me,onOpen:ie},null,8,["project","debug","publicPath"]),a("div",at,[a("span",{class:x(["inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-normal",fe(l)])}," 生成: "+g(de(l)),3),a("span",st," 耗时: "+g(pe(l)),1)]),l.owner?(n(),o("div",{key:0,class:"mt-2 flex items-center gap-2 px-1 py-1 -ml-1 rounded-md hover:bg-black/5 transition-colors cursor-pointer w-fit",onClick:K(s=>f.value=l.owner.id,["stop"]),title:"Filter by this user"},[l.owner.avatar?(n(),o("img",{key:0,src:l.owner.avatar,class:"w-5 h-5 rounded-full object-cover bg-black/5"},null,8,ot)):(n(),o("div",rt,g((l.owner.name||l.owner.email||"?")[0].toUpperCase()),1)),a("span",it,g(l.owner.name||l.owner.email),1)],8,nt)):S("",!0)]))),128))]),$.value?(n(),o("div",ut,[c(u(Be),{class:"w-6 h-6 animate-spin text-black/20"})])):!m.value&&R.value.length>0?(n(),o("div",ct,[...e[17]||(e[17]=[a("div",{class:"text-sm text-black/20"},"No more designs",-1)])])):S("",!0)])],512))])]))}};export{Tt as default};
2//# sourceMappingURL=DFAb2WXj.js.map

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.