2 lines
7.7 KiB
JavaScript
2 lines
7.7 KiB
JavaScript
|
|
import{w as p,C as $,as as b,i as A,h as E,m as g,l as W,x as K,c as X}from"./index-BTglIPU2.js?v=1773287522785";import{_ as Z}from"./index-BRQskX9P.js?v=1773287522785";import{c as G}from"./copy-D-wIKr0q.js?v=1773287522785";import{u as J}from"./useTableColumns-DDeyYvje.js?v=1773287522785";import{W as Q,F as Y}from"./FileIcon-eIHDRaxH.js?v=1773287522785";import{a9 as x,$ as ee,b as te,a0 as se,n as ie,b4 as oe,at as le}from"./naive-ui--dJnpVcV.js?v=1773287522785";import{k as ne,R as ae,i as re,r as _,c as pe,a0 as l,F as de,aw as ue,$ as w,a8 as _e,a9 as r,_ as e,S as i,X as k,aa as t,j as ce,l as me,Z as fe}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";import"./index-S15tYq5l.js?v=1773287522785";import"./index-DIKmrNCq.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-DeTfbeeM.js?v=1773287522785";import"./index-Cg6fMjw6.js?v=1773287522785";import"./soft-Cjyfamvm.js?v=1773287522785";const ve={class:"properties-wrapper"},he={class:"content"},$e={class:"info-group"},ge={class:"info-item h-60px"},ye={class:"info-item-label"},be={class:"info-item-value"},we={class:"w-360px"},ke={class:"my-10px"},Ce={class:"info-group"},Te={class:"info-item"},ze={class:"info-item-label"},Fe={class:"info-item-value"},Ne={class:"info-item"},Ie={class:"info-item-label"},Pe={class:"info-item-value flex"},Be={class:"max-w-300px"},De={class:"info-item",style:{"margin-bottom":"0"}},He={class:"info-item-label"},Oe={class:"info-item-value"},Re={class:"my-10px"},Se={class:"info-group"},Ve={class:"info-item"},je={class:"info-item-label"},qe={class:"info-item-value"},Le={class:"info-item"},Me={class:"info-item-label"},Ue={class:"info-item-value"},Ae={class:"info-item",style:{"margin-bottom":"0"}},Ee={class:"info-item-label"},We={class:"info-item-value"},Ke={class:"my-10px"},Xe={class:"info-group"},Ze={class:"info-item"},Ge={class:"info-item-label"},Je={class:"info-item-value"},Qe={class:"info-item"},Ye={class:"info-item-label"},xe={class:"info-item-value"},et={class:"content overflow-auto"},tt={width:"200"},st={class:"content"},it=ne({__name:"Properties",setup(ot,{expose:C}){const{t:n}=ae(),T=re("fileStore"),{choosedKeys:z,fileList:F,currentPath:N}=T,d=_(!1),c=_("general"),m=_(!1),o=_({st_atime:0,st_mtime:0,st_ctime:0}),y=pe(()=>o.value.path?"".concat(o.value.path,"/").concat(o.value.name):"--"),I=_([{key:"st_mtime",title:()=>n("file.properties.modifiedTime"),width:154,render:s=>p(s.st_mtime)},{key:"st_size",title:()=>n("file.properties.size"),width:80,render:s=>$(s.st_size)},{key:"md5",title:()=>n("file.properties.md5"),ellipsis:{tooltip:!0}},J({width:110,options:s=>[{label:n("file.properties.view"),onClick:()=>{O(s)}},{label:n("file.properties.restore"),onClick:()=>{D(s)}}]})]),P=()=>{G(y.value)};C({open(){d.value=!0;const s=F.value.find(a=>a.nm==z.value[0]);B(s.path)},close(){d.value=!1}});async function B(s){m.value=!0;try{const{message:a}=await b.post("/files?action=get_file_attribute",{filename:s},{requestOptions:{isOriginalResult:!0}});A(a)&&(o.value=a)}finally{m.value=!1}}async function D(s){E({title:n("file.properties.restoreHistoryFiles"),width:480,content:()=>l(de,null,[l("div",null,[n("file.properties.restoreHistoryConfirm",{time:p(s.st_mtime)})]),l("div",{class:"mt-8px text-12px text-default leading-[1.4]"},[n("file.properties.restoreHistoryWarning")])]),onConfirm:async()=>{await H("".concat(o.value.path,"/").concat(o.value.name),s.st_mtime)}})}async function H(s,a){const f=g.loading(n("file.properties.restoring"));try{const{status:u}=await b.post("/files?action=re_history",{filename:s,history:a},{requestOptions:{errorMessage:!1}});u===0?g.success(n("file.properties.restoreSuccess")):g.error(n("file.properties.restoreFailed"))}finally{f.close()}}async function O(s){Q(s.history_file,N.value)}return(s,a)=>{const f=te,u=se,R=ie,S=W,v=ee,V=oe,j=le,q=Z,L=x,M=K,U=ue("table");return w(),_e(M,{show:i(d),"onUpdate:show":a[1]||(a[1]=h=>k(d)?d.value=h:null),width:580,title:"[".concat(i(o).name,"] - ").concat(s.$t("file.properties.fileProperties"))},{default:r(()=>[e("div",ve,[l(L,{show:i
|