diff --git a/1 b/1 new file mode 100644 index 0000000..e69de29 diff --git a/readme.md b/readme.md index 1e68102..c19d00d 100644 --- a/readme.md +++ b/readme.md @@ -22,11 +22,7 @@ ## 🚀 更新计划 - [ ] 切片上传,同文件秒传,断点续传 -- [x] 适配子目录 -- [x] 用户登录重构 -- [x] webdav存储 -- [x] 存储支持自定义路径 -- [x] s3优化,不修改昵称为uuid,新建目录 +- [ ] 文件收集功能 ## 📝 项目简介 @@ -34,6 +30,7 @@ FileCodeBox 是一个基于 FastAPI + Vue3 开发的轻量级文件分享工具 ## 🖼️ 功能预览 +别问前端源码怎么是js了,麻烦仔细看下面的内容
'+(n?i:z(i,!0))+`
-`:""+(n?i:z(i,!0))+`
-`}blockquote({tokens:e}){return`-${this.parser.parse(e)}-`}html({text:e}){return e}heading({tokens:e,depth:t}){return`
${this.parser.parseInline(e)}
-`}table(e){let t="",n="";for(let i=0;i${e}`}br(e){return"An error occurred:
"+z(n.message+"",!0)+"";return t?Promise.resolve(s):s}if(t)return Promise.reject(n);throw n}}}const F=new Wt;function m(d,e){return F.parse(d,e)}m.options=m.setOptions=function(d){return F.setOptions(d),m.defaults=F.defaults,Re(m.defaults),m};m.getDefaults=ue;m.defaults=Z;m.use=function(...d){return F.use(...d),m.defaults=F.defaults,Re(m.defaults),m};m.walkTokens=function(d,e){return F.walkTokens(d,e)};m.parseInline=F.parseInline;m.Parser=A;m.parser=A.parse;m.Renderer=re;m.TextRenderer=xe;m.Lexer=S;m.lexer=S.lex;m.Tokenizer=se;m.Hooks=G;m.parse=m;m.options;m.setOptions;m.use;m.walkTokens;m.parseInline;A.parse;S.lex;const Xt={class:"min-h-screen flex items-center justify-center p-4 overflow-hidden transition-colors duration-300"},Kt={class:"w-full max-w-md relative z-10"},Jt={class:"p-8"},Yt={class:"flex justify-center mb-8"},en={class:"rounded-full bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 p-1 animate-spin-slow"},tn={class:"rounded-full bg-gray-900 p-2"},nn={class:"mb-6 relative"},sn={class:"relative"},rn=["readonly"],on={key:0,class:"absolute inset-y-0 right-0 flex items-center pr-3"},ln=["disabled"],an={class:"flex items-center justify-center relative z-10"},cn={class:"mt-6 text-center"},un={class:"flex-grow overflow-y-auto p-6"},hn={class:"flex-shrink-0 mr-4"},pn={class:"flex-grow min-w-0 mr-4"},dn={class:"flex-shrink-0 flex space-x-2"},fn=["onClick"],gn=["onClick"],xn=["onClick"],kn={key:0,class:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50"},bn={class:"space-y-4"},wn={class:"flex items-center"},mn={class:"flex items-center"},yn={class:"flex items-center"},vn={class:"flex items-center"},_n={key:0,class:"ml-2"},$n={key:1},Tn=["href"],Rn={class:"mt-6 flex flex-col items-center"},zn={class:"bg-white p-2 rounded-lg shadow-md"},Sn={key:0,class:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50"},An={class:"flex justify-between items-center mb-4 flex-shrink-0"},En={class:"flex items-center gap-3"},Cn={class:"flex-1 overflow-y-auto custom-scrollbar"},In=["innerHTML"],Ln={__name:"RetrievewFileView",setup(d){const e=Oe(),t=window.location.origin,n=nt(),s=Ge("isDarkMode"),i=it(),{receiveData:r}=Ue(i),o=D(""),a=D({readonly:!1,loading:!1}),c=D(!1),l=D(""),u=D(null),p=D(!1),x=He(),w=r,T=JSON.parse(localStorage.getItem("config")||"{}");Qe(()=>{const k=x.query.code;k&&(o.value=k)}),Ne(o,k=>{k.length===5&&I()});const R=async()=>{u.value&&u.value.content&&await at(u.value.content,{successMsg:"内容已复制到剪贴板",errorMsg:"复制失败,请重试"})},I=async()=>{if(o.value.length!==5){e.showAlert("请输入5位取件码","error");return}a.value.readonly=!0,a.value.loading=!0;try{const k=await st.post("/share/select/",{code:o.value});if(k.code===200)if(k.detail){const g=k.detail.text.startsWith("/share/download")||k.detail.name!=="Text",C={id:Date.now(),code:k.detail.code,filename:k.detail.name,size:B(k.detail.size),downloadUrl:g?k.detail.text:null,content:g?null:k.detail.text,date:new Date().toLocaleString()};let $=!0;i.receiveData.forEach(ee=>{if(ee.code===C.code){$=!1;return}}),$&&i.addReceiveData(C),g?u.value=C:(u.value=C,Y.value=!0),e.showAlert("文件获取成功","success")}else e.showAlert("无效的取件码","error");else e.showAlert(k.detail||"获取文件失败","error")}catch(k){console.error("取件失败:",k),e.showAlert("取件失败,请稍后重试","error")}finally{a.value.readonly=!1,a.value.loading=!1,o.value=""}},B=k=>{if(k===0)return"0 Bytes";const g=1024,C=["Bytes","KB","MB","GB","TB"],$=Math.floor(Math.log(k)/Math.log(g));return parseFloat((k/Math.pow(g,$)).toFixed(2))+" "+C[$]},E=k=>{u.value=k},K=k=>{const g=w.value.findIndex(C=>C.id===k);g!==-1&&i.deleteReceiveData(g)},J=()=>{p.value=!p.value},O=()=>{n.push("/send")},q=k=>k.downloadUrl?`${t}${k.downloadUrl}`:`${t}?code=${k.code}`,je=k=>{if(console.log(k),k.downloadUrl)window.open(`${k.downloadUrl.startsWith("http")?"":t}${k.downloadUrl}`,"_blank");else if(k.content){const g=new Blob([k.content],{type:"text/plain;charset=utf-8"});xt.saveAs(g,`${k.filename}.txt`)}},Y=D(!1),qe=Ve(()=>u.value&&u.value.content?m(u.value.content):""),De=()=>{Y.value=!0};return(k,g)=>{const C=Je("router-link");return M(),L("div",Xt,[h("div",Kt,[h("div",{class:b(["rounded-3xl shadow-2xl overflow-hidden border transform transition-all duration-300",[f(s)?"bg-gray-800 bg-opacity-50 backdrop-filter backdrop-blur-xl border-gray-700":"bg-white border-gray-200"]])},[h("div",Jt,[h("div",Yt,[h("div",en,[h("div",tn,[_(f(ut),{class:"w-8 h-8 text-white"})])])]),h("h2",{onClick:O,class:b(["text-3xl cursor-pointer font-extrabold text-center mb-6",[f(s)?"text-transparent bg-clip-text bg-gradient-to-r from-indigo-300 via-purple-300 to-pink-300":"text-indigo-600"]])},j(f(T).name),3),h("form",{onSubmit:We(I,["prevent"])},[h("div",nn,[h("label",{for:"code",class:b(["block text-sm font-medium mb-2",[f(s)?"text-gray-300":"text-gray-800"]])},"取件码",2),h("div",sn,[Xe(h("input",{id:"code","onUpdate:modelValue":g[0]||(g[0]=$=>o.value=$),type:"text",class:b(["w-full px-4 py-3 rounded-lg placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 transition duration-300 pr-10",[f(s)?"bg-gray-700 bg-opacity-50":"bg-gray-100",{"ring-2 ring-red-500":l.value},f(s)?"text-gray-300":"text-gray-800"]]),placeholder:"请输入5位取件码",required:"",readonly:a.value.readonly,maxlength:"5",onFocus:g[1]||(g[1]=$=>c.value=!0),onBlur:g[2]||(g[2]=$=>c.value=!1)},null,42,rn),[[Ke,o.value]]),a.value.loading?(M(),L("div",on,g[5]||(g[5]=[h("span",{class:"animate-spin rounded-full h-5 w-5 border-b-2 border-indigo-500"},null,-1)]))):te("",!0)]),h("div",{class:b(["absolute -bottom-0.5 left-2 h-0.5 bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 transition-all duration-300 ease-in-out",{"w-97-100":c.value,"w-0":!c.value}])},null,2)]),h("button",{type:"submit",class:"w-full bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 text-white font-bold py-3 px-4 rounded-lg hover:from-indigo-600 hover:via-purple-600 hover:to-pink-600 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-opacity-50 transition duration-300 transform hover:scale-105 hover:shadow-lg relative overflow-hidden group",disabled:a.value.loading},[h("span",an,[h("span",null,j(a.value.loading?"处理中...":"提取文件"),1),_(f(dt),{class:"w-5 h-5 ml-2 transition-transform duration-300 transform group-hover:translate-x-1"})]),g[6]||(g[6]=h("span",{class:"absolute top-0 left-0 w-full h-full bg-gradient-to-r from-pink-500 via-purple-500 to-indigo-500 opacity-0 group-hover:opacity-100 transition-opacity duration-300"},null,-1))],8,ln)],32),h("div",cn,[_(C,{to:"/send",class:"text-indigo-400 hover:text-indigo-300 transition duration-300"},{default:U(()=>g[7]||(g[7]=[P(" 需要发送文件?点击这里 ")])),_:1})])]),h("div",{class:b(["px-8 py-4 bg-opacity-50 flex justify-between items-center",[f(s)?"bg-gray-800":"bg-gray-100"]])},[h("span",{class:b(["text-sm flex items-center",[f(s)?"text-gray-300":"text-gray-800"]])},[_(f(rt),{class:"w-4 h-4 mr-1 text-green-400"}),g[8]||(g[8]=P(" 安全加密 "))],2),h("button",{onClick:J,class:b(["text-sm hover:text-indigo-300 transition duration-300 flex items-center",[f(s)?"text-indigo-400":"text-indigo-600"]])},[g[9]||(g[9]=P(" 取件记录 ")),_(f(ot),{class:"w-4 h-4 ml-1"})],2)],2)],2)]),_(ae,{name:"drawer"},{default:U(()=>[p.value?(M(),L("div",{key:0,class:b(["fixed inset-y-0 right-0 w-full sm:w-120 bg-opacity-70 backdrop-filter backdrop-blur-xl shadow-2xl z-50 overflow-hidden flex flex-col",[f(s)?"bg-gray-900":"bg-white"]])},[h("div",{class:b(["flex justify-between items-center p-6 border-b",[f(s)?"border-gray-700":"border-gray-200"]])},[h("h3",{class:b(["text-2xl font-bold",[f(s)?"text-white":"text-gray-800"]])}," 取件记录 ",2),h("button",{onClick:J,class:b(["hover:text-white transition duration-300",[f(s)?"text-gray-400":"text-gray-800"]])},[_(f(ke),{class:"w-6 h-6"})],2)],2),h("div",un,[_(Ye,{name:"list",tag:"div",class:"space-y-4"},{default:U(()=>[(M(!0),L(et,null,tt(f(w),$=>(M(),L("div",{key:$.id,class:b(["bg-opacity-50 rounded-lg p-4 flex items-center shadow-md hover:shadow-lg transition duration-300 transform hover:scale-102",[f(s)?"bg-gray-800 hover:bg-gray-700":"bg-gray-100 hover:bg-white"]])},[h("div",hn,[_(f(be),{class:b(["w-10 h-10",[f(s)?"text-indigo-400":"text-indigo-600"]])},null,8,["class"])]),h("div",pn,[h("p",{class:b(["font-medium text-lg truncate",[f(s)?"text-white":"text-gray-800"]])},j($.filename),3),h("p",{class:b(["text-sm truncate",[f(s)?"text-gray-400":"text-gray-600"]])},j($.date)+" · "+j($.size),3)]),h("div",dn,[h("button",{onClick:ee=>E($),class:b(["p-2 rounded-full hover:bg-opacity-20 transition duration-300",[f(s)?"hover:bg-indigo-400 text-indigo-400":"hover:bg-indigo-100 text-indigo-600"]])},[_(f(ct),{class:"w-5 h-5"})],10,fn),h("button",{onClick:ee=>je($),class:b(["p-2 rounded-full hover:bg-opacity-20 transition duration-300",[f(s)?"hover:bg-green-400 text-green-400":"hover:bg-green-100 text-green-600"]])},[_(f(we),{class:"w-5 h-5"})],10,gn),h("button",{onClick:ee=>K($.id),class:b(["p-2 rounded-full hover:bg-opacity-20 transition duration-300",[f(s)?"hover:bg-red-400 text-red-400":"hover:bg-red-100 text-red-600"]])},[_(f(pt),{class:"w-5 h-5"})],10,xn)])],2))),128))]),_:1})])],2)):te("",!0)]),_:1}),_(ae,{name:"fade"},{default:U(()=>[u.value?(M(),L("div",kn,[h("div",{class:b(["p-8 rounded-2xl max-w-md w-full mx-4 shadow-2xl transform transition-all duration-300 ease-out backdrop-filter backdrop-blur-lg overflow-hidden",[f(s)?"bg-gray-800 bg-opacity-70":"bg-white bg-opacity-95"]])},[h("h3",{class:b(["text-2xl font-bold mb-6 truncate",[f(s)?"text-white":"text-gray-800"]])}," 文件详情 ",2),h("div",bn,[h("div",wn,[_(f(be),{class:b(["w-6 h-6 mr-3 flex-shrink-0",[f(s)?"text-indigo-400":"text-indigo-600"]])},null,8,["class"]),h("p",{class:b([[f(s)?"text-gray-300":"text-gray-800"],"truncate flex-grow"])},[g[10]||(g[10]=h("span",{class:"font-medium"},"文件名:",-1)),P(j(u.value.filename),1)],2)]),h("div",mn,[_(f(ft),{class:b(["w-6 h-6 mr-3 flex-shrink-0",[f(s)?"text-indigo-400":"text-indigo-600"]])},null,8,["class"]),h("p",{class:b([[f(s)?"text-gray-300":"text-gray-800"],"truncate flex-grow"])},[g[11]||(g[11]=h("span",{class:"font-medium"},"取件日期:",-1)),P(j(u.value.date),1)],2)]),h("div",yn,[_(f(ht),{class:b(["w-6 h-6 mr-3 flex-shrink-0",[f(s)?"text-indigo-400":"text-indigo-600"]])},null,8,["class"]),h("p",{class:b([[f(s)?"text-gray-300":"text-gray-800"],"truncate flex-grow"])},[g[12]||(g[12]=h("span",{class:"font-medium"},"文件大小:",-1)),P(j(u.value.size),1)],2)]),h("div",vn,[_(f(we),{class:b(["w-6 h-6 mr-3",[f(s)?"text-indigo-400":"text-indigo-600"]])},null,8,["class"]),h("p",{class:b([f(s)?"text-gray-300":"text-gray-800"])},g[13]||(g[13]=[h("span",{class:"font-medium"},"文件内容:",-1)]),2),u.value.filename=="Text"?(M(),L("div",_n,[h("button",{onClick:De,class:"px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition duration-300"}," 预览内容 ")])):(M(),L("div",$n,[h("a",{href:`${f(t)}${u.value.downloadUrl}`,target:"_blank",rel:"noopener noreferrer",class:"px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition duration-300"}," 点击下载 ",8,Tn)]))])]),h("div",Rn,[h("h4",{class:b(["text-lg font-semibold mb-3",[f(s)?"text-white":"text-gray-800"]])}," 取件二维码 ",2),h("div",zn,[_(lt,{value:q(u.value),size:128,level:"M"},null,8,["value"])]),h("p",{class:b(["mt-2 text-sm",[f(s)?"text-gray-400":"text-gray-600"]])}," 扫描二维码快速取件 ",2)]),h("button",{onClick:g[3]||(g[3]=$=>u.value=null),class:"mt-8 w-full bg-gradient-to-r from-indigo-500 to-purple-600 text-white px-6 py-3 rounded-lg font-medium hover:from-indigo-600 hover:to-purple-700 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-opacity-50 transition duration-300 transform hover:scale-105"}," 关闭 ")],2)])):te("",!0)]),_:1}),_(ae,{name:"fade"},{default:U(()=>[Y.value?(M(),L("div",Sn,[h("div",{class:b(["p-6 rounded-2xl max-w-3xl w-full mx-4 shadow-2xl transform transition-all duration-300 ease-out backdrop-filter backdrop-blur-lg bg-opacity-70 max-h-[85vh] overflow-hidden flex flex-col",[f(s)?"bg-gray-800":"bg-white"]])},[h("div",An,[h("h3",{class:b(["text-2xl font-bold",[f(s)?"text-white":"text-gray-800"]])}," 内容预览 ",2),h("div",En,[h("button",{onClick:R,class:b(["px-4 py-1.5 rounded-lg transition duration-300 flex items-center gap-2 text-sm font-medium",[f(s)?"bg-gray-700 hover:bg-gray-600 text-gray-300 hover:text-white":"bg-gray-100 hover:bg-gray-200 text-gray-700 hover:text-gray-900"]])},[_(f(gt),{class:"w-4 h-4"}),g[14]||(g[14]=P(" 复制 "))],2),h("button",{onClick:g[4]||(g[4]=$=>Y.value=!1),class:b(["p-1.5 rounded-lg transition duration-300 hover:bg-opacity-10",[f(s)?"text-gray-400 hover:text-white hover:bg-white":"text-gray-500 hover:text-gray-900 hover:bg-black"]])},[_(f(ke),{class:"w-5 h-5"})],2)])]),h("div",Cn,[h("div",{class:b(["prose max-w-none p-6 rounded-xl",[f(s)?"prose-invert bg-gray-900 bg-opacity-50":"bg-gray-50"]]),innerHTML:qe.value},null,10,In)])],2)])):te("",!0)]),_:1})])}}},Zn=Ze(Ln,[["__scopeId","data-v-4f544e47"]]);export{Zn as default}; diff --git a/themes/2024/assets/RetrievewFileView-DxenbR0j.css b/themes/2024/assets/RetrievewFileView-DxenbR0j.css deleted file mode 100644 index 0185786..0000000 --- a/themes/2024/assets/RetrievewFileView-DxenbR0j.css +++ /dev/null @@ -1 +0,0 @@ -@keyframes blob-4f544e47{0%,to{transform:translate(0) scale(1)}25%{transform:translate(20px,-50px) scale(1.1)}50%{transform:translate(-20px,20px) scale(.9)}75%{transform:translate(50px,50px) scale(1.05)}}.animate-blob-1[data-v-4f544e47]{animation:blob-4f544e47 25s infinite}.animate-blob-2[data-v-4f544e47]{animation:blob-4f544e47 30s infinite}.animate-blob-3[data-v-4f544e47]{animation:blob-4f544e47 35s infinite}.animate-blob-4[data-v-4f544e47]{animation:blob-4f544e47 40s infinite}.animate-spin-slow[data-v-4f544e47]{animation:spin-4f544e47 8s linear infinite}@keyframes spin-4f544e47{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.fade-enter-active[data-v-4f544e47],.fade-leave-active[data-v-4f544e47]{transition:opacity .3s ease}.fade-enter-from[data-v-4f544e47],.fade-leave-to[data-v-4f544e47]{opacity:0}.list-enter-active[data-v-4f544e47],.list-leave-active[data-v-4f544e47]{transition:all .5s ease}.list-enter-from[data-v-4f544e47],.list-leave-to[data-v-4f544e47]{opacity:0;transform:translate(30px)}.drawer-enter-active[data-v-4f544e47],.drawer-leave-active[data-v-4f544e47]{transition:transform .3s ease}.drawer-enter-from[data-v-4f544e47],.drawer-leave-to[data-v-4f544e47]{transform:translate(100%)}.w-97-100[data-v-4f544e47]{width:97%}[data-v-4f544e47] .prose{text-align:left}[data-v-4f544e47] .prose h1,[data-v-4f544e47] .prose h2,[data-v-4f544e47] .prose h3,[data-v-4f544e47] .prose h4,[data-v-4f544e47] .prose h5,[data-v-4f544e47] .prose h6{color:#4f46e5}@media (prefers-color-scheme: dark){[data-v-4f544e47] .prose h1,[data-v-4f544e47] .prose h2,[data-v-4f544e47] .prose h3,[data-v-4f544e47] .prose h4,[data-v-4f544e47] .prose h5,[data-v-4f544e47] .prose h6{color:#818cf8}}@media (min-width: 640px){.sm\:w-120[data-v-4f544e47]{width:30rem}}.custom-scrollbar[data-v-4f544e47]{scrollbar-width:thin;scrollbar-color:rgba(156,163,175,.3) transparent}.custom-scrollbar[data-v-4f544e47]::-webkit-scrollbar{width:6px;height:6px}.custom-scrollbar[data-v-4f544e47]::-webkit-scrollbar-track{background:transparent}.custom-scrollbar[data-v-4f544e47]::-webkit-scrollbar-thumb{background-color:#9ca3af4d;border-radius:3px;-webkit-transition:background-color .3s;transition:background-color .3s}.custom-scrollbar[data-v-4f544e47]::-webkit-scrollbar-thumb:hover{background-color:#9ca3af80}[data-v-4f544e47] [class*=dark] .custom-scrollbar{scrollbar-color:rgba(75,85,99,.3) transparent}[data-v-4f544e47] [class*=dark] .custom-scrollbar::-webkit-scrollbar-thumb{background-color:#4b55634d}[data-v-4f544e47] [class*=dark] .custom-scrollbar::-webkit-scrollbar-thumb:hover{background-color:#4b556380} diff --git a/themes/2024/assets/SendFileView-DGNuBZrN.js b/themes/2024/assets/SendFileView-DGNuBZrN.js deleted file mode 100644 index 4e6d0f3..0000000 --- a/themes/2024/assets/SendFileView-DGNuBZrN.js +++ /dev/null @@ -1,26 +0,0 @@ -import{c as L,d as de,r as I,o as ue,w as Te,a as _,b as e,e as C,_ as ge,u as Ie,f as Ae,g as x,n,h as r,i as $e,t as T,j as E,k as U,l as R,m as O,v as se,T as Q,F as J,p as De,q as ae,s as K,x as Fe,X as ne,y as Pe,z as je,A as V}from"./index-CgECfBL8.js";import{u as Be,S as le,C as Ue,c as Re,a as Ve,Q as Le,b as X,E as He}from"./clipboard-CHTS9sg2.js";import{F as ie}from"./file-kmEdX82y.js";import{T as qe}from"./trash-u1reBTUb.js";/** - * @license lucide-vue-next v0.445.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Y=L("ClipboardCopyIcon",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]]);/** - * @license lucide-vue-next v0.445.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ee=L("ClockIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** - * @license lucide-vue-next v0.445.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ne=L("CloudUploadIcon",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]]);/** - * @license lucide-vue-next v0.445.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const We=L("SendIcon",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/** - * @license lucide-vue-next v0.445.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ge=L("TerminalIcon",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]),Oe=de({__name:"BorderProgressBar",props:{progress:{}},setup($){const M=$,j=I(null),o=I(null);let u=null;const w=()=>{if(!u||!o.value||!j.value)return;const g=j.value.clientWidth,f=j.value.clientHeight;o.value.width=g,o.value.height=f;const d=4,l=8;u.lineWidth=d;const v=u.createLinearGradient(0,0,g,f);v.addColorStop(0,"#4f46e5"),v.addColorStop(.5,"#7c3aed"),v.addColorStop(1,"#db2777"),u.strokeStyle="rgba(229, 231, 235, 0.2)",k(u,d/2,d/2,g-d,f-d,l),u.stroke();const b=((g+f)*2-8*l+2*Math.PI*l)*M.progress/100;u.strokeStyle=v,u.lineCap="round",u.lineJoin="round",u.beginPath();let c=b;const m=d/2,z=g-d,D=f-d;if(c>0){const p=Math.min(z-2*l,c);u.moveTo(l+m,m),u.lineTo(p+l+m,m),c-=p}if(c>0){const p=Math.min(Math.PI/2,c/l);u.arc(z-l+m,l+m,l,-Math.PI/2,p-Math.PI/2,!1),c-=p*l}if(c>0){const p=Math.min(D-2*l,c);u.lineTo(z+m,p+l+m),c-=p}if(c>0){const p=Math.min(Math.PI/2,c/l);u.arc(z-l+m,D-l+m,l,0,p,!1),c-=p*l}if(c>0){const p=Math.min(z-2*l,c);u.lineTo(z-p-l+m,D+m),c-=p}if(c>0){const p=Math.min(Math.PI/2,c/l);u.arc(l+m,D-l+m,l,Math.PI/2,Math.PI/2+p,!1),c-=p*l}if(c>0){const p=Math.min(D-2*l,c);u.lineTo(m,D-p-l+m),c-=p}if(c>0){const p=Math.min(Math.PI/2,c/l);u.arc(l+m,l+m,l,Math.PI,Math.PI+p,!1)}u.stroke()};function k(g,f,d,l,v,y){g.beginPath(),g.moveTo(f+y,d),g.lineTo(f+l-y,d),g.arcTo(f+l,d,f+l,d+y,y),g.lineTo(f+l,d+v-y),g.arcTo(f+l,d+v,f+l-y,d+v,y),g.lineTo(f+y,d+v),g.arcTo(f,d+v,f,d+v-y,y),g.lineTo(f,d+y),g.arcTo(f,d,f+y,d,y),g.closePath()}return ue(()=>{o.value&&(u=o.value.getContext("2d"),w())}),Te(()=>M.progress,w),(g,f)=>(C(),_("div",{class:"border-progress-container",ref_key:"container",ref:j},[e("canvas",{ref_key:"canvas",ref:o,class:"border-progress-canvas"},null,512)],512))}}),Qe=ge(Oe,[["__scopeId","data-v-2fbf5085"]]),ce=$=>$>=1024*1024*1024?Math.round($/(1024*1024*1024))+"GB":$>=1024*1024?Math.round($/(1024*1024))+"MB":Math.round($/1024)+"KB",Je={class:"p-8"},Ke={class:"flex justify-center space-x-4 mb-6"},Xe={key:"file",class:"grid grid-cols-1 gap-8"},Ye={key:0,class:"absolute inset-0 w-full h-full"},Ze={class:"block truncate"},et={key:"text",class:"grid grid-cols-1 gap-8"},tt={key:0,class:"flex flex-col"},rt={class:"flex flex-col space-y-3"},ot={class:"relative flex-grow group"},st=["placeholder"],at=["value"],nt={type:"submit",class:"w-full bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 text-white font-bold py-4 px-6 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-opacity-50 transition-all duration-300 transform hover:scale-105 hover:shadow-lg relative overflow-hidden group"},lt={class:"relative z-10 flex items-center justify-center text-lg"},it={class:"mt-6 text-center"},ct={class:"flex-grow overflow-y-auto p-6"},dt={class:"flex-shrink-0 mr-4"},ut={class:"flex-grow min-w-0 mr-4"},gt={class:"flex-shrink-0 flex space-x-2"},pt=["onClick"],ht=["onClick"],ft=["onClick"],xt={key:0,class:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50 p-3 sm:p-4 overflow-y-auto"},mt={class:"flex items-center justify-between"},vt={class:"p-4 sm:p-6"},yt={class:"flex items-center mb-3 sm:mb-4"},bt={class:"ml-3 sm:ml-4 min-w-0 flex-1"},wt={class:"grid grid-cols-2 gap-3 sm:gap-4"},kt={class:"flex items-center min-w-0"},_t={class:"flex items-center min-w-0"},Ct={class:"grid grid-cols-1 md:grid-cols-2 gap-4 sm:gap-6"},St={class:"space-y-3 sm:space-y-4"},Mt={class:"bg-gradient-to-br from-indigo-500 to-purple-600 rounded-xl p-4 sm:p-5 text-white"},zt={class:"flex items-center justify-between mb-3 sm:mb-4"},Tt={class:"text-2xl sm:text-3xl font-bold tracking-wider text-center break-all"},It={class:"flex items-center justify-between mb-2 sm:mb-3"},At={class:"bg-white p-3 sm:p-4 rounded-lg shadow-sm mb-3 sm:mb-4"},$t=de({__name:"SendFileView",setup($){const M=JSON.parse(localStorage.getItem("config")||"{}"),j=je(),o=$e("isDarkMode"),u=Be(),w=I("file"),k=I(null),g=I(""),f=I(null),d=I("day"),l=I("1"),v=I(0),y=I(!1),b=I(null),c=Ie(),m=Ae(()=>u.shareData),z=I(""),D=()=>{var a;(a=f.value)==null||a.click()},p=async a=>{const t=a.target;if(t.files&&t.files.length>0){const i=t.files[0];if(k.value=i,!W())return;z.value=await N(i),console.log(z.value)}},pe=async a=>{var t;if((t=a.dataTransfer)!=null&&t.files&&a.dataTransfer.files.length>0){const i=a.dataTransfer.files[0];if(k.value=i,!W())return;z.value=await N(i)}},he=async a=>{var i;const t=(i=a.clipboardData)==null?void 0:i.items;if(t)for(const s of t)if(s.kind==="file"){const h=s.getAsFile();if(h){if(h.size===0){c.showAlert("无法读取空文件","error");return}if(h.type.startsWith("image/")){if(k.value=h,!W())return;try{z.value=await N(h),c.showAlert("已从剪贴板添加图片:"+h.name,"success")}catch(S){c.showAlert("文件处理失败","error"),console.error("File hash calculation failed:",S)}}else c.showAlert("目前仅支持粘贴图片文件","warning");break}}else w.value="text",t[0].getAsString(h=>{g.value+=h})},N=async a=>new Promise(t=>{const s=new FileReader;let h=0;const S=Math.ceil(a.size/2097152);s.onload=async F=>{const A=new Uint8Array(F.target.result);try{if(window.isSecureContext){const P=await crypto.subtle.digest("SHA-256",A),G=Array.from(new Uint8Array(P)).map(q=>q.toString(16).padStart(2,"0")).join("");h++,h
{if(!s._listeners)return;let o=s._listeners.length;for(;o-- >0;)s._listeners[o](r);s._listeners=null}),this.promise.then=r=>{let o;const i=new Promise(l=>{s.subscribe(l),o=l}).then(r);return i.cancel=function(){s.unsubscribe(o)},i},t(function(o,i,l){s.reason||(s.reason=new fn(o,i,l),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=s=>{t.abort(s)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Nc(function(r){t=r}),cancel:t}}};function yp(e){return function(n){return e.apply(null,n)}}function bp(e){return b.isObject(e)&&e.isAxiosError===!0}const Ar={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ar).forEach(([e,t])=>{Ar[t]=e});function Mc(e){const t=new $t(e),n=uc($t.prototype.request,t);return b.extend(n,$t.prototype,t,{allOwnKeys:!0}),b.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return Mc(Vt(e,r))},n}const he=Mc(Wn);he.Axios=$t;he.CanceledError=fn;he.CancelToken=gp;he.isCancel=Rc;he.VERSION=Ic;he.toFormData=js;he.AxiosError=J;he.Cancel=he.CanceledError;he.all=function(t){return Promise.all(t)};he.spread=yp;he.isAxiosError=bp;he.mergeConfig=Vt;he.AxiosHeaders=Le;he.formToJSON=e=>xc(b.isHTMLForm(e)?new FormData(e):e);he.getAdapter=Lc.getAdapter;he.HttpStatusCode=Ar;he.default=he;const{Axios:zp,AxiosError:Jp,CanceledError:Gp,isCancel:Xp,CancelToken:Qp,VERSION:Yp,all:Zp,Cancel:em,isAxiosError:tm,spread:nm,toFormData:sm,AxiosHeaders:rm,HttpStatusCode:om,formToJSON:im,getAdapter:lm,mergeConfig:cm}=he,_p="",kc=_p,Zr=he.create({baseURL:kc,timeout:1e15,headers:{"Content-Type":"application/json"}});Zr.interceptors.request.use(e=>{const t=localStorage.getItem("token");return t&&(e.headers.Authorization=`Bearer ${t}`),e.url&&!e.url.startsWith("http")&&(e.url=`${kc}/${e.url.replace(/^\//,"")}`),e},e=>Promise.reject(e));Zr.interceptors.response.use(e=>e.data,e=>{if(e.response)switch(e.response.status){case 401:console.error("未授权,请重新登录"),localStorage.clear(),window.location.href="/#/login";break;case 403:console.error("禁止访问");break;case 404:console.error("请求的资源不存在");break;default:console.error("发生错误:",e.response.data)}else e.request?console.error("未收到响应:",e.request):console.error("请求配置错误:",e.message);return Promise.reject(e)});const Fc=Tf("alert",{state:()=>({alerts:[]}),actions:{showAlert(e,t="info",n=5e3){const s=Date.now(),r=Date.now();this.alerts.push({id:s,message:e,type:t,progress:100,duration:n,startTime:r}),setTimeout(()=>this.removeAlert(s),n)},removeAlert(e){const t=this.alerts.findIndex(n=>n.id===e);t>-1&&this.alerts.splice(t,1)},updateAlertProgress(e){const t=this.alerts.find(n=>n.id===e);if(t){const s=100-(Date.now()-t.startTime)/t.duration*100;t.progress=Math.max(0,s),t.progress<=0&&this.removeAlert(e)}}}}),vp={class:"p-4"},wp={class:"flex items-start"},Ep={class:"flex-shrink-0"},Sp={class:"ml-3 flex-1 pt-0.5"},xp=["innerHTML"],Rp={class:"ml-4 flex-shrink-0 flex"},Cp=["onClick"],Tp={class:"h-1 bg-white bg-opacity-25"},Ap=Vn({__name:"AlertComponent",setup(e){const t=Fc(),{alerts:n}=Af(t),{removeAlert:s,updateAlertProgress:r}=t,o={success:"from-green-500 to-green-600",error:"from-red-500 to-red-600",warning:"from-yellow-500 to-yellow-600",info:"from-blue-500 to-blue-600"},i={success:Fd,error:$d,warning:kd,info:Dd};let l;return As(()=>{l=setInterval(()=>{n.value.forEach(c=>{r(c.id)})},100)}),qr(()=>{clearInterval(l)}),(c,u)=>(qe(),tn(lf,{name:"alert-fade",tag:"div",class:"fixed top-4 left-4 z-50 w-full sm:max-w-sm md:max-w-md space-y-4 px-4 sm:px-0"},{default:us(()=>[(qe(!0),Nn(He,null,Va(Oe(n),a=>(qe(),Nn("div",{key:a.id,class:an(["w-full rounded-lg shadow-xl overflow-hidden","bg-gradient-to-r",o[a.type]])},[ke("div",vp,[ke("div",wp,[ke("div",Ep,[(qe(),tn(ml(i[a.type]),{class:"h-6 w-6 text-white"}))]),ke("div",Sp,[ke("p",{class:"text-sm font-medium text-white",innerHTML:a.message},null,8,xp)]),ke("div",Rp,[ke("button",{onClick:f=>Oe(s)(a.id),class:"inline-flex text-white hover:text-gray-200 focus:outline-none transition-colors duration-200"},[u[0]||(u[0]=ke("span",{class:"sr-only"},"关闭",-1)),me(Oe(Hd),{class:"h-5 w-5"})],8,Cp)])])]),ke("div",Tp,[ke("div",{class:"h-full bg-white transition-all duration-100 ease-out",style:Es({width:`${a.progress}%`})},null,4)])],2))),128))]),_:1}))}}),Op=(e,t)=>{const n=e.__vccOpts||e;for(const[s,r]of t)n[s]=r;return n},Pp=Op(Ap,[["__scopeId","data-v-6fdbaa84"]]),Lp={key:0,class:"loading-overlay"},Ip=Vn({__name:"App",setup(e){const t=en(!1),n=en(!1),s=Id(),r=Fc(),o=()=>window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches,i=()=>{const c=localStorage.getItem("colorMode");return c?c==="dark":null},l=c=>{t.value=c,localStorage.setItem("colorMode",c?"dark":"light")};return As(()=>{const c=i();l(c!==null?c:o()),Zr.post("/",{}).then(u=>{u.code===200&&(localStorage.setItem("config",JSON.stringify(u.detail)),u.detail.notify_title&&u.detail.notify_content&&localStorage.getItem("notify")!==u.detail.notify_title+u.detail.notify_content&&(localStorage.setItem("notify",u.detail.notify_title+u.detail.notify_content),r.showAlert(u.detail.notify_title+": "+u.detail.notify_content,"success")))})}),fu(()=>{document.documentElement.classList.toggle("dark",t.value)}),s.beforeEach((c,u,a)=>{n.value=!0,a()}),s.afterEach(()=>{setTimeout(()=>{n.value=!1},200)}),Bt("isDarkMode",t),Bt("setColorMode",l),Bt("isLoading",n),(c,u)=>(qe(),Nn("div",{class:an(["app-container",t.value?"dark":"light"])},[me(Ud,{modelValue:t.value,"onUpdate:modelValue":u[0]||(u[0]=a=>t.value=a)},null,8,["modelValue"]),n.value?(qe(),Nn("div",Lp,u[1]||(u[1]=[ke("div",{class:"loading-spinner"},null,-1)]))):xu("",!0),me(Oe(ac),null,{default:us(({Component:a})=>[me($u,{name:"fade",mode:"out-in"},{default:us(()=>[(qe(),tn(ml(a),{key:c.$route.fullPath}))]),_:2},1024)]),_:1}),me(Pp)],2))}}),Np="modulepreload",Mp=function(e){return"/"+e},Ei={},Mt=function(t,n,s){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),l=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));r=Promise.allSettled(n.map(c=>{if(c=Mp(c),c in Ei)return;Ei[c]=!0;const u=c.endsWith(".css"),a=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${a}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":Np,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((p,m)=>{f.addEventListener("load",p),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${c}`)))})}))}function o(i){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=i,window.dispatchEvent(l),!l.defaultPrevented)throw i}return r.then(i=>{for(const l of i||[])l.status==="rejected"&&o(l.reason);return t().catch(o)})},kp=()=>Mt(()=>import("./SendFileView-DGNuBZrN.js"),__vite__mapDeps([0,1,2,3,4])),Fp=Pd({history:id("/"),routes:[{path:"/",name:"Retrieve",component:()=>Mt(()=>import("./RetrievewFileView-B7zOwXdR.js"),__vite__mapDeps([5,1,6,2,7,3,8]))},{path:"/send",name:"Send",component:kp},{path:"/admin",name:"Manage",component:()=>Mt(()=>import("./AdminLayout-D-tzisCa.js"),__vite__mapDeps([9,6,10])),redirect:"/admin/dashboard",children:[{path:"/admin/dashboard",name:"Dashboard",component:()=>Mt(()=>import("./DashboardView-wb2hNhNX.js"),__vite__mapDeps([11,2,7]))},{path:"/admin/files",name:"FileManage",component:()=>Mt(()=>import("./FileManageView-DneuSVD7.js"),__vite__mapDeps([12,2,3,13]))},{path:"/admin/settings",name:"Settings",component:()=>Mt(()=>import("./SystemSettingsView-ClMONiWZ.js"),[])}]},{path:"/login",name:"Login",component:()=>Mt(()=>import("./LoginView-9m1c7olD.js"),__vite__mapDeps([14,6,15]))}]}),eo=bf(Ip);eo.use(wf());eo.use(Fp);eo.mount("#app");export{Zr as A,Af as B,qp as C,nn as D,fl as E,He as F,Tf as G,Hn as H,qr as I,tn as J,ml as K,Vp as L,$p as M,$u as T,Hd as X,Op as _,Nn as a,ke as b,qt as c,Vn as d,qe as e,Fe as f,me as g,Oe as h,Pe as i,Up as j,us as k,xu as l,Dp as m,an as n,As as o,Hp as p,Va as q,en as r,Su as s,Xc as t,Fc as u,Bp as v,Sn as w,jp as x,lf as y,Id as z}; diff --git a/themes/2024/assets/trash-u1reBTUb.js b/themes/2024/assets/trash-u1reBTUb.js deleted file mode 100644 index 894b9ea..0000000 --- a/themes/2024/assets/trash-u1reBTUb.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c}from"./index-CgECfBL8.js";/** - * @license lucide-vue-next v0.445.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const e=c("TrashIcon",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]);export{e as T}; diff --git a/themes/2024/index.html b/themes/2024/index.html index bdaf9f0..ec43614 100644 --- a/themes/2024/index.html +++ b/themes/2024/index.html @@ -12,7 +12,7 @@