diff --git a/cista-front/src/components/FileViewer.vue b/cista-front/src/components/FileViewer.vue index 40d10ce..a3d24ff 100644 --- a/cista-front/src/components/FileViewer.vue +++ b/cista-front/src/components/FileViewer.vue @@ -28,7 +28,7 @@ import { watchEffect, ref } from 'vue' import Router from '@/router/index'; import { url_document_get } from '@/repositories/Document'; -const dataURL = ref('') +const dataURL = ref('') watchEffect(()=>{ console.log('😎😎😎😎') console.log(url_document_get) @@ -37,7 +37,7 @@ watchEffect(()=>{ console.log('----------') dataURL.value = new URL( url_document_get + Router.currentRoute.value.path, - location.origin.replace( /^http/, 'ws') + location.origin ).toString(); }) const emit = defineEmits({ diff --git a/cista/wwwroot/assets/index-04b5e7e6.js b/cista/wwwroot/assets/index-52a6c063.js similarity index 99% rename from cista/wwwroot/assets/index-04b5e7e6.js rename to cista/wwwroot/assets/index-52a6c063.js index ce4f57b..477afd8 100644 --- a/cista/wwwroot/assets/index-04b5e7e6.js +++ b/cista/wwwroot/assets/index-52a6c063.js @@ -509,4 +509,4 @@ __p += '`),Jt&&(Ue+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+Ue+`return __p -}`;var Wt=R4(function(){return nn(le,bt+"return "+Ue).apply(n,be)});if(Wt.source=Ue,ib(Wt))throw Wt;return Wt}function Bj(f){return rn(f).toLowerCase()}function Nj(f){return rn(f).toUpperCase()}function Fj(f,y,T){if(f=rn(f),f&&(T||y===n))return j2(f);if(!f||!(y=ur(y)))return f;var H=ti(f),q=ti(y),le=W2(H,q),be=V2(H,q)+1;return zl(H,le,be).join("")}function Lj(f,y,T){if(f=rn(f),f&&(T||y===n))return f.slice(0,U2(f)+1);if(!f||!(y=ur(y)))return f;var H=ti(f),q=V2(H,ti(y))+1;return zl(H,0,q).join("")}function kj(f,y,T){if(f=rn(f),f&&(T||y===n))return f.replace(Ve,"");if(!f||!(y=ur(y)))return f;var H=ti(f),q=W2(H,ti(y));return zl(H,q).join("")}function zj(f,y){var T=A,H=R;if(An(y)){var q="separator"in y?y.separator:q;T="length"in y?Ht(y.length):T,H="omission"in y?ur(y.omission):H}f=rn(f);var le=f.length;if(Fs(f)){var be=ti(f);le=be.length}if(T>=le)return f;var xe=T-Ls(H);if(xe<1)return H;var _e=be?zl(be,0,xe).join(""):f.slice(0,xe);if(q===n)return _e+H;if(be&&(xe+=_e.length-xe),lb(q)){if(f.slice(xe).search(q)){var He,We=_e;for(q.global||(q=C0(q.source,rn(No.exec(q))+"g")),q.lastIndex=0;He=q.exec(We);)var Ue=He.index;_e=_e.slice(0,Ue===n?xe:Ue)}}else if(f.indexOf(ur(q),xe)!=xe){var et=_e.lastIndexOf(q);et>-1&&(_e=_e.slice(0,et))}return _e+H}function Hj(f){return f=rn(f),f&&Mn.test(f)?f.replace(Dt,vF):f}var jj=Ks(function(f,y,T){return f+(T?" ":"")+y.toUpperCase()}),cb=D3("toUpperCase");function A4(f,y,T){return f=rn(f),y=T?n:y,y===n?dF(f)?yF(f):nF(f):f.match(y)||[]}var R4=Vt(function(f,y){try{return sr(f,n,y)}catch(T){return ib(T)?T:new Bt(T)}}),Wj=Yi(function(f,y){return Mr(y,function(T){T=wi(T),Gi(f,T,ob(f[T],f))}),f});function Vj(f){var y=f==null?0:f.length,T=Ot();return f=y?In(f,function(H){if(typeof H[1]!="function")throw new Ar(l);return[T(H[0]),H[1]]}):[],Vt(function(H){for(var q=-1;++qD)return[];var T=V,H=wo(f,V);y=Ot(y),f-=V;for(var q=y0(H,y);++T0||y<0)?new Xt(T):(f<0?T=T.takeRight(-f):f&&(T=T.drop(f)),y!==n&&(y=Ht(y),T=y<0?T.dropRight(-y):T.take(y-f)),T)},Xt.prototype.takeRightWhile=function(f){return this.reverse().takeWhile(f).reverse()},Xt.prototype.toArray=function(){return this.take(V)},Ci(Xt.prototype,function(f,y){var T=/^(?:filter|find|map|reject)|While$/.test(y),H=/^(?:head|last)$/.test(y),q=oe[H?"take"+(y=="last"?"Right":""):y],le=H||/^find/.test(y);q&&(oe.prototype[y]=function(){var be=this.__wrapped__,xe=H?[1]:arguments,_e=be instanceof Xt,He=xe[0],We=_e||Ft(be),Ue=function(Kt){var Jt=q.apply(oe,Dl([Kt],xe));return H&&et?Jt[0]:Jt};We&&T&&typeof He=="function"&&He.length!=1&&(_e=We=!1);var et=this.__chain__,bt=!!this.__actions__.length,Pt=le&&!et,Wt=_e&&!bt;if(!le&&We){be=Wt?be:new Xt(this);var It=f.apply(be,xe);return It.__actions__.push({func:Op,args:[Ue],thisArg:n}),new Rr(It,et)}return Pt&&Wt?f.apply(this,xe):(It=this.thru(Ue),Pt?H?It.value()[0]:It.value():It)})}),Mr(["pop","push","shift","sort","splice","unshift"],function(f){var y=Zf[f],T=/^(?:push|sort|unshift)$/.test(f)?"tap":"thru",H=/^(?:pop|shift)$/.test(f);oe.prototype[f]=function(){var q=arguments;if(H&&!this.__chain__){var le=this.value();return y.apply(Ft(le)?le:[],q)}return this[T](function(be){return y.apply(Ft(be)?be:[],q)})}}),Ci(Xt.prototype,function(f,y){var T=oe[y];if(T){var H=T.name+"";an.call(js,H)||(js[H]=[]),js[H].push({name:y,func:T})}}),js[bp(n,$).name]=[{name:"wrapper",func:n}],Xt.prototype.clone=HF,Xt.prototype.reverse=jF,Xt.prototype.value=WF,oe.prototype.at=bz,oe.prototype.chain=yz,oe.prototype.commit=Sz,oe.prototype.next=$z,oe.prototype.plant=xz,oe.prototype.reverse=wz,oe.prototype.toJSON=oe.prototype.valueOf=oe.prototype.value=Oz,oe.prototype.first=oe.prototype.head,Cu&&(oe.prototype[Cu]=Cz),oe},ks=SF();Pa?((Pa.exports=ks)._=ks,d0._=ks):go._=ks}).call(Sr)})(gv,gv.exports);var lTe=gv.exports;function TN(e){return xv()?(QS(e),!0):!1}function x2(e){return typeof e=="function"?e():lt(e)}const _N=typeof window<"u"&&typeof document<"u",aTe=Object.prototype.toString,sTe=e=>aTe.call(e)==="[object Object]",U_=()=>+Date.now(),KS=()=>{};function cTe(e,t){function n(...o){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(r).catch(i)})}return n}function uTe(e,t=!0,n=!0,o=!1){let r=0,i,l=!0,a=KS,s;const c=()=>{i&&(clearTimeout(i),i=void 0,a(),a=KS)};return d=>{const p=x2(e),g=Date.now()-r,m=()=>s=d();return c(),p<=0?(r=Date.now(),m()):(g>p&&(n||!l)?(r=Date.now(),m()):t&&(s=new Promise((v,S)=>{a=o?S:v,i=setTimeout(()=>{r=Date.now(),l=!0,v(m()),c()},Math.max(0,p-g))})),!n&&!i&&(i=setTimeout(()=>l=!0,p)),l=!1,s)}}function US(e){var t;const n=x2(e);return(t=n==null?void 0:n.$el)!=null?t:n}const EN=_N?window:void 0,dTe=_N?window.document:void 0;function vv(...e){let t,n,o,r;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,o,r]=e,t=EN):[t,n,o,r]=e,!t)return KS;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const i=[],l=()=>{i.forEach(u=>u()),i.length=0},a=(u,d,p,g)=>(u.addEventListener(d,p,g),()=>u.removeEventListener(d,p,g)),s=Te(()=>[US(t),x2(r)],([u,d])=>{if(l(),!u)return;const p=sTe(d)?{...d}:d;i.push(...n.flatMap(g=>o.map(m=>a(u,g,m,p))))},{immediate:!0,flush:"post"}),c=()=>{s(),l()};return TN(c),c}function fTe(){const e=fe(!1);return eo()&&st(()=>{e.value=!0}),e}function pTe(e){const t=fTe();return E(()=>(t.value,!!e()))}const G_=["fullscreenchange","webkitfullscreenchange","webkitendfullscreen","mozfullscreenchange","MSFullscreenChange"];function hTe(e,t={}){const{document:n=dTe,autoExit:o=!1}=t,r=E(()=>{var $;return($=US(e))!=null?$:n==null?void 0:n.querySelector("html")}),i=fe(!1),l=E(()=>["requestFullscreen","webkitRequestFullscreen","webkitEnterFullscreen","webkitEnterFullScreen","webkitRequestFullScreen","mozRequestFullScreen","msRequestFullscreen"].find($=>n&&$ in n||r.value&&$ in r.value)),a=E(()=>["exitFullscreen","webkitExitFullscreen","webkitExitFullScreen","webkitCancelFullScreen","mozCancelFullScreen","msExitFullscreen"].find($=>n&&$ in n||r.value&&$ in r.value)),s=E(()=>["fullScreen","webkitIsFullScreen","webkitDisplayingFullscreen","mozFullScreen","msFullscreenElement"].find($=>n&&$ in n||r.value&&$ in r.value)),c=["fullscreenElement","webkitFullscreenElement","mozFullScreenElement","msFullscreenElement"].find($=>n&&$ in n),u=pTe(()=>r.value&&n&&l.value!==void 0&&a.value!==void 0&&s.value!==void 0),d=()=>c?(n==null?void 0:n[c])===r.value:!1,p=()=>{if(s.value){if(n&&n[s.value]!=null)return n[s.value];{const $=r.value;if(($==null?void 0:$[s.value])!=null)return!!$[s.value]}}return!1};async function g(){if(!(!u.value||!i.value)){if(a.value)if((n==null?void 0:n[a.value])!=null)await n[a.value]();else{const $=r.value;($==null?void 0:$[a.value])!=null&&await $[a.value]()}i.value=!1}}async function m(){if(!u.value||i.value)return;p()&&await g();const $=r.value;l.value&&($==null?void 0:$[l.value])!=null&&(await $[l.value](),i.value=!0)}async function v(){await(i.value?g():m())}const S=()=>{const $=p();(!$||$&&d())&&(i.value=$)};return vv(n,G_,S,!1),vv(()=>US(r),G_,S,!1),o&&TN(g),{isSupported:u,isFullscreen:i,enter:m,exit:g,toggle:v}}const gTe=["mousemove","mousedown","resize","keydown","touchstart","wheel"],vTe=6e4;function mTe(e=vTe,t={}){const{initialState:n=!1,listenForVisibilityChange:o=!0,events:r=gTe,window:i=EN,eventFilter:l=uTe(50)}=t,a=fe(n),s=fe(U_());let c;const u=()=>{a.value=!1,clearTimeout(c),c=setTimeout(()=>a.value=!0,e)},d=cTe(l,()=>{s.value=U_(),u()});if(i){const p=i.document;for(const g of r)vv(i,g,d,{passive:!0});o&&vv(p,"visibilitychange",()=>{p.hidden||d()}),u()}return{idle:a,lastActive:s,reset:u}}const bTe=["data"],yTe={key:2},STe=se({__name:"FileViewer",props:{type:{},visibleImg:{type:Boolean}},emits:{visibleImg(e){return e}},setup(e,{emit:t}){const n=e,o=fe("");tt(()=>{console.log("😎😎😎😎"),console.log(K_),console.log(Cr.currentRoute),console.log(Cr.currentRoute.value.path),console.log("----------"),o.value=new URL(K_+Cr.currentRoute.value.path,location.origin.replace(/^http/,"ws")).toString()});function r(i){t("visibleImg",i)}return(i,l)=>{const a=d9;return n.type==="pdf"?(Tn(),_o("object",{key:0,data:o.value,type:"application/pdf",width:"100%",height:"100%"},null,8,bTe)):n.type==="image"?(Tn(),ha(a,{key:1,width:"50%",src:o.value,onClick:l[0]||(l[0]=()=>r(!0)),previewMask:!1,preview:{visibleImg:i.visibleImg,onVisibleChange:r}},null,8,["src","preview"])):(Tn(),_o("h1",yTe," Unsupported file type "))}}}),$Te=se({__name:"FileCarousel",setup(e){const t=fe(null),{isFullscreen:n,toggle:o}=hTe(t),r=fe(!1),i=_l(),l=fe(void 0);tt(()=>{if(i.mainDocument[0]&&i.mainDocument[0].type==="file"){const d=i.mainDocument[0].ext;l.value=P6e(d)}});function a(d){r.value=d}const{idle:s}=mTe(2e3);function c(){const p=Cr.currentRoute.value.path.split("/").filter(m=>m);p.length<=1?p[0]="/":p.pop();const g=p.join("/");Cr.push(g)}function u(d){const p=decodeURIComponent(new String(Cr.currentRoute.value.path)),g=i.getNextDocumentInRoute(d,p);let m=p.split("/");m.pop(),m.push(g),m=m.join("/"),Cr.push(m)}return(d,p)=>{const g=hn,m=B9,v=JR,S=N9;return Tn(),_o("div",{class:"carousel",ref_key:"fileCarousel",ref:t},[h(m,{style:$v({visibility:lt(s)?"hidden":"visible"})},{extra:Sn(()=>[h(g,{type:"text",class:"action-button",onclick:lt(o),icon:fn(lt(n)?lt(Yme):lt(Qme))},null,8,["onclick","icon"]),h(g,{type:"text",class:"action-button",onclick:c,icon:fn(lt(rr))},null,8,["icon"])]),_:1},8,["style"]),h(S,{class:"slider"},{default:Sn(()=>[h(v,{span:2,class:"centered-vertically"},{default:Sn(()=>[io("div",{class:"custom-slick-arrow slick-arrow slick-prev centered",onClick:p[0]||(p[0]=$=>u(-1)),style:{left:"10px","z-index":"1"}},[En(h(lt(Cl),null,null,512),[[$o,!lt(s)]])])]),_:1}),h(v,{span:20,class:"centered"},{default:Sn(()=>[lt(i).loading?rd("",!0):(Tn(),ha(STe,{key:0,visibleImg:r.value,onVisibleImg:a,type:l.value},null,8,["visibleImg","type"]))]),_:1}),h(v,{span:2,class:"centered-vertically right"},{default:Sn(()=>[io("div",{class:"custom-slick-arrow slick-arrow slick-prev centered",onClick:p[1]||(p[1]=$=>u(1)),style:{right:"10px"}},[En(h(lt(Zr),null,null,512),[[$o,!lt(s)]])])]),_:1})]),_:1})],512)}}}),CTe=hu($Te,[["__scopeId","data-v-386423b9"]]),xTe={key:0,class:"carousel-container"},wTe={key:0,class:"editable-cell"},OTe={key:0,class:"action-container editable-cell-input-wrapper"},PTe={key:1,class:"action-container editable-cell-text-wrapper"},ITe=["href"],TTe={class:"more-action"},_Te={class:"action-container"},ETe={class:"action-container"},MTe={class:"action-container"},ATe={class:"action-container"},RTe={class:"action-container"},DTe={class:"action-container"},BTe=se({__name:"FileExplorer",setup(e){const t=_l(),n=Rt({}),o=Rt({selectedRowKeys:[]}),r=E(()=>Cr.currentRoute.value.path==="/"?"":Cr.currentRoute.value.path),i=fe([{title:"Name",dataIndex:"name",width:"70%",key:"name",sortDirections:["ascend","descend"],sorter:(c,u,d)=>u.name.localeCompare(c.name)},{title:"Modified",dataIndex:"modified",responsive:["lg"],sortDirections:["ascend","descend"],defaultSortOrder:"descend",sorter:(c,u)=>{const d=new Date(c.modified),p=new Date(u.modified);return dp?1:0},key:"modified"},{title:"Size",dataIndex:"size",responsive:["lg"],sortDirections:["ascend","descend"],sorter:(c,u)=>c.size-u.size,key:"size"},{width:"5%",key:"action"}]),l=c=>{const u=[];c.forEach(d=>{if(t.mainDocument){const p=t.mainDocument.find(g=>g.key===d);p&&u.push(p)}}),t.setSelectedDocuments(u),o.selectedRowKeys=c},a=c=>{n[c]=lTe.cloneDeep(t.mainDocument.filter(u=>c===u.key)[0])},s=c=>{Object.assign(t.mainDocument.filter(u=>c===u.key)[0],n[c]),delete n[c]};return(c,u)=>{const d=Wn,p=hn,g=mm,m=PB;return Tn(),_o("main",null,[!lt(t).loading&<(t).document[0]&<(t).document[0].type==="file"?(Tn(),_o("div",xTe,[h(CTe)])):!lt(t).loading&<(t).mainDocument?(Tn(),ha(m,{key:1,pagination:!1,"row-selection":{selectedRowKeys:o.selectedRowKeys,onChange:l},columns:i.value,"data-source":lt(t).mainDocument},{headerCell:Sn(({column:v})=>[]),bodyCell:Sn(({column:v,record:S})=>[v.key==="name"?(Tn(),_o("div",wTe,[n[S.key]?(Tn(),_o("div",OTe,[h(d,{class:"name",value:n[S.key].name,"onUpdate:value":$=>n[S.key].name=$,onPressEnter:$=>s(S.key)},null,8,["value","onUpdate:value","onPressEnter"]),h(lt(bf),{class:"edit-action editable-cell-icon-check",onClick:$=>s(S.key)},null,8,["onClick"])])):(Tn(),_o("div",PTe,[io("a",{class:"name",href:`#${r.value}/${S.name}`},JS(S.name),9,ITe),h(lt(uS),{class:"edit-action editable-cell-icon",onClick:$=>a(S.key)},null,8,["onClick"])]))])):rd("",!0),v.key==="action"?(Tn(),ha(g,{key:1,trigger:"click"},{content:Sn(()=>[io("div",TTe,[io("div",_Te,[h(p,{type:"text",class:"action-button",icon:fn(lt(a0e))},null,8,["icon"]),Nn("Open ")]),io("div",ETe,[h(p,{type:"text",class:"action-button",icon:fn(lt(uS))},null,8,["icon"]),Nn(" Rename ")]),io("div",MTe,[h(p,{type:"text",class:"action-button",icon:fn(lt(uD))},null,8,["icon"]),Nn(" Share ")]),io("div",ATe,[h(p,{type:"text",class:"action-button",icon:fn(lt(lD))},null,8,["icon"]),Nn(" Copy ")]),io("div",RTe,[h(p,{type:"text",class:"action-button",icon:fn(lt(H0e))},null,8,["icon"]),Nn(" Cut ")]),io("div",DTe,[h(p,{type:"text",class:"action-button",icon:fn(lt(Fm))},null,8,["icon"]),Nn(" Delete ")])])]),default:Sn(()=>[h(p,{type:"text",class:"action-button",icon:fn(lt(bm))},null,8,["icon"])]),_:1})):rd("",!0)]),_:1},8,["row-selection","columns","data-source"])):rd("",!0)])}}}),NTe=hu(BTe,[["__scopeId","data-v-094bcc7c"]]),FTe=se({__name:"ExplorerView",setup(e){const t=_l();function n(o){return!!(o.includes(".")&&!o.endsWith("."))}return tt(async()=>{const o=new String(Cr.currentRoute.value.path);n(o)?t.setActualDocumentFile(o):t.setActualDocument(o.toString()),setTimeout(()=>{t.loading=!1},2e3)}),(o,r)=>(Tn(),ha(NTe))}}),Cr=C6e({history:zIe("/"),routes:[{path:"/:pathMatch(.*)*",name:"explorer",component:FTe}]}),LTe={class:"wrapper"},kTe=se({__name:"App",setup(e){const t=_l(),n=E(()=>{const o=Cr.currentRoute.value.path.split("/").filter(r=>r!=="");return{path:Cr.currentRoute.value.path,pathList:o}});return tt(()=>{const o=new U8e,r=new G8e,i=D_(V8e,o.handleWebSocketMessage),l=D_(K8e,r.handleWebSocketMessage);t.wsWatch=i,t.wsUpload=l}),(o,r)=>(Tn(),_o(ot,null,[io("header",LTe,[h(oTe,{WS:"WS"}),h(iTe,{path:n.value.pathList},null,8,["path"])]),h(lt(lN),{class:"page-container"})],64))}}),zTe=hu(kTe,[["__scopeId","data-v-48270352"]]),Lf=tE(zTe);Lf.config.errorHandler=e=>{console.log(e)};Lf.use(cU());Lf.use($Ie);Lf.use(Cr);Lf.mount("#app")});export default HTe(); +}`;var Wt=R4(function(){return nn(le,bt+"return "+Ue).apply(n,be)});if(Wt.source=Ue,ib(Wt))throw Wt;return Wt}function Bj(f){return rn(f).toLowerCase()}function Nj(f){return rn(f).toUpperCase()}function Fj(f,y,T){if(f=rn(f),f&&(T||y===n))return j2(f);if(!f||!(y=ur(y)))return f;var H=ti(f),q=ti(y),le=W2(H,q),be=V2(H,q)+1;return zl(H,le,be).join("")}function Lj(f,y,T){if(f=rn(f),f&&(T||y===n))return f.slice(0,U2(f)+1);if(!f||!(y=ur(y)))return f;var H=ti(f),q=V2(H,ti(y))+1;return zl(H,0,q).join("")}function kj(f,y,T){if(f=rn(f),f&&(T||y===n))return f.replace(Ve,"");if(!f||!(y=ur(y)))return f;var H=ti(f),q=W2(H,ti(y));return zl(H,q).join("")}function zj(f,y){var T=A,H=R;if(An(y)){var q="separator"in y?y.separator:q;T="length"in y?Ht(y.length):T,H="omission"in y?ur(y.omission):H}f=rn(f);var le=f.length;if(Fs(f)){var be=ti(f);le=be.length}if(T>=le)return f;var xe=T-Ls(H);if(xe<1)return H;var _e=be?zl(be,0,xe).join(""):f.slice(0,xe);if(q===n)return _e+H;if(be&&(xe+=_e.length-xe),lb(q)){if(f.slice(xe).search(q)){var He,We=_e;for(q.global||(q=C0(q.source,rn(No.exec(q))+"g")),q.lastIndex=0;He=q.exec(We);)var Ue=He.index;_e=_e.slice(0,Ue===n?xe:Ue)}}else if(f.indexOf(ur(q),xe)!=xe){var et=_e.lastIndexOf(q);et>-1&&(_e=_e.slice(0,et))}return _e+H}function Hj(f){return f=rn(f),f&&Mn.test(f)?f.replace(Dt,vF):f}var jj=Ks(function(f,y,T){return f+(T?" ":"")+y.toUpperCase()}),cb=D3("toUpperCase");function A4(f,y,T){return f=rn(f),y=T?n:y,y===n?dF(f)?yF(f):nF(f):f.match(y)||[]}var R4=Vt(function(f,y){try{return sr(f,n,y)}catch(T){return ib(T)?T:new Bt(T)}}),Wj=Yi(function(f,y){return Mr(y,function(T){T=wi(T),Gi(f,T,ob(f[T],f))}),f});function Vj(f){var y=f==null?0:f.length,T=Ot();return f=y?In(f,function(H){if(typeof H[1]!="function")throw new Ar(l);return[T(H[0]),H[1]]}):[],Vt(function(H){for(var q=-1;++qD)return[];var T=V,H=wo(f,V);y=Ot(y),f-=V;for(var q=y0(H,y);++T0||y<0)?new Xt(T):(f<0?T=T.takeRight(-f):f&&(T=T.drop(f)),y!==n&&(y=Ht(y),T=y<0?T.dropRight(-y):T.take(y-f)),T)},Xt.prototype.takeRightWhile=function(f){return this.reverse().takeWhile(f).reverse()},Xt.prototype.toArray=function(){return this.take(V)},Ci(Xt.prototype,function(f,y){var T=/^(?:filter|find|map|reject)|While$/.test(y),H=/^(?:head|last)$/.test(y),q=oe[H?"take"+(y=="last"?"Right":""):y],le=H||/^find/.test(y);q&&(oe.prototype[y]=function(){var be=this.__wrapped__,xe=H?[1]:arguments,_e=be instanceof Xt,He=xe[0],We=_e||Ft(be),Ue=function(Kt){var Jt=q.apply(oe,Dl([Kt],xe));return H&&et?Jt[0]:Jt};We&&T&&typeof He=="function"&&He.length!=1&&(_e=We=!1);var et=this.__chain__,bt=!!this.__actions__.length,Pt=le&&!et,Wt=_e&&!bt;if(!le&&We){be=Wt?be:new Xt(this);var It=f.apply(be,xe);return It.__actions__.push({func:Op,args:[Ue],thisArg:n}),new Rr(It,et)}return Pt&&Wt?f.apply(this,xe):(It=this.thru(Ue),Pt?H?It.value()[0]:It.value():It)})}),Mr(["pop","push","shift","sort","splice","unshift"],function(f){var y=Zf[f],T=/^(?:push|sort|unshift)$/.test(f)?"tap":"thru",H=/^(?:pop|shift)$/.test(f);oe.prototype[f]=function(){var q=arguments;if(H&&!this.__chain__){var le=this.value();return y.apply(Ft(le)?le:[],q)}return this[T](function(be){return y.apply(Ft(be)?be:[],q)})}}),Ci(Xt.prototype,function(f,y){var T=oe[y];if(T){var H=T.name+"";an.call(js,H)||(js[H]=[]),js[H].push({name:y,func:T})}}),js[bp(n,$).name]=[{name:"wrapper",func:n}],Xt.prototype.clone=HF,Xt.prototype.reverse=jF,Xt.prototype.value=WF,oe.prototype.at=bz,oe.prototype.chain=yz,oe.prototype.commit=Sz,oe.prototype.next=$z,oe.prototype.plant=xz,oe.prototype.reverse=wz,oe.prototype.toJSON=oe.prototype.valueOf=oe.prototype.value=Oz,oe.prototype.first=oe.prototype.head,Cu&&(oe.prototype[Cu]=Cz),oe},ks=SF();Pa?((Pa.exports=ks)._=ks,d0._=ks):go._=ks}).call(Sr)})(gv,gv.exports);var lTe=gv.exports;function TN(e){return xv()?(QS(e),!0):!1}function x2(e){return typeof e=="function"?e():lt(e)}const _N=typeof window<"u"&&typeof document<"u",aTe=Object.prototype.toString,sTe=e=>aTe.call(e)==="[object Object]",U_=()=>+Date.now(),KS=()=>{};function cTe(e,t){function n(...o){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(r).catch(i)})}return n}function uTe(e,t=!0,n=!0,o=!1){let r=0,i,l=!0,a=KS,s;const c=()=>{i&&(clearTimeout(i),i=void 0,a(),a=KS)};return d=>{const p=x2(e),g=Date.now()-r,m=()=>s=d();return c(),p<=0?(r=Date.now(),m()):(g>p&&(n||!l)?(r=Date.now(),m()):t&&(s=new Promise((v,S)=>{a=o?S:v,i=setTimeout(()=>{r=Date.now(),l=!0,v(m()),c()},Math.max(0,p-g))})),!n&&!i&&(i=setTimeout(()=>l=!0,p)),l=!1,s)}}function US(e){var t;const n=x2(e);return(t=n==null?void 0:n.$el)!=null?t:n}const EN=_N?window:void 0,dTe=_N?window.document:void 0;function vv(...e){let t,n,o,r;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,o,r]=e,t=EN):[t,n,o,r]=e,!t)return KS;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const i=[],l=()=>{i.forEach(u=>u()),i.length=0},a=(u,d,p,g)=>(u.addEventListener(d,p,g),()=>u.removeEventListener(d,p,g)),s=Te(()=>[US(t),x2(r)],([u,d])=>{if(l(),!u)return;const p=sTe(d)?{...d}:d;i.push(...n.flatMap(g=>o.map(m=>a(u,g,m,p))))},{immediate:!0,flush:"post"}),c=()=>{s(),l()};return TN(c),c}function fTe(){const e=fe(!1);return eo()&&st(()=>{e.value=!0}),e}function pTe(e){const t=fTe();return E(()=>(t.value,!!e()))}const G_=["fullscreenchange","webkitfullscreenchange","webkitendfullscreen","mozfullscreenchange","MSFullscreenChange"];function hTe(e,t={}){const{document:n=dTe,autoExit:o=!1}=t,r=E(()=>{var $;return($=US(e))!=null?$:n==null?void 0:n.querySelector("html")}),i=fe(!1),l=E(()=>["requestFullscreen","webkitRequestFullscreen","webkitEnterFullscreen","webkitEnterFullScreen","webkitRequestFullScreen","mozRequestFullScreen","msRequestFullscreen"].find($=>n&&$ in n||r.value&&$ in r.value)),a=E(()=>["exitFullscreen","webkitExitFullscreen","webkitExitFullScreen","webkitCancelFullScreen","mozCancelFullScreen","msExitFullscreen"].find($=>n&&$ in n||r.value&&$ in r.value)),s=E(()=>["fullScreen","webkitIsFullScreen","webkitDisplayingFullscreen","mozFullScreen","msFullscreenElement"].find($=>n&&$ in n||r.value&&$ in r.value)),c=["fullscreenElement","webkitFullscreenElement","mozFullScreenElement","msFullscreenElement"].find($=>n&&$ in n),u=pTe(()=>r.value&&n&&l.value!==void 0&&a.value!==void 0&&s.value!==void 0),d=()=>c?(n==null?void 0:n[c])===r.value:!1,p=()=>{if(s.value){if(n&&n[s.value]!=null)return n[s.value];{const $=r.value;if(($==null?void 0:$[s.value])!=null)return!!$[s.value]}}return!1};async function g(){if(!(!u.value||!i.value)){if(a.value)if((n==null?void 0:n[a.value])!=null)await n[a.value]();else{const $=r.value;($==null?void 0:$[a.value])!=null&&await $[a.value]()}i.value=!1}}async function m(){if(!u.value||i.value)return;p()&&await g();const $=r.value;l.value&&($==null?void 0:$[l.value])!=null&&(await $[l.value](),i.value=!0)}async function v(){await(i.value?g():m())}const S=()=>{const $=p();(!$||$&&d())&&(i.value=$)};return vv(n,G_,S,!1),vv(()=>US(r),G_,S,!1),o&&TN(g),{isSupported:u,isFullscreen:i,enter:m,exit:g,toggle:v}}const gTe=["mousemove","mousedown","resize","keydown","touchstart","wheel"],vTe=6e4;function mTe(e=vTe,t={}){const{initialState:n=!1,listenForVisibilityChange:o=!0,events:r=gTe,window:i=EN,eventFilter:l=uTe(50)}=t,a=fe(n),s=fe(U_());let c;const u=()=>{a.value=!1,clearTimeout(c),c=setTimeout(()=>a.value=!0,e)},d=cTe(l,()=>{s.value=U_(),u()});if(i){const p=i.document;for(const g of r)vv(i,g,d,{passive:!0});o&&vv(p,"visibilitychange",()=>{p.hidden||d()}),u()}return{idle:a,lastActive:s,reset:u}}const bTe=["data"],yTe={key:2},STe=se({__name:"FileViewer",props:{type:{},visibleImg:{type:Boolean}},emits:{visibleImg(e){return e}},setup(e,{emit:t}){const n=e,o=fe("");tt(()=>{console.log("😎😎😎😎"),console.log(K_),console.log(Cr.currentRoute),console.log(Cr.currentRoute.value.path),console.log("----------"),o.value=new URL(K_+Cr.currentRoute.value.path,location.origin).toString()});function r(i){t("visibleImg",i)}return(i,l)=>{const a=d9;return n.type==="pdf"?(Tn(),_o("object",{key:0,data:o.value,type:"application/pdf",width:"100%",height:"100%"},null,8,bTe)):n.type==="image"?(Tn(),ha(a,{key:1,width:"50%",src:o.value,onClick:l[0]||(l[0]=()=>r(!0)),previewMask:!1,preview:{visibleImg:i.visibleImg,onVisibleChange:r}},null,8,["src","preview"])):(Tn(),_o("h1",yTe," Unsupported file type "))}}}),$Te=se({__name:"FileCarousel",setup(e){const t=fe(null),{isFullscreen:n,toggle:o}=hTe(t),r=fe(!1),i=_l(),l=fe(void 0);tt(()=>{if(i.mainDocument[0]&&i.mainDocument[0].type==="file"){const d=i.mainDocument[0].ext;l.value=P6e(d)}});function a(d){r.value=d}const{idle:s}=mTe(2e3);function c(){const p=Cr.currentRoute.value.path.split("/").filter(m=>m);p.length<=1?p[0]="/":p.pop();const g=p.join("/");Cr.push(g)}function u(d){const p=decodeURIComponent(new String(Cr.currentRoute.value.path)),g=i.getNextDocumentInRoute(d,p);let m=p.split("/");m.pop(),m.push(g),m=m.join("/"),Cr.push(m)}return(d,p)=>{const g=hn,m=B9,v=JR,S=N9;return Tn(),_o("div",{class:"carousel",ref_key:"fileCarousel",ref:t},[h(m,{style:$v({visibility:lt(s)?"hidden":"visible"})},{extra:Sn(()=>[h(g,{type:"text",class:"action-button",onclick:lt(o),icon:fn(lt(n)?lt(Yme):lt(Qme))},null,8,["onclick","icon"]),h(g,{type:"text",class:"action-button",onclick:c,icon:fn(lt(rr))},null,8,["icon"])]),_:1},8,["style"]),h(S,{class:"slider"},{default:Sn(()=>[h(v,{span:2,class:"centered-vertically"},{default:Sn(()=>[io("div",{class:"custom-slick-arrow slick-arrow slick-prev centered",onClick:p[0]||(p[0]=$=>u(-1)),style:{left:"10px","z-index":"1"}},[En(h(lt(Cl),null,null,512),[[$o,!lt(s)]])])]),_:1}),h(v,{span:20,class:"centered"},{default:Sn(()=>[lt(i).loading?rd("",!0):(Tn(),ha(STe,{key:0,visibleImg:r.value,onVisibleImg:a,type:l.value},null,8,["visibleImg","type"]))]),_:1}),h(v,{span:2,class:"centered-vertically right"},{default:Sn(()=>[io("div",{class:"custom-slick-arrow slick-arrow slick-prev centered",onClick:p[1]||(p[1]=$=>u(1)),style:{right:"10px"}},[En(h(lt(Zr),null,null,512),[[$o,!lt(s)]])])]),_:1})]),_:1})],512)}}}),CTe=hu($Te,[["__scopeId","data-v-386423b9"]]),xTe={key:0,class:"carousel-container"},wTe={key:0,class:"editable-cell"},OTe={key:0,class:"action-container editable-cell-input-wrapper"},PTe={key:1,class:"action-container editable-cell-text-wrapper"},ITe=["href"],TTe={class:"more-action"},_Te={class:"action-container"},ETe={class:"action-container"},MTe={class:"action-container"},ATe={class:"action-container"},RTe={class:"action-container"},DTe={class:"action-container"},BTe=se({__name:"FileExplorer",setup(e){const t=_l(),n=Rt({}),o=Rt({selectedRowKeys:[]}),r=E(()=>Cr.currentRoute.value.path==="/"?"":Cr.currentRoute.value.path),i=fe([{title:"Name",dataIndex:"name",width:"70%",key:"name",sortDirections:["ascend","descend"],sorter:(c,u,d)=>u.name.localeCompare(c.name)},{title:"Modified",dataIndex:"modified",responsive:["lg"],sortDirections:["ascend","descend"],defaultSortOrder:"descend",sorter:(c,u)=>{const d=new Date(c.modified),p=new Date(u.modified);return dp?1:0},key:"modified"},{title:"Size",dataIndex:"size",responsive:["lg"],sortDirections:["ascend","descend"],sorter:(c,u)=>c.size-u.size,key:"size"},{width:"5%",key:"action"}]),l=c=>{const u=[];c.forEach(d=>{if(t.mainDocument){const p=t.mainDocument.find(g=>g.key===d);p&&u.push(p)}}),t.setSelectedDocuments(u),o.selectedRowKeys=c},a=c=>{n[c]=lTe.cloneDeep(t.mainDocument.filter(u=>c===u.key)[0])},s=c=>{Object.assign(t.mainDocument.filter(u=>c===u.key)[0],n[c]),delete n[c]};return(c,u)=>{const d=Wn,p=hn,g=mm,m=PB;return Tn(),_o("main",null,[!lt(t).loading&<(t).document[0]&<(t).document[0].type==="file"?(Tn(),_o("div",xTe,[h(CTe)])):!lt(t).loading&<(t).mainDocument?(Tn(),ha(m,{key:1,pagination:!1,"row-selection":{selectedRowKeys:o.selectedRowKeys,onChange:l},columns:i.value,"data-source":lt(t).mainDocument},{headerCell:Sn(({column:v})=>[]),bodyCell:Sn(({column:v,record:S})=>[v.key==="name"?(Tn(),_o("div",wTe,[n[S.key]?(Tn(),_o("div",OTe,[h(d,{class:"name",value:n[S.key].name,"onUpdate:value":$=>n[S.key].name=$,onPressEnter:$=>s(S.key)},null,8,["value","onUpdate:value","onPressEnter"]),h(lt(bf),{class:"edit-action editable-cell-icon-check",onClick:$=>s(S.key)},null,8,["onClick"])])):(Tn(),_o("div",PTe,[io("a",{class:"name",href:`#${r.value}/${S.name}`},JS(S.name),9,ITe),h(lt(uS),{class:"edit-action editable-cell-icon",onClick:$=>a(S.key)},null,8,["onClick"])]))])):rd("",!0),v.key==="action"?(Tn(),ha(g,{key:1,trigger:"click"},{content:Sn(()=>[io("div",TTe,[io("div",_Te,[h(p,{type:"text",class:"action-button",icon:fn(lt(a0e))},null,8,["icon"]),Nn("Open ")]),io("div",ETe,[h(p,{type:"text",class:"action-button",icon:fn(lt(uS))},null,8,["icon"]),Nn(" Rename ")]),io("div",MTe,[h(p,{type:"text",class:"action-button",icon:fn(lt(uD))},null,8,["icon"]),Nn(" Share ")]),io("div",ATe,[h(p,{type:"text",class:"action-button",icon:fn(lt(lD))},null,8,["icon"]),Nn(" Copy ")]),io("div",RTe,[h(p,{type:"text",class:"action-button",icon:fn(lt(H0e))},null,8,["icon"]),Nn(" Cut ")]),io("div",DTe,[h(p,{type:"text",class:"action-button",icon:fn(lt(Fm))},null,8,["icon"]),Nn(" Delete ")])])]),default:Sn(()=>[h(p,{type:"text",class:"action-button",icon:fn(lt(bm))},null,8,["icon"])]),_:1})):rd("",!0)]),_:1},8,["row-selection","columns","data-source"])):rd("",!0)])}}}),NTe=hu(BTe,[["__scopeId","data-v-094bcc7c"]]),FTe=se({__name:"ExplorerView",setup(e){const t=_l();function n(o){return!!(o.includes(".")&&!o.endsWith("."))}return tt(async()=>{const o=new String(Cr.currentRoute.value.path);n(o)?t.setActualDocumentFile(o):t.setActualDocument(o.toString()),setTimeout(()=>{t.loading=!1},2e3)}),(o,r)=>(Tn(),ha(NTe))}}),Cr=C6e({history:zIe("/"),routes:[{path:"/:pathMatch(.*)*",name:"explorer",component:FTe}]}),LTe={class:"wrapper"},kTe=se({__name:"App",setup(e){const t=_l(),n=E(()=>{const o=Cr.currentRoute.value.path.split("/").filter(r=>r!=="");return{path:Cr.currentRoute.value.path,pathList:o}});return tt(()=>{const o=new U8e,r=new G8e,i=D_(V8e,o.handleWebSocketMessage),l=D_(K8e,r.handleWebSocketMessage);t.wsWatch=i,t.wsUpload=l}),(o,r)=>(Tn(),_o(ot,null,[io("header",LTe,[h(oTe,{WS:"WS"}),h(iTe,{path:n.value.pathList},null,8,["path"])]),h(lt(lN),{class:"page-container"})],64))}}),zTe=hu(kTe,[["__scopeId","data-v-48270352"]]),Lf=tE(zTe);Lf.config.errorHandler=e=>{console.log(e)};Lf.use(cU());Lf.use($Ie);Lf.use(Cr);Lf.mount("#app")});export default HTe(); diff --git a/cista/wwwroot/index.html b/cista/wwwroot/index.html index 80b2a7f..326c24c 100644 --- a/cista/wwwroot/index.html +++ b/cista/wwwroot/index.html @@ -5,7 +5,7 @@ Vite Vasanko - +