r2-explorer 1.1.1 → 1.1.3

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 +111 -51
  2. package/dashboard/assets/{AuthLayout.297460d7.js → AuthLayout.7618f480.js} +1 -1
  3. package/dashboard/{spa/assets/EmailFilePage.f737d2d4.js → assets/EmailFilePage.bbf7a6c5.js} +1 -1
  4. package/dashboard/{spa/assets/ErrorNotFound.be9ef3ac.js → assets/ErrorNotFound.699f3886.js} +1 -1
  5. package/dashboard/{spa/assets/LoginPage.fbddb0c0.js → assets/LoginPage.149f1ef8.js} +1 -1
  6. package/dashboard/assets/auth-store.f621e290.js +1 -0
  7. package/dashboard/assets/auth.9b526521.js +1 -0
  8. package/dashboard/assets/{bus.b6904cee.js → bus.18b30314.js} +1 -1
  9. package/dashboard/assets/{index.b2fb13c9.js → index.69bcbd86.js} +3 -3
  10. package/dashboard/assets/{index.c9ff738b.css → index.7e109f1f.css} +1 -1
  11. package/dashboard/index.html +5 -7
  12. package/dashboard/spa/assets/{AuthLayout.297460d7.js → AuthLayout.7618f480.js} +1 -1
  13. package/dashboard/{assets/EmailFilePage.f737d2d4.js → spa/assets/EmailFilePage.bbf7a6c5.js} +1 -1
  14. package/dashboard/{assets/ErrorNotFound.be9ef3ac.js → spa/assets/ErrorNotFound.699f3886.js} +1 -1
  15. package/dashboard/{assets/LoginPage.fbddb0c0.js → spa/assets/LoginPage.149f1ef8.js} +1 -1
  16. package/dashboard/spa/assets/auth-store.f621e290.js +1 -0
  17. package/dashboard/spa/assets/auth.9b526521.js +1 -0
  18. package/dashboard/spa/assets/{bus.b6904cee.js → bus.18b30314.js} +1 -1
  19. package/dashboard/spa/assets/{index.b2fb13c9.js → index.69bcbd86.js} +3 -3
  20. package/dashboard/spa/assets/{index.c9ff738b.css → index.7e109f1f.css} +1 -1
  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,74 +1,134 @@
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
+ # R2-Explorer
24
+
25
+ R2-Explorer brings a familiar Google Drive-like interface to your Cloudflare R2 storage buckets, making file management simple and intuitive.
26
+
27
+ ## Quick Links
28
+
29
+ - 📚 **Documentation**: [r2explorer.dev](https://r2explorer.dev)
30
+ - 🎮 **Live Demo**: [demo.r2explorer.dev](https://demo.r2explorer.dev)
31
+ - 💻 **Source Code**: [github.com/G4brym/R2-Explorer](https://github.com/G4brym/R2-Explorer)
32
+
33
+ Available in multiple languages:
34
+ [English](https://r2explorer.dev) |
35
+ [Español](https://r2explorer-dev.translate.goog/?_x_tr_sl=en&_x_tr_tl=es) |
36
+ [Português](https://r2explorer-dev.translate.goog/?_x_tr_sl=en&_x_tr_tl=pt-PT) |
37
+ [Français](https://r2explorer-dev.translate.goog/?_x_tr_sl=en&_x_tr_tl=fr)
38
+
39
+ ## Overview
40
+
41
+ R2-Explorer transforms your Cloudflare R2 storage experience with a modern, user-friendly interface. It provides powerful file management capabilities while maintaining enterprise-grade security through Cloudflare's infrastructure.
42
+
43
+ ## Key Features
17
44
 
18
- **Documentation**: <a href="https://r2explorer.dev" target="_blank">https://r2explorer.dev</a>
45
+ - **🔒 Security**
46
+ - Basic Authentication support
47
+ - Cloudflare Access integration
48
+ - Self-hosted on your Cloudflare account
19
49
 
20
- **Live Demo**: <a href="https://demo.r2explorer.dev" target="_blank">https://demo.r2explorer.dev</a>
50
+ - **📁 File Management**
51
+ - Drag-and-drop file upload
52
+ - Folder creation and organization
53
+ - Multi-part upload for large files
54
+ - Right-click context menu for advanced options
55
+ - HTTP/Custom metadata editing
21
56
 
22
- ---
57
+ - **👀 File Handling**
58
+ - In-browser file preview
59
+ - PDF documents
60
+ - Images
61
+ - Text files
62
+ - Markdown
63
+ - CSV
64
+ - Logpush files
65
+ - In-browser file editing
66
+ - Folder upload support
67
+
68
+ - **📧 Email Integration**
69
+ - Receive and process emails via Cloudflare Email Routing
70
+ - View email attachments directly in the interface
23
71
 
24
- ## Features
72
+ ## Installation Methods
25
73
 
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
74
+ Choose the method that best suits your needs:
39
75
 
40
- ## Getting Started
76
+ 1. **GitHub Action (Recommended)**
77
+ ```bash
78
+ # Follow the guide at:
79
+ https://r2explorer.dev/getting-started/creating-a-new-project/#1st-method-github-action-recommended
80
+ ```
41
81
 
42
- Run this command to get an example project setup
82
+ 2. **Cloudflare CLI**
83
+ ```bash
84
+ # Follow the guide at:
85
+ https://r2explorer.dev/getting-started/creating-a-new-project/#2nd-method-create-cloudflare
86
+ ```
43
87
 
44
- ```bash
45
- npm create cloudflare@latest r2-explorer -- --template "G4brym/R2-Explorer/template"
46
- ```
88
+ 3. **Template Repository**
89
+ ```bash
90
+ # Use our template at:
91
+ https://github.com/G4brym/R2-Explorer/tree/main/template
92
+ ```
47
93
 
48
- ## Upgrading your installation
94
+ For detailed instructions on maintaining and updating your installation, visit our [update guide](https://r2explorer.dev/getting-started/updating-your-project/).
49
95
 
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
96
+ ## Roadmap
52
97
 
53
- ```bash
54
- npm install r2-explorer@latest --save
55
- ```
98
+ We're actively working on these exciting features:
56
99
 
57
- ```bash
58
- wrangler publish
59
- ```
100
+ - **File Management**
101
+ - Support for bucket names with spaces
102
+ - File search functionality
103
+ - Folder renaming capability
104
+ - Image thumbnails generation
105
+
106
+ - **AI Integration**
107
+ - Object detection using workers-ai
108
+
109
+ - **User Experience**
110
+ - Enhanced timestamp tooltips
111
+ - Email response capabilities
112
+ - Advanced file type-specific editing
113
+
114
+ ## Known Issues
60
115
 
61
- ## TODO
116
+ - When using basic authentication, email inline images and assets don't load properly
117
+ - Additional issues can be found and reported on our [GitHub Issues](https://github.com/G4brym/R2-Explorer/issues) page
62
118
 
63
- - allow bucket names with spaces
64
- - Search files
65
- - Rename folders
66
- - Image thumbnail's ?
67
- - Object detection on images using workers-ai ?
68
- - Tooltip when hovering a file with absolute time in "x days time ago" format
69
- - support for responding to emails
70
- - More advanced file editing with more validations per file type
119
+ ## Contributing
71
120
 
72
- ## Known issues
121
+ We welcome contributions! Whether it's bug fixes, new features, or documentation improvements, please feel free to:
73
122
 
74
- - Email inline images and assets don't load when using basic auth
123
+ 1. Fork the repository
124
+ 2. Create a feature branch
125
+ 3. Submit a Pull Request
126
+
127
+ ## Support
128
+
129
+ - 📚 Documentation: [r2explorer.dev](https://r2explorer.dev)
130
+ - 🐛 Issue Tracker: [GitHub Issues](https://github.com/G4brym/R2-Explorer/issues)
131
+
132
+ ## License
133
+
134
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
@@ -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.69bcbd86.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.69bcbd86.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.69bcbd86.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.69bcbd86.js";import{u as P}from"./auth-store.f621e290.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.69bcbd86.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.69bcbd86.js";import{u as s}from"./auth-store.f621e290.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.69bcbd86.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};