Файловый менеджер - Редактировать - /var/www/vhosts/aviointeriors.dev1.mndrn.cloud/admin/09-07-24/assets/view-folder-KLWWLLDX.js
Назад
import{u as j,_ as H}from"./avio-upload-5LxDPLUA.js";import{J as g,L as S,I as D,R as h,M as u,S as i,i as l,N as a,F as U,O as G,P as s,Q as r,U as p,X as f,W as T,j as O,a2 as L}from"./index-mKOwJ4Un.js";import{_ as Y,q as W,j as C,i as k,o as I,V as b,r as M,k as X}from"./index-dJRjWN6S.js";import{V as q}from"./VContainer-fKiAlvGY.js";import{V as E,a as J}from"./VDataTable-UL1ivaAn.js";import{V as w}from"./VTextField-lRcPhTtq.js";import{V as c}from"./VBtn-zq8TiS3t.js";import{a as V,V as N}from"./VTooltip-ytu6eD0e.js";import{V as Q}from"./VRow-0GkbhU-J.js";import{V as A}from"./VCol-fneZYSk7.js";import{V as B}from"./VAutocomplete-HvUeBzqi.js";import{V as z}from"./VMenu-7n9b6eDW.js";import{V as K}from"./VInput-RB-Z9H30.js";import{V as P}from"./VCheckbox-FgdVfvUY.js";import"./forwardRefs-g5bhJaRn.js";import"./VSelect-vqe7ulfJ.js";import"./VOverlay-6ufyEHy2.js";import"./filter-znXohkY4.js";const Z={setup(){return{fs:j()}},data:()=>({tableHeaders:[{title:"Name",value:"name",key:"name"},{title:"Year",value:"subFolder",key:"subFolder"},{title:"P/N",value:"serialNumber",key:"serialNumber"},{title:"Actions",value:"actions",sortable:!1}],sortBy:[{key:"name",order:"asc"}],search:"",items:[],currentItem:null,s3response:null,sameFile:[],toUpload:[],toUpdate:[],s3updateToLocalMsg:"",s3uploadToLocalMsg:"",s3deleteToLocalMsg:"",toDelete:[],parent:"",selected_serial:"",parentId:null,company:null,currentCabin:null,missingSerials:[],serials_available_count:0,all_available:[],loading:!1,dialog:!1,alert:{type:"error",show:!1,text:""}}),props:["id"],created(){this.getFolderContents()},computed:{},methods:{dataToModal(e){this.currentItem=e},saveInfo(e,t){console.log(e),console.log(t),g.post("/documents/editLabelAndPN",{item:e,selected_serial:t}).then(o=>{o.status!==200||(this.selected_serial="",this.getFolderContents())}).catch(o=>{o.response.status==401})},updateS3toLocal(e,t){this.toUpdate.length>0&&g.post("/s3updateToLocal",{to_update:this.toUpdate}).then(o=>{o.status!==200||(console.log(o.data),this.s3updateToLocalMsg=o.data,this.check_sync_s3(e,t),this.toUpdate=[])}).catch(o=>{o.response.status==401})},uploadS3toLocal(e,t){this.toUpload.length>0&&g.post("/s3uploadToLocal",{to_upload:this.toUpload}).then(o=>{o.status!==200||(console.log(o.data),this.s3uploadToLocalMsg=o.data,this.check_sync_s3(e,t),this.toUpload=[])}).catch(o=>{o.response.status==401})},deleteS3toLocal(e,t){this.toDelete.length>0&&g.post("/s3deleteToLocal",{to_delete:this.toDelete}).then(o=>{o.status!==200||(console.log(o.data),this.s3deleteToLocalMsg=o.data,this.check_sync_s3(e,t),this.toDelete=[])}).catch(o=>{o.response.status==401})},check_sync_s3(e,t){console.log(e),console.log(t),g.post("/s3check",{path:e,type:t}).then(o=>{o.status!==200||(console.log(o.data),this.s3response=o.data)}).catch(o=>{o.response.status==401})},getMissingSerials(){this.missingSerials=this.currentCabin.products,this.serials_available_count=this.currentCabin.products.length;for(let t=0;t<this.missingSerials.length;t++)for(let o=0;o<this.items.length;o++)this.missingSerials[t].serialNumber==this.items[o].serialNumber&&this.missingSerials.splice(t,1);this.serials_available=[];for(var e=this.missingSerials.length-1;e>=0;e--)this.serials_available.push(this.missingSerials[e].serialNumber)},getIndex(){this.currentCabin=[],g.get("/documents").then(e=>{e.status!==200||(this.items=S.map(e.data.items,function(t){return S.extend({},t,{dialog:!1})}),this.parent=e.data.parent,this.company=null,this.fs.updatePath("/")),this.loading=!1}).catch(e=>{e.response.status==401&&(D(),this.$router.push("/login")),this.loading=!1})},getFolderContents(){this.currentCabin=[],g.get("/documents/folder/"+this.$route.params.id).then(e=>{e.status!==200||(this.items=S.map(e.data.items,function(t){return S.extend({},t,{dialog:!1})}),this.parent=e.data.parent,this.parentId=e.data.parentId,this.parent&&this.parent!="/"&&e.data.companyId&&g.get("/companies/"+e.data.companyId).then(t=>{if(t.status===200)if(this.company=t.data.company,this.parent.split("/").length>=2){this.currentCabin=t.data.company.cabinClasses.filter(v=>v.name==this.parent.split("/")[1])[0],console.log(this.currentCabin.products);for(var o=this.currentCabin.products.length-1;o>=0;o--)this.currentCabin.products[o].active!=!0&&this.currentCabin.products.splice(o,1);this.getMissingSerials(),console.log(this.currentCabin.products)}else this.currentCabin=[]}).catch(t=>{}),this.fs.updatePath(this.parent)),this.loading=!1}).catch(e=>{e.response.status==401&&(D(),this.$router.push("/login")),this.loading=!1})},deleteFile(e,t){t.dialog=!1,g.post("/documents/delete",{path:e}).then(o=>{o.status!==200||this.getFolderContents(this.fs.currentPath),this.loading=!1}).catch(o=>{o.response.status==401&&(D(),this.$router.push("/login")),this.loading=!1})},deleteFolder(e,t){t.dialog=!1,g.delete(`/documents/folder/${e}`).then(o=>{o.status!==200||this.getFolderContents(this.fs.currentPath),this.loading=!1}).catch(o=>{o.response.status==401&&(D(),this.$router.push("/login")),this.loading=!1})},downloadPath(e){this.loading=!0,g.post("/documents/download",{path:e},{responseType:"blob"}).then(t=>{if(t.status!==200)this.loading=!1;else{const o=window.URL.createObjectURL(new Blob([t.data])),v=document.createElement("a");v.href=o,v.setAttribute("download",e),document.body.appendChild(v),v.click()}this.loading=!1}).catch(t=>{this.loading=!1})},uploadCleanup(e){console.log(e),this.getFolderContents(this.fs.currentPath)},getItemUrl(e){}}},x={class:"d-flex ga-2"},ee=r("div",{class:"text-end"},"Actions",-1),te={class:"d-flex justify-end"},le={class:"text-caption mb-2"},ae=r("b",null,"Current Part number:",-1),oe=r("br",null,null,-1),se=r("br",null,null,-1),ne={key:0},ie=r("br",null,null,-1),re={key:0},de={key:0,style:{color:"darkorange"}},ue=r("b",null,"THE FILE OR FOLDER IS NOT ON S3 REPOSITORY",-1),pe=[ue],ce={key:1,style:{color:"green"}},he=r("b",null,"NOTHING TO SYNC",-1),me=[he],fe={key:2},ge=r("b",null,"[Cloud => Local] CHANGED FILES",-1),ye=[ge],be={key:4},ve={key:5},ke={key:6},Ce=r("b",null,"[Cloud => Local] NEW FILES",-1),Ve=[Ce],_e={key:9},Ue={key:10},Le={key:11},Se=r("b",null,"[Cloud => Local] FILES TO DELETE ON LOCAL",-1),De=[Se],Te={key:13},Ie={key:14},Ne={key:15,class:"d-flex justify-center align-center"},Fe=r("br",null,null,-1),Ee=r("p",{class:"text-body-1 text-error"},"This operation cannot be reversed.",-1);function we(e,t,o,v,Pe,y){const R=H,F=G("router-link");return s(),h(U,null,[this.loading?(s(),u(X,{key:0,indeterminate:"",color:"primary","bg-color":"blue"})):i("",!0),l(W,null,{default:a(()=>[l(q,null,{default:a(()=>[this.parent!="/"&&this.parent.split("/").length>=2?(s(),u(R,{key:0,company:this.company,cabin:this.currentCabin,onUploadFinished:y.uploadCleanup},null,8,["company","cabin","onUploadFinished"])):i("",!0),this.parent!="/"&&this.parent.split("/").length>=2?(s(),u(k,{key:1,class:"bg-blue-lighten-4"},{default:a(()=>[l(C,null,{default:a(()=>[r("h3",null,[p(" Total Part Numbers: "),r("b",null,f(e.serials_available_count),1)]),r("h3",null,[p(" Missing Part Numbers: "),r("b",null,f(e.missingSerials.length),1)]),r("h3",null,[p(" Total Documents: "),r("b",null,f(e.items.length),1)])]),_:1})]),_:1})):i("",!0),this.currentCabin&&this.parent!="/"&&this.parent.split("/").length>=2?(s(),u(k,{key:2,flat:"",class:"bg-blue-lighten-5"},{default:a(()=>[l(I,null,{default:a(()=>[p("Missing Part Numbers")]),_:1}),l(C,null,{default:a(()=>[(s(!0),h(U,null,T(this.missingSerials,n=>(s(),h("div",null,f(n.serialNumber),1))),256))]),_:1})]),_:1})):i("",!0),l(k,{flat:""},{default:a(()=>[l(I,{class:"d-flex align-center pe-2"},{default:a(()=>[l(b,{icon:"mdi-folder",color:"primary"}),p(" "),l(F,{to:"/documents"},{default:a(()=>[p("Documents")]),_:1}),this.parentId?(s(),u(F,{key:0,to:`/documents/folder/${this.parentId}`,class:"cursor-pointer"},{default:a(()=>[l(b,{icon:"mdi-chevron-right"}),p(f(this.parent.split("/")[0]),1)]),_:1},8,["to"])):i("",!0),r("span",null,[l(b,{icon:"mdi-chevron-right"}),p(f(this.parent.split("/").slice(-1)[0]),1)]),l(E),l(w,{modelValue:e.search,"onUpdate:modelValue":t[0]||(t[0]=n=>e.search=n),"prepend-inner-icon":"mdi-magnify",density:"comfortable",label:"Search","single-line":"",color:"primary","hide-details":"",variant:"outlined"},null,8,["modelValue"])]),_:1}),this.items?(s(),u(J,{key:0,headers:e.tableHeaders,search:e.search,"onUpdate:search":t[13]||(t[13]=n=>e.search=n),"sort-by":e.sortBy,"onUpdate:sortBy":t[14]||(t[14]=n=>e.sortBy=n),items:this.items},{"item.name":a(({item:n})=>[r("div",x,[l(F,{to:`/documents/folder/${n.folderId}`},{default:a(()=>[n.type=="folder"?(s(),u(c,{key:0,variant:"plain",color:"primary","prepend-icon":"mdi-folder",class:"text-none"},{default:a(()=>[p(f(n.name),1)]),_:2},1024)):i("",!0)]),_:2},1032,["to"]),n.type=="file"?(s(),u(c,{key:0,variant:"plain",color:"blue","prepend-icon":"mdi-file-outline",class:"text-none"},{default:a(()=>[p(f(n.name),1)]),_:2},1024)):i("",!0)])]),"header.actions":a(()=>[ee]),"item.actions":a(({item:n})=>[r("div",te,[n.type=="file"?(s(),u(c,{key:0,variant:"plain",onClick:d=>y.downloadPath(n.path)},{default:a(()=>[l(b,{icon:"mdi-download",color:"primary"}),l(V,{type:"plain",activator:"parent",location:"bottom",text:"Download"})]),_:2},1032,["onClick"])):i("",!0),n.type=="file"?(s(),u(c,{key:1,variant:"plain"},{default:a(()=>[l(N,{modelValue:e.dialog,"onUpdate:modelValue":t[5]||(t[5]=d=>e.dialog=d),"max-width":"400",persistent:""},{activator:a(({props:d})=>[l(c,O(d,{variant:"flat",onClick:L(m=>{y.dataToModal(n)},["prevent"])}),{default:a(()=>[l(b,{icon:"mdi-table-edit",color:"primary"}),l(V,{activator:"parent",location:"bottom",text:"Edit"})]),_:2},1040,["onClick"])]),default:a(()=>[l(k,{"prepend-icon":"mdi-table-edit",title:"Edit"},{default:a(()=>[l(C,null,{default:a(()=>[l(Q,{dense:""},{default:a(()=>[l(A,{cols:"12",md:"12",sm:"12"},{default:a(()=>[l(w,{label:"Label",modelValue:e.currentItem.name,"onUpdate:modelValue":t[1]||(t[1]=d=>e.currentItem.name=d)},null,8,["modelValue"])]),_:1}),l(A,{cols:"12",sm:"12"},{default:a(()=>[r("p",le,[ae,p(),r("span",null,[r("i",null,f(e.currentItem.serialNumber),1)])]),l(B,{items:e.serials_available,modelValue:e.selected_serial,"onUpdate:modelValue":t[2]||(t[2]=d=>e.selected_serial=d),label:"Part Number","auto-select-first":""},null,8,["items","modelValue"])]),_:1})]),_:1})]),_:1}),l(z),l(M,null,{default:a(()=>[l(E),l(c,{text:"Close",variant:"plain",color:"red",onClick:t[3]||(t[3]=d=>{e.selected_serial="",e.dialog=!1})}),l(c,{color:"primary",text:"Save",variant:"tonal",onClick:t[4]||(t[4]=d=>{y.saveInfo(e.currentItem,e.selected_serial),e.dialog=!1})})]),_:1})]),_:1})]),_:2},1032,["modelValue"])]),_:2},1024)):i("",!0),l(c,{variant:"plain"},{default:a(()=>[l(b,{icon:"mdi-eye",color:"primary"}),l(V,{activator:"parent",location:"bottom",text:"View"})]),_:1}),n.type!="file"?(s(),u(c,{key:2,variant:"plain"},{default:a(()=>[l(N,{"max-width":"500"},{activator:a(({props:d})=>[l(c,O(d,{variant:"flat",onClick:L(m=>{y.check_sync_s3(n.path,n.type)},["prevent"])}),{default:a(()=>[l(b,{icon:"mdi-cloud-sync-outline",color:"primary"}),l(V,{activator:"parent",location:"bottom",text:"Cloud sync"})]),_:2},1040,["onClick"])]),default:a(({isActive:d})=>[l(k,{title:"Dialog"},{default:a(()=>[l(C,null,{default:a(()=>[p(f(n.path)+" ",1),oe,se,e.s3response!=null?(s(),h("span",ne,[ie,e.s3response.toUpdate.length==0&&e.s3response.toUpload.length==0&&e.s3response.toDelete.length==0&&e.s3response.sameFile.length==0?(s(),h("span",re,[e.s3response.toUpdate.length==0&&e.s3response.toUpload.length==0&&e.s3response.toDelete.length==0&&e.s3response.sameFile.length==0?(s(),h("p",de,pe)):i("",!0)])):i("",!0),e.s3response.toUpdate.length<=0&&e.s3response.toUpload.length<=0&&e.s3response.toDelete.length<=0?(s(),h("p",ce,me)):i("",!0),e.s3response.toUpdate!=null&&e.s3response.toUpdate.length!=0?(s(),h("p",fe,ye)):i("",!0),(s(!0),h(U,null,T(e.s3response.toUpdate,(m,$)=>(s(),u(P,{modelValue:e.toUpdate,"onUpdate:modelValue":t[6]||(t[6]=_=>e.toUpdate=_),label:m.key,color:"warning","input-value":"true",value:m.key},null,8,["modelValue","label","value"]))),256)),e.toUpdate.length>0?(s(),u(c,{key:3,variant:"flat",color:"warning",onClick:t[7]||(t[7]=L(m=>{y.updateS3toLocal()},["prevent"]))},{default:a(()=>[p("UPDATE EXISTING FILES")]),_:1})):i("",!0),r("p",null,f(e.s3updateToLocalMsg),1),e.toUpdate.length>0?(s(),h("br",be)):i("",!0),e.toUpdate.length>0?(s(),h("br",ve)):i("",!0),e.s3response.toUpload!=null&&e.s3response.toUpload.length!=0?(s(),h("p",ke,Ve)):i("",!0),(s(!0),h(U,null,T(e.s3response.toUpload,(m,$)=>(s(),u(P,{modelValue:e.toUpload,"onUpdate:modelValue":t[8]||(t[8]=_=>e.toUpload=_),label:m.key,color:"green","input-value":"true",value:m.key},null,8,["modelValue","label","value"]))),256)),e.toUpload.length>0?(s(),u(K,{key:7})):i("",!0),e.toUpload.length>0?(s(),u(c,{key:8,variant:"flat",color:"success",onClick:L(m=>{y.uploadS3toLocal(n.path,n.type)},["prevent"])},{default:a(()=>[p("GRAB SELECTED FILES FROM CLOUD")]),_:2},1032,["onClick"])):i("",!0),e.toUpload.length>0?(s(),h("br",_e)):i("",!0),e.toUpload.length>0?(s(),h("br",Ue)):i("",!0),e.s3response.toDelete!=null&&e.s3response.toDelete.length!=0?(s(),h("p",Le,De)):i("",!0),(s(!0),h(U,null,T(e.s3response.toDelete,(m,$)=>(s(),u(P,{modelValue:e.toDelete,"onUpdate:modelValue":t[9]||(t[9]=_=>e.toDelete=_),label:m.key,color:"red","input-value":"true",value:m.key},null,8,["modelValue","label","value"]))),256)),e.toDelete.length>0?(s(),u(c,{key:12,variant:"flat",color:"error",onClick:L(m=>{y.deleteS3toLocal(n.path,n.type)},["prevent"])},{default:a(()=>[p("DELETE SELECTED FILES ON LOCAL")]),_:2},1032,["onClick"])):i("",!0),e.toDelete.length>0?(s(),h("br",Te)):i("",!0),e.toDelete.length>0?(s(),h("br",Ie)):i("",!0),this.hasProduct?(s(),h("div",Ne,[this.$props.products?(s(),u(B,{key:0,class:"mt-4",items:this.$props.products,modelValue:e.serialNumber,"onUpdate:modelValue":t[10]||(t[10]=m=>e.serialNumber=m),"item-title":"serialNumber",density:"compact",variant:"outlined",label:"Serial number"},null,8,["items","modelValue"])):(s(),u(w,{key:1,class:"mt-4",modelValue:this.serialNumber,"onUpdate:modelValue":t[11]||(t[11]=m=>this.serialNumber=m),density:"compact",variant:"outlined",label:"Serial number"},null,8,["modelValue"])),l(c,{variant:"plain",ripple:!1,flat:"",icon:"mdi-close",color:"secondary",onClick:t[12]||(t[12]=m=>this.hasProduct=!this.hasProduct)})])):i("",!0)])):i("",!0)]),_:2},1024),l(M,null,{default:a(()=>[l(E),l(c,{text:"Close",onClick:m=>{d.value=!1,e.s3response=null,e.toUpdate=[],e.toUpload=[],e.toDelete=[]}},null,8,["onClick"])]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024)):i("",!0),n.type=="file"?(s(),u(c,{key:3,variant:"plain",loading:this.loading},{default:a(()=>[l(b,{icon:"mdi-delete",color:"error"}),l(V,{activator:"parent",location:"bottom",text:"Delete"}),l(N,{activator:"parent",class:"dialog-container",modelValue:n.dialog,"onUpdate:modelValue":d=>n.dialog=d},{default:a(()=>[l(k,{class:"py-4 mx-auto d-flex align-center"},{default:a(()=>[l(I,null,{default:a(()=>[p("Are you sure you want to delete the file "),r("strong",null,f(n.path.split("/").slice(-1)[0]),1)]),_:2},1024),l(C,{class:"d-flex w-100 justify-end mt-10"},{default:a(()=>[l(c,{color:"primary",onClick:d=>n.dialog=!1},{default:a(()=>[p("Cancel")]),_:2},1032,["onClick"]),l(c,{class:"ml-8",color:"error",onClick:d=>y.deleteFile(n.path,n)},{default:a(()=>[p("Delete")]),_:2},1032,["onClick"])]),_:2},1024)]),_:2},1024)]),_:2},1032,["modelValue","onUpdate:modelValue"])]),_:2},1032,["loading"])):i("",!0),n.type=="folder"?(s(),u(c,{key:4,variant:"plain",loading:this.loading},{default:a(()=>[l(b,{icon:"mdi-delete",color:"error"}),l(V,{activator:"parent",location:"bottom",text:"Delete"}),l(N,{activator:"parent",class:"dialog-container",modelValue:n.dialog,"onUpdate:modelValue":d=>n.dialog=d},{default:a(()=>[l(k,{class:"py-4 mx-auto d-flex align-center"},{default:a(()=>[l(I,null,{default:a(()=>[p("Are you sure you want to delete the folder "),r("strong",null,f(n.path.split("/").slice(-1)[0]),1),p(" and all of its contents?"),Fe,Ee]),_:2},1024),l(C,{class:"d-flex w-100 justify-end mt-10"},{default:a(()=>[l(c,{color:"primary",onClick:d=>n.dialog=!1},{default:a(()=>[p("Cancel")]),_:2},1032,["onClick"]),l(c,{class:"ml-8",color:"error",onClick:d=>y.deleteFolder(n.folderId,n)},{default:a(()=>[p("Delete")]),_:2},1032,["onClick"])]),_:2},1024)]),_:2},1024)]),_:2},1032,["modelValue","onUpdate:modelValue"])]),_:2},1032,["loading"])):i("",!0)])]),_:1},8,["headers","search","sort-by","items"])):i("",!0)]),_:1})]),_:1})]),_:1})],64)}const xe=Y(Z,[["render",we]]);export{xe as default};
| ver. 1.4 |
Github
|
.
| PHP 8.2.5 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка