UNPKG

p3x-redis-ui-material

Version:

💿 P3X Redis UI triple frontend — Angular + React/MUI + Vue/Vuetify with 54 languages, 7 themes, Socket.IO, desktop notifications, and full feature parity

1 lines • 4.41 kB
import{A as e,C as t,Ct as n,D as r,E as i,J as a,Kt as o,M as s,R as c,Wt as l,Yt as u,g as d,ht as f,it as p,k as m,o as h,t as g,w as _}from"./i18n.store-B-qxQMr8.js";import{o as v,t as y,x as b}from"./_plugin-vue_export-helper-Cw5qm5mn.js";import{c as x,t as S,u as C}from"./VList-mCTikV89.js";import{t as w}from"./VToolbar-Q0bl9jin.js";import{t as T}from"./VTextField-8aQmyraC.js";import{a as E,g as D,o as O,p as k}from"./index-Cn1nft6Q.js";import{t as A}from"./gui-switch-LOLl4mMP.js";var j={class:`p3xr-login-wrapper`},M={class:`p3xr-login-card`},N={class:`p3xr-login-content`},P={key:0,class:`p3xr-login-error`};function F(e,t){return typeof e==`function`?e(t):e??``}var I=y(s({__name:`LoginPage`,setup(s){let y=g(),I=t(()=>y.strings),L=E(),{themeKey:R}=h(O()),z={enterprise:`#212121`,light:`#263238`,redis:`#b71c1c`,dark:`#212121`,darkNeu:`#263238`,darkoBluo:`#1a237e`,matrix:`#33691e`},B={enterprise:`#9e9e9e`,light:`#b0bec5`,redis:`#ef9a9a`,dark:`#9e9e9e`,darkNeu:`#90a4ae`,darkoBluo:`#3f51b5`,matrix:`#76ff03`},V=t(()=>z[R.value]),H=t(()=>R.value===`matrix`?`#0a2e0d`:B[R.value]),U=f(``),W=f(``),G=f(!1),K=f(!1),q=f(!1),J=(()=>{try{return localStorage.getItem(`p3xr-frontend`)}catch{return`ng`}})();async function Y(){K.value||!U.value||!W.value||(K.value=!0,await L.login(U.value,W.value)&&location.reload(),K.value=!1)}return(t,s)=>(a(),r(`div`,j,[_(`div`,M,[e(w,{density:`compact`,style:o({backgroundColor:V.value,color:`rgba(255,255,255,0.87)`}),class:`p3xr-login-toolbar`},{default:p(()=>[e(k),e(D,{modelValue:q.value,"onUpdate:modelValue":s[3]||=e=>q.value=e,location:`bottom end`},{activator:p(({props:t})=>[e(v,c(t,{variant:`text`,size:`small`,style:{color:`inherit`}}),{default:p(()=>[e(b,{size:`18`,class:`mr-1`},{default:p(()=>[...s[7]||=[m(`mdi-monitor`,-1)]]),_:1}),s[8]||=m(` GUI `,-1)]),_:1},16)]),default:p(()=>[e(S,{density:`compact`},{default:p(()=>[e(x,{class:l({"v-list-item--active":n(J)===`ng`}),onClick:s[0]||=e=>n(A)(`ng`)},{prepend:p(()=>[...s[9]||=[_(`i`,{class:`fab fa-angular`,style:{"font-size":`18px`,width:`24px`,"text-align":`center`,"margin-right":`8px`,color:`#dd0031`}},null,-1)]]),default:p(()=>[e(C,null,{default:p(()=>[...s[10]||=[m(`Angular`,-1)]]),_:1})]),_:1},8,[`class`]),e(x,{class:l({"v-list-item--active":n(J)===`react`}),onClick:s[1]||=e=>n(A)(`react`)},{prepend:p(()=>[...s[11]||=[_(`i`,{class:`fab fa-react`,style:{"font-size":`18px`,width:`24px`,"text-align":`center`,"margin-right":`8px`,color:`#61dafb`}},null,-1)]]),default:p(()=>[e(C,null,{default:p(()=>[...s[12]||=[m(`React`,-1)]]),_:1})]),_:1},8,[`class`]),e(x,{class:l({"v-list-item--active":n(J)===`vue`}),onClick:s[2]||=e=>n(A)(`vue`)},{prepend:p(()=>[...s[13]||=[_(`i`,{class:`fab fa-vuejs`,style:{"font-size":`18px`,width:`24px`,"text-align":`center`,"margin-right":`8px`,color:`#42b883`}},null,-1)]]),default:p(()=>[e(C,null,{default:p(()=>[...s[14]||=[m(`Vue`,-1)]]),_:1})]),_:1},8,[`class`])]),_:1})]),_:1},8,[`modelValue`])]),_:1},8,[`style`]),_(`div`,N,[e(T,{modelValue:U.value,"onUpdate:modelValue":s[4]||=e=>U.value=e,autofocus:``,label:F(I.value?.form?.connection?.label?.username),autocomplete:`username`,density:`comfortable`,variant:`outlined`,"hide-details":``,class:`mb-3`,onKeydown:d(Y,[`enter`])},{"prepend-inner":p(()=>[e(b,{size:`20`},{default:p(()=>[...s[15]||=[m(`mdi-account`,-1)]]),_:1})]),_:1},8,[`modelValue`,`label`]),e(T,{modelValue:W.value,"onUpdate:modelValue":s[6]||=e=>W.value=e,label:F(I.value?.form?.connection?.label?.password),type:G.value?`text`:`password`,autocomplete:`current-password`,density:`comfortable`,variant:`outlined`,"hide-details":``,class:`mb-3`,onKeydown:d(Y,[`enter`])},{"prepend-inner":p(()=>[e(b,{size:`20`},{default:p(()=>[...s[16]||=[m(`mdi-lock`,-1)]]),_:1})]),"append-inner":p(()=>[e(b,{size:`20`,style:{cursor:`pointer`},onClick:s[5]||=e=>G.value=!G.value},{default:p(()=>[m(u(G.value?`mdi-eye-off`:`mdi-eye`),1)]),_:1})]),_:1},8,[`modelValue`,`label`,`type`]),n(L).loginError?(a(),r(`div`,P,u(I.value?.confirm?.invalidCredentials),1)):i(``,!0)]),_(`div`,{class:`p3xr-login-footer`,style:o({backgroundColor:H.value})},[e(v,{color:`primary`,variant:`flat`,disabled:K.value||!U.value||!W.value,onClick:Y},{default:p(()=>[e(b,{size:`20`,class:`mr-1`},{default:p(()=>[...s[17]||=[m(`mdi-login`,-1)]]),_:1}),m(` `+u(I.value?.intention?.ok),1)]),_:1},8,[`disabled`])],4)])]))}}),[[`__scopeId`,`data-v-79c4e174`]]);export{I as default};