server/dist/files_sharing-init-public.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

2 строки
56 KiB
JavaScript
Исходник Обычный вид История

(()=>{"use strict";var t,e,n,r={51528:(t,e,n)=>{var r=n(35810),i=n(32981),s=n(53334),o=n(50352),a=n(85471);const l='<svg xmlns="http://www.w3.org/2000/svg" id="mdi-link" viewBox="0 0 24 24"><path d="M3.9,12C3.9,10.29 5.29,8.9 7,8.9H11V7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H11V15.1H7C5.29,15.1 3.9,13.71 3.9,12M8,13H16V11H8V13M17,7H13V8.9H17C18.71,8.9 20.1,10.29 20.1,12C20.1,13.71 18.71,15.1 17,15.1H13V17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7Z" /></svg>';var d=n(36117),u=n(43627);const c=(0,r.H4)();var h=n(35947);const p=(0,h.YK)().setApp("files").detectUser().build(),f=t=>(0,r.Al)(t),g=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/";t=(0,u.join)(r.lJ,t);const e=new AbortController,n=(0,r.VL)();return new d.CancelablePromise((async(r,i,s)=>{s((()=>e.abort()));try{const i=await c.getDirectoryContents(t,{details:!0,data:n,includeSelf:!0,signal:e.signal}),s=i.data[0],o=i.data.slice(1);if(s.filename!==t&&`${s.filename}/`!==t)throw p.debug(`Exepected "${t}" but got filename "${s.filename}" instead.`),new Error("Root node does not match requested path");r({folder:f(s),contents:o.map((t=>{try{return f(t)}catch(e){return p.error(`Invalid node detected '${t.basename}'`,{error:e}),null}})).filter(Boolean)})}catch(t){i(t)}}))},m=(0,h.YK)().setApp("files_sharing").detectUser().build();var E=n(63814),w=n(82490),v=n(40173);const N=(0,i.C)("files_sharing","view"),b=(0,i.C)("files_sharing","sharingToken");a.Ay.use(v.Ay);const y=v.Ay.prototype.push;v.Ay.prototype.push=function(t,e,n){return e||n?y.call(this,t,e,n):y.call(this,t).catch((t=>t))};const x=new v.Ay({mode:"history",base:(0,E.Jv)("/s"),linkActiveClass:"active",routes:[{path:"/",redirect:{name:"filelist",params:{view:N,token:b}}},{path:"/:token",name:"filelist",props:!0}],stringifyQuery(t){const e=w.A.stringify(t).replace(/%2F/gim,"/");return e?"?"+e:""}});(()=>{const t=(0,i.C)("files_sharing","filename");let e,l;const d=new r.Ss({id:"public-file-drop",name:(0,s.Tl)("files_sharing","File drop"),caption:(0,s.Tl)("files_sharing","Upload files to {foldername}",{foldername:t}),icon:o,order:1,emptyView:async r=>{if(void 0===e){const{default:t}=await Promise.all([n.e(4208),n.e(9087)]).then(n.bind(n,99087));e=a.Ay.extend(t)}l&&l.$destroy(),l=new e({propsData:{foldername:t}}),l.$mount(r)},getContents:async()=>({contents:[],folder:new r.vd({id:0,source:`${r.PY}${r.lJ}`,root:r.lJ,owner:null,permissions:r.aX.CREATE})})});(0,r.bh)().register(d)})(),(()=>{const t=new r.Ss({id:"public-share",name:(0,s.Tl)("files_sharing","Public share"),caption:(0,s.Tl)("files_sharing","Public shared files."),emptyTitle:(0,s.Tl)("files_sharing","No files"),emptyCaption:(0,s.Tl)("files_sharing","Files and folders shared with you will show up here"),icon:l,order:1,getContents:g});(0,r.bh)().register(t)})(),(()=>{const t=new r.Ss({id:"public-file-share",name:(0,s.Tl)("files_sharing","Public file share"),caption:(0,s.Tl)("files_sharing","Public shared file."),emptyTitle:(0,s.Tl)("files_sharing","No file"),emptyCaption:(0,s.Tl)("files_sharing","The file shared with you will show up here"),icon:l,order:1,getContents:()=>new d.CancelablePromise((async(t,e,n)=>{const i=new AbortController;n((()=>i.abort()));try{const e=await c.stat(r.lJ,{data:(0,r.VL)(),details:!0,signal:i.signal});t({contents:[(0,r.Al)(e.data)],folder:new r.vd({id:0,source:`${r.PY}${r.lJ}`,root:r.lJ,owner:null,permissions:r.aX.READ,attributes:{note:e.data.props?.note}})})}catch(t){m.error(t),e(t)}}))});(0,r.bh)().register(t)})();const I=(0,i.C)("files_sharing","view"),O=(0,r.bh)();O.setActive(O.views.find((t=>{let{id:e}=t;return e===I}))??null),window.OCP.Files=window.OCP.Files??{},window.OCP.Files.Router=new class{constructor(t){var e,n,r;e=this,r=void 0,(n=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(n="router"))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}
//# sourceMappingURL=files_sharing-init-public.js.map?v=95de7fc139eac39ef100