Файловый менеджер - Редактировать - /var/www/vhosts/aviointeriors.dev1.mndrn.cloud/user/assets/documents-Dzs9qDli.js
Назад
import{D as k,G as d,I as c,E as h,O as y,J as u,Q as i,z as n,K as o,F as x,L as v,M as r,$ as p,P as m,N as g}from"./index-D1h448_Z.js";import{u as w,V as _,a as $,b as F}from"./VTooltip-BVRIkNqG.js";import{_ as U,p as B,j as b,V as f,i as P}from"./index-BoPYeLSL.js";import{V as S}from"./VContainer-Cme4lOJz.js";import{V as I,b as T}from"./VCard-BX7_GSZd.js";import{a as N}from"./VTextField-CB8_CfWO.js";import"./VSelect-B5jKwMMM.js";import"./form-CnC7Ky5f.js";import"./forwardRefs-C-GTDzx5.js";import"./VMenu-Dgle3co-.js";import"./easing-DY7PVvcf.js";import"./VCheckboxBtn-DLlhaLU6.js";const D={setup(){const e=w(),t=k();return t.fetchUser(),{fs:e,authStore:t}},data:()=>({tableHeaders:[{title:"Name",value:"name",key:"name"}],sortBy:[{key:"name",order:"asc"}],search:"",items:[],parent:"",company:null,currentCabin:null,loading:!1,alert:{type:"error",show:!1,text:""}}),created(){this.getIndex()},methods:{getIndex(){this.authStore.currentUser&&this.authStore.currentUser.company==null&&this.$router.push("/profile"),this.currentCabin=[],d.get("/documents").then(e=>{e.status!==200||(this.items=c.map(e.data.items,function(t){return c.extend({},t,{dialog:!1})}),this.parent=e.data.parent,this.company=null,this.fs.updatePath("/")),this.loading=!1}).catch(e=>{e.response.status==401&&(h(),this.$router.push("/login")),this.loading=!1})},getFolderContents(e){this.currentCabin=[],d.post("/documents/show",{path:e}).then(t=>{t.status!==200||(this.items=c.map(t.data.items,function(a){return c.extend({},a,{dialog:!1})}),this.parent=t.data.parent,this.parent&&this.parent!="/"&&(this.company=this.authStore.currentUser.company,this.parent.split("/").length>=2?this.currentCabin=this.company.cabinClasses.filter(a=>a.name==this.parent.split("/")[1])[0]:this.currentCabin=[]),this.fs.updatePath(e)),this.loading=!1}).catch(t=>{t.response.status==401&&(h(),this.$router.push("/login")),this.loading=!1})},deleteFile(e,t){t.dialog=!1,d.post("/documents/delete",{path:e}).then(a=>{a.status!==200||this.getFolderContents(this.fs.currentPath),this.loading=!1}).catch(a=>{a.response.status==401&&(h(),this.$router.push("/login")),this.loading=!1})},deleteFolder(e,t){t.dialog=!1,d.delete(`/documents/folder/${e}`).then(a=>{a.status!==200||this.getFolderContents(this.fs.currentPath),this.loading=!1}).catch(a=>{a.response.status==401&&(h(),this.$router.push("/login")),this.loading=!1})},downloadPath(e){this.loading=!0,d.post("/documents/download",{path:e},{responseType:"blob"}).then(t=>{if(t.status!==200)this.loading=!1;else{const a=window.URL.createObjectURL(new Blob([t.data])),l=document.createElement("a");l.href=a,l.setAttribute("download",e),document.body.appendChild(l),l.click()}this.loading=!1}).catch(t=>{this.loading=!1})},uploadCleanup(e){console.log(e),this.getFolderContents(this.fs.currentPath)},closeDialog(){isActive=!1}}},A={class:"d-flex ga-2"},E=g("div",{class:"text-end"},"Actions",-1),L={class:"d-flex justify-end"};function j(e,t,a,l,H,V){const C=v("router-link");return r(),y(x,null,[this.loading?(r(),u(P,{key:0,indeterminate:"",color:"primary","bg-color":"blue"})):i("",!0),n(B,null,{default:o(()=>[n(S,null,{default:o(()=>[n(I,{flat:""},{default:o(()=>[n(T,{class:"d-flex align-center pe-2"},{default:o(()=>[n(b,{icon:"mdi-folder",color:"primary"}),p(" "),this.authStore.currentUser?(r(),y("span",{key:0,class:"cursor-pointer",onClick:t[0]||(t[0]=(...s)=>this.getIndex&&this.getIndex(...s))},m(this.authStore.currentUser.company.name),1)):i("",!0),n(_),n(N,{modelValue:e.search,"onUpdate:modelValue":t[1]||(t[1]=s=>e.search=s),"prepend-inner-icon":"mdi-magnify",density:"comfortable",label:"Search","single-line":"",color:"primary","hide-details":"",variant:"outlined"},null,8,["modelValue"])]),_:1}),this.items?(r(),u(F,{key:0,headers:e.tableHeaders,search:e.search,"onUpdate:search":t[2]||(t[2]=s=>e.search=s),"sort-by":e.sortBy,"onUpdate:sortBy":t[3]||(t[3]=s=>e.sortBy=s),items:this.items},{"item.name":o(({item:s})=>[g("div",A,[s.type=="folder"?(r(),u(C,{key:0,to:`/documents/folder/${s.folderId}`},{default:o(()=>[n(f,{variant:"plain",color:"primary","prepend-icon":"mdi-folder",class:"text-none",style:{opacity:"1"}},{default:o(()=>[p(m(s.name),1)]),_:2},1024)]),_:2},1032,["to"])):i("",!0),s.type=="file"?(r(),u(f,{key:1,variant:"plain",color:"blue","prepend-icon":"mdi-file-outline",class:"text-none"},{default:o(()=>[p(m(s.name),1)]),_:2},1024)):i("",!0)])]),"header.actions":o(()=>[E]),"item.actions":o(({item:s})=>[g("div",L,[s.type=="file"?(r(),u(f,{key:0,variant:"plain",onClick:O=>V.downloadPath(s.path)},{default:o(()=>[n(b,{icon:"mdi-download",color:"primary"}),n($,{type:"plain",activator:"parent",location:"bottom",text:"Download"})]),_:2},1032,["onClick"])):i("",!0)])]),_:1},8,["headers","search","sort-by","items"])):i("",!0)]),_:1})]),_:1})]),_:1})],64)}const ee=U(D,[["render",j]]);export{ee as default};
| ver. 1.4 |
Github
|
.
| PHP 8.2.5 | Генерация страницы: 0.01 |
proxy
|
phpinfo
|
Настройка