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(m)},{default:r(()=>[l(q,{value:i(c),"onUpdate:value":a[0]||(a[0]=h=>k(c)?c.value=h:null)},{default:r(()=>[l(v,{name:"general",tab:s.$t("file.properties.general")},{default:r(()=>[e("div",he,[e("div",$e,[e("div",ge,[e("div",ye,[l(Y,{ext:"".concat(i(o).st_type),size:"large"},null,8,["ext"])]),e("div",be,[e("div",we,[l(f,{value:i(o).name,readonly:""},null,8,["value"])])])])]),e("div",ke,[l(u)]),e("div",Ce,[e("div",Te,[e("div",ze,t(s.$t("file.properties.type"))+":",1),e("div",Fe,t(i(o).st_type),1)]),e("div",Ne,[e("div",Ie,t(s.$t("file.properties.location"))+":",1),e("div",Pe,[e("div",Be,[l(R,null,{default:r(()=>[ce(t(i(y)),1)]),_:1})]),l(S,{class:"ml-10px cursor-pointer",name:"common-copy",size:"14",onClick:P})])]),e("div",De,[e("div",He,t(s.$t("file.properties.size"))+":",1),e("div",Oe,t(i($)(i(o).st_size)),1)])]),e("div",Re,[l(u)]),e("div",Se,[e("div",Ve,[e("div",je,t(s.$t("file.properties.permissions"))+":",1),e("div",qe,t(i(o).mode),1)]),e("div",Le,[e("div",Me,t(s.$t("file.properties.group"))+":",1),e("div",Ue,t(i(o).group),1)]),e("div",Ae,[e("div",Ee,t(s.$t("file.properties.user"))+":",1),e("div",We,t(i(o).user),1)])]),e("div",Ke,[l(u)]),e("div",Xe,[e("div",Ze,[e("div",Ge,t(s.$t("file.properties.visitTime"))+":",1),e("div",Je,t(i(p)(i(o).st_atime)),1)]),e("div",Qe,[e("div",Ye,t(s.$t("file.properties.modifiedTime"))+":",1),e("div",xe,t(i(p)(i(o).st_mtime)),1)])])])]),_:1},8,["tab"]),l(v,{name:"details",tab:s.$t("file.properties.details")},{default:r(()=>[me((w(),fe("div",et,[l(V,null,{default:r(()=>[e("thead",null,[e("tr",null,[e("th",tt,t(s.$t("file.properties.name")),1),e("th",null,t(s.$t("file.properties.value")),1)])]),e("tbody",null,[e("tr",null,[e("td",null,t(s.$t("file.properties.name")),1),e("td",null,t(i(o).name),1)]),e("tr",null,[e("td",null,t(s.$t("file.properties.type")),1),e("td",null,t(i(o).st_type),1)]),e("tr",null,[e("td",null,t(s.$t("file.properties.location")),1),e("td",null,t(i(o).path),1)]),e("tr",null,[e("td",null,t(s.$t("file.properties.size")),1),e("td",null,t(i($)(i(o).st_size)),1)]),e("tr",null,[e("td",null,t(s.$t("file.properties.visitTime")),1),e("td",null,t(i(p)(i(o).st_atime)),1)]),e("tr",null,[e("td",null,t(s.$t("file.properties.modifiedTime")),1),e("td",null,t(i(p)(i(o).st_mtime)),1)]),e("tr",null,[e("td",null,t(s.$t("file.properties.metadataModificationTime")),1),e("td",null,t(i(p)(i(o).st_mtime)),1)]),e("tr",null,[e("td",null,t(s.$t("file.properties.md5")),1),e("td",null,t(i(o).md5),1)]),e("tr",null,[e("td",null,t(s.$t("file.properties.sha1")),1),e("td",null,t(i(o).sha1),1)]),e("tr",null,[e("td",null,t(s.$t("file.properties.user")),1),e("td",null,t(i(o).user),1)]),e("tr",null,[e("td",null,t(s.$t("file.properties.group")),1),e("td",null,t(i(o).group),1)]),e("tr",null,[e("td",null,t(s.$t("file.properties.permissions")),1),e("td",null,t(i(o).mode),1)]),e("tr",null,[e("td",null,t(s.$t("file.properties.uid")),1),e("td",null,t(i(o).st_uid),1)]),e("tr",null,[e("td",null,t(s.$t("file.properties.gid")),1),e("td",null,t(i(o).st_gid),1)]),e("tr",null,[e("td",null,t(s.$t("file.properties.numOfInodeLinks")),1),e("td",null,t(Number(i(o).is_link)),1)]),e("tr",null,[e("td",null,t(s.$t("file.properties.inodeNodeNum")),1),e("td",null,t(i(o).st_ino),1)]),e("tr",null,[e("td",null,t(s.$t("file.properties.inodeProtectionMode")),1),e("td",null,t(i(o).st_mode),1)]),e("tr",null,[e("td",null,t(s.$t("file.properties.inodeResidentDevice")),1),e("td",null,t(i(o).st_dev),1)])])]),_:1})])),[[U]])]),_:1},8,["tab"]),l(v,{name:"history",tab:s.$t("file.properties.history")},{default:r(()=>[e("div",st,[l(j,{"max-height":"386px",columns:i(I),data:i(o).history||[]},null,8,["columns","data"])])]),_:1},8,["tab"])]),_:1},8,["value"])]),_:1},8,["show"])])]),_:1},8,["show","title"])}}}),$t=X(it,[["__scopeId","data-v-80434e12"]]);export{$t as default};
|