Files
filecodebox/themes/2024/assets/FileManageView-Bevef92J.js
T

32 lines
23 KiB
Python

import{c as P,d as E,a as x,o as y,n as o,e as t,i as U,b as e,K as H,t as s,y as F,D as A,g as j,l as c,E as b,u as te,r as _,p as oe,j as V,x as k,z as M,Y as ae,v as q,Z as L}from"./index-B9FIg8c4.js";import{C as ie}from"./copy-ClIbpnbK.js";import{F as se}from"./file-CSeBUDan.js";import{E as re,T as ne}from"./trash-DPD8vC5o.js";/**
* @license lucide-vue-next v0.535.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const C=P("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
* @license lucide-vue-next v0.535.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const le=P("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
* @license lucide-vue-next v0.535.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const de=P("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
* @license lucide-vue-next v0.535.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=P("file-text",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
* @license lucide-vue-next v0.535.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const I=P("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
* @license lucide-vue-next v0.535.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const K=P("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),ce={class:"overflow-x-auto"},ue=E({__name:"DataTable",props:{title:{},headers:{}},setup(T){const h=U("isDarkMode");return(i,a)=>(y(),x("div",{class:o(["rounded-lg shadow-sm overflow-hidden transition-all duration-300",[t(h)?"bg-gray-800 bg-opacity-70":"bg-white"]])},[e("div",{class:o(["px-6 py-4 border-b",[t(h)?"border-gray-700":"border-gray-200"]])},[e("h3",{class:o(["text-lg font-medium",[t(h)?"text-white":"text-gray-800"]])},s(i.title),3)],2),e("div",ce,[e("table",{class:o(["min-w-full divide-y",[t(h)?"divide-gray-700":"divide-gray-200"]])},[e("thead",{class:o([t(h)?"bg-gray-900/50":"bg-gray-50"])},[e("tr",null,[(y(!0),x(F,null,A(i.headers,v=>(y(),x("th",{key:v,class:o(["px-6 py-3.5 text-left text-xs font-medium uppercase tracking-wider",[t(h)?"text-gray-400":"text-gray-500"]])},s(v),3))),128))])],2),e("tbody",{class:o([t(h)?"bg-gray-800/50 divide-y divide-gray-700":"bg-white divide-y divide-gray-200"])},[H(i.$slots,"body")],2)],2)]),H(i.$slots,"footer")],2))}}),pe={class:"flex items-center space-x-2"},xe=["disabled"],ye={class:"flex items-center space-x-1"},he=["onClick"],fe=["disabled"],me=E({__name:"DataPagination",props:{currentPage:{},pageSize:{},total:{}},emits:["page-change"],setup(T){const h=T,i=U("isDarkMode"),a=j(()=>Math.ceil(h.total/h.pageSize)),v=j(()=>{const d=h.currentPage,p=a.value,g=2,f=[];f.push(1);const u=Math.max(2,d-g),w=Math.min(p-1,d+g);u>2&&f.push("...");for(let m=u;m<=w;m++)f.push(m);return w<p-1&&f.push("..."),p>1&&f.push(p),f});return(d,p)=>(y(),x("div",{class:o(["mt-4 flex items-center justify-between px-6 py-4 border-t",[t(i)?"border-gray-700":"border-gray-200"]])},[e("div",{class:o(["flex items-center text-sm",[t(i)?"text-gray-400":"text-gray-500"]])}," 显示第 "+s((d.currentPage-1)*d.pageSize+1)+" 到 "+s(Math.min(d.currentPage*d.pageSize,d.total))+" 条,共 "+s(d.total)+" 条 ",3),e("div",pe,[e("button",{onClick:p[0]||(p[0]=g=>d.$emit("page-change",d.currentPage-1)),disabled:d.currentPage===1,class:o(["inline-flex items-center px-3 py-1.5 rounded-md transition-colors duration-200",[t(i)?d.currentPage===1?"bg-gray-800 text-gray-600 cursor-not-allowed":"bg-gray-800 text-gray-300 hover:bg-gray-700":d.currentPage===1?"bg-gray-100 text-gray-400 cursor-not-allowed":"bg-gray-100 text-gray-700 hover:bg-gray-200"]])},[c(t(de),{class:"w-4 h-4"}),p[2]||(p[2]=b(" 上一页 ",-1))],10,xe),e("div",ye,[(y(!0),x(F,null,A(v.value,g=>(y(),x(F,{key:g},[g!=="..."?(y(),x("button",{key:0,onClick:f=>d.$emit("page-change",g),class:o(["inline-flex items-center px-3 py-1.5 rounded-md transition-colors duration-200",[d.currentPage===g?"bg-indigo-600 text-white":t(i)?"bg-gray-800 text-gray-300 hover:bg-gray-700":"bg-gray-100 text-gray-700 hover:bg-gray-200"]])},s(g),11,he)):(y(),x("span",{key:1,class:o(["px-2",[t(i)?"text-gray-400":"text-gray-500"]])}," ... ",2))],64))),128))]),e("button",{onClick:p[1]||(p[1]=g=>d.$emit("page-change",d.currentPage+1)),disabled:d.currentPage>=a.value,class:o(["inline-flex items-center px-3 py-1.5 rounded-md transition-colors duration-200",[t(i)?d.currentPage>=a.value?"bg-gray-800 text-gray-600 cursor-not-allowed":"bg-gray-800 text-gray-300 hover:bg-gray-700":d.currentPage>=a.value?"bg-gray-100 text-gray-400 cursor-not-allowed":"bg-gray-100 text-gray-700 hover:bg-gray-200"]])},[p[3]||(p[3]=b(" 下一页 ",-1)),c(t(le),{class:"w-4 h-4"})],10,fe)])],2))}}),be={class:"p-6 overflow-y-auto custom-scrollbar"},ve={class:"mb-8"},we={class:"flex flex-1 gap-4 w-full sm:w-auto"},_e={class:"relative flex-1"},ke=["placeholder"],Me={class:"px-6 py-4 whitespace-nowrap"},Ce={class:"flex items-center"},Pe={class:"px-6 py-4"},$e={class:"flex items-center group relative"},Se=["title"],ze={class:"absolute left-0 -top-2 -translate-y-full opacity-0 group-hover:opacity-100 transition-opacity duration-200 pointer-events-none"},Fe={class:"bg-gray-900 text-white text-sm rounded px-2 py-1 max-w-xs break-all"},je={class:"px-6 py-4 whitespace-nowrap"},Te={class:"px-6 py-4"},De={class:"flex items-center gap-2"},Ve=["onClick"],Le={class:"px-6 py-4 whitespace-nowrap"},Ee={class:"px-6 py-4 whitespace-nowrap text-right text-sm font-medium"},Ue={class:"flex items-center space-x-2"},Ae=["onClick"],Be=["onClick"],He={key:0,class:"fixed inset-0 z-50","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true"},qe={class:"fixed inset-0 z-10 overflow-y-auto"},Ie={class:"flex min-h-full items-center justify-center p-4 text-center sm:p-0"},Ke={class:"flex items-center justify-between"},Ye={class:"flex items-center space-x-3"},Ze={class:"px-6 py-5"},Re={class:"grid gap-6"},Ge={class:"space-y-2 group"},Je={class:"relative rounded-lg shadow-sm"},Ne=["placeholder"],Oe={class:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none transition-opacity duration-200 opacity-0 group-focus-within:opacity-100"},Qe={class:"space-y-2 group"},We={class:"relative rounded-lg shadow-sm"},Xe=["placeholder"],et={class:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none transition-opacity duration-200 opacity-0 group-focus-within:opacity-100"},tt={class:"space-y-2 group"},ot={class:"relative rounded-lg shadow-sm"},at=["placeholder"],it={class:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none transition-opacity duration-200 opacity-0 group-focus-within:opacity-100"},st={class:"space-y-2 group"},rt={class:"relative rounded-lg shadow-sm"},nt={class:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none transition-opacity duration-200 opacity-0 group-focus-within:opacity-100"},lt={class:"space-y-2 group"},dt={class:"relative rounded-lg shadow-sm"},gt=["placeholder"],ct={class:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none transition-opacity duration-200 opacity-0 group-focus-within:opacity-100"},ut={key:1,class:"fixed inset-0 z-50","aria-labelledby":"text-preview-title",role:"dialog","aria-modal":"true"},pt={class:"fixed inset-0 z-10 overflow-y-auto"},xt={class:"flex min-h-full items-center justify-center p-4 text-center sm:p-0"},yt={class:"flex items-center justify-between"},ht={class:"flex items-center space-x-3"},ft={class:"px-6 py-4"},_t=E({__name:"FileManageView",setup(T){function h(n){const l=new Date(n),r=l.getFullYear(),z=(l.getMonth()+1).toString().padStart(2,"0"),Q=l.getDate().toString().padStart(2,"0"),W=l.getHours().toString().padStart(2,"0"),X=l.getMinutes().toString().padStart(2,"0"),ee=l.getSeconds().toString().padStart(2,"0");return`${r}-${z}-${Q} ${W}:${X}:${ee}`}const{t:i}=te(),a=U("isDarkMode"),v=_([]),d=oe(),p=j(()=>[i("fileManage.headers.code"),i("fileManage.headers.name"),i("fileManage.headers.size"),i("fileManage.headers.description"),i("fileManage.headers.expiration"),i("fileManage.headers.actions")]),g=_({page:1,size:10,total:0,keyword:""}),f=_(!1),u=_({id:null,code:"",prefix:"",suffix:"",expired_at:"",expired_count:null}),w=_(!1),m=_(""),Y=n=>{m.value=n,w.value=!0},D=()=>{w.value=!1,m.value=""},Z=async()=>{try{await navigator.clipboard.writeText(m.value),d.showAlert(i("fileManage.copySuccess"),"success")}catch{d.showAlert(i("fileManage.copyFailed"),"error")}},R=n=>{u.value={id:n.id,code:n.code,prefix:n.prefix,suffix:n.suffix,expired_at:n.expired_at?n.expired_at.slice(0,16):"",expired_count:n.expired_count},f.value=!0},S=()=>{f.value=!1,u.value={id:null,code:"",prefix:"",suffix:"",expired_at:"",expired_count:null}},G=async()=>{try{await L.updateFile(u.value),await $(),S()}catch(n){const l=n;d.showAlert(l.response?.data?.detail||i("manage.fileManage.updateFailed"),"error")}},J=async n=>{try{await L.deleteAdminFile(n),await $()}catch(l){console.error(i("manage.fileManage.deleteFailed"),l)}},$=async()=>{try{const n=await L.getAdminFileList(g.value);n.detail&&(v.value=n.detail.data,g.value.total=n.detail.total)}catch(n){console.error(i("manage.fileManage.loadFileListFailed"),n)}},N=async n=>{typeof n!="string"&&(n<1||n>O.value||(g.value.page=n,await $()))};$();const O=j(()=>Math.ceil(g.value.total/g.value.size)),B=async()=>{g.value.page=1,await $()};return(n,l)=>(y(),x("div",be,[e("div",ve,[e("h2",{class:o(["text-2xl font-bold mb-4",[t(a)?"text-white":"text-gray-800"]])},s(t(i)("fileManage.title")),3)]),e("div",{class:o(["mb-6 flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between bg-opacity-70 p-4 rounded-lg shadow-sm",[t(a)?"bg-gray-800":"bg-white"]])},[e("div",we,[e("div",_e,[k(e("input",{type:"text","onUpdate:modelValue":l[0]||(l[0]=r=>g.value.keyword=r),onKeyup:ae(B,["enter"]),class:o([t(a)?"bg-gray-700 border-gray-600 text-white placeholder-gray-400":"bg-white border-gray-300 text-gray-900 placeholder-gray-400","w-full pl-10 pr-4 py-2.5 rounded-lg border focus:ring-2 focus:ring-indigo-500 focus:border-transparent"]),placeholder:t(i)("fileManage.searchPlaceholder")},null,42,ke),[[M,g.value.keyword]]),c(t(K),{class:o(["absolute left-3 top-3 w-5 h-5",[t(a)?"text-gray-400":"text-gray-500"]])},null,8,["class"])]),e("button",{onClick:B,class:"px-4 py-2.5 rounded-lg inline-flex items-center transition-all duration-200 bg-indigo-600 hover:bg-indigo-700 text-white shadow-sm"},[c(t(K),{class:"w-5 h-5 mr-2"}),b(" "+s(t(i)("common.search")),1)])])],2),c(ue,{title:t(i)("fileManage.allFiles"),headers:p.value},{body:q(()=>[(y(!0),x(F,null,A(v.value,r=>(y(),x("tr",{key:r.id,class:o(["hover:bg-opacity-50 transition-colors duration-200",[t(a)?"hover:bg-gray-700":"hover:bg-gray-50"]])},[e("td",Me,[e("div",Ce,[e("span",{class:o(["font-medium select-all",[t(a)?"text-white":"text-gray-900"]])},s(r.code),3)])]),e("td",Pe,[e("div",$e,[c(t(se),{class:o(["w-5 h-5 mr-2 flex-shrink-0",[t(a)?"text-indigo-400":"text-indigo-500"]])},null,8,["class"]),e("span",{class:o(["font-medium truncate max-w-[200px]",[t(a)?"text-white":"text-gray-900"]]),title:r.prefix},s(r.prefix),11,Se),e("div",ze,[e("div",Fe,s(r.prefix),1)])])]),e("td",je,[e("span",{class:o(["inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",[t(a)?"bg-gray-700 text-gray-300":"bg-gray-100 text-gray-800"]])},s(Math.round(r.size/1024/1024*100)/100)+"MB ",3)]),e("td",Te,[e("div",De,[e("span",{class:o(["block truncate max-w-[200px]",[t(a)?"text-gray-400":"text-gray-500"]])},s(r.text||"-"),3),r.text&&r.text.length>30?(y(),x("button",{key:0,onClick:z=>Y(r.text),class:o(["flex-shrink-0 inline-flex items-center px-2 py-1 rounded text-xs transition-colors duration-200",[t(a)?"bg-gray-700 text-gray-300 hover:bg-gray-600 hover:text-white":"bg-gray-100 text-gray-600 hover:bg-gray-200"]])},[c(t(re),{class:"w-3 h-3 mr-1"}),b(" "+s(t(i)("fileManage.viewText")),1)],10,Ve)):V("",!0)])]),e("td",Le,[e("span",{class:o(["inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",[r.expired_at?t(a)?"bg-yellow-900/30 text-yellow-400":"bg-yellow-100 text-yellow-800":t(a)?"bg-green-900/30 text-green-400":"bg-green-100 text-green-800"]])},s(r.expired_at?h(r.expired_at):t(i)("send.expiration.units.forever")),3)]),e("td",Ee,[e("div",Ue,[e("button",{onClick:z=>R(r),class:o(["inline-flex items-center px-3 py-1.5 rounded-md transition-colors duration-200",[t(a)?"bg-blue-900/20 text-blue-400 hover:bg-blue-900/30":"bg-blue-50 text-blue-600 hover:bg-blue-100"]])},[c(t(I),{class:"w-4 h-4 mr-1.5"}),b(" "+s(t(i)("common.edit")),1)],10,Ae),e("button",{onClick:z=>J(r.id),class:o(["inline-flex items-center px-3 py-1.5 rounded-md transition-colors duration-200",[t(a)?"bg-red-900/20 text-red-400 hover:bg-red-900/30":"bg-red-50 text-red-600 hover:bg-red-100"]])},[c(t(ne),{class:"w-4 h-4 mr-1.5"}),b(" "+s(t(i)("common.delete")),1)],10,Be)])])],2))),128))]),footer:q(()=>[c(me,{"current-page":g.value.page,"page-size":g.value.size,total:g.value.total,onPageChange:N},null,8,["current-page","page-size","total"])]),_:1},8,["title","headers"]),f.value?(y(),x("div",He,[e("div",{class:"fixed inset-0 bg-gradient-to-br from-gray-900/90 to-black/90 backdrop-blur-sm transition-opacity duration-300",onClick:S}),e("div",qe,[e("div",Ie,[e("div",{class:o(["relative transform overflow-hidden rounded-2xl text-left shadow-2xl transition-all sm:my-8 sm:w-full sm:max-w-xl animate-modal-scale",[t(a)?"bg-gray-800/95 backdrop-blur-md":"bg-white"]])},[e("div",{class:o(["relative px-6 pt-6 pb-4",[t(a)?"bg-gradient-to-r from-gray-800/50 to-gray-700/50":"bg-gradient-to-r from-gray-50 to-white"]])},[e("div",Ke,[e("div",Ye,[e("div",{class:o(["p-2 rounded-lg",[t(a)?"bg-indigo-500/10":"bg-indigo-50"]])},[c(t(I),{class:o(["w-5 h-5",[t(a)?"text-indigo-400":"text-indigo-600"]])},null,8,["class"])],2),e("h3",{class:o(["text-xl font-semibold leading-6",[t(a)?"text-white":"text-gray-900"]])},s(t(i)("fileManage.editFileInfo")),3)]),e("button",{onClick:S,class:o(["rounded-lg p-2 transition-all duration-200 hover:rotate-90",[t(a)?"text-gray-400 hover:text-white hover:bg-white/10":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"]])},[...l[6]||(l[6]=[e("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)])],2)])],2),e("div",Ze,[e("div",Re,[e("div",Ge,[e("label",{class:o(["text-sm font-medium flex items-center space-x-2 transition-colors duration-200",[t(a)?"text-gray-300 group-focus-within:text-indigo-400":"text-gray-700 group-focus-within:text-indigo-600"]])},[e("span",null,s(t(i)("fileManage.form.code")),1),e("div",{class:o(["h-px flex-1 transition-colors duration-200",[t(a)?"bg-gray-700 group-focus-within:bg-indigo-500/50":"bg-gray-200 group-focus-within:bg-indigo-500/30"]])},null,2)],2),e("div",Je,[k(e("input",{type:"text","onUpdate:modelValue":l[1]||(l[1]=r=>u.value.code=r),class:o(["block w-full rounded-lg border-0 py-2.5 pl-4 pr-10 transition-all duration-200 focus:ring-2 focus:ring-inset sm:text-sm",[t(a)?"bg-gray-700/50 text-white placeholder-gray-400 focus:ring-indigo-500/50":"bg-gray-50 text-gray-900 placeholder-gray-400 focus:ring-indigo-500"]]),placeholder:t(i)("fileManage.form.codePlaceholder")},null,10,Ne),[[M,u.value.code]]),e("div",Oe,[c(t(C),{class:o(["w-5 h-5",[t(a)?"text-indigo-400":"text-indigo-600"]])},null,8,["class"])])])]),e("div",Qe,[e("label",{class:o(["text-sm font-medium flex items-center space-x-2 transition-colors duration-200",[t(a)?"text-gray-300 group-focus-within:text-indigo-400":"text-gray-700 group-focus-within:text-indigo-600"]])},[e("span",null,s(t(i)("fileManage.form.filename")),1),e("div",{class:o(["h-px flex-1 transition-colors duration-200",[t(a)?"bg-gray-700 group-focus-within:bg-indigo-500/50":"bg-gray-200 group-focus-within:bg-indigo-500/30"]])},null,2)],2),e("div",We,[k(e("input",{type:"text","onUpdate:modelValue":l[2]||(l[2]=r=>u.value.prefix=r),class:o(["block w-full rounded-lg border-0 py-2.5 pl-4 pr-10 transition-all duration-200 focus:ring-2 focus:ring-inset sm:text-sm",[t(a)?"bg-gray-700/50 text-white placeholder-gray-400 focus:ring-indigo-500/50":"bg-gray-50 text-gray-900 placeholder-gray-400 focus:ring-indigo-500"]]),placeholder:t(i)("fileManage.form.filenamePlaceholder")},null,10,Xe),[[M,u.value.prefix]]),e("div",et,[c(t(C),{class:o(["w-5 h-5",[t(a)?"text-indigo-400":"text-indigo-600"]])},null,8,["class"])])])]),e("div",tt,[e("label",{class:o(["text-sm font-medium flex items-center space-x-2 transition-colors duration-200",[t(a)?"text-gray-300 group-focus-within:text-indigo-400":"text-gray-700 group-focus-within:text-indigo-600"]])},[e("span",null,s(t(i)("fileManage.form.suffix")),1),e("div",{class:o(["h-px flex-1 transition-colors duration-200",[t(a)?"bg-gray-700 group-focus-within:bg-indigo-500/50":"bg-gray-200 group-focus-within:bg-indigo-500/30"]])},null,2)],2),e("div",ot,[k(e("input",{type:"text","onUpdate:modelValue":l[3]||(l[3]=r=>u.value.suffix=r),class:o(["block w-full rounded-lg border-0 py-2.5 pl-4 pr-10 transition-all duration-200 focus:ring-2 focus:ring-inset sm:text-sm",[t(a)?"bg-gray-700/50 text-white placeholder-gray-400 focus:ring-indigo-500/50":"bg-gray-50 text-gray-900 placeholder-gray-400 focus:ring-indigo-500"]]),placeholder:t(i)("fileManage.form.suffixPlaceholder")},null,10,at),[[M,u.value.suffix]]),e("div",it,[c(t(C),{class:o(["w-5 h-5",[t(a)?"text-indigo-400":"text-indigo-600"]])},null,8,["class"])])])]),e("div",st,[e("label",{class:o(["text-sm font-medium flex items-center space-x-2 transition-colors duration-200",[t(a)?"text-gray-300 group-focus-within:text-indigo-400":"text-gray-700 group-focus-within:text-indigo-600"]])},[e("span",null,s(t(i)("send.expiration.label")),1),e("div",{class:o(["h-px flex-1 transition-colors duration-200",[t(a)?"bg-gray-700 group-focus-within:bg-indigo-500/50":"bg-gray-200 group-focus-within:bg-indigo-500/30"]])},null,2)],2),e("div",rt,[k(e("input",{type:"datetime-local","onUpdate:modelValue":l[4]||(l[4]=r=>u.value.expired_at=r),class:o(["block w-full rounded-lg border-0 py-2.5 pl-4 pr-10 transition-all duration-200 focus:ring-2 focus:ring-inset sm:text-sm",[t(a)?"bg-gray-700/50 text-white placeholder-gray-400 focus:ring-indigo-500/50":"bg-gray-50 text-gray-900 placeholder-gray-400 focus:ring-indigo-500"]])},null,2),[[M,u.value.expired_at]]),e("div",nt,[c(t(C),{class:o(["w-5 h-5",[t(a)?"text-indigo-400":"text-indigo-600"]])},null,8,["class"])])])]),e("div",lt,[e("label",{class:o(["text-sm font-medium flex items-center space-x-2 transition-colors duration-200",[t(a)?"text-gray-300 group-focus-within:text-indigo-400":"text-gray-700 group-focus-within:text-indigo-600"]])},[e("span",null,s(t(i)("fileManage.form.downloadLimit")),1),e("div",{class:o(["h-px flex-1 transition-colors duration-200",[t(a)?"bg-gray-700 group-focus-within:bg-indigo-500/50":"bg-gray-200 group-focus-within:bg-indigo-500/30"]])},null,2)],2),e("div",dt,[k(e("input",{type:"number","onUpdate:modelValue":l[5]||(l[5]=r=>u.value.expired_count=r),class:o(["block w-full rounded-lg border-0 py-2.5 pl-4 pr-10 transition-all duration-200 focus:ring-2 focus:ring-inset sm:text-sm",[t(a)?"bg-gray-700/50 text-white placeholder-gray-400 focus:ring-indigo-500/50":"bg-gray-50 text-gray-900 placeholder-gray-400 focus:ring-indigo-500"]]),placeholder:t(i)("fileManage.form.downloadLimitPlaceholder")},null,10,gt),[[M,u.value.expired_count]]),e("div",ct,[c(t(C),{class:o(["w-5 h-5",[t(a)?"text-indigo-400":"text-indigo-600"]])},null,8,["class"])])])])])]),e("div",{class:o(["flex items-center justify-end gap-3 px-6 py-4 border-t bg-gradient-to-b",[t(a)?"border-gray-700/50 from-gray-800/50 to-gray-800":"border-gray-200 from-gray-50 to-white"]])},[e("button",{onClick:S,class:o(["inline-flex items-center justify-center rounded-lg px-4 py-2.5 text-sm font-medium transition-all duration-200",[t(a)?"bg-gray-700/50 text-gray-300 hover:bg-gray-600/50 hover:text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"]])},s(t(i)("common.cancel")),3),e("button",{onClick:G,class:"inline-flex items-center justify-center rounded-lg px-4 py-2.5 text-sm font-medium transition-all duration-200 bg-gradient-to-r from-indigo-600 to-indigo-500 hover:from-indigo-500 hover:to-indigo-600 text-white shadow-lg shadow-indigo-500/25 hover:shadow-indigo-500/35"},[c(t(C),{class:"w-4 h-4 mr-2"}),b(" "+s(t(i)("fileManage.saveChanges")),1)])],2)],2)])])])):V("",!0),w.value?(y(),x("div",ut,[e("div",{class:"fixed inset-0 bg-gradient-to-br from-gray-900/90 to-black/90 backdrop-blur-sm transition-opacity duration-300",onClick:D}),e("div",pt,[e("div",xt,[e("div",{class:o(["relative transform overflow-hidden rounded-2xl text-left shadow-2xl transition-all sm:my-8 sm:w-full sm:max-w-2xl animate-modal-scale",[t(a)?"bg-gray-800/95 backdrop-blur-md":"bg-white"]])},[e("div",{class:o(["relative px-6 pt-6 pb-4",[t(a)?"bg-gradient-to-r from-gray-800/50 to-gray-700/50":"bg-gradient-to-r from-gray-50 to-white"]])},[e("div",yt,[e("div",ht,[e("div",{class:o(["p-2 rounded-lg",[t(a)?"bg-indigo-500/10":"bg-indigo-50"]])},[c(t(ge),{class:o(["w-5 h-5",[t(a)?"text-indigo-400":"text-indigo-600"]])},null,8,["class"])],2),e("h3",{class:o(["text-xl font-semibold leading-6",[t(a)?"text-white":"text-gray-900"]])},s(t(i)("fileManage.textPreview")),3)]),e("button",{onClick:D,class:o(["rounded-lg p-2 transition-all duration-200 hover:rotate-90",[t(a)?"text-gray-400 hover:text-white hover:bg-white/10":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"]])},[...l[7]||(l[7]=[e("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)])],2)])],2),e("div",ft,[e("div",{class:o(["max-h-[60vh] overflow-y-auto rounded-lg p-4 custom-scrollbar",[t(a)?"bg-gray-700/50":"bg-gray-50"]])},[e("pre",{class:o(["whitespace-pre-wrap break-words text-sm font-mono",[t(a)?"text-gray-200":"text-gray-700"]])},s(m.value),3)],2),e("div",{class:o(["mt-2 text-xs",[t(a)?"text-gray-500":"text-gray-400"]])},s(t(i)("fileManage.charCount",{count:m.value.length})),3)]),e("div",{class:o(["flex items-center justify-end gap-3 px-6 py-4 border-t",[t(a)?"border-gray-700/50":"border-gray-200"]])},[e("button",{onClick:Z,class:o(["inline-flex items-center justify-center rounded-lg px-4 py-2.5 text-sm font-medium transition-all duration-200",[t(a)?"bg-gray-700/50 text-gray-300 hover:bg-gray-600/50 hover:text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"]])},[c(t(ie),{class:"w-4 h-4 mr-2"}),b(" "+s(t(i)("fileManage.copyText")),1)],2),e("button",{onClick:D,class:"inline-flex items-center justify-center rounded-lg px-4 py-2.5 text-sm font-medium transition-all duration-200 bg-gradient-to-r from-indigo-600 to-indigo-500 hover:from-indigo-500 hover:to-indigo-600 text-white shadow-lg shadow-indigo-500/25 hover:shadow-indigo-500/35"},s(t(i)("common.close")),1)],2)],2)])])])):V("",!0)]))}});export{_t as default};