r2-explorer 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/README.md +50 -47
  2. package/dashboard/assets/{AuthLayout.297460d7.js → AuthLayout.47bc4d6b.js} +1 -1
  3. package/dashboard/{spa/assets/EmailFilePage.f737d2d4.js → assets/EmailFilePage.5146dfaa.js} +1 -1
  4. package/dashboard/{spa/assets/ErrorNotFound.be9ef3ac.js → assets/ErrorNotFound.2be1d090.js} +1 -1
  5. package/dashboard/{spa/assets/LoginPage.fbddb0c0.js → assets/LoginPage.e449cd8d.js} +1 -1
  6. package/dashboard/assets/auth-store.1a4593f8.js +1 -0
  7. package/dashboard/assets/auth.a5ffeab6.js +1 -0
  8. package/dashboard/assets/{bus.b6904cee.js → bus.67913454.js} +1 -1
  9. package/dashboard/assets/{index.c9ff738b.css → index.7e109f1f.css} +1 -1
  10. package/dashboard/assets/{index.b2fb13c9.js → index.ddf53a58.js} +3 -3
  11. package/dashboard/index.html +5 -7
  12. package/dashboard/spa/assets/{AuthLayout.297460d7.js → AuthLayout.47bc4d6b.js} +1 -1
  13. package/dashboard/{assets/EmailFilePage.f737d2d4.js → spa/assets/EmailFilePage.5146dfaa.js} +1 -1
  14. package/dashboard/{assets/ErrorNotFound.be9ef3ac.js → spa/assets/ErrorNotFound.2be1d090.js} +1 -1
  15. package/dashboard/{assets/LoginPage.fbddb0c0.js → spa/assets/LoginPage.e449cd8d.js} +1 -1
  16. package/dashboard/spa/assets/auth-store.1a4593f8.js +1 -0
  17. package/dashboard/spa/assets/auth.a5ffeab6.js +1 -0
  18. package/dashboard/spa/assets/{bus.b6904cee.js → bus.67913454.js} +1 -1
  19. package/dashboard/spa/assets/{index.c9ff738b.css → index.7e109f1f.css} +1 -1
  20. package/dashboard/spa/assets/{index.b2fb13c9.js → index.ddf53a58.js} +3 -3
  21. package/dashboard/spa/index.html +5 -7
  22. package/dist/index.d.mts +0 -5
  23. package/dist/index.d.ts +0 -5
  24. package/dist/index.js +41 -62
  25. package/dist/index.mjs +33 -54
  26. package/package.json +5 -5
  27. package/dashboard/assets/auth-store.748ba7e9.js +0 -1
  28. package/dashboard/assets/auth.221c63c3.js +0 -1
  29. package/dashboard/spa/assets/auth-store.748ba7e9.js +0 -1
  30. package/dashboard/spa/assets/auth.221c63c3.js +0 -1
package/README.md CHANGED
@@ -1,64 +1,67 @@
1
- [![Commit rate](https://img.shields.io/github/commit-activity/m/G4brym/R2-Explorer?label=Commits&style=social)](https://github.com/G4brym/R2-Explorer/commits/main) [![Issues](https://img.shields.io/github/issues/G4brym/R2-Explorer?style=social)](https://github.com/G4brym/R2-Explorer/issues) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=social)](LICENSE)
2
-
3
- Read this in other languages: [Español](READMEes.md), [Português](READMEpt.md), [Français](READMEfr.md)
4
-
5
- # R2-Explorer
1
+ <div align="center">
2
+ <a href="https://r2explorer.dev/">
3
+ <img src="https://raw.githubusercontent.com/G4brym/R2-explorer/refs/heads/main/packages/docs/pages/assets/r2-explorer-logo.png" width="500" height="auto" alt="R2-Explorer"/>
4
+ </a>
5
+ </div>
6
6
 
7
7
  <p align="center">
8
8
  <em>A Google Drive Interface for your Cloudflare R2 Buckets!</em>
9
9
  </p>
10
10
 
11
- <p>
12
- This project is deployed/self-hosted in your own Cloudflare Account as a Worker, and no credential/token is required to
13
- start using it.
11
+ <p align="center">
12
+ <a href="https://github.com/G4brym/R2-Explorer/commits/main" target="_blank">
13
+ <img src="https://img.shields.io/github/commit-activity/m/G4brym/R2-Explorer?label=Commits&style=social" alt="R2-Explorer Commits">
14
+ </a>
15
+ <a href="https://github.com/G4brym/R2-Explorer/issues" target="_blank">
16
+ <img src="https://img.shields.io/github/issues/G4brym/R2-Explorer?style=social" alt="Issues">
17
+ </a>
18
+ <a href="https://github.com/G4brym/R2-Explorer/blob/main/LICENSE" target="_blank">
19
+ <img src="https://img.shields.io/badge/license-MIT-brightgreen.svg?style=social" alt="Software License">
20
+ </a>
14
21
  </p>
15
22
 
16
- ---
23
+ <hr />
17
24
 
18
- **Documentation**: <a href="https://r2explorer.dev" target="_blank">https://r2explorer.dev</a>
25
+ **Documentation**: <a href="https://r2explorer.dev/">r2explorer.dev</a>
19
26
 
20
- **Live Demo**: <a href="https://demo.r2explorer.dev" target="_blank">https://demo.r2explorer.dev</a>
21
-
22
- ---
23
-
24
- ## Features
27
+ **Demo**: <a href="https://demo.r2explorer.dev/">demo.r2explorer.dev</a>
25
28
 
26
- - PWA support (install this app on your phone)
27
- - [Email Explorer](https://r2explorer.dev/guides/setup-email-explorer/) (using Cloudflare Email Routing)
28
- - [Basic Auth](https://r2explorer.dev/getting-started/security/#basic-auth)
29
- - [Cloudflare Access Authentication](https://r2explorer.dev/getting-started/security/)
30
- - Very quick bucket/folder navigation
31
- - pdf, image, txt, markdown, csv, etc in-browser preview
32
- - Drag-and-Drop upload
33
- - Multiple files and folder uploads
34
- - Create folders
35
- - Upload/Rename/Download/Delete files
36
- - Right click in file for extra options
37
- - Multipart upload for big files
38
- - File editing
29
+ **Source Code**: <a href="https://github.com/G4brym/R2-Explorer/">github.com/G4brym/R2-Explorer</a>
39
30
 
40
- ## Getting Started
31
+ <hr />
41
32
 
42
- Run this command to get an example project setup
33
+ Read this in other languages: [Español](https://r2explorer-dev.translate.goog/?_x_tr_sl=en&_x_tr_tl=es&_x_tr_hl=es&_x_tr_pto=wapp),
34
+ [Português](https://r2explorer-dev.translate.goog/?_x_tr_sl=en&_x_tr_tl=pt-PT&_x_tr_hl=pt-PT&_x_tr_pto=wapp),
35
+ [Français](https://r2explorer-dev.translate.goog/?_x_tr_sl=en&_x_tr_tl=fr&_x_tr_hl=fr&_x_tr_pto=wapp)
43
36
 
44
- ```bash
45
- npm create cloudflare@latest r2-explorer -- --template "G4brym/R2-Explorer/template"
46
- ```
47
-
48
- ## Upgrading your installation
49
-
50
- In order to update to the latest version you just need to install the latest r2-explorer package from npm and re-deploy
51
- your application
52
-
53
- ```bash
54
- npm install r2-explorer@latest --save
55
- ```
56
-
57
- ```bash
58
- wrangler publish
59
- ```
37
+ ## Features
60
38
 
61
- ## TODO
39
+ - Self-hosted/Deployed on your own Cloudflare Account
40
+ - [Receive and read emails](https://r2explorer.dev/guides/setup-email-explorer/) (via Cloudflare Email Routing)
41
+ - Security:
42
+ - [Basic Auth](https://r2explorer.dev/getting-started/security/#basic-auth)
43
+ - [Cloudflare Access](https://r2explorer.dev/getting-started/security/#authenticating-with-cloudflare-access)
44
+ - Managing files:
45
+ - In-browser File preview (pdf, image, txt, markdown, csv, logpush...)
46
+ - In-browser File editing
47
+ - Drag-and-Drop upload
48
+ - Upload files or folders with files
49
+ - Multipart upload for big files
50
+ - HTTP/Custom metadata edit
51
+ - Organization:
52
+ - Create folders
53
+ - Upload/Rename/Download/Delete files
54
+ - Right click in file for extra options
55
+
56
+ ## Installation
57
+
58
+ 1. Method: [Github Action](https://r2explorer.dev/getting-started/creating-a-new-project/#1st-method-github-action-recommended)
59
+ 2. Method: [Create Cloudflare CLI](https://r2explorer.dev/getting-started/creating-a-new-project/#2nd-method-create-cloudflare)
60
+ 3. Method: [Template](https://github.com/G4brym/R2-Explorer/tree/main/template)
61
+
62
+ Learn more about keeping your instance updated in the [Updating your project docs](https://r2explorer.dev/getting-started/updating-your-project/).
63
+
64
+ ## Coming soon
62
65
 
63
66
  - allow bucket names with spaces
64
67
  - Search files
@@ -1 +1 @@
1
- import{_ as a,c as n,r,o as s,e as c,w as e,Q as _,f as o,g as p}from"./index.b2fb13c9.js";const u=n({name:"AuthLayout",components:{}});function f(i,d,l,m,h,v){const t=r("router-view");return s(),c(_,{view:"hHh lpR fFf"},{default:e(()=>[o(p,{class:"container"},{default:e(()=>[o(t)]),_:1})]),_:1})}var x=a(u,[["render",f]]);export{x as default};
1
+ import{_ as a,c as n,r,o as s,e as c,w as e,Q as _,f as o,g as p}from"./index.ddf53a58.js";const u=n({name:"AuthLayout",components:{}});function f(i,d,l,m,h,v){const t=r("router-view");return s(),c(_,{view:"hHh lpR fFf"},{default:e(()=>[o(p,{class:"container"},{default:e(()=>[o(t)]),_:1})]),_:1})}var x=a(u,[["render",f]]);export{x as default};
@@ -1,2 +1,2 @@
1
- import{h as te,G as _e,H as Se,I as q,J as W,K as Te,L as $e,M as Pe,N as x,k as _,O as N,P as Be,R as Ce,S as qe,T as He,U as Ee,V as Me,W as Ae,X as z,Y as D,Z as U,$ as V,a0 as Fe,a1 as j,a2 as R,a3 as Oe,l as M,a4 as Ie,n as Le,a5 as Qe,m as ae,a6 as We,_ as xe,c as Ne,a7 as G,a8 as J,a9 as ze,aa as w,u as De,ab as Ue,o as u,ac as p,f as s,w as o,F as K,ad as Ve,x as $,E as P,z as b,ae as X,e as H,B as Y,y as d,A as v,t as Z,af as ee,ag as je,ah as Re}from"./index.b2fb13c9.js";var E=te({name:"QTooltip",inheritAttrs:!1,props:{..._e,...Se,...q,maxHeight:{type:String,default:null},maxWidth:{type:String,default:null},transitionShow:{...q.transitionShow,default:"jump-down"},transitionHide:{...q.transitionHide,default:"jump-up"},anchor:{type:String,default:"bottom middle",validator:W},self:{type:String,default:"top middle",validator:W},offset:{type:Array,default:()=>[14,14],validator:Te},scrollTarget:$e,delay:{type:Number,default:0},hideDelay:{type:Number,default:0},persistent:Boolean},emits:[...Pe],setup(e,{slots:t,emit:m,attrs:l}){let a,n;const r=Le(),{proxy:{$q:c}}=r,g=x(null),S=x(!1),se=_(()=>N(e.anchor,c.lang.rtl)),le=_(()=>N(e.self,c.lang.rtl)),ne=_(()=>e.persistent!==!0),{registerTick:oe,removeTick:ie}=Be(),{registerTimeout:T}=Ce(),{transitionProps:re,transitionStyle:de}=qe(e),{localScrollTarget:A,changeScrollEvent:ce,unconfigureScrollTarget:ue}=He(e,L),{anchorEl:f,canShow:fe,anchorEvents:k}=Ee({showing:S,configureAnchorEl:ye}),{show:me,hide:B}=Me({showing:S,canShow:fe,handleShow:pe,handleHide:ve,hideOnRouteChange:ne,processOnMount:!0});Object.assign(k,{delayShow:ge,delayHide:ke});const{showPortal:F,hidePortal:O,renderPortal:he}=Ae(r,g,be,"tooltip");if(c.platform.is.mobile===!0){const i={anchorEl:f,innerRef:g,onClickOutside(h){return B(h),h.target.classList.contains("q-dialog__backdrop")&&We(h),!0}},C=_(()=>e.modelValue===null&&e.persistent!==!0&&S.value===!0);z(C,h=>{(h===!0?Qe:U)(i)}),D(()=>{U(i)})}function pe(i){F(),oe(()=>{n=new MutationObserver(()=>y()),n.observe(g.value,{attributes:!1,childList:!0,characterData:!0,subtree:!0}),y(),L()}),a===void 0&&(a=z(()=>c.screen.width+"|"+c.screen.height+"|"+e.self+"|"+e.anchor+"|"+c.lang.rtl,y)),T(()=>{F(!0),m("show",i)},e.transitionDuration)}function ve(i){ie(),O(),I(),T(()=>{O(!0),m("hide",i)},e.transitionDuration)}function I(){n!==void 0&&(n.disconnect(),n=void 0),a!==void 0&&(a(),a=void 0),ue(),V(k,"tooltipTemp")}function y(){Fe({targetEl:g.value,offset:e.offset,anchorEl:f.value,anchorOrigin:se.value,selfOrigin:le.value,maxHeight:e.maxHeight,maxWidth:e.maxWidth})}function ge(i){if(c.platform.is.mobile===!0){j(),document.body.classList.add("non-selectable");const C=f.value,h=["touchmove","touchcancel","touchend","click"].map(Q=>[C,Q,"delayHide","passiveCapture"]);R(k,"tooltipTemp",h)}T(()=>{me(i)},e.delay)}function ke(i){c.platform.is.mobile===!0&&(V(k,"tooltipTemp"),j(),setTimeout(()=>{document.body.classList.remove("non-selectable")},10)),T(()=>{B(i)},e.hideDelay)}function ye(){if(e.noParentEvent===!0||f.value===null)return;const i=c.platform.is.mobile===!0?[[f.value,"touchstart","delayShow","passive"]]:[[f.value,"mouseenter","delayShow","passive"],[f.value,"mouseleave","delayHide","passive"]];R(k,"anchor",i)}function L(){if(f.value!==null||e.scrollTarget!==void 0){A.value=Oe(f.value,e.scrollTarget);const i=e.noParentEvent===!0?y:B;ce(A.value,i)}}function we(){return S.value===!0?M("div",{...l,ref:g,class:["q-tooltip q-tooltip--style q-position-engine no-pointer-events",l.class],style:[l.style,de.value],role:"tooltip"},ae(t.default)):null}function be(){return M(Ie,re.value,we)}return D(I),Object.assign(r.proxy,{updatePosition:y}),he}}),Ge=te({name:"QBtnGroup",props:{unelevated:Boolean,outline:Boolean,flat:Boolean,rounded:Boolean,square:Boolean,push:Boolean,stretch:Boolean,glossy:Boolean,spread:Boolean},setup(e,{slots:t}){const m=_(()=>{const l=["unelevated","outline","flat","rounded","square","push","stretch","glossy"].filter(a=>e[a]===!0).map(a=>`q-btn-group--${a}`).join(" ");return`q-btn-group row no-wrap${l.length!==0?" "+l:""}`+(e.spread===!0?" q-btn-group--spread":" inline")});return()=>M("div",{class:m.value},ae(t.default))}});const Je=Ne({name:"EmailFolderPage",data:()=>({srcdoc:null,file:null,fileHead:null,timeInterval:null,attachments:[]}),computed:{selectedBucket:function(){return this.$route.params.bucket},selectedFolder:function(){return this.$route.params.folder},selectedFile:function(){return this.$route.params.file},filePath:function(){const e=G(this.selectedFile);return`.r2-explorer/emails/${this.selectedFolder}/${e}`}},watch:{selectedBucket(e){this.$router.push({name:"email-folder",params:{bucket:e,folder:J(this.selectedFolder)}})}},methods:{timeSince:ze,contentFinishedLoading(){clearInterval(this.timeInterval),this.timeInterval=null,this.resizeIframe()},resizeIframe(){this.$refs.renderWindow&&(this.$refs.renderWindow.style.height=`${this.$refs.renderWindow.contentWindow.document.documentElement.scrollHeight}px`)},fetchEmail:async function(){const e=G(this.selectedFile),t=await w.downloadFile(this.selectedBucket,this.filePath,{}),m=e.split(".json")[0];this.file=t.data;let l=t.data.html;if(l){l=l.replaceAll(/<a(.*?)>(.*?)<\/a>/gi,'<a$1 target="_blank">$2</a>');for(const a of t.data.attachments){a.display=!0,a.downloadUrl=`${this.mainStore.serverUrl}/api/buckets/${this.selectedBucket}/${J(`.r2-explorer/emails/${this.selectedFolder}/${m}/${a.filename}`)}`;let n=a.contentId;if(n){n.startsWith("<")&&n.endsWith(">")&&(n=n.substring(1,n.length-1));const r=`cid:${n}`;l.includes(r)&&(l=l.replaceAll(`cid:${n}`,a.downloadUrl),a.display=!1)}}this.srcdoc=l}this.attachments=t.data.attachments.filter(a=>a.display),w.headFile(this.selectedBucket,this.filePath).then(async a=>{a.customMetadata.read==="false"?this.fileHead=await w.updateMetadata(this.selectedBucket,this.filePath,{...a.customMetadata,read:!0}):this.fileHead=a}),setTimeout(()=>{this.contentFinishedLoading()},1e4),this.timeInterval=setInterval(()=>{this.resizeIframe()},400)},markAsUnread:async function(){this.fileHead=await w.updateMetadata(this.selectedBucket,this.filePath,{...this.fileHead.customMetadata,read:!1}),this.q.notify({group:!1,icon:"done",spinner:!1,message:"Email marked as unread!",timeout:2500})},markAsRead:async function(){this.fileHead=await w.updateMetadata(this.selectedBucket,this.filePath,{...this.fileHead.customMetadata,read:!0}),this.q.notify({group:!1,icon:"done",spinner:!1,message:"Email marked as read!",timeout:2500})},downloadAtt:e=>{console.log(e);const t=document.createElement("a");t.download=e.filename,t.href=e.downloadUrl,document.body.appendChild(t),t.click(),document.body.removeChild(t)}},created(){this.fetchEmail()},setup(){return{mainStore:De(),q:Ue()}}}),Ke={key:0},Xe={class:"font-18 q-my-none"},Ye={class:"d-flex row"},Ze={class:"d-flex column"},et={class:"text-muted"},tt={class:"q-ml-auto"},at={class:""},st={class:"overflow-auto d-block email-wrapper"},lt=["srcdoc"],nt=["innerHTML"],ot={class:"row attachments"},it={key:1,class:"text-center q-my-lg"};function rt(e,t,m,l,a,n){return this.file?(u(),p("div",Ke,[s(K,null,{default:o(()=>[s($,{class:"bg-grey-2 text-black",vertical:""},{default:o(()=>[s(Ge,{unelevated:""},{default:o(()=>[s(P,{push:"",icon:"arrow_back",to:{name:"email-folder",params:{bucket:e.$route.params.bucket,folder:e.$route.params.folder}}},{default:o(()=>[s(E,null,{default:o(()=>t[1]||(t[1]=[b("Back")])),_:1})]),_:1},8,["to"]),e.fileHead?(u(),p(X,{key:0},[e.fileHead.customMetadata.read==="true"?(u(),H(P,{key:0,push:"",icon:"mark_email_unread",onClick:e.markAsUnread},{default:o(()=>[s(E,null,{default:o(()=>t[2]||(t[2]=[b("Mark email as unread")])),_:1})]),_:1},8,["onClick"])):(u(),H(P,{key:1,push:"",icon:"mark_email_read",onClick:e.markAsRead},{default:o(()=>[s(E,null,{default:o(()=>t[3]||(t[3]=[b("Mark email as read")])),_:1})]),_:1},8,["onClick"]))],64)):Y("",!0)]),_:1})]),_:1}),s($,{vertical:""},{default:o(()=>[d("h5",Xe,v(e.file.subject),1)]),_:1}),s($,{horizontal:"",class:"q-px-sm"},{default:o(()=>[d("div",Ye,[s(Z,{name:"account_circle",size:"xl",class:"q-mr-sm"}),d("div",Ze,[d("span",null,[b(v(e.file.from.name)+" ",1),d("small",et,"<"+v(e.file.from.address)+">",1)]),d("span",null,"to "+v(e.file.to[0].address),1)])]),d("div",tt,[d("small",at,v(e.file.date)+" ("+v(e.timeSince(new Date(e.file.date)))+")",1)])]),_:1}),s(ee,{vertical:""},{default:o(()=>[d("div",st,[e.srcdoc?(u(),p("iframe",{key:0,frameborder:"0",scrolling:"no",class:"w-100 d-block",onLoad:t[0]||(t[0]=(...r)=>e.contentFinishedLoading&&e.contentFinishedLoading(...r)),ref:"renderWindow",id:"renderWindow",srcdoc:e.srcdoc,sandbox:"allow-popups allow-popups-to-escape-sandbox allow-same-origin",csp:"script-src 'none'"},null,40,lt)):(u(),p("div",{key:1,innerHTML:e.file.text.replaceAll(`
1
+ import{h as te,G as _e,H as Se,I as q,J as W,K as Te,L as $e,M as Pe,N as x,k as _,O as N,P as Be,R as Ce,S as qe,T as He,U as Ee,V as Me,W as Ae,X as z,Y as D,Z as U,$ as V,a0 as Fe,a1 as j,a2 as R,a3 as Oe,l as M,a4 as Ie,n as Le,a5 as Qe,m as ae,a6 as We,_ as xe,c as Ne,a7 as G,a8 as J,a9 as ze,aa as w,u as De,ab as Ue,o as u,ac as p,f as s,w as o,F as K,ad as Ve,x as $,E as P,z as b,ae as X,e as H,B as Y,y as d,A as v,t as Z,af as ee,ag as je,ah as Re}from"./index.ddf53a58.js";var E=te({name:"QTooltip",inheritAttrs:!1,props:{..._e,...Se,...q,maxHeight:{type:String,default:null},maxWidth:{type:String,default:null},transitionShow:{...q.transitionShow,default:"jump-down"},transitionHide:{...q.transitionHide,default:"jump-up"},anchor:{type:String,default:"bottom middle",validator:W},self:{type:String,default:"top middle",validator:W},offset:{type:Array,default:()=>[14,14],validator:Te},scrollTarget:$e,delay:{type:Number,default:0},hideDelay:{type:Number,default:0},persistent:Boolean},emits:[...Pe],setup(e,{slots:t,emit:m,attrs:l}){let a,n;const r=Le(),{proxy:{$q:c}}=r,g=x(null),S=x(!1),se=_(()=>N(e.anchor,c.lang.rtl)),le=_(()=>N(e.self,c.lang.rtl)),ne=_(()=>e.persistent!==!0),{registerTick:oe,removeTick:ie}=Be(),{registerTimeout:T}=Ce(),{transitionProps:re,transitionStyle:de}=qe(e),{localScrollTarget:A,changeScrollEvent:ce,unconfigureScrollTarget:ue}=He(e,L),{anchorEl:f,canShow:fe,anchorEvents:k}=Ee({showing:S,configureAnchorEl:ye}),{show:me,hide:B}=Me({showing:S,canShow:fe,handleShow:pe,handleHide:ve,hideOnRouteChange:ne,processOnMount:!0});Object.assign(k,{delayShow:ge,delayHide:ke});const{showPortal:F,hidePortal:O,renderPortal:he}=Ae(r,g,be,"tooltip");if(c.platform.is.mobile===!0){const i={anchorEl:f,innerRef:g,onClickOutside(h){return B(h),h.target.classList.contains("q-dialog__backdrop")&&We(h),!0}},C=_(()=>e.modelValue===null&&e.persistent!==!0&&S.value===!0);z(C,h=>{(h===!0?Qe:U)(i)}),D(()=>{U(i)})}function pe(i){F(),oe(()=>{n=new MutationObserver(()=>y()),n.observe(g.value,{attributes:!1,childList:!0,characterData:!0,subtree:!0}),y(),L()}),a===void 0&&(a=z(()=>c.screen.width+"|"+c.screen.height+"|"+e.self+"|"+e.anchor+"|"+c.lang.rtl,y)),T(()=>{F(!0),m("show",i)},e.transitionDuration)}function ve(i){ie(),O(),I(),T(()=>{O(!0),m("hide",i)},e.transitionDuration)}function I(){n!==void 0&&(n.disconnect(),n=void 0),a!==void 0&&(a(),a=void 0),ue(),V(k,"tooltipTemp")}function y(){Fe({targetEl:g.value,offset:e.offset,anchorEl:f.value,anchorOrigin:se.value,selfOrigin:le.value,maxHeight:e.maxHeight,maxWidth:e.maxWidth})}function ge(i){if(c.platform.is.mobile===!0){j(),document.body.classList.add("non-selectable");const C=f.value,h=["touchmove","touchcancel","touchend","click"].map(Q=>[C,Q,"delayHide","passiveCapture"]);R(k,"tooltipTemp",h)}T(()=>{me(i)},e.delay)}function ke(i){c.platform.is.mobile===!0&&(V(k,"tooltipTemp"),j(),setTimeout(()=>{document.body.classList.remove("non-selectable")},10)),T(()=>{B(i)},e.hideDelay)}function ye(){if(e.noParentEvent===!0||f.value===null)return;const i=c.platform.is.mobile===!0?[[f.value,"touchstart","delayShow","passive"]]:[[f.value,"mouseenter","delayShow","passive"],[f.value,"mouseleave","delayHide","passive"]];R(k,"anchor",i)}function L(){if(f.value!==null||e.scrollTarget!==void 0){A.value=Oe(f.value,e.scrollTarget);const i=e.noParentEvent===!0?y:B;ce(A.value,i)}}function we(){return S.value===!0?M("div",{...l,ref:g,class:["q-tooltip q-tooltip--style q-position-engine no-pointer-events",l.class],style:[l.style,de.value],role:"tooltip"},ae(t.default)):null}function be(){return M(Ie,re.value,we)}return D(I),Object.assign(r.proxy,{updatePosition:y}),he}}),Ge=te({name:"QBtnGroup",props:{unelevated:Boolean,outline:Boolean,flat:Boolean,rounded:Boolean,square:Boolean,push:Boolean,stretch:Boolean,glossy:Boolean,spread:Boolean},setup(e,{slots:t}){const m=_(()=>{const l=["unelevated","outline","flat","rounded","square","push","stretch","glossy"].filter(a=>e[a]===!0).map(a=>`q-btn-group--${a}`).join(" ");return`q-btn-group row no-wrap${l.length!==0?" "+l:""}`+(e.spread===!0?" q-btn-group--spread":" inline")});return()=>M("div",{class:m.value},ae(t.default))}});const Je=Ne({name:"EmailFolderPage",data:()=>({srcdoc:null,file:null,fileHead:null,timeInterval:null,attachments:[]}),computed:{selectedBucket:function(){return this.$route.params.bucket},selectedFolder:function(){return this.$route.params.folder},selectedFile:function(){return this.$route.params.file},filePath:function(){const e=G(this.selectedFile);return`.r2-explorer/emails/${this.selectedFolder}/${e}`}},watch:{selectedBucket(e){this.$router.push({name:"email-folder",params:{bucket:e,folder:J(this.selectedFolder)}})}},methods:{timeSince:ze,contentFinishedLoading(){clearInterval(this.timeInterval),this.timeInterval=null,this.resizeIframe()},resizeIframe(){this.$refs.renderWindow&&(this.$refs.renderWindow.style.height=`${this.$refs.renderWindow.contentWindow.document.documentElement.scrollHeight}px`)},fetchEmail:async function(){const e=G(this.selectedFile),t=await w.downloadFile(this.selectedBucket,this.filePath,{}),m=e.split(".json")[0];this.file=t.data;let l=t.data.html;if(l){l=l.replaceAll(/<a(.*?)>(.*?)<\/a>/gi,'<a$1 target="_blank">$2</a>');for(const a of t.data.attachments){a.display=!0,a.downloadUrl=`${this.mainStore.serverUrl}/api/buckets/${this.selectedBucket}/${J(`.r2-explorer/emails/${this.selectedFolder}/${m}/${a.filename}`)}`;let n=a.contentId;if(n){n.startsWith("<")&&n.endsWith(">")&&(n=n.substring(1,n.length-1));const r=`cid:${n}`;l.includes(r)&&(l=l.replaceAll(`cid:${n}`,a.downloadUrl),a.display=!1)}}this.srcdoc=l}this.attachments=t.data.attachments.filter(a=>a.display),w.headFile(this.selectedBucket,this.filePath).then(async a=>{a.customMetadata.read==="false"?this.fileHead=await w.updateMetadata(this.selectedBucket,this.filePath,{...a.customMetadata,read:!0}):this.fileHead=a}),setTimeout(()=>{this.contentFinishedLoading()},1e4),this.timeInterval=setInterval(()=>{this.resizeIframe()},400)},markAsUnread:async function(){this.fileHead=await w.updateMetadata(this.selectedBucket,this.filePath,{...this.fileHead.customMetadata,read:!1}),this.q.notify({group:!1,icon:"done",spinner:!1,message:"Email marked as unread!",timeout:2500})},markAsRead:async function(){this.fileHead=await w.updateMetadata(this.selectedBucket,this.filePath,{...this.fileHead.customMetadata,read:!0}),this.q.notify({group:!1,icon:"done",spinner:!1,message:"Email marked as read!",timeout:2500})},downloadAtt:e=>{console.log(e);const t=document.createElement("a");t.download=e.filename,t.href=e.downloadUrl,document.body.appendChild(t),t.click(),document.body.removeChild(t)}},created(){this.fetchEmail()},setup(){return{mainStore:De(),q:Ue()}}}),Ke={key:0},Xe={class:"font-18 q-my-none"},Ye={class:"d-flex row"},Ze={class:"d-flex column"},et={class:"text-muted"},tt={class:"q-ml-auto"},at={class:""},st={class:"overflow-auto d-block email-wrapper"},lt=["srcdoc"],nt=["innerHTML"],ot={class:"row attachments"},it={key:1,class:"text-center q-my-lg"};function rt(e,t,m,l,a,n){return this.file?(u(),p("div",Ke,[s(K,null,{default:o(()=>[s($,{class:"bg-grey-2 text-black",vertical:""},{default:o(()=>[s(Ge,{unelevated:""},{default:o(()=>[s(P,{push:"",icon:"arrow_back",to:{name:"email-folder",params:{bucket:e.$route.params.bucket,folder:e.$route.params.folder}}},{default:o(()=>[s(E,null,{default:o(()=>t[1]||(t[1]=[b("Back")])),_:1})]),_:1},8,["to"]),e.fileHead?(u(),p(X,{key:0},[e.fileHead.customMetadata.read==="true"?(u(),H(P,{key:0,push:"",icon:"mark_email_unread",onClick:e.markAsUnread},{default:o(()=>[s(E,null,{default:o(()=>t[2]||(t[2]=[b("Mark email as unread")])),_:1})]),_:1},8,["onClick"])):(u(),H(P,{key:1,push:"",icon:"mark_email_read",onClick:e.markAsRead},{default:o(()=>[s(E,null,{default:o(()=>t[3]||(t[3]=[b("Mark email as read")])),_:1})]),_:1},8,["onClick"]))],64)):Y("",!0)]),_:1})]),_:1}),s($,{vertical:""},{default:o(()=>[d("h5",Xe,v(e.file.subject),1)]),_:1}),s($,{horizontal:"",class:"q-px-sm"},{default:o(()=>[d("div",Ye,[s(Z,{name:"account_circle",size:"xl",class:"q-mr-sm"}),d("div",Ze,[d("span",null,[b(v(e.file.from.name)+" ",1),d("small",et,"<"+v(e.file.from.address)+">",1)]),d("span",null,"to "+v(e.file.to[0].address),1)])]),d("div",tt,[d("small",at,v(e.file.date)+" ("+v(e.timeSince(new Date(e.file.date)))+")",1)])]),_:1}),s(ee,{vertical:""},{default:o(()=>[d("div",st,[e.srcdoc?(u(),p("iframe",{key:0,frameborder:"0",scrolling:"no",class:"w-100 d-block",onLoad:t[0]||(t[0]=(...r)=>e.contentFinishedLoading&&e.contentFinishedLoading(...r)),ref:"renderWindow",id:"renderWindow",srcdoc:e.srcdoc,sandbox:"allow-popups allow-popups-to-escape-sandbox allow-same-origin",csp:"script-src 'none'"},null,40,lt)):(u(),p("div",{key:1,innerHTML:e.file.text.replaceAll(`
2
2
  `,"<br>")},null,8,nt))])]),_:1}),e.attachments.length>0?(u(),H(ee,{key:0,vertical:""},{default:o(()=>[s(je),t[4]||(t[4]=d("h6",{class:"q-my-md"},"Attachments",-1)),d("div",ot,[(u(!0),p(X,null,Re(e.file.attachments,r=>(u(),p("div",{class:"col-md-4 col-sm-12",key:r.filename},[s(K,null,{default:o(()=>[s($,{class:"q-pa-sm flex",style:{"align-items":"center"}},{default:o(()=>[s(Z,{name:"description",size:"md",color:"blue",class:"q-mr-sm"}),b(" "+v(r.filename)+" ",1),s(P,{color:"white","text-color":"black",icon:"download",class:"q-mr-0 q-ml-auto",onClick:c=>e.downloadAtt(r)},null,8,["onClick"])]),_:2},1024)]),_:2},1024)]))),128))])]),_:1})):Y("",!0)]),_:1})])):(u(),p("div",it,[s(Ve,{color:"primary",size:"3em"})]))}var ct=xe(Je,[["render",rt],["__scopeId","data-v-59368c26"]]);export{ct as default};
@@ -1 +1 @@
1
- import{_ as o,c as s,o as r,ac as n,y as t,f as a,E as l}from"./index.b2fb13c9.js";const c=s({name:"ErrorNotFound"}),d={class:"fullscreen bg-blue text-white text-center q-pa-md flex flex-center"};function i(p,e,f,u,x,m){return r(),n("div",d,[t("div",null,[e[0]||(e[0]=t("div",{style:{"font-size":"30vh"}}," 404 ",-1)),e[1]||(e[1]=t("div",{class:"text-h2",style:{opacity:".4"}}," Oops. Nothing here... ",-1)),a(l,{class:"q-mt-xl",color:"white","text-color":"blue",unelevated:"",to:"/",label:"Go Home","no-caps":""})])])}var _=o(c,[["render",i]]);export{_ as default};
1
+ import{_ as o,c as s,o as r,ac as n,y as t,f as a,E as l}from"./index.ddf53a58.js";const c=s({name:"ErrorNotFound"}),d={class:"fullscreen bg-blue text-white text-center q-pa-md flex flex-center"};function i(p,e,f,u,x,m){return r(),n("div",d,[t("div",null,[e[0]||(e[0]=t("div",{style:{"font-size":"30vh"}}," 404 ",-1)),e[1]||(e[1]=t("div",{class:"text-h2",style:{opacity:".4"}}," Oops. Nothing here... ",-1)),a(l,{class:"q-mt-xl",color:"white","text-color":"blue",unelevated:"",to:"/",label:"Go Home","no-caps":""})])])}var _=o(c,[["render",i]]);export{_ as default};
@@ -1 +1 @@
1
- import{h,i as w,j as y,k as u,l as r,m,n as k,p as q,q as C,s as S,t as V,_ as x,c as Q,o as p,e as v,w as t,v as B,f as o,x as f,y as g,z as E,A as I,B as _,C as $,D as b,E as A,F as D}from"./index.b2fb13c9.js";import{u as P}from"./auth-store.748ba7e9.js";var N=h({name:"QBanner",props:{...w,inlineActions:Boolean,dense:Boolean,rounded:Boolean},setup(e,{slots:a}){const{proxy:{$q:s}}=k(),d=y(e,s),l=u(()=>"q-banner row items-center"+(e.dense===!0?" q-banner--dense":"")+(d.value===!0?" q-banner--dark q-dark":"")+(e.rounded===!0?" rounded-borders":"")),i=u(()=>`q-banner__actions row items-center justify-end col-${e.inlineActions===!0?"auto":"all"}`);return()=>{const n=[r("div",{class:"q-banner__avatar col-auto row items-center self-start"},m(a.avatar)),r("div",{class:"q-banner__content col text-body2"},m(a.default))],c=m(a.action);return c!==void 0&&n.push(r("div",{class:i.value},c)),r("div",{class:l.value+(e.inlineActions===!1&&c!==void 0?" q-banner--top-padding":""),role:"alert"},n)}}}),U=h({name:"QToggle",props:{...q,icon:String,iconColor:String},emits:C,setup(e){function a(s,d){const l=u(()=>(s.value===!0?e.checkedIcon:d.value===!0?e.indeterminateIcon:e.uncheckedIcon)||e.icon),i=u(()=>s.value===!0?e.iconColor:null);return()=>[r("div",{class:"q-toggle__track"}),r("div",{class:"q-toggle__thumb absolute flex flex-center no-wrap"},l.value!==void 0?[r(V,{name:l.value,color:i.value})]:void 0)]}return S("toggle",a)}});const z=P(),j=Q({name:"login-page",components:{},data(){return{loading:!1,showError:"",form:{username:"",password:"",remind:!0}}},methods:{async onSubmit(){this.loading=!0;try{await z.LogIn(this.$router,this.form),this.showError=""}catch(e){throw this.showError=e.message,e}finally{this.loading=!1}}}});function F(e,a,s,d,l,i){return p(),v(B,{class:"flex flex-center"},{default:t(()=>[o(D,{class:"q-pa-md shadow-2",bordered:""},{default:t(()=>[o(f,{class:"text-center"},{default:t(()=>a[3]||(a[3]=[g("div",{class:"text-grey-9 text-h5 text-weight-bold"},"Sign in",-1),g("div",{class:"text-grey-8"},"Enter your email address and password to access admin panel.",-1)])),_:1}),e.showError?(p(),v(f,{key:0},{default:t(()=>[o(N,{"inline-actions":"",class:"text-white bg-red"},{default:t(()=>[E(I(e.showError),1)]),_:1})]),_:1})):_("",!0),o(f,null,{default:t(()=>[o($,{onSubmit:e.onSubmit,class:"q-gutter-sm"},{default:t(()=>[o(b,{filled:"",modelValue:e.form.username,"onUpdate:modelValue":a[0]||(a[0]=n=>e.form.username=n),label:"Username","lazy-rules":"",type:"text"},null,8,["modelValue"]),o(b,{filled:"",modelValue:e.form.password,"onUpdate:modelValue":a[1]||(a[1]=n=>e.form.password=n),label:"Password","lazy-rules":"",type:"password"},null,8,["modelValue"]),o(U,{modelValue:e.form.remind,"onUpdate:modelValue":a[2]||(a[2]=n=>e.form.remind=n),label:"Remember me"},null,8,["modelValue"]),g("div",null,[o(A,{loading:e.loading,label:"Sign in",type:"submit",color:"primary"},null,8,["loading"])])]),_:1},8,["onSubmit"])]),_:1})]),_:1})]),_:1})}var R=x(j,[["render",F]]);export{R as default};
1
+ import{h,i as w,j as y,k as u,l as r,m,n as k,p as q,q as C,s as S,t as V,_ as x,c as Q,o as p,e as v,w as t,v as B,f as o,x as f,y as g,z as E,A as I,B as _,C as $,D as b,E as A,F as D}from"./index.ddf53a58.js";import{u as P}from"./auth-store.1a4593f8.js";var N=h({name:"QBanner",props:{...w,inlineActions:Boolean,dense:Boolean,rounded:Boolean},setup(e,{slots:a}){const{proxy:{$q:s}}=k(),d=y(e,s),l=u(()=>"q-banner row items-center"+(e.dense===!0?" q-banner--dense":"")+(d.value===!0?" q-banner--dark q-dark":"")+(e.rounded===!0?" rounded-borders":"")),i=u(()=>`q-banner__actions row items-center justify-end col-${e.inlineActions===!0?"auto":"all"}`);return()=>{const n=[r("div",{class:"q-banner__avatar col-auto row items-center self-start"},m(a.avatar)),r("div",{class:"q-banner__content col text-body2"},m(a.default))],c=m(a.action);return c!==void 0&&n.push(r("div",{class:i.value},c)),r("div",{class:l.value+(e.inlineActions===!1&&c!==void 0?" q-banner--top-padding":""),role:"alert"},n)}}}),U=h({name:"QToggle",props:{...q,icon:String,iconColor:String},emits:C,setup(e){function a(s,d){const l=u(()=>(s.value===!0?e.checkedIcon:d.value===!0?e.indeterminateIcon:e.uncheckedIcon)||e.icon),i=u(()=>s.value===!0?e.iconColor:null);return()=>[r("div",{class:"q-toggle__track"}),r("div",{class:"q-toggle__thumb absolute flex flex-center no-wrap"},l.value!==void 0?[r(V,{name:l.value,color:i.value})]:void 0)]}return S("toggle",a)}});const z=P(),j=Q({name:"login-page",components:{},data(){return{loading:!1,showError:"",form:{username:"",password:"",remind:!0}}},methods:{async onSubmit(){this.loading=!0;try{await z.LogIn(this.$router,this.form),this.showError=""}catch(e){throw this.showError=e.message,e}finally{this.loading=!1}}}});function F(e,a,s,d,l,i){return p(),v(B,{class:"flex flex-center"},{default:t(()=>[o(D,{class:"q-pa-md shadow-2",bordered:""},{default:t(()=>[o(f,{class:"text-center"},{default:t(()=>a[3]||(a[3]=[g("div",{class:"text-grey-9 text-h5 text-weight-bold"},"Sign in",-1),g("div",{class:"text-grey-8"},"Enter your email address and password to access admin panel.",-1)])),_:1}),e.showError?(p(),v(f,{key:0},{default:t(()=>[o(N,{"inline-actions":"",class:"text-white bg-red"},{default:t(()=>[E(I(e.showError),1)]),_:1})]),_:1})):_("",!0),o(f,null,{default:t(()=>[o($,{onSubmit:e.onSubmit,class:"q-gutter-sm"},{default:t(()=>[o(b,{filled:"",modelValue:e.form.username,"onUpdate:modelValue":a[0]||(a[0]=n=>e.form.username=n),label:"Username","lazy-rules":"",type:"text"},null,8,["modelValue"]),o(b,{filled:"",modelValue:e.form.password,"onUpdate:modelValue":a[1]||(a[1]=n=>e.form.password=n),label:"Password","lazy-rules":"",type:"password"},null,8,["modelValue"]),o(U,{modelValue:e.form.remind,"onUpdate:modelValue":a[2]||(a[2]=n=>e.form.remind=n),label:"Remember me"},null,8,["modelValue"]),g("div",null,[o(A,{loading:e.loading,label:"Sign in",type:"submit",color:"primary"},null,8,["loading"])])]),_:1},8,["onSubmit"])]),_:1})]),_:1})]),_:1})}var R=x(j,[["render",F]]);export{R as default};
@@ -0,0 +1 @@
1
+ import{d as l,u as i,a as r}from"./index.ddf53a58.js";const a="r2_explorer_session_token",c=l("auth",{state:()=>({}),getters:{isAuthenticated:e=>!!e.user,StateUser:e=>e.user},actions:{async LogIn(e,s){const o=i(),t=btoa(`${s.username}:${s.password}`);r.defaults.headers.common.Authorization=`Basic ${t}`;try{await o.loadServerConfigs(e,this.q)}catch(n){throw console.log(n),delete r.defaults.headers.common.Authorization,new Error("Invalid username or password")}r.defaults.headers.common.Authorization=`Basic ${t}`,s.remind===!0?localStorage.setItem(a,t):sessionStorage.setItem(a,t)},async CheckLoginInStorage(e,s){let o=sessionStorage.getItem(a),t=!1;if(o||(o=localStorage.getItem(a)),!o)return!1;const n=i();return r.defaults.headers.common.Authorization=`Basic ${o}`,t=await n.loadServerConfigs(e,s,!0),t||delete r.defaults.headers.common.Authorization,!1},async LogOut(e){localStorage.removeItem(a),sessionStorage.removeItem(a),await e.replace({name:"login"})}}});export{c as u};
@@ -0,0 +1 @@
1
+ import{b as e,u as r}from"./index.ddf53a58.js";import{u as s}from"./auth-store.1a4593f8.js";var c=e(async({app:o,router:t,store:a})=>{await s(a).CheckLoginInStorage(t,o.config.globalProperties.$q)===!1&&await r(a).loadServerConfigs(t,o.config.globalProperties.$q,!0)});export{c as default};
@@ -1 +1 @@
1
- import{b as c}from"./index.b2fb13c9.js";class n{constructor(){this.__stack={}}on(t,s,i){return(this.__stack[t]||(this.__stack[t]=[])).push({fn:s,ctx:i}),this}once(t,s,i){const o=(...e)=>{this.off(t,o),s.apply(i,e)};return o.__callback=s,this.on(t,o,i)}emit(t){const s=this.__stack[t];if(s!==void 0){const i=[].slice.call(arguments,1);s.forEach(o=>{o.fn.apply(o.ctx,i)})}return this}off(t,s){const i=this.__stack[t];if(i===void 0)return this;if(s===void 0)return delete this.__stack[t],this;const o=i.filter(e=>e.fn!==s&&e.fn.__callback!==s);return o.length!==0?this.__stack[t]=o:delete this.__stack[t],this}}var h=c(({app:r})=>{const t=new n;r.config.globalProperties.$bus=t,r.provide("bus",t)});export{h as default};
1
+ import{b as c}from"./index.ddf53a58.js";class n{constructor(){this.__stack={}}on(t,s,i){return(this.__stack[t]||(this.__stack[t]=[])).push({fn:s,ctx:i}),this}once(t,s,i){const o=(...e)=>{this.off(t,o),s.apply(i,e)};return o.__callback=s,this.on(t,o,i)}emit(t){const s=this.__stack[t];if(s!==void 0){const i=[].slice.call(arguments,1);s.forEach(o=>{o.fn.apply(o.ctx,i)})}return this}off(t,s){const i=this.__stack[t];if(i===void 0)return this;if(s===void 0)return delete this.__stack[t],this;const o=i.filter(e=>e.fn!==s&&e.fn.__callback!==s);return o.length!==0?this.__stack[t]=o:delete this.__stack[t],this}}var h=c(({app:r})=>{const t=new n;r.config.globalProperties.$bus=t,r.provide("bus",t)});export{h as default};