r2-explorer 1.1.4 → 1.1.6
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.
- package/README.md +19 -25
- package/dashboard/assets/{AuthLayout.69a601d4.js → AuthLayout.b8a06fe7.js} +1 -1
- package/dashboard/{spa/assets/EmailFilePage.b9af5203.js → assets/EmailFilePage.6051a393.js} +1 -1
- package/dashboard/{spa/assets/ErrorNotFound.e25d48e7.js → assets/ErrorNotFound.0a48c788.js} +1 -1
- package/dashboard/{spa/assets/LoginPage.7cae560f.js → assets/LoginPage.56938389.js} +1 -1
- package/dashboard/assets/{auth-store.adb4e0f1.js → auth-store.56a803cf.js} +1 -1
- package/dashboard/assets/{auth.888ee5c0.js → auth.9b1934ac.js} +1 -1
- package/dashboard/assets/{bus.f801e67b.js → bus.71537b60.js} +1 -1
- package/dashboard/assets/{index.81c5f354.js → index.6c65756b.js} +39 -39
- package/dashboard/assets/{index.7e109f1f.css → index.9dfc5b79.css} +1 -1
- package/dashboard/index.html +2 -2
- package/dashboard/spa/assets/{AuthLayout.69a601d4.js → AuthLayout.b8a06fe7.js} +1 -1
- package/dashboard/{assets/EmailFilePage.b9af5203.js → spa/assets/EmailFilePage.6051a393.js} +1 -1
- package/dashboard/{assets/ErrorNotFound.e25d48e7.js → spa/assets/ErrorNotFound.0a48c788.js} +1 -1
- package/dashboard/{assets/LoginPage.7cae560f.js → spa/assets/LoginPage.56938389.js} +1 -1
- package/dashboard/spa/assets/{auth-store.adb4e0f1.js → auth-store.56a803cf.js} +1 -1
- package/dashboard/spa/assets/{auth.888ee5c0.js → auth.9b1934ac.js} +1 -1
- package/dashboard/spa/assets/{bus.f801e67b.js → bus.71537b60.js} +1 -1
- package/dashboard/spa/assets/{index.81c5f354.js → index.6c65756b.js} +39 -39
- package/dashboard/spa/assets/{index.7e109f1f.css → index.9dfc5b79.css} +1 -1
- package/dashboard/spa/index.html +2 -2
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<a href="https://r2explorer.
|
|
2
|
+
<a href="https://r2explorer.com/">
|
|
3
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
4
|
</a>
|
|
5
5
|
</div>
|
|
@@ -26,15 +26,15 @@ R2-Explorer brings a familiar Google Drive-like interface to your Cloudflare R2
|
|
|
26
26
|
|
|
27
27
|
## Quick Links
|
|
28
28
|
|
|
29
|
-
- 📚 **Documentation**: [r2explorer.
|
|
30
|
-
- 🎮 **Live Demo**: [demo.r2explorer.
|
|
29
|
+
- 📚 **Documentation**: [r2explorer.com](https://r2explorer.com)
|
|
30
|
+
- 🎮 **Live Demo**: [demo.r2explorer.com](https://demo.r2explorer.com)
|
|
31
31
|
- 💻 **Source Code**: [github.com/G4brym/R2-Explorer](https://github.com/G4brym/R2-Explorer)
|
|
32
32
|
|
|
33
33
|
Available in multiple languages:
|
|
34
|
-
[English](https://r2explorer.
|
|
35
|
-
[Español](https://r2explorer-
|
|
36
|
-
[Português](https://r2explorer-
|
|
37
|
-
[Français](https://r2explorer-
|
|
34
|
+
[English](https://r2explorer.com) |
|
|
35
|
+
[Español](https://r2explorer-com.translate.goog/?_x_tr_sl=en&_x_tr_tl=es) |
|
|
36
|
+
[Português](https://r2explorer-com.translate.goog/?_x_tr_sl=en&_x_tr_tl=pt-PT) |
|
|
37
|
+
[Français](https://r2explorer-com.translate.goog/?_x_tr_sl=en&_x_tr_tl=fr)
|
|
38
38
|
|
|
39
39
|
## Overview
|
|
40
40
|
|
|
@@ -64,7 +64,7 @@ R2-Explorer transforms your Cloudflare R2 storage experience with a modern, user
|
|
|
64
64
|
- Logpush files
|
|
65
65
|
- In-browser file editing
|
|
66
66
|
- Folder upload support
|
|
67
|
-
|
|
67
|
+
|
|
68
68
|
- **📧 Email Integration**
|
|
69
69
|
- Receive and process emails via Cloudflare Email Routing
|
|
70
70
|
- View email attachments directly in the interface
|
|
@@ -74,24 +74,18 @@ R2-Explorer transforms your Cloudflare R2 storage experience with a modern, user
|
|
|
74
74
|
Choose the method that best suits your needs:
|
|
75
75
|
|
|
76
76
|
1. **GitHub Action (Recommended)**
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
https://r2explorer.dev/getting-started/creating-a-new-project/#1st-method-github-action-recommended
|
|
80
|
-
```
|
|
77
|
+
|
|
78
|
+
[Follow the guide here](https://r2explorer.com/getting-started/creating-a-new-project/#1st-method-github-action-recommended)
|
|
81
79
|
|
|
82
80
|
2. **Cloudflare CLI**
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
https://r2explorer.dev/getting-started/creating-a-new-project/#2nd-method-create-cloudflare
|
|
86
|
-
```
|
|
81
|
+
|
|
82
|
+
[Follow the guide here](https://r2explorer.com/getting-started/creating-a-new-project/#2nd-method-create-cloudflare)
|
|
87
83
|
|
|
88
84
|
3. **Template Repository**
|
|
89
|
-
```bash
|
|
90
|
-
# Use our template at:
|
|
91
|
-
https://github.com/G4brym/R2-Explorer/tree/main/template
|
|
92
|
-
```
|
|
93
85
|
|
|
94
|
-
|
|
86
|
+
[Use our template here](https://github.com/G4brym/R2-Explorer/tree/main/template)
|
|
87
|
+
|
|
88
|
+
For detailed instructions on maintaining and updating your installation, visit our [update guide](https://r2explorer.com/getting-started/updating-your-project/).
|
|
95
89
|
|
|
96
90
|
## Roadmap
|
|
97
91
|
|
|
@@ -102,15 +96,15 @@ We're actively working on these exciting features:
|
|
|
102
96
|
- File search functionality
|
|
103
97
|
- Folder renaming capability
|
|
104
98
|
- Image thumbnails generation
|
|
105
|
-
|
|
99
|
+
|
|
106
100
|
- **AI Integration**
|
|
107
101
|
- Object detection using workers-ai
|
|
108
|
-
|
|
102
|
+
|
|
109
103
|
- **User Experience**
|
|
110
104
|
- Enhanced timestamp tooltips
|
|
111
105
|
- Email response capabilities
|
|
112
106
|
- Advanced file type-specific editing
|
|
113
|
-
|
|
107
|
+
|
|
114
108
|
## Known Issues
|
|
115
109
|
|
|
116
110
|
- When using basic authentication, email inline images and assets don't load properly
|
|
@@ -126,7 +120,7 @@ We welcome contributions! Whether it's bug fixes, new features, or documentation
|
|
|
126
120
|
|
|
127
121
|
## Support
|
|
128
122
|
|
|
129
|
-
- 📚 Documentation: [r2explorer.
|
|
123
|
+
- 📚 Documentation: [r2explorer.com](https://r2explorer.com)
|
|
130
124
|
- 🐛 Issue Tracker: [GitHub Issues](https://github.com/G4brym/R2-Explorer/issues)
|
|
131
125
|
|
|
132
126
|
## License
|
|
@@ -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.
|
|
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.6c65756b.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.
|
|
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.6c65756b.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.
|
|
1
|
+
import{_ as o,c as s,o as r,ac as n,y as t,f as a,E as l}from"./index.6c65756b.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.
|
|
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.6c65756b.js";import{u as P}from"./auth-store.56a803cf.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 +1 @@
|
|
|
1
|
-
import{d as l,u as i,a as r}from"./index.
|
|
1
|
+
import{d as l,u as i,a as r}from"./index.6c65756b.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as e,u as r}from"./index.
|
|
1
|
+
import{b as e,u as r}from"./index.6c65756b.js";import{u as s}from"./auth-store.56a803cf.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.
|
|
1
|
+
import{b as c}from"./index.6c65756b.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};
|