diff --git a/app/dashboard/build/404.html b/app/dashboard/build/404.html index 128e9aed..d4138704 100644 --- a/app/dashboard/build/404.html +++ b/app/dashboard/build/404.html @@ -33,7 +33,7 @@ - + diff --git a/app/dashboard/build/assets/index.a97b5769.js b/app/dashboard/build/assets/index.9b159dc0.js similarity index 55% rename from app/dashboard/build/assets/index.a97b5769.js rename to app/dashboard/build/assets/index.9b159dc0.js index 4f7ab6a1..70c9d9d7 100644 --- a/app/dashboard/build/assets/index.a97b5769.js +++ b/app/dashboard/build/assets/index.9b159dc0.js @@ -1,4 +1,4 @@ -import{i as Nt,B as sn,a as an,b as ln,j as vr,d as B,U as Ht,z as cn,r as dn,f as hn,Q as un,e as pn,$ as mn,c as zt,g as y,h as gn,C as fn,k as Dt,u as Bt,l as j,m as r,H as _,n as e,T as h,o as bn,p as D,s as xn,q as f,t as ht,J as yn,v as Ir,A as Et,w as Sn,x as Cn,M as oe,y as se,D as ae,E as ie,F as le,G as fe,I as Ve,K as zr,L as wn,N as lt,O as ce,P as R,R as H,S as Dr,V as ne,W as U,X as pe,Y as Z,Z as Re,_ as F,a0 as Ut,a1 as rt,a2 as _n,a3 as Ee,a4 as Ne,a5 as kn,a6 as Er,a7 as Ur,a8 as st,a9 as St,aa as vn,ab as je,ac as Ct,ad as Jt,ae as In,af as Rr,ag as Lr,ah as Tr,ai as me,aj as zn,ak as Dn,al as En,am as Un,an as Rn,ao as $t,ap as Ar,aq as Mr,ar as ge,as as Kt,at as Ln,au as Tn,av as An,aw as Ft,ax as Mn,ay as Nn,az as Fn,aA as Pn,aB as Wn,aC as On,aD as wt,aE as jn,aF as Me,aG as Hn,aH as x,aI as ut,aJ as Nr,aK as pt,aL as N,aM as Vt,aN as Bn,aO as He,aP as Be,aQ as Pt,aR as $e,aS as Ce,aT as we,aU as _e,aV as ke,aW as ve,aX as Ie,aY as er,aZ as $n,a_ as _t,a$ as at,b0 as Gt,b1 as Vn,b2 as Gn,b3 as Yn,b4 as Fr,b5 as Zn,b6 as ct,b7 as kt,b8 as Pr,b9 as Qn,ba as qn,bb as Wr,bc as Ae,bd as Xn,be as Jn,bf as Kn,bg as Yt,bh as Rt,bi as tr,bj as Or,bk as eo,bl as to,bm as rr,bn as ro,bo as nr,bp as jr,bq as no,br as Hr,bs as oo,bt as so,bu as Br,bv as ao,bw as io,bx as $r,by as Vr,bz as Gr,bA as X,bB as lo,bC as Yr,bD as or,bE as co,bF as ho,bG as uo,bH as po,bI as mo,bJ as go,bK as Zr,bL as fo,bM as sr,bN as ar,bO as Oe,bP as ze,bQ as ir,bR as ue,bS as lr,bT as bo,bU as xo,bV as yo,bW as So,bX as Co,bY as wo,bZ as _o,b_ as ko,b$ as vo,c0 as Io,c1 as zo,c2 as Do,c3 as Eo,c4 as Uo,c5 as Ro,c6 as Lo,c7 as To}from"./vendor.8aa8dc93.js";(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&s(l)}).observe(document,{childList:!0,subtree:!0});function o(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerpolicy&&(a.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?a.credentials="include":i.crossorigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(i){if(i.ep)return;i.ep=!0;const a=o(i);fetch(i.href,a)}})();Nt.use(sn).use(an).use(ln).init({debug:{}.NODE_ENV==="development",returnNull:!1,fallbackLng:"en",interpolation:{escapeValue:!1},react:{useSuspense:!1},load:"languageOnly",detection:{caches:["localStorage","sessionStorage","cookie"]},backend:{loadPath:vr(["/dashboard/","locales/{{lng}}.json"])}},function(t,n){B.locale(Nt.language)});Nt.on("languageChanged",t=>{B.locale(t)});Ht("zh-cn",cn);Ht("ru",dn);Ht("fa",hn);const Wt=new un,Qr=t=>{const n=document.querySelector('meta[name="theme-color"]');n==null||n.setAttribute("content",t=="dark"?"#1A202C":"#3B81F6")},Ao=pn({shadows:{outline:"0 0 0 2px var(--chakra-colors-primary-200)"},fonts:{body:"Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif"},colors:{"light-border":"#d2d2d4",primary:{50:"#9cb7f2",100:"#88a9ef",200:"#749aec",300:"#618ce9",400:"#4d7de7",500:"#396fe4",600:"#3364cd",700:"#2e59b6",800:"#284ea0",900:"#224389"},gray:{750:"#222C3B"}},components:{Alert:{baseStyle:{container:{borderRadius:"6px",fontSize:"sm"}}},Select:{baseStyle:{field:{_dark:{borderColor:"gray.600",borderRadius:"6px"},_light:{borderRadius:"6px"}}}},FormHelperText:{baseStyle:{fontSize:"xs"}},FormLabel:{baseStyle:{fontSize:"sm",fontWeight:"medium",mb:"1",_dark:{color:"gray.300"}}},Input:{baseStyle:{addon:{_dark:{borderColor:"gray.600",_placeholder:{color:"gray.500"}}},field:{_focusVisible:{boxShadow:"none",borderColor:"primary.200",outlineColor:"primary.200"},_dark:{borderColor:"gray.600",_disabled:{color:"gray.400",borderColor:"gray.500"},_placeholder:{color:"gray.500"}}}}},Table:{baseStyle:{table:{borderCollapse:"separate",borderSpacing:0},thead:{borderBottomColor:"light-border"},th:{background:"#F9FAFB",borderColor:"light-border !important",borderBottomColor:"light-border !important",borderTop:"1px solid ",borderTopColor:"light-border !important",_first:{borderLeft:"1px solid",borderColor:"light-border !important"},_last:{borderRight:"1px solid",borderColor:"light-border !important"},_dark:{borderColor:"gray.600 !important",background:"gray.750"}},td:{transition:"all .1s ease-out",borderColor:"light-border",borderBottomColor:"light-border !important",_first:{borderLeft:"1px solid",borderColor:"light-border",_dark:{borderColor:"gray.600"}},_last:{borderRight:"1px solid",borderColor:"light-border",_dark:{borderColor:"gray.600"}},_dark:{borderColor:"gray.600",borderBottomColor:"gray.600 !important"}},tr:{"&.interactive":{cursor:"pointer",_hover:{"& > td":{bg:"gray.200"},_dark:{"& > td":{bg:"gray.750"}}}},_last:{"& > td":{_first:{borderBottomLeftRadius:"8px"},_last:{borderBottomRightRadius:"8px"}}}}}}}});const vt=()=>localStorage.getItem("token"),Mo=t=>{localStorage.setItem("token",t)},No=()=>{localStorage.removeItem("token")},Fo=mn.create({baseURL:"/api/"}),Po=(t,n={})=>(vt()&&(n.headers={...(n==null?void 0:n.headers)||{},Authorization:`Bearer ${vt()}`}),Fo(t,n)),O=Po,Wo=zt(t=>({isLoading:!0,isPostLoading:!1,version:null,started:!1,logs_websocket:null,config:"",fetchCoreSettings:()=>{t({isLoading:!0}),Promise.all([O("/core").then(({version:n,started:o,logs_websocket:s})=>t({version:n,started:o,logs_websocket:s})),O("/core/config").then(n=>t({config:n}))]).finally(()=>t({isLoading:!1}))},updateConfig:n=>(t({isPostLoading:!0}),O("/core/config",{method:"PUT",body:n}).finally(()=>{t({isPostLoading:!1})})),restartCore:()=>O("/core/restart",{method:"POST"})}));function re(t,n=2,o=!1){if(!+t)return"0 B";const s=1024,i=n<0?0:n,a=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],l=Math.floor(Math.log(t)/Math.log(s));return o?[parseFloat((t/Math.pow(s,l)).toFixed(i)),a[l]]:`${parseFloat((t/Math.pow(s,l)).toFixed(i))} ${a[l]}`}const cr=t=>{if(t!==null)return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")},Oo=y(gn,{baseStyle:{w:5,h:5,position:"relative",zIndex:"2"}}),jo=y(fn,{baseStyle:{w:5,h:5,position:"relative",zIndex:"2"}}),Ho=y(Dt,{baseStyle:{w:5,h:5,position:"relative",zIndex:"2"}}),Lt=({title:t,content:n,icon:o})=>r(bn,{p:6,borderWidth:"1px",borderColor:"light-border",bg:"#F9FAFB",_dark:{borderColor:"gray.600",bg:"gray.750"},borderStyle:"solid",boxShadow:"none",borderRadius:"12px",width:"full",display:"flex",justifyContent:"space-between",flexDirection:"row",children:[r(_,{alignItems:"center",columnGap:"4",children:[e(D,{p:"2",position:"relative",color:"white",_before:{content:'""',position:"absolute",top:0,left:0,bg:"primary.400",display:"block",w:"full",h:"full",borderRadius:"5px",opacity:".5",z:"1"},_after:{content:'""',position:"absolute",top:"-5px",left:"-5px",bg:"primary.400",display:"block",w:"calc(100% + 10px)",h:"calc(100% + 10px)",borderRadius:"8px",opacity:".4",z:"1"},children:o}),e(h,{color:"gray.600",_dark:{color:"gray.300"},fontWeight:"medium",textTransform:"capitalize",fontSize:"sm",children:t})]}),e(D,{fontSize:"3xl",fontWeight:"semibold",mt:"2",children:n})]}),Ot="statistics-query-key",Bo=t=>{const{version:n}=E(),{data:o}=Bt({queryKey:Ot,queryFn:()=>O("/system"),refetchInterval:5e3,onSuccess:({version:i})=>{n!==i&&E.setState({version:i})}}),{t:s}=j();return r(_,{justifyContent:"space-between",gap:0,columnGap:{lg:4,md:0},rowGap:{lg:0,base:4},display:"flex",flexDirection:{lg:"row",base:"column"},...t,children:[e(Lt,{title:s("activeUsers"),content:o&&r(_,{alignItems:"flex-end",children:[e(h,{children:cr(o.users_active)}),r(h,{fontWeight:"normal",fontSize:"lg",as:"span",display:"inline-block",pb:"5px",children:["/ ",cr(o.total_user)]})]}),icon:e(Oo,{})}),e(Lt,{title:s("dataUsage"),content:o&&re(o.incoming_bandwidth+o.outgoing_bandwidth),icon:e(jo,{})}),e(Lt,{title:s("memoryUsage"),content:o&&r(_,{alignItems:"flex-end",children:[e(h,{children:re(o.mem_used,1,!0)[0]}),r(h,{fontWeight:"normal",fontSize:"lg",as:"span",display:"inline-block",pb:"5px",children:[re(o.mem_used,1,!0)[1]," /"," ",re(o.mem_total,1)]})]}),icon:e(Ho,{})})]})},qr="marzban-num-users-per-page",dr=10,$o=()=>{const t=localStorage.getItem(qr)||dr.toString();return parseInt(t)||dr},Vo=t=>localStorage.setItem(qr,t),Go=t=>{for(const n in t)t[n]||delete t[n];return E.setState({loading:!0}),O("/users",{query:t}).then(n=>(E.setState({users:n}),n)).finally(()=>{E.setState({loading:!1})})},Yo=()=>O("/inbounds").then(t=>{E.setState({inbounds:new Map(Object.entries(t))})}).finally(()=>{E.setState({loading:!1})}),E=zt(xn((t,n)=>({version:null,editingUser:null,deletingUser:null,isCreatingNewUser:!1,QRcodeLinks:null,subscribeUrl:null,users:{users:[],total:0},loading:!0,isResetingAllUsage:!1,isEditingHosts:!1,isEditingNodes:!1,isShowingNodesUsage:!1,resetUsageUser:null,revokeSubscriptionUser:null,filters:{username:"",limit:$o(),sort:"-created_at"},inbounds:new Map,isEditingCore:!1,refetchUsers:()=>{Go(n().filters)},resetAllUsage:()=>O("/users/reset",{method:"POST"}).then(()=>{n().onResetAllUsage(!1),n().refetchUsers()}),onResetAllUsage:o=>t({isResetingAllUsage:o}),onCreateUser:o=>t({isCreatingNewUser:o}),onEditingUser:o=>{t({editingUser:o})},onDeletingUser:o=>{t({deletingUser:o})},onFilterChange:o=>{t({filters:{...n().filters,...o}}),n().refetchUsers()},setQRCode:o=>{t({QRcodeLinks:o})},deleteUser:o=>(t({editingUser:null}),O(`/user/${o.username}`,{method:"DELETE"}).then(()=>{t({deletingUser:null}),n().refetchUsers(),Wt.invalidateQueries(Ot)})),createUser:o=>O("/user",{method:"POST",body:o}).then(()=>{t({editingUser:null}),n().refetchUsers(),Wt.invalidateQueries(Ot)}),editUser:o=>O(`/user/${o.username}`,{method:"PUT",body:o}).then(()=>{n().onEditingUser(null),n().refetchUsers()}),fetchUserUsage:(o,s)=>{for(const i in s)s[i]||delete s[i];return O(`/user/${o.username}/usage`,{method:"GET",query:s})},onEditingHosts:o=>{t({isEditingHosts:o})},onEditingNodes:o=>{t({isEditingNodes:o})},onShowingNodesUsage:o=>{t({isShowingNodesUsage:o})},setSubLink:o=>{t({subscribeUrl:o})},resetDataUsage:o=>O(`/user/${o.username}/reset`,{method:"POST"}).then(()=>{t({resetUsageUser:null}),n().refetchUsers()}),revokeSubscription:o=>O(`/user/${o.username}/revoke_sub`,{method:"POST"}).then(s=>{t({revokeSubscriptionUser:null,editingUser:s}),n().refetchUsers()})}))),de=({children:t,color:n})=>e(D,{position:"relative",width:"36px",height:"36px",display:"flex",justifyContent:"center",alignItems:"center",_before:{content:'""',display:"block",position:"absolute",top:"0",left:"0",width:"calc(100%)",height:"calc(100%)",bg:`${n}.400`,opacity:".5",borderRadius:"5px",zIndex:"1",_dark:{bg:`${n}.400`}},_after:{content:'""',display:"block",position:"absolute",top:"0",left:"0",width:"calc(100% + 10px)",height:"calc(100% + 10px)",transform:"translate(-5px, -5px)",bg:`${n}.400`,opacity:".4",borderRadius:"8px",zIndex:"1",_dark:{bg:`${n}.400`}},children:e(h,{color:`${n}.500`,_dark:{color:`${n}.900`},position:"relative",zIndex:"2",children:t})});window.ace.define("ace/theme/nord_dark",["require","exports","module","ace/lib/dom"],(t,n,o)=>{n.isDark=!0,n.cssClass="ace-nord-dark",t("../lib/dom").importCssString(n.cssText,n.cssClass)});window.ace.define("ace/theme/dawn",["require","exports","module","ace/lib/dom"],(t,n,o)=>{n.isDark=!1,n.cssClass="ace-dawn",t("../lib/dom").importCssString(n.cssText,n.cssClass)});const Zo=f.exports.forwardRef(({json:t,onChange:n,mode:o="code"},s)=>{const{colorMode:i}=ht(),a={mode:o,onChangeText:n,statusBar:!1,mainMenuBar:!1,theme:i==="dark"?"ace/theme/nord_dark":"ace/theme/dawn"},l=f.exports.useRef(null),u=f.exports.useRef(null);return f.exports.useEffect(()=>(u.current=new yn(l.current,a),()=>{u.current&&u.current.destroy()}),[]),f.exports.useEffect(()=>{u.current&&u.current.update(t)},[t]),e(D,{ref:s,border:"1px solid",borderColor:"gray.300",_dark:{borderColor:"gray.500"},borderRadius:5,h:"full",children:e(D,{height:"full",ref:l})})}),hr=500,Qo=y(Ir,{baseStyle:{w:5,h:5}}),qo=y(Et,{baseStyle:{w:4,h:4}}),Xo=y(Sn,{baseStyle:{w:4,h:4}}),Jo=y(Cn,{baseStyle:{w:3,h:3}}),Ko=t=>({[rt.ReadyState.CONNECTING]:"connecting",[rt.ReadyState.OPEN]:"connected",[rt.ReadyState.CLOSING]:"closed",[rt.ReadyState.CLOSED]:"closed",[rt.ReadyState.UNINSTANTIATED]:"closed"})[t],es=()=>{try{let t=new URL("/api/".startsWith("/")?window.location.origin+"/api/":"/api/");return(t.protocol==="https:"?"wss://":"ws://")+vr([t.host+t.pathname,"/core/logs"])+"?interval=1&token="+vt()}catch(t){return console.error("Unable to generate websocket url"),console.error(t),null}};let Le=[];const ts=()=>{const{isEditingCore:t}=E(),{fetchCoreSettings:n,updateConfig:o,isLoading:s,config:i,isPostLoading:a,version:l,restartCore:u}=Wo(),p=f.exports.useRef(null),[C,d]=f.exports.useState([]),{t:c}=j(),w=fe(),v=Ve({defaultValues:{config:i||{}}});f.exports.useEffect(()=>{i&&v.setValue("config",i)},[i]),f.exports.useEffect(()=>{t&&n()},[t]);const m=f.exports.useRef(!0),S=f.exports.useCallback(zr(L=>{var J,z,P;const V=Math.abs((((J=p.current)==null?void 0:J.scrollTop)||0)-(((z=p.current)==null?void 0:z.scrollHeight)||0)+(((P=p.current)==null?void 0:P.offsetHeight)||0))<10;p.current&&V?m.current=!0:m.current=!1,L.length<40&&d(L)},300),[]),{readyState:T}=wn(es(),{onMessage:L=>{Le.push(L.data),Le.length>hr&&(Le=Le.splice(0,Le.length-hr)),S([...Le])},shouldReconnect:()=>!0,reconnectAttempts:10,reconnectInterval:1e3});f.exports.useEffect(()=>{var L;p.current&&m.current&&(p.current.scrollTop=(L=p.current)==null?void 0:L.scrollHeight)},[C]),f.exports.useEffect(()=>()=>{Le=[]},[]);const g=Ko(T.toString()),{mutate:b,isLoading:W}=lt(u),$=({config:L})=>{o(L).then(()=>{w({title:c("core.successMessage"),status:"success",isClosable:!0,position:"top",duration:3e3})}).catch(V=>{let J=c("core.generalErrorMessage");typeof V.response._data.detail=="object"&&(J=V.response._data.detail[Object.keys(V.response._data.detail)[0]]),typeof V.response._data.detail=="string"&&(J=V.response._data.detail),w({title:J,status:"error",isClosable:!0,position:"top",duration:3e3})})},I=f.exports.useRef(null),[A,Y]=f.exports.useState(!1),q=()=>{var L;document.fullscreenElement?(document.exitFullscreen(),Y(!1)):((L=I.current)==null||L.requestFullscreen(),Y(!0))};return r("form",{onSubmit:v.handleSubmit($),children:[r(ce,{children:[r(R,{children:[r(_,{justifyContent:"space-between",alignItems:"flex-start",children:[r(H,{children:[c("core.configuration")," ",s&&e(Dr,{isIndeterminate:!0,size:"15px"})]}),e(_,{gap:0,children:e(ne,{label:"Xray Version",placement:"top",children:e(U,{height:"100%",textTransform:"lowercase",children:l&&`v${l}`})})})]}),r(D,{position:"relative",ref:I,minHeight:"300px",children:[e(pe,{control:v.control,name:"config",render:({field:L})=>e(Zo,{json:i,onChange:L.onChange})}),e(Z,{size:"xs","aria-label":"full screen",variant:"ghost",position:"absolute",top:"2",right:"4",onClick:q,children:A?e(Jo,{}):e(Xo,{})})]})]}),r(R,{mt:"4",children:[r(_,{justifyContent:"space-between",children:[e(H,{children:c("core.logs")}),e(h,{as:H,children:c(`core.socket.${g}`)})]}),e(D,{border:"1px solid",borderColor:"gray.300",bg:"#F9F9F9",_dark:{borderColor:"gray.500",bg:"#2e3440"},borderRadius:5,minHeight:"200px",maxHeight:"250px",p:2,overflowY:"auto",ref:p,children:C.map((L,V)=>e(h,{fontSize:"xs",opacity:.8,whiteSpace:"pre-line",children:L},V))})]})]}),e(Re,{children:r(_,{w:"full",justifyContent:"space-between",children:[e(D,{children:e(F,{size:"sm",leftIcon:e(qo,{className:Ut({"animate-spin":W})}),onClick:()=>b(),children:c(W?"core.restarting":"core.restartCore")})}),e(_,{children:e(F,{size:"sm",variant:"solid",colorScheme:"primary",px:"5",type:"submit",isDisabled:s||a,isLoading:a,children:c("core.save")})})]})})]})},rs=()=>{const{isEditingCore:t}=E(),n=E.setState.bind(null,{isEditingCore:!1}),{t:o}=j();return r(oe,{isOpen:t,onClose:n,size:"3xl",children:[e(se,{bg:"blackAlpha.300",backdropFilter:"blur(10px)"}),r(ae,{mx:"3",w:"full",children:[e(ie,{pt:6,children:r(_,{gap:2,children:[e(de,{color:"primary",children:e(Qo,{color:"white"})}),e(h,{fontWeight:"semibold",fontSize:"lg",children:o("core.title")})]})}),e(le,{mt:3}),e(ts,{})]})]})},mt=y(_n,{baseStyle:{w:5,h:5}}),ns=()=>{const[t,n]=f.exports.useState(!1),{deletingUser:o,onDeletingUser:s,deleteUser:i}=E(),{t:a}=j(),l=fe(),u=()=>{s(null)},p=()=>{o&&(n(!0),i(o).then(()=>{l({title:a("deleteUser.deleteSuccess",{username:o.username}),status:"success",isClosable:!0,position:"top",duration:3e3})}).then(u).finally(n.bind(null,!1)))};return r(oe,{isCentered:!0,isOpen:!!o,onClose:u,size:"sm",children:[e(se,{bg:"blackAlpha.300",backdropFilter:"blur(10px)"}),r(ae,{mx:"3",children:[e(ie,{pt:6,children:e(de,{color:"red",children:e(mt,{})})}),e(le,{mt:3}),r(ce,{children:[e(h,{fontWeight:"semibold",fontSize:"lg",children:a("deleteUser.title")}),o&&e(h,{mt:1,fontSize:"sm",_dark:{color:"gray.400"},color:"gray.600",children:e(Ee,{components:{b:e("b",{})},children:a("deleteUser.prompt",{username:o.username})})})]}),r(Re,{display:"flex",children:[e(F,{size:"sm",onClick:u,mr:3,w:"full",variant:"outline",children:a("cancel")}),e(F,{size:"sm",w:"full",colorScheme:"red",onClick:p,leftIcon:t?e(Ne,{size:"xs"}):void 0,children:a("delete")})]})]})]})},Zt={baseStyle:{w:4,h:4}},os=y(kn,Zt),ss=y(Er,Zt),Xr=y(Et,Zt),as=zr(t=>{E.getState().onFilterChange({...E.getState().filters,offset:0,search:t})},300),is=({...t})=>{const{loading:n,filters:o,onFilterChange:s,refetchUsers:i,onCreateUser:a}=E(),{t:l}=j(),[u,p]=f.exports.useState(""),C=c=>{p(c.target.value),as(c.target.value)},d=()=>{p(""),s({...o,offset:0,search:""})};return r(Ur,{id:"filters",templateColumns:{lg:"repeat(3, 1fr)",md:"repeat(4, 1fr)",base:"repeat(1, 1fr)"},position:"sticky",top:0,mx:"-6",px:"6",rowGap:4,gap:{lg:4,base:0},bg:"var(--chakra-colors-chakra-body-bg)",py:4,zIndex:"docked",...t,children:[e(st,{colSpan:{base:1,md:2,lg:1},order:{base:2,md:1},children:r(St,{children:[e(vn,{pointerEvents:"none",children:e(os,{})}),e(je,{placeholder:l("search"),value:u,borderColor:"light-border",onChange:C}),r(Ct,{children:[n&&e(Ne,{size:"xs"}),o.search&&o.search.length>0&&e(Z,{onClick:d,"aria-label":"clear",size:"xs",variant:"ghost",children:e(ss,{})})]})]})}),e(st,{colSpan:2,order:{base:1,md:2},children:r(_,{justifyContent:"flex-end",alignItems:"center",h:"full",children:[e(Z,{"aria-label":"refresh users",disabled:n,onClick:i,size:"sm",variant:"outline",children:e(Xr,{className:Ut({"animate-spin":n})})}),e(F,{colorScheme:"primary",size:"sm",onClick:()=>a(!0),px:5,children:l("createUser")})]})})]})},Jr="https://github.com/Gozargah/Marzban",ls="https://github.com/Gozargah",cs="https://github.com/Gozargah/Marzban#donation",Kr=t=>{const{version:n}=E();return e(_,{w:"full",py:"0",position:"relative",...t,children:r(h,{display:"inline-block",flexGrow:1,textAlign:"center",color:"gray.500",fontSize:"xs",children:[e(Jt,{color:"blue.400",href:Jr,children:"Marzban"}),n?` (v${n}), `:", ","Made with \u2764\uFE0F in"," ",e(Jt,{color:"blue.400",href:ls,children:"Gozargah"})]})})},ds=y(In,{baseStyle:{w:4,h:4}}),en=({actions:t})=>{const{i18n:n}=j();var o=s=>{n.changeLanguage(s)};return r(Rr,{placement:"bottom-end",children:[e(Lr,{as:Z,size:"sm",variant:"outline",icon:e(ds,{}),position:"relative"}),r(Tr,{minW:"100px",zIndex:9999,children:[e(me,{maxW:"100px",fontSize:"sm",onClick:()=>o("en"),children:"English"}),e(me,{maxW:"100px",fontSize:"sm",onClick:()=>o("fa"),children:"\u0641\u0627\u0631\u0633\u06CC"}),e(me,{maxW:"100px",fontSize:"sm",onClick:()=>o("zh-cn"),children:"\u7B80\u4F53\u4E2D\u6587"}),e(me,{maxW:"100px",fontSize:"sm",onClick:()=>o("ru"),children:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439"})]})]})},be={baseStyle:{w:4,h:4}},hs=y(zn,be),us=y(Dn,be),ps=y(Ir,be),ms=y(En,be),gs=y(Un,be),fs=y(Rn,be),bs=y($t,be),xs=y(Ar,be),ys=y(Dt,be),Ss=y(Mr,be),ur=y(D,{baseStyle:{bg:"yellow.500",w:"2",h:"2",rounded:"full",position:"absolute"}}),tn="marzban-menu-notification",Cs=()=>{const t=localStorage.getItem(tn);if(!t)return!0;try{return t&&Tn(parseInt(t))?An(new Date,new Date(parseInt(t)))>=7:!0}catch{return!0}},ws=({actions:t})=>{const{onEditingHosts:n,onResetAllUsage:o,onEditingNodes:s,onShowingNodesUsage:i}=E(),{t:a}=j(),{colorMode:l,toggleColorMode:u}=ht(),[p,C]=f.exports.useState(Cs()),d=l==="dark"?"dark_dimmed":l,c=()=>{localStorage.setItem(tn,new Date().getTime().toString()),C(!1)};return r(_,{gap:2,justifyContent:"space-between",__css:{"& .menuList":{direction:"ltr"}},position:"relative",children:[e(h,{as:"h1",fontWeight:"semibold",fontSize:"2xl",children:a("users")}),p&&e(ur,{top:"0",right:"0",zIndex:9999}),e(D,{overflow:"auto",css:{direction:"rtl"},children:r(_,{alignItems:"center",children:[r(Rr,{children:[e(Lr,{as:Z,size:"sm",variant:"outline",icon:e(ge,{children:e(ms,{})}),position:"relative"}),r(Tr,{minW:"170px",zIndex:99999,className:"menuList",children:[e(me,{maxW:"170px",fontSize:"sm",icon:e(bs,{}),onClick:n.bind(null,!0),children:a("header.hostSettings")}),e(me,{maxW:"170px",fontSize:"sm",icon:e(xs,{}),onClick:s.bind(null,!0),children:a("header.nodeSettings")}),e(me,{maxW:"170px",fontSize:"sm",icon:e(ys,{}),onClick:i.bind(null,!0),children:a("header.nodesUsage")}),e(me,{maxW:"170px",fontSize:"sm",icon:e(Ss,{}),onClick:o.bind(null,!0),children:a("resetAllUsage")}),e(Kt,{to:cs,target:"_blank",children:r(me,{maxW:"170px",fontSize:"sm",icon:e(fs,{}),position:"relative",onClick:c,children:[a("header.donation")," ",p&&e(ur,{top:"3",right:"2"})]})}),e(Kt,{to:"/login",children:e(me,{maxW:"170px",fontSize:"sm",icon:e(gs,{}),children:a("header.logout")})})]})]}),e(Z,{size:"sm",variant:"outline","aria-label":"core settings",onClick:()=>{E.setState({isEditingCore:!0})},children:e(ps,{})}),e(en,{}),e(Z,{size:"sm",variant:"outline","aria-label":"switch theme",onClick:()=>{Qr(l=="dark"?"light":"dark"),u()},children:l==="light"?e(hs,{}):e(us,{})}),e(D,{css:{direction:"ltr"},display:"flex",alignItems:"center",pr:"2",__css:{"& span":{display:"inline-flex"}},children:e(Ln,{href:Jr,"data-color-scheme":`no-preference: ${d}; light: ${d}; dark: ${d};`,"data-size":"large","data-show-count":"true","aria-label":"Star Marzban on GitHub",children:"Star"})})]})})]})},_s=[{title:"Inbound's default",value:"inbound_default"},{title:"TLS",value:"tls"},{title:"None",value:"none"}],ks=[{title:"",value:""},{title:"h3",value:"h3"},{title:"h2",value:"h2"},{title:"http/1.1",value:"http/1.1"},{title:"h3,h2,http/1.1",value:"h3,h2,http/1.1"},{title:"h3,h2",value:"h3,h2"},{title:"h2,http/1.1",value:"h2,http/1.1"}],vs=[{title:"",value:""},...["chrome","firefox","safari","ios","android","edge","360","qq","random","randomized"].map(t=>({title:t,value:t}))],Is=[{title:"none",value:""},{title:"xtls-rprx-vision",value:"xtls-rprx-vision"}],zs=["aes-128-gcm","aes-256-gcm","chacha20-ietf-poly1305"],Ds=zt(t=>({isLoading:!1,isPostLoading:!1,hosts:{},fetchHosts:()=>{t({isLoading:!0}),O("/hosts").then(n=>t({hosts:n})).finally(()=>t({isLoading:!1}))},setHosts:n=>(t({isPostLoading:!0}),O("/hosts",{method:"PUT",body:n}).finally(()=>{t({isPostLoading:!1})}))}));const Es=y(Er,{baseStyle:{w:4,h:4}}),Ue=Ft.forwardRef(({disabled:t,step:n,label:o,className:s,startAdornment:i,endAdornment:a,type:l="text",placeholder:u,onChange:p,onBlur:C,name:d,value:c,onClick:w,error:v,clearable:m=!1,...S},T)=>{const g=()=>{p&&p({target:{value:"",name:d}})},{size:b="md"}=S,W=l=="number"?jn:je,$=l=="number"?Mn:Ft.Fragment,I=l=="number"?{keepWithinRange:!0,precision:5,format:A=>isNaN(parseFloat(String(A)))||Number(parseFloat(String(A)).toFixed(5))===0?A:Number(parseFloat(String(A)).toFixed(5)),min:0,step:n,name:d,type:l,placeholder:u,onChange:A=>{p&&p(A)},onBlur:C,value:c,onClick:w,disabled:t,flexGrow:1,size:b}:{};return r(R,{isInvalid:!!v,children:[o&&e(H,{children:o}),r(St,{size:b,w:"full",rounded:"md",_focusWithin:{outline:"2px solid",outlineColor:"primary.200"},bg:t?"gray.100":"transparent",_dark:{bg:t?"gray.600":"transparent"},children:[i&&e(Nn,{children:i}),r($,{...I,children:[e(W,{name:d,ref:T,step:n,className:Ut(s),type:l,placeholder:u,onChange:p,onBlur:C,value:c,onClick:w,disabled:t,flexGrow:1,_focusVisible:{outline:"none",borderTopColor:"transparent",borderRightColor:"transparent",borderBottomColor:"transparent"},_disabled:{cursor:"not-allowed"},...S,roundedLeft:i?"0":"md",roundedRight:a?"0":"md"}),l=="number"&&e(ge,{children:r(Fn,{children:[e(Pn,{}),e(Wn,{})]})})]}),a&&e(On,{borderLeftRadius:0,borderRightRadius:"6px",bg:"transparent",children:a}),m&&c&&c.length&&e(Ct,{borderLeftRadius:0,borderRightRadius:"6px",bg:"transparent",onClick:g,cursor:"pointer",children:e(Es,{})})]}),!!v&&e(wt,{children:v})]})}),Tt=y(Me,{baseStyle:{bg:"white",_dark:{bg:"gray.700"}}}),Te=y(Ue,{baseStyle:{bg:"white",_dark:{bg:"gray.700"}}}),Us=y($t,{baseStyle:{w:5,h:5}}),De=y(Hn,{baseStyle:{w:4,h:4,color:"gray.400",cursor:"pointer"}}),Rs=x.record(x.string().min(1),x.array(x.object({remark:x.string().min(1,"Remark is required"),address:x.string().min(1,"Address is required"),port:x.string().or(x.number()).nullable().transform(t=>typeof t=="number"?t:t!==null&&!isNaN(parseInt(t))?Number(parseInt(t)):null),path:x.string().nullable(),sni:x.string().nullable(),host:x.string().nullable(),mux_enable:x.boolean().default(!1),allowinsecure:x.boolean().nullable().default(!1),is_disabled:x.boolean().default(!0),fragment_setting:x.string().nullable(),random_user_agent:x.boolean().default(!1),security:x.string(),alpn:x.string(),fingerprint:x.string()}))),Se=y(wt,{baseStyle:{color:"red.400",display:"block",textAlign:"left",w:"100%"}}),Ls=({hostKey:t,isOpen:n,toggleAccordion:o})=>{const{inbounds:s}=E(),i=[...s.values()].flat().filter(v=>v.tag===t)[0],a=Vt(),{fields:l,append:u,remove:p}=Bn({control:a.control,name:t}),{errors:C}=a.formState,{t:d}=j(),c=C[t],w=()=>{u({host:"",sni:"",port:null,path:null,address:"",remark:"",mux_enable:!1,allowinsecure:!1,is_disabled:!1,fragment_setting:"",random_user_agent:!1,security:"inbound_default",alpn:"",fingerprint:""})};return f.exports.useEffect(()=>{c&&!n&&o()},[c]),r(He,{border:"1px solid",_dark:{borderColor:"gray.600"},_light:{borderColor:"gray.200"},borderRadius:"4px",p:1,w:"full",children:[r(Be,{px:2,borderRadius:"3px",onClick:o,children:[e(h,{as:"span",fontWeight:"medium",fontSize:"sm",flex:"1",textAlign:"left",color:"gray.700",_dark:{color:"gray.300"},children:t}),e(Pt,{})]}),e($e,{px:2,pb:2,children:r(N,{gap:3,children:[l.map((v,m)=>{var S,T,g,b,W,$,I,A,Y,q,L,V,J,z,P,K,Fe,bt,xt,ee,Pe,Ye,Ze,Qe,qe,Xe,k,M,te,xe,he,ye,G,Je,Ke,et,tt;return r(N,{border:"1px solid",_dark:{borderColor:"gray.600",bg:"#273142"},_light:{borderColor:"gray.200",bg:"#fcfbfb"},p:2,w:"full",borderRadius:"4px",children:[e(_,{w:"100%",alignItems:"flex-start",children:r(R,{position:"relative",zIndex:10,isInvalid:!!(c&&((S=c[m])==null?void 0:S.remark)),children:[r(St,{children:[e(Te,{...a.register(t+"."+m+".remark"),size:"sm",borderRadius:"4px",placeholder:"Remark"}),e(Ct,{children:r(Ce,{isLazy:!0,placement:"right",children:[e(we,{children:e(D,{mt:"-8px",children:e(De,{})})}),e(_e,{children:r(ke,{children:[e(ve,{}),e(Ie,{}),e(er,{children:r(D,{fontSize:"xs",children:[e(h,{pr:"20px",children:d("hostsDialog.desc")}),r(h,{children:[r(U,{children:["{","SERVER_IP","}"]})," ",d("hostsDialog.currentServer")]}),r(h,{mt:1,children:[r(U,{children:["{","SERVER_IPV6","}"]})," ",d("hostsDialog.currentServerv6")]}),r(h,{mt:1,children:[r(U,{children:["{","USERNAME","}"]})," ",d("hostsDialog.username")]}),r(h,{mt:1,children:[r(U,{children:["{","DATA_USAGE","}"]})," ",d("hostsDialog.dataUsage")]}),r(h,{mt:1,children:[r(U,{children:["{","DATA_LEFT","}"]})," ",d("hostsDialog.remainingData")]}),r(h,{mt:1,children:[r(U,{children:["{","DATA_LIMIT","}"]})," ",d("hostsDialog.dataLimit")]}),r(h,{mt:1,children:[r(U,{children:["{","DAYS_LEFT","}"]})," ",d("hostsDialog.remainingDays")]}),r(h,{mt:1,children:[r(U,{children:["{","EXPIRE_DATE","}"]})," ",d("hostsDialog.expireDate")]}),r(h,{mt:1,children:[r(U,{children:["{","JALALI_EXPIRE_DATE","}"]})," ",d("hostsDialog.jalaliExpireDate")]}),r(h,{mt:1,children:[r(U,{children:["{","TIME_LEFT","}"]})," ",d("hostsDialog.remainingTime")]}),r(h,{mt:1,children:[r(U,{children:["{","STATUS_TEXT","}"]})," ",d("hostsDialog.statusText")]}),r(h,{mt:1,children:[r(U,{children:["{","STATUS_EMOJI","}"]})," ",d("hostsDialog.statusEmoji")]}),r(h,{mt:1,children:[r(U,{children:["{","PROTOCOL","}"]})," ",d("hostsDialog.proxyProtocol")]}),r(h,{mt:1,children:[r(U,{children:["{","TRANSPORT","}"]})," ",d("hostsDialog.proxyMethod")]})]})})]})})]})})]}),c&&((T=c[m])==null?void 0:T.remark)&&e(Se,{children:(b=(g=c[m])==null?void 0:g.remark)==null?void 0:b.message})]})}),r(R,{isInvalid:!!(c&&((W=c[m])==null?void 0:W.address)),children:[r(St,{children:[e(Te,{size:"sm",borderRadius:"4px",placeholder:"Address (e.g. example.com)",...a.register(t+"."+m+".address")}),e(Ct,{children:r(Ce,{isLazy:!0,placement:"right",children:[e(we,{children:e(D,{mt:"-8px",children:e(De,{})})}),e(_e,{children:r(ke,{children:[e(ve,{}),e(Ie,{}),e(er,{children:r(D,{fontSize:"xs",children:[e(h,{pr:"20px",children:d("hostsDialog.desc")}),r(h,{children:[r(U,{children:["{","SERVER_IP","}"]})," ",d("hostsDialog.currentServer")]}),r(h,{mt:1,children:[r(U,{children:["{","SERVER_IPV6","}"]})," ",d("hostsDialog.currentServerv6")]}),r(h,{mt:1,children:[r(U,{children:["{","USERNAME","}"]})," ",d("hostsDialog.username")]}),r(h,{mt:1,children:[r(U,{children:["{","DATA_USAGE","}"]})," ",d("hostsDialog.dataUsage")]}),r(h,{mt:1,children:[r(U,{children:["{","DATA_LEFT","}"]})," ",d("hostsDialog.remainingData")]}),r(h,{mt:1,children:[r(U,{children:["{","DATA_LIMIT","}"]})," ",d("hostsDialog.dataLimit")]}),r(h,{mt:1,children:[r(U,{children:["{","DAYS_LEFT","}"]})," ",d("hostsDialog.remainingDays")]}),r(h,{mt:1,children:[r(U,{children:["{","EXPIRE_DATE","}"]})," ",d("hostsDialog.expireDate")]}),r(h,{mt:1,children:[r(U,{children:["{","JALALI_EXPIRE_DATE","}"]})," ",d("hostsDialog.jalaliExpireDate")]}),r(h,{mt:1,children:[r(U,{children:["{","TIME_LEFT","}"]})," ",d("hostsDialog.remainingTime")]}),r(h,{mt:1,children:[r(U,{children:["{","STATUS_TEXT","}"]})," ",d("hostsDialog.statusText")]}),r(h,{mt:1,children:[r(U,{children:["{","STATUS_EMOJI","}"]})," ",d("hostsDialog.statusEmoji")]}),r(h,{mt:1,children:[r(U,{children:["{","PROTOCOL","}"]})," ",d("hostsDialog.proxyProtocol")]}),r(h,{mt:1,children:[r(U,{children:["{","TRANSPORT","}"]})," ",d("hostsDialog.proxyMethod")]})]})})]})})]})})]}),c&&(($=c[m])==null?void 0:$.address)&&e(Se,{children:(A=(I=c[m])==null?void 0:I.address)==null?void 0:A.message})]}),e(pt,{w:"full",allowToggle:!0,children:r(He,{border:"0",children:[r(Be,{display:"flex",px:0,py:1,borderRadius:3,_hover:{bg:"transparent"},children:[r(h,{flex:"3",align:"start",fontSize:"xs",color:"gray.600",_dark:{color:"gray.500"},pl:1,children:[d("hostsDialog.advancedOptions"),e(Pt,{fontSize:"sm",ml:1})]}),r($n,{flex:"1",px:"0",children:[e(pe,{control:a.control,name:`${t}.${m}.is_disabled`,render:({field:Q})=>e(_t,{mx:"1.5",colorScheme:"primary",...Q,value:void 0,isChecked:!Q.value,onChange:We=>{console.log(We.target.checked),Q.onChange(!We.target.checked)}})}),e(ne,{label:"Delete",placement:"top",children:e(Z,{"aria-label":"Delete",size:"sm",colorScheme:"red",variant:"ghost",onClick:p.bind(null,m),children:e(mt,{})})})]})]}),e($e,{w:"full",p:1,children:r(N,{w:"full",borderRadius:"4px",children:[r(R,{isInvalid:!!(c&&((Y=c[m])==null?void 0:Y.port)),children:[r(H,{display:"flex",pb:1,alignItems:"center",justifyContent:"space-between",gap:1,m:"0",children:[e("span",{children:d("hostsDialog.port")}),r(Ce,{isLazy:!0,placement:"right",children:[e(we,{children:e(De,{})}),e(_e,{children:r(ke,{p:2,children:[e(ve,{}),e(Ie,{}),e(h,{fontSize:"xs",pr:5,children:d("hostsDialog.port.info")})]})})]})]}),e(Te,{size:"sm",borderRadius:"4px",placeholder:String(i.port||"8080"),type:"number",...a.register(t+"."+m+".port")})]}),r(R,{isInvalid:!!(c&&((q=c[m])==null?void 0:q.sni)),children:[r(H,{display:"flex",pb:1,alignItems:"center",gap:1,justifyContent:"space-between",m:"0",children:[e("span",{children:d("hostsDialog.sni")}),r(Ce,{isLazy:!0,placement:"right",children:[e(we,{children:e(De,{})}),e(_e,{children:r(ke,{p:2,children:[e(ve,{}),e(Ie,{}),e(h,{fontSize:"xs",pr:5,children:d("hostsDialog.sni.info")}),e(h,{fontSize:"xs",mt:"2",children:e(Ee,{i18nKey:"hostsDialog.host.wildcard",components:{badge:e(U,{})}})}),e(h,{fontSize:"xs",children:e(Ee,{i18nKey:"hostsDialog.host.multiHost",components:{badge:e(U,{})}})})]})})]})]}),e(Te,{size:"sm",borderRadius:"4px",placeholder:"SNI (e.g. example.com)",...a.register(t+"."+m+".sni")}),c&&((L=c[m])==null?void 0:L.sni)&&e(Se,{children:(J=(V=c[m])==null?void 0:V.sni)==null?void 0:J.message})]}),r(R,{isInvalid:!!(c&&((z=c[m])==null?void 0:z.host)),children:[r(H,{display:"flex",pb:1,alignItems:"center",gap:1,justifyContent:"space-between",m:"0",children:[e("span",{children:d("hostsDialog.host")}),r(Ce,{isLazy:!0,placement:"right",children:[e(we,{children:e(De,{})}),e(_e,{children:r(ke,{p:2,children:[e(ve,{}),e(Ie,{}),e(h,{fontSize:"xs",pr:5,children:d("hostsDialog.host.info")}),e(h,{fontSize:"xs",mt:"2",children:e(Ee,{i18nKey:"hostsDialog.host.wildcard",components:{badge:e(U,{})}})}),e(h,{fontSize:"xs",children:e(Ee,{i18nKey:"hostsDialog.host.multiHost",components:{badge:e(U,{})}})})]})})]})]}),e(Te,{size:"sm",borderRadius:"4px",placeholder:"Host (e.g. example.com)",...a.register(t+"."+m+".host")}),c&&((P=c[m])==null?void 0:P.host)&&e(Se,{children:(Fe=(K=c[m])==null?void 0:K.host)==null?void 0:Fe.message})]}),r(R,{isInvalid:!!(c&&((bt=c[m])==null?void 0:bt.path)),children:[r(H,{display:"flex",pb:1,alignItems:"center",gap:1,justifyContent:"space-between",m:"0",children:[e("span",{children:d("hostsDialog.path")}),r(Ce,{isLazy:!0,placement:"right",children:[e(we,{children:e(De,{})}),e(_e,{children:r(ke,{p:2,children:[e(ve,{}),e(Ie,{}),e(h,{fontSize:"xs",pr:5,children:d("hostsDialog.path.info")})]})})]})]}),e(Te,{size:"sm",borderRadius:"4px",placeholder:"path (e.g. /vless)",...a.register(t+"."+m+".path")}),c&&((xt=c[m])==null?void 0:xt.path)&&e(Se,{children:(Pe=(ee=c[m])==null?void 0:ee.path)==null?void 0:Pe.message})]}),r(R,{height:"66px",children:[r(H,{display:"flex",pb:1,alignItems:"center",gap:1,justifyContent:"space-between",m:"0",children:[e("span",{children:d("hostsDialog.security")}),r(Ce,{isLazy:!0,placement:"right",children:[e(we,{children:e(De,{})}),e(_e,{children:r(ke,{p:2,children:[e(ve,{}),e(Ie,{}),e(h,{fontSize:"xs",pr:5,children:d("hostsDialog.security.info")})]})})]})]}),e(Tt,{size:"sm",...a.register(t+"."+m+".security"),children:_s.map(Q=>e("option",{value:Q.value,children:Q.title},Q.value))})]}),r(R,{height:"66px",children:[e(H,{display:"flex",pb:1,alignItems:"center",gap:1,justifyContent:"space-between",m:"0",children:e("span",{children:d("hostsDialog.alpn")})}),e(Tt,{size:"sm",...a.register(t+"."+m+".alpn"),children:ks.map(Q=>e("option",{value:Q.value,children:Q.title},Q.value))})]}),r(R,{height:"66px",children:[e(H,{display:"flex",pb:1,alignItems:"center",gap:1,justifyContent:"space-between",m:"0",children:e("span",{children:d("hostsDialog.fingerprint")})}),e(Tt,{size:"sm",...a.register(t+"."+m+".fingerprint"),children:vs.map(Q=>e("option",{value:Q.value,children:Q.title},Q.value))})]}),r(R,{isInvalid:!!(c&&((Ye=c[m])==null?void 0:Ye.fragment_setting)),children:[r(H,{display:"flex",pb:1,alignItems:"center",gap:1,justifyContent:"space-between",m:"0",children:[e("span",{children:d("hostsDialog.fragment")}),r(Ce,{isLazy:!0,placement:"right",children:[e(we,{children:e(De,{})}),e(_e,{children:r(ke,{p:2,children:[e(ve,{}),e(Ie,{}),e(h,{fontSize:"xs",pr:5,children:d("hostsDialog.fragment.info")}),e(h,{fontSize:"xs",pr:5,pt:2,pb:1,children:d("hostsDialog.fragment.info.examples")}),e(h,{fontSize:"xs",pr:5,children:"100-200,10-20,tlshello"}),e(h,{fontSize:"xs",pr:5,children:"100-200,10-20,1-3"}),e(h,{fontSize:"xs",pr:5,pt:"3",children:d("hostsDialog.fragment.info.attention")})]})})]})]}),e(Te,{size:"sm",borderRadius:"4px",placeholder:"Fragment settings by pattern",...a.register(t+"."+m+".fragment_setting")}),c&&((Ze=c[m])==null?void 0:Ze.fragment_setting)&&e(Se,{children:(qe=(Qe=c[m])==null?void 0:Qe.fragment_setting)==null?void 0:qe.message})]}),e(R,{isInvalid:!!(c&&((Xe=c[m])==null?void 0:Xe.allowinsecure)),children:r(at,{...a.register(t+"."+m+".allowinsecure"),name:t+"."+m+".allowinsecure",children:[e(H,{children:d("hostsDialog.allowinsecure")}),c&&((k=c[m])==null?void 0:k.allowinsecure)&&e(Se,{children:(te=(M=c[m])==null?void 0:M.allowinsecure)==null?void 0:te.message})]})}),r(R,{isInvalid:!!(c&&((xe=c[m])==null?void 0:xe.mux_enable)),children:[e(at,{...a.register(t+"."+m+".mux_enable"),children:e(H,{children:d("hostsDialog.muxEnable")})}),c&&((he=c[m])==null?void 0:he.mux_enable)&&e(Se,{children:(G=(ye=c[m])==null?void 0:ye.mux_enable)==null?void 0:G.message})]}),r(R,{isInvalid:!!(c&&((Je=c[m])==null?void 0:Je.random_user_agent)),children:[e(at,{...a.register(t+"."+m+".random_user_agent"),children:e(H,{children:d("hostsDialog.randomUserAgent")})}),c&&((Ke=c[m])==null?void 0:Ke.random_user_agent)&&e(Se,{children:(tt=(et=c[m])==null?void 0:et.random_user_agent)==null?void 0:tt.message})]})]},m)})]})})]},m)}),e(F,{variant:"outline",w:"full",size:"sm",color:"",fontWeight:"normal",onClick:w,children:d("hostsDialog.addHost")})]})})]})},Ts=()=>{const{isEditingHosts:t,onEditingHosts:n,refetchUsers:o,inbounds:s}=E(),{isLoading:i,hosts:a,fetchHosts:l,isPostLoading:u,setHosts:p}=Ds(),C=fe(),{t:d}=j(),[c,w]=f.exports.useState({});f.exports.useEffect(()=>{t&&l()},[t]);const v=Ve({resolver:ut(Rs)});f.exports.useEffect(()=>{a&&t&&v.reset(a)},[a]);const m=()=>{w({}),n(!1)},S=g=>{p(g).then(()=>{C({title:d("hostsDialog.savedSuccess"),status:"success",isClosable:!0,position:"top",duration:3e3}),o()}).catch(b=>{var W,$,I,A,Y;(((W=b==null?void 0:b.response)==null?void 0:W.status)===409||(($=b==null?void 0:b.response)==null?void 0:$.status)===400)&&C({title:(A=(I=b.response)==null?void 0:I._data)==null?void 0:A.detail,status:"error",isClosable:!0,position:"top",duration:3e3}),((Y=b==null?void 0:b.response)==null?void 0:Y.status)===422&&Object.keys(b.response._data.detail).forEach(q=>{C({title:b.response._data.detail[q]+" ("+q+")",status:"error",isClosable:!0,position:"top",duration:3e3})})})},T=g=>{c[String(g)]?delete c[String(g)]:c[String(g)]={},w({...c})};return r(oe,{isOpen:t,onClose:m,children:[e(se,{bg:"blackAlpha.300",backdropFilter:"blur(10px)"}),r(ae,{mx:"3",w:"fit-content",maxW:"3xl",children:[e(ie,{pt:6,children:e(de,{color:"primary",children:e(Us,{color:"white"})})}),e(le,{mt:3}),e(ce,{w:"440px",pb:3,pt:3,children:e(Nr,{...v,children:r("form",{onSubmit:v.handleSubmit(S),children:[e(h,{mb:3,opacity:.8,fontSize:"sm",children:d("hostsDialog.title")}),i&&d("hostsDialog.loading"),!i&&a&&(Object.keys(a).length>0?e(pt,{w:"full",allowToggle:!0,allowMultiple:!0,index:Object.keys(c).map(g=>parseInt(g)),children:e(N,{w:"full",children:Object.keys(a).map((g,b)=>e(Ls,{toggleAccordion:()=>T(b),isOpen:c[String(b)],hostKey:g},g))})}):"No inbound found. Please check your Xray config file."),e(_,{justifyContent:"flex-end",py:2,children:e(F,{variant:"solid",mt:"2",type:"submit",colorScheme:"primary",size:"sm",px:5,isLoading:u,disabled:u,children:d("hostsDialog.apply")})})]})})})]})]})},rn=x.object({name:x.string().min(1),address:x.string().min(1),port:x.number().min(1).or(x.string().transform(t=>parseFloat(t))),api_port:x.number().min(1).or(x.string().transform(t=>parseFloat(t))),xray_version:x.string().nullable().optional(),id:x.number().nullable().optional(),status:x.enum(["connected","connecting","error","disabled"]).nullable().optional(),message:x.string().nullable().optional(),add_as_new_host:x.boolean().optional(),usage_coefficient:x.number().or(x.string().transform(t=>parseFloat(t)))}),As=()=>({name:"",address:"",port:62050,api_port:62051,xray_version:"",usage_coefficient:1}),dt="fetch-nodes-query-key",Ms=()=>{const{isEditingNodes:t}=E();return Bt({queryKey:dt,queryFn:gt.getState().fetchNodes,refetchInterval:t?3e3:void 0,refetchOnWindowFocus:!1})},gt=zt((t,n)=>({nodes:[],addNode(o){return O("/node",{method:"POST",body:o})},fetchNodes(){return O("/nodes")},fetchNodesUsage(o){return O("/nodes/usage",{query:o})},updateNode(o){return O(`/node/${o.id}`,{method:"PUT",body:o})},setDeletingNode(o){t({deletingNode:o})},reconnectNode(o){return O(`/node/${o.id}/reconnect`,{method:"POST"})},deleteNode:()=>{var o;return O(`/node/${(o=n().deletingNode)==null?void 0:o.id}`,{method:"DELETE"})}})),Qt=(t,n,o)=>{if(t.response&&t.response._data){if(typeof t.response._data.detail=="string")return n({title:t.response._data.detail,status:"error",isClosable:!0,position:"top",duration:3e3});if(typeof t.response._data.detail=="object"&&o){Object.keys(t.response._data.detail).forEach(s=>o.setError(s,{message:t.response._data.detail[s]}));return}}return n({title:"Something went wrong!",status:"error",isClosable:!0,position:"top",duration:3e3})},qt=(t,n)=>n({title:t,status:"success",isClosable:!0,position:"top",duration:3e3}),Ns=({deleteCallback:t})=>{const{deleteNode:n,deletingNode:o,setDeletingNode:s}=gt(),{t:i}=j(),a=fe(),l=Gt(),u=()=>{s(null)},{isLoading:p,mutate:C}=lt(n,{onSuccess:()=>{qt(i("deleteNode.deleteSuccess",{name:o&&o.name}),a),s(null),l.invalidateQueries(dt),t&&t()},onError:d=>{Qt(d,a)}});return r(oe,{isCentered:!0,isOpen:!!o,onClose:u,size:"sm",children:[e(se,{bg:"blackAlpha.300",backdropFilter:"blur(10px)"}),r(ae,{mx:"3",children:[e(ie,{pt:6,children:e(de,{color:"red",children:e(mt,{})})}),e(le,{mt:3}),r(ce,{children:[e(h,{fontWeight:"semibold",fontSize:"lg",children:i("deleteNode.title")}),o&&e(h,{mt:1,fontSize:"sm",_dark:{color:"gray.400"},color:"gray.600",children:e(Ee,{components:{b:e("b",{})},children:i("deleteNode.prompt",{name:o.name})})})]}),r(Re,{display:"flex",children:[e(F,{size:"sm",onClick:u,mr:3,w:"full",variant:"outline",children:i("cancel")}),e(F,{size:"sm",w:"full",colorScheme:"red",onClick:()=>C(),leftIcon:p?e(Ne,{size:"xs"}):void 0,children:i("delete")})]})]})]})},ft={baseStyle:{strokeWidth:"2px",w:4,h:4}},pr=y(Vn,ft),Fs=y(Gn,ft),mr=y(Yn,ft),gr=y(Fr,ft),Ps=y(Fr,ft),jt=[{title:"No",value:"no_reset"},{title:"Daily",value:"day"},{title:"Weekly",value:"week"},{title:"Monthly",value:"month"},{title:"Annually",value:"year"}],it={active:{statusColor:"green",bandWidthColor:"primary",icon:pr},connected:{statusColor:"green",bandWidthColor:"primary",icon:pr},disabled:{statusColor:"gray",bandWidthColor:"gray",icon:Fs},expired:{statusColor:"orange",bandWidthColor:"orange",icon:gr},on_hold:{statusColor:"purple",bandWidthColor:"purple",icon:Ps},connecting:{statusColor:"orange",bandWidthColor:"orange",icon:gr},limited:{statusColor:"red",bandWidthColor:"red",icon:mr},error:{statusColor:"red",bandWidthColor:"red",icon:mr}},Xt=t=>{let n={status:"",time:""};if(t){B(t*1e3).utc().isAfter(B().utc())?n.status="expires":n.status="expired";const o=[],s=B.duration(B(t*1e3).utc().diff(B()));s.years()!=0&&o.push(Math.abs(s.years())+" year"+(Math.abs(s.years())!=1?"s":"")),s.months()!=0&&o.push(Math.abs(s.months())+" month"+(Math.abs(s.months())!=1?"s":"")),s.days()!=0&&o.push(Math.abs(s.days())+" day"+(Math.abs(s.days())!=1?"s":"")),o.length===0&&(s.hours()!=0&&o.push(Math.abs(s.hours())+" hour"+(Math.abs(s.hours())!=1?"s":"")),s.minutes()!=0&&o.push(Math.abs(s.minutes())+" min"+(Math.abs(s.minutes())!=1?"s":""))),n.time=o.join(", ")}return n},yt=({expiryDate:t,status:n,compact:o=!1,showDetail:s=!0,extraText:i})=>{const{t:a}=j(),l=Xt(t),u=it[n].icon;return r(ge,{children:[r(U,{colorScheme:it[n].statusColor,rounded:"full",display:"inline-flex",px:3,py:1,columnGap:o?1:2,alignItems:"center",children:[e(u,{w:o?3:4}),s&&r(h,{textTransform:"capitalize",fontSize:o?".7rem":".875rem",lineHeight:o?"1rem":"1.25rem",fontWeight:"medium",letterSpacing:"tighter",children:[n==="on_hold"?a(n):n,i&&`: ${i}`]})]}),s&&t&&e(h,{display:"inline-block",fontSize:"xs",fontWeight:"medium",ml:"2",color:"gray.600",_dark:{color:"gray.400"},children:a(l.status,{time:l.time})})]})},nt=y(Ue,{baseStyle:{bg:"white",_dark:{bg:"gray.700"}}}),Ws=y(Ar,{baseStyle:{w:5,h:5}}),Os=y(Zn,{baseStyle:{w:5,h:5,strokeWidth:2}}),js=({toggleAccordion:t,node:n})=>{const{updateNode:o,reconnectNode:s,setDeletingNode:i}=gt(),{t:a}=j(),l=Gt(),u=fe(),p=Ve({defaultValues:n,resolver:ut(rn)}),C=i.bind(null,n),{isLoading:d,mutate:c}=lt(o,{onSuccess:()=>{qt("Node updated successfully",u),l.invalidateQueries(dt)},onError:S=>{Qt(S,u,p)}}),{isLoading:w,mutate:v}=lt(s.bind(null,n),{onSuccess:()=>{l.invalidateQueries(dt)}}),m=w?"connecting":n.status?n.status:"error";return r(He,{border:"1px solid",_dark:{borderColor:"gray.600"},_light:{borderColor:"gray.200"},borderRadius:"4px",p:1,w:"full",children:[r(Be,{px:2,borderRadius:"3px",onClick:t,children:[r(_,{w:"full",justifyContent:"space-between",pr:2,children:[e(h,{as:"span",fontWeight:"medium",fontSize:"sm",flex:"1",textAlign:"left",color:"gray.700",_dark:{color:"gray.300"},children:n.name}),r(_,{children:[n.xray_version&&e(U,{colorScheme:"blue",rounded:"full",display:"inline-flex",px:3,py:1,children:r(h,{textTransform:"capitalize",fontSize:"0.7rem",fontWeight:"medium",letterSpacing:"tighter",children:["Xray ",n.xray_version]})}),n.status&&e(yt,{status:m,compact:!0})]})]}),e(Pt,{})]}),r($e,{px:2,pb:2,children:[e(N,{pb:3,alignItems:"flex-start",children:m==="error"&&e(ct,{status:"error",size:"xs",children:r(D,{children:[r(_,{w:"full",children:[e(kt,{w:4}),e(h,{marginInlineEnd:0,children:n.message})]}),e(_,{justifyContent:"flex-end",w:"full",children:e(F,{size:"sm","aria-label":"reconnect node",leftIcon:e(Xr,{}),onClick:()=>v(),disabled:w,children:a(w?"nodes.reconnecting":"nodes.reconnect")})})]})})}),e(nn,{form:p,mutate:c,isLoading:d,submitBtnText:a("nodes.editNode"),btnLeftAdornment:e(ne,{label:a("delete"),placement:"top",children:e(Z,{colorScheme:"red",variant:"ghost",size:"sm","aria-label":"delete node",onClick:C,children:e(mt,{})})})})]})]})},Hs=({toggleAccordion:t,resetAccordions:n})=>{const o=fe(),{t:s}=j(),i=Gt(),{addNode:a}=gt(),l=Ve({resolver:ut(rn),defaultValues:{...As(),add_as_new_host:!0}}),{isLoading:u,mutate:p}=lt(a,{onSuccess:()=>{qt(s("nodes.addNodeSuccess",{name:l.getValues("name")}),o),i.invalidateQueries(dt),l.reset(),n()},onError:C=>{Qt(C,o,l)}});return r(He,{border:"1px solid",_dark:{borderColor:"gray.600"},_light:{borderColor:"gray.200"},borderRadius:"4px",p:1,w:"full",children:[e(Be,{px:2,borderRadius:"3px",onClick:t,children:r(h,{as:"span",fontWeight:"medium",fontSize:"sm",flex:"1",textAlign:"left",color:"gray.700",_dark:{color:"gray.300"},display:"flex",gap:1,children:[e(Os,{display:"inline-block"})," ",e("span",{children:s("nodes.addNewMarzbanNode")})]})}),e($e,{px:2,py:4,children:e(nn,{form:l,mutate:p,isLoading:u,submitBtnText:s("nodes.addNode"),btnProps:{variant:"solid"},addAsHost:!0})})]})},nn=({form:t,mutate:n,isLoading:o,submitBtnText:s,btnProps:i={},btnLeftAdornment:a,addAsHost:l=!1})=>{var v,m,S,T,g,b,W,$,I,A,Y,q,L,V,J;const{t:u}=j(),[p,C]=f.exports.useState(!1),{data:d,isLoading:c}=Bt({queryKey:"node-settings",queryFn:()=>O("/node/settings")});function w(z){if(document.body.createTextRange){const P=document.body.createTextRange();P.moveToElementText(z),P.select()}else if(window.getSelection){const P=window.getSelection(),K=document.createRange();K.selectNodeContents(z),P.removeAllRanges(),P.addRange(K)}else console.warn("Could not select text in node: Unsupported browser.")}return e("form",{onSubmit:t.handleSubmit(z=>n(z)),children:r(N,{children:[d&&d.certificate&&e(ct,{status:"info",alignItems:"start",children:r(Pr,{display:"flex",flexDirection:"column",overflow:"hidden",children:[e("span",{children:u("nodes.connection-hint")}),r(_,{justify:"end",py:2,children:[e(F,{as:"a",colorScheme:"primary",size:"xs",download:"ssl_client_cert.pem",href:URL.createObjectURL(new Blob([d.certificate],{type:"text/plain"})),children:u("nodes.download-certificate")}),e(ne,{placement:"top",label:u("nodes.show-certificate"),children:e(Z,{"aria-label":u("nodes.show-certificate"),onClick:C.bind(null,!p),colorScheme:"whiteAlpha",color:"primary",size:"xs",children:p?e(qn,{width:"15px"}):e(Qn,{width:"15px"})})})]}),e(Wr,{in:p,animateOpacity:!0,children:e(h,{bg:"rgba(255,255,255,.5)",_dark:{bg:"rgba(255,255,255,.2)"},rounded:"md",p:"2",lineHeight:"1.2",fontSize:"10px",fontFamily:"Courier",whiteSpace:"pre",overflow:"auto",onClick:z=>{w(z.target)},children:d.certificate})})]})}),r(_,{w:"full",children:[e(R,{children:e(nt,{label:u("nodes.nodeName"),size:"sm",placeholder:"Marzban-S2",...t.register("name"),error:(S=(m=(v=t.formState)==null?void 0:v.errors)==null?void 0:m.name)==null?void 0:S.message})}),e(_,{px:1,children:e(pe,{name:"status",control:t.control,render:({field:z})=>e(ne,{placement:"top",label:`${u("usersTable.status")}: `+(z.value!=="disabled"?u("active"):u("disabled")),textTransform:"capitalize",children:e(D,{mt:"6",children:e(_t,{colorScheme:"primary",isChecked:z.value!=="disabled",onChange:P=>{P.target.checked?z.onChange("connecting"):z.onChange("disabled")}})})},z.value)})})]}),e(_,{alignItems:"flex-start",w:"100%",children:e(D,{w:"100%",children:e(nt,{label:u("nodes.nodeAddress"),size:"sm",placeholder:"51.20.12.13",...t.register("address"),error:(b=(g=(T=t.formState)==null?void 0:T.errors)==null?void 0:g.address)==null?void 0:b.message})})}),r(_,{alignItems:"flex-start",w:"100%",children:[e(D,{children:e(nt,{label:u("nodes.nodePort"),size:"sm",placeholder:"62050",...t.register("port"),error:(I=($=(W=t.formState)==null?void 0:W.errors)==null?void 0:$.port)==null?void 0:I.message})}),e(D,{children:e(nt,{label:u("nodes.nodeAPIPort"),size:"sm",placeholder:"62051",...t.register("api_port"),error:(q=(Y=(A=t.formState)==null?void 0:A.errors)==null?void 0:Y.api_port)==null?void 0:q.message})}),e(D,{children:e(nt,{label:u("nodes.usageCoefficient"),size:"sm",placeholder:"1",...t.register("usage_coefficient"),error:(J=(V=(L=t.formState)==null?void 0:L.errors)==null?void 0:V.usage_coefficient)==null?void 0:J.message})})]}),l&&e(R,{py:1,children:e(at,{...t.register("add_as_new_host"),children:e(H,{m:0,children:u("nodes.addHostForEveryInbound")})})}),r(_,{w:"full",children:[a,e(F,{flexGrow:1,type:"submit",colorScheme:"primary",size:"sm",px:5,w:"full",isLoading:o,...i,children:s})]})]})})},Bs=()=>{const{isEditingNodes:t,onEditingNodes:n}=E(),{t:o}=j(),[s,i]=f.exports.useState({}),{data:a,isLoading:l}=Ms(),u=()=>{i({}),n(!1)},p=C=>{s[String(C)]?delete s[String(C)]:s[String(C)]={},i({...s})};return r(ge,{children:[r(oe,{isOpen:t,onClose:u,children:[e(se,{bg:"blackAlpha.300",backdropFilter:"blur(10px)"}),r(ae,{mx:"3",w:"fit-content",maxW:"3xl",children:[e(ie,{pt:6,children:e(de,{color:"primary",children:e(Ws,{color:"white"})})}),e(le,{mt:3}),r(ce,{w:"440px",pb:6,pt:3,children:[e(h,{mb:3,opacity:.8,fontSize:"sm",children:o("nodes.title")}),l&&"loading...",e(pt,{w:"full",allowToggle:!0,index:Object.keys(s).map(C=>parseInt(C)),children:r(N,{w:"full",children:[!l&&a&&a.map((C,d)=>e(js,{toggleAccordion:()=>p(d),node:C},C.name)),e(Hs,{toggleAccordion:()=>p((a||[]).length),resetAccordions:()=>i({})})]})})]})]})]}),e(Ns,{deleteCallback:()=>i({})})]})};function $s(t){const n=360/t,o=90,s=47,i=[];for(let a=0;a(w<0&&(w+=1),w>1&&(w-=1),w<.16666666666666666?d+(c-d)*6*w:w<.5?c:w<.6666666666666666?d+(c-d)*(.6666666666666666-w)*6:d),p=o<.5?o*(1+n):o+n-o*n,C=2*o-p;s=Math.round(u(C,p,t+1/3)*255),i=Math.round(u(C,p,t)*255),a=Math.round(u(C,p,t-1/3)*255)}const l=u=>{const p=u.toString(16);return p.length===1?"0"+p:p};return`#${l(s)}${l(i)}${l(a)}`}const fr=({border:t,...n})=>{const{getInputProps:o,getRadioProps:s}=no(n),i=Ae({base:"xs",md:"sm"});return r(D,{as:"label",children:[e("input",{...o()}),e(D,{...s(),minW:"48px",w:"full",h:"full",textAlign:"center",cursor:"pointer",fontSize:i,borderWidth:t?"1px":"0px",borderRadius:"md",_checked:{bg:"primary.500",color:"white",borderColor:"primary.500"},_focus:{boxShadow:"outline"},px:3,py:1,children:n.children})]})},on=({onChange:t,defaultValue:n,...o})=>{const{t:s,i18n:i}=j();ht();const a=Ae({base:["7h","1d","3d","1w"],md:["7h","1d","3d","1w","1m","3m"]}),l={h:"hour",d:"day",w:"week",m:"month",y:"year"},u=Ae({base:[{title:"hours",options:["1h","3h","6h","12h"]},{title:"days",options:["1d","2d","3d","4d"]},{title:"weeks",options:["1w","2w","3w","4w"]},{title:"months",options:["1m","2m","3m","6m"]}],md:[{title:"hours",options:["1h","2h","3h","6h","8h","12h"]},{title:"days",options:["1d","2d","3d","4d","5d","6d"]},{title:"weeks",options:["1w","2w","3w","4w"]},{title:"months",options:["1m","2m","3m","6m","8m"]}]}),{getRootProps:p,getRadioProps:C,setValue:d}=Xn({name:"filter",defaultValue:n,onChange:z=>{if(z==="custom")return;v(),a.indexOf(z)>=0?(T(s("userDialog.custom")),b(!1)):(T(s("userDialog.custom")+` (${z})`),b(!0));const P=Number(z.substring(0,z.length-1)),K=l[z[z.length-1]];t(z,{start:B().utc().subtract(P,K).format("YYYY-MM-DDTHH:00:00")})}}),{isOpen:c,onOpen:w,onClose:v}=Jn(),m=f.exports.useRef(null);Kn({ref:m,handler:v});const[S,T]=f.exports.useState(s("userDialog.custom")),[g,b]=f.exports.useState(!1),[W,$]=f.exports.useState(0),I=Ae({base:1,md:2}),A=Ae({base:"xs",md:"sm"}),[Y,q]=f.exports.useState(null),[L,V]=f.exports.useState(null),J=z=>{const[P,K]=z;L&&!K?(q(null),V(null)):(q(P),V(K),P&&K&&(v(),t("custom",{start:B(P).format("YYYY-MM-DDT00:00:00"),end:B(K).format("YYYY-MM-DDT23:59:59")})))};return r(N,{...o,children:[W==0&&r(Yt,{...p(),gap:0,display:"flex",borderWidth:"1px",borderRadius:"md",minW:{base:"320px",md:"400px"},children:[a.map(z=>e(fr,{...C({value:z}),children:z},z)),e(D,{onClick:()=>{q(null),V(null),w()},cursor:"pointer",borderRadius:"md",w:"full",fontSize:A,px:3,py:1,bg:g?"primary.500":"unset",color:g?"white":"unset",borderColor:g?"primary.500":"unset",children:r(_,{children:[e(h,{children:S}),e(Rt,{as:tr,boxSize:"18px"})]})})]}),W==1&&r(_,{onClick:w,cursor:"pointer",fontSize:A,borderRadius:"md",px:3,py:1,minW:{base:"320px",md:"400px"},borderWidth:"1px",children:[e(h,{w:"full",color:Y?"unset":"gray.500",children:Y?B(Y).format("YYYY-MM-DD (00:00)"):s("userDialog.startDate")}),e(Rt,{as:Or,boxSize:"18px"}),e(h,{w:"full",color:L?"unset":"gray.500",children:L?B(L).format("YYYY-MM-DD (23:59)"):s("userDialog.endDate")}),e(Rt,{as:tr,boxSize:"18px"})]}),e(N,{ref:m,marginTop:"40px !important",borderRadius:"md",borderWidth:"1px",position:"absolute",zIndex:"1",backgroundColor:"white",_dark:{backgroundColor:"gray.700"},display:c?"unset":"none",children:r(eo,{onChange:z=>$(z),children:[r(to,{children:[e(rr,{fontSize:A,children:s("userDialog.relative")}),e(rr,{fontSize:A,children:s("userDialog.absolute")})]}),r(ro,{children:[e(nr,{children:u.map(z=>e(N,{alignItems:"start",pl:2,pr:2,children:r(_,{justifyItems:"flex-start",mb:4,children:[e(h,{fontSize:A,minW:"60px",children:s("userDialog."+z.title)}),z.options.map(P=>e(fr,{border:!0,...C({value:P}),children:P},P+".custom"))]})},z.title))}),e(nr,{className:"datepicker-panel",children:e(N,{children:e(jr,{locale:i.language.toLocaleLowerCase(),selected:Y,onChange:J,startDate:Y,endDate:L,selectsRange:!0,maxDate:new Date,monthsShown:I,peekNextMonth:!1,inline:!0})})})]})]})})]})};function It(t,n,o=[],s=[]){const i=re(o.reduce((a,l)=>a+=l,0));return{series:o,options:{labels:s,chart:{width:"100%",height:"100%",type:"donut",animations:{enabled:!1}},title:{text:`${n}${i}`,align:"center",style:{fontWeight:"var(--chakra-fontWeights-medium)",color:t==="dark"?"var(--chakra-colors-gray-300)":void 0}},legend:{position:"bottom",labels:{colors:t==="dark"?"#CBD5E0":void 0,useSeriesColors:!1}},stroke:{width:1,colors:void 0},dataLabels:{formatter:(a,{seriesIndex:l,w:u})=>re(u.config.series[l],1)},tooltip:{custom:({series:a,seriesIndex:l,dataPointIndex:u,w:p})=>{const C=re(a[l],1),d=Math.max(a.reduce((w,v)=>w+=v),1),c=Math.round(a[l]/d*1e3)/10+"%";return` +import{i as Nt,B as sn,a as an,b as ln,j as vr,d as B,U as Ht,z as cn,r as dn,f as hn,Q as un,e as pn,$ as mn,c as Dt,g as y,h as gn,C as fn,k as Et,u as Bt,l as j,m as r,H as _,n as e,T as h,o as bn,p as D,s as xn,q as f,t as ut,J as yn,v as Ir,A as Ut,w as Sn,x as Cn,M as oe,y as se,D as ae,E as ie,F as le,G as fe,I as Ve,K as zr,L as wn,N as ct,O as ce,P as R,R as H,S as Dr,V as ne,W as U,X as pe,Y as Z,Z as Re,_ as F,a0 as Rt,a1 as rt,a2 as _n,a3 as Ee,a4 as Ne,a5 as kn,a6 as Er,a7 as Ur,a8 as at,a9 as Ct,aa as vn,ab as je,ac as wt,ad as Jt,ae as In,af as Rr,ag as Lr,ah as Tr,ai as me,aj as zn,ak as Dn,al as En,am as Un,an as Rn,ao as $t,ap as Ar,aq as Mr,ar as ge,as as Kt,at as Ln,au as Tn,av as An,aw as Ft,ax as Mn,ay as Nn,az as Fn,aA as Pn,aB as Wn,aC as On,aD as _t,aE as jn,aF as Me,aG as Hn,aH as b,aI as pt,aJ as Nr,aK as mt,aL as N,aM as Vt,aN as Bn,aO as He,aP as Be,aQ as Pt,aR as $e,aS as Ce,aT as we,aU as _e,aV as ke,aW as ve,aX as Ie,aY as er,aZ as $n,a_ as kt,a$ as it,b0 as Gt,b1 as Vn,b2 as Gn,b3 as Yn,b4 as Fr,b5 as Zn,b6 as dt,b7 as vt,b8 as Pr,b9 as Qn,ba as qn,bb as Wr,bc as Ae,bd as Xn,be as Jn,bf as Kn,bg as Yt,bh as Lt,bi as tr,bj as Or,bk as eo,bl as to,bm as rr,bn as ro,bo as nr,bp as jr,bq as no,br as Hr,bs as oo,bt as so,bu as Br,bv as ao,bw as io,bx as $r,by as Vr,bz as Gr,bA as X,bB as lo,bC as Yr,bD as or,bE as co,bF as ho,bG as uo,bH as po,bI as mo,bJ as go,bK as Zr,bL as fo,bM as sr,bN as ar,bO as Oe,bP as ze,bQ as ir,bR as ue,bS as lr,bT as bo,bU as xo,bV as yo,bW as So,bX as Co,bY as wo,bZ as _o,b_ as ko,b$ as vo,c0 as Io,c1 as zo,c2 as Do,c3 as Eo,c4 as Uo,c5 as Ro,c6 as Lo,c7 as To}from"./vendor.8aa8dc93.js";(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&s(l)}).observe(document,{childList:!0,subtree:!0});function o(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerpolicy&&(a.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?a.credentials="include":i.crossorigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(i){if(i.ep)return;i.ep=!0;const a=o(i);fetch(i.href,a)}})();Nt.use(sn).use(an).use(ln).init({debug:{}.NODE_ENV==="development",returnNull:!1,fallbackLng:"en",interpolation:{escapeValue:!1},react:{useSuspense:!1},load:"languageOnly",detection:{caches:["localStorage","sessionStorage","cookie"]},backend:{loadPath:vr(["/dashboard/","locales/{{lng}}.json"])}},function(t,n){B.locale(Nt.language)});Nt.on("languageChanged",t=>{B.locale(t)});Ht("zh-cn",cn);Ht("ru",dn);Ht("fa",hn);const Wt=new un,Qr=t=>{const n=document.querySelector('meta[name="theme-color"]');n==null||n.setAttribute("content",t=="dark"?"#1A202C":"#3B81F6")},Ao=pn({shadows:{outline:"0 0 0 2px var(--chakra-colors-primary-200)"},fonts:{body:"Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif"},colors:{"light-border":"#d2d2d4",primary:{50:"#9cb7f2",100:"#88a9ef",200:"#749aec",300:"#618ce9",400:"#4d7de7",500:"#396fe4",600:"#3364cd",700:"#2e59b6",800:"#284ea0",900:"#224389"},gray:{750:"#222C3B"}},components:{Alert:{baseStyle:{container:{borderRadius:"6px",fontSize:"sm"}}},Select:{baseStyle:{field:{_dark:{borderColor:"gray.600",borderRadius:"6px"},_light:{borderRadius:"6px"}}}},FormHelperText:{baseStyle:{fontSize:"xs"}},FormLabel:{baseStyle:{fontSize:"sm",fontWeight:"medium",mb:"1",_dark:{color:"gray.300"}}},Input:{baseStyle:{addon:{_dark:{borderColor:"gray.600",_placeholder:{color:"gray.500"}}},field:{_focusVisible:{boxShadow:"none",borderColor:"primary.200",outlineColor:"primary.200"},_dark:{borderColor:"gray.600",_disabled:{color:"gray.400",borderColor:"gray.500"},_placeholder:{color:"gray.500"}}}}},Table:{baseStyle:{table:{borderCollapse:"separate",borderSpacing:0},thead:{borderBottomColor:"light-border"},th:{background:"#F9FAFB",borderColor:"light-border !important",borderBottomColor:"light-border !important",borderTop:"1px solid ",borderTopColor:"light-border !important",_first:{borderLeft:"1px solid",borderColor:"light-border !important"},_last:{borderRight:"1px solid",borderColor:"light-border !important"},_dark:{borderColor:"gray.600 !important",background:"gray.750"}},td:{transition:"all .1s ease-out",borderColor:"light-border",borderBottomColor:"light-border !important",_first:{borderLeft:"1px solid",borderColor:"light-border",_dark:{borderColor:"gray.600"}},_last:{borderRight:"1px solid",borderColor:"light-border",_dark:{borderColor:"gray.600"}},_dark:{borderColor:"gray.600",borderBottomColor:"gray.600 !important"}},tr:{"&.interactive":{cursor:"pointer",_hover:{"& > td":{bg:"gray.200"},_dark:{"& > td":{bg:"gray.750"}}}},_last:{"& > td":{_first:{borderBottomLeftRadius:"8px"},_last:{borderBottomRightRadius:"8px"}}}}}}}});const It=()=>localStorage.getItem("token"),Mo=t=>{localStorage.setItem("token",t)},No=()=>{localStorage.removeItem("token")},Fo=mn.create({baseURL:"/api/"}),Po=(t,n={})=>(It()&&(n.headers={...(n==null?void 0:n.headers)||{},Authorization:`Bearer ${It()}`}),Fo(t,n)),O=Po,Wo=Dt(t=>({isLoading:!0,isPostLoading:!1,version:null,started:!1,logs_websocket:null,config:"",fetchCoreSettings:()=>{t({isLoading:!0}),Promise.all([O("/core").then(({version:n,started:o,logs_websocket:s})=>t({version:n,started:o,logs_websocket:s})),O("/core/config").then(n=>t({config:n}))]).finally(()=>t({isLoading:!1}))},updateConfig:n=>(t({isPostLoading:!0}),O("/core/config",{method:"PUT",body:n}).finally(()=>{t({isPostLoading:!1})})),restartCore:()=>O("/core/restart",{method:"POST"})}));function re(t,n=2,o=!1){if(!+t)return"0 B";const s=1024,i=n<0?0:n,a=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],l=Math.floor(Math.log(t)/Math.log(s));return o?[parseFloat((t/Math.pow(s,l)).toFixed(i)),a[l]]:`${parseFloat((t/Math.pow(s,l)).toFixed(i))} ${a[l]}`}const cr=t=>{if(t!==null)return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")},Oo=y(gn,{baseStyle:{w:5,h:5,position:"relative",zIndex:"2"}}),jo=y(fn,{baseStyle:{w:5,h:5,position:"relative",zIndex:"2"}}),Ho=y(Et,{baseStyle:{w:5,h:5,position:"relative",zIndex:"2"}}),Tt=({title:t,content:n,icon:o})=>r(bn,{p:6,borderWidth:"1px",borderColor:"light-border",bg:"#F9FAFB",_dark:{borderColor:"gray.600",bg:"gray.750"},borderStyle:"solid",boxShadow:"none",borderRadius:"12px",width:"full",display:"flex",justifyContent:"space-between",flexDirection:"row",children:[r(_,{alignItems:"center",columnGap:"4",children:[e(D,{p:"2",position:"relative",color:"white",_before:{content:'""',position:"absolute",top:0,left:0,bg:"primary.400",display:"block",w:"full",h:"full",borderRadius:"5px",opacity:".5",z:"1"},_after:{content:'""',position:"absolute",top:"-5px",left:"-5px",bg:"primary.400",display:"block",w:"calc(100% + 10px)",h:"calc(100% + 10px)",borderRadius:"8px",opacity:".4",z:"1"},children:o}),e(h,{color:"gray.600",_dark:{color:"gray.300"},fontWeight:"medium",textTransform:"capitalize",fontSize:"sm",children:t})]}),e(D,{fontSize:"3xl",fontWeight:"semibold",mt:"2",children:n})]}),Ot="statistics-query-key",Bo=t=>{const{version:n}=E(),{data:o}=Bt({queryKey:Ot,queryFn:()=>O("/system"),refetchInterval:5e3,onSuccess:({version:i})=>{n!==i&&E.setState({version:i})}}),{t:s}=j();return r(_,{justifyContent:"space-between",gap:0,columnGap:{lg:4,md:0},rowGap:{lg:0,base:4},display:"flex",flexDirection:{lg:"row",base:"column"},...t,children:[e(Tt,{title:s("activeUsers"),content:o&&r(_,{alignItems:"flex-end",children:[e(h,{children:cr(o.users_active)}),r(h,{fontWeight:"normal",fontSize:"lg",as:"span",display:"inline-block",pb:"5px",children:["/ ",cr(o.total_user)]})]}),icon:e(Oo,{})}),e(Tt,{title:s("dataUsage"),content:o&&re(o.incoming_bandwidth+o.outgoing_bandwidth),icon:e(jo,{})}),e(Tt,{title:s("memoryUsage"),content:o&&r(_,{alignItems:"flex-end",children:[e(h,{children:re(o.mem_used,1,!0)[0]}),r(h,{fontWeight:"normal",fontSize:"lg",as:"span",display:"inline-block",pb:"5px",children:[re(o.mem_used,1,!0)[1]," /"," ",re(o.mem_total,1)]})]}),icon:e(Ho,{})})]})},qr="marzban-num-users-per-page",dr=10,$o=()=>{const t=localStorage.getItem(qr)||dr.toString();return parseInt(t)||dr},Vo=t=>localStorage.setItem(qr,t),Go=t=>{for(const n in t)t[n]||delete t[n];return E.setState({loading:!0}),O("/users",{query:t}).then(n=>(E.setState({users:n}),n)).finally(()=>{E.setState({loading:!1})})},Yo=()=>O("/inbounds").then(t=>{E.setState({inbounds:new Map(Object.entries(t))})}).finally(()=>{E.setState({loading:!1})}),E=Dt(xn((t,n)=>({version:null,editingUser:null,deletingUser:null,isCreatingNewUser:!1,QRcodeLinks:null,subscribeUrl:null,users:{users:[],total:0},loading:!0,isResetingAllUsage:!1,isEditingHosts:!1,isEditingNodes:!1,isShowingNodesUsage:!1,resetUsageUser:null,revokeSubscriptionUser:null,filters:{username:"",limit:$o(),sort:"-created_at"},inbounds:new Map,isEditingCore:!1,refetchUsers:()=>{Go(n().filters)},resetAllUsage:()=>O("/users/reset",{method:"POST"}).then(()=>{n().onResetAllUsage(!1),n().refetchUsers()}),onResetAllUsage:o=>t({isResetingAllUsage:o}),onCreateUser:o=>t({isCreatingNewUser:o}),onEditingUser:o=>{t({editingUser:o})},onDeletingUser:o=>{t({deletingUser:o})},onFilterChange:o=>{t({filters:{...n().filters,...o}}),n().refetchUsers()},setQRCode:o=>{t({QRcodeLinks:o})},deleteUser:o=>(t({editingUser:null}),O(`/user/${o.username}`,{method:"DELETE"}).then(()=>{t({deletingUser:null}),n().refetchUsers(),Wt.invalidateQueries(Ot)})),createUser:o=>O("/user",{method:"POST",body:o}).then(()=>{t({editingUser:null}),n().refetchUsers(),Wt.invalidateQueries(Ot)}),editUser:o=>O(`/user/${o.username}`,{method:"PUT",body:o}).then(()=>{n().onEditingUser(null),n().refetchUsers()}),fetchUserUsage:(o,s)=>{for(const i in s)s[i]||delete s[i];return O(`/user/${o.username}/usage`,{method:"GET",query:s})},onEditingHosts:o=>{t({isEditingHosts:o})},onEditingNodes:o=>{t({isEditingNodes:o})},onShowingNodesUsage:o=>{t({isShowingNodesUsage:o})},setSubLink:o=>{t({subscribeUrl:o})},resetDataUsage:o=>O(`/user/${o.username}/reset`,{method:"POST"}).then(()=>{t({resetUsageUser:null}),n().refetchUsers()}),revokeSubscription:o=>O(`/user/${o.username}/revoke_sub`,{method:"POST"}).then(s=>{t({revokeSubscriptionUser:null,editingUser:s}),n().refetchUsers()})}))),de=({children:t,color:n})=>e(D,{position:"relative",width:"36px",height:"36px",display:"flex",justifyContent:"center",alignItems:"center",_before:{content:'""',display:"block",position:"absolute",top:"0",left:"0",width:"calc(100%)",height:"calc(100%)",bg:`${n}.400`,opacity:".5",borderRadius:"5px",zIndex:"1",_dark:{bg:`${n}.400`}},_after:{content:'""',display:"block",position:"absolute",top:"0",left:"0",width:"calc(100% + 10px)",height:"calc(100% + 10px)",transform:"translate(-5px, -5px)",bg:`${n}.400`,opacity:".4",borderRadius:"8px",zIndex:"1",_dark:{bg:`${n}.400`}},children:e(h,{color:`${n}.500`,_dark:{color:`${n}.900`},position:"relative",zIndex:"2",children:t})});window.ace.define("ace/theme/nord_dark",["require","exports","module","ace/lib/dom"],(t,n,o)=>{n.isDark=!0,n.cssClass="ace-nord-dark",t("../lib/dom").importCssString(n.cssText,n.cssClass)});window.ace.define("ace/theme/dawn",["require","exports","module","ace/lib/dom"],(t,n,o)=>{n.isDark=!1,n.cssClass="ace-dawn",t("../lib/dom").importCssString(n.cssText,n.cssClass)});const Zo=f.exports.forwardRef(({json:t,onChange:n,mode:o="code"},s)=>{const{colorMode:i}=ut(),a={mode:o,onChangeText:n,statusBar:!1,mainMenuBar:!1,theme:i==="dark"?"ace/theme/nord_dark":"ace/theme/dawn"},l=f.exports.useRef(null),u=f.exports.useRef(null);return f.exports.useEffect(()=>(u.current=new yn(l.current,a),()=>{u.current&&u.current.destroy()}),[]),f.exports.useEffect(()=>{u.current&&u.current.update(t)},[t]),e(D,{ref:s,border:"1px solid",borderColor:"gray.300",_dark:{borderColor:"gray.500"},borderRadius:5,h:"full",children:e(D,{height:"full",ref:l})})}),hr=500,Qo=y(Ir,{baseStyle:{w:5,h:5}}),qo=y(Ut,{baseStyle:{w:4,h:4}}),Xo=y(Sn,{baseStyle:{w:4,h:4}}),Jo=y(Cn,{baseStyle:{w:3,h:3}}),Ko=t=>({[rt.ReadyState.CONNECTING]:"connecting",[rt.ReadyState.OPEN]:"connected",[rt.ReadyState.CLOSING]:"closed",[rt.ReadyState.CLOSED]:"closed",[rt.ReadyState.UNINSTANTIATED]:"closed"})[t],es=()=>{try{let t=new URL("/api/".startsWith("/")?window.location.origin+"/api/":"/api/");return(t.protocol==="https:"?"wss://":"ws://")+vr([t.host+t.pathname,"/core/logs"])+"?interval=1&token="+It()}catch(t){return console.error("Unable to generate websocket url"),console.error(t),null}};let Le=[];const ts=()=>{const{isEditingCore:t}=E(),{fetchCoreSettings:n,updateConfig:o,isLoading:s,config:i,isPostLoading:a,version:l,restartCore:u}=Wo(),p=f.exports.useRef(null),[C,d]=f.exports.useState([]),{t:c}=j(),w=fe(),v=Ve({defaultValues:{config:i||{}}});f.exports.useEffect(()=>{i&&v.setValue("config",i)},[i]),f.exports.useEffect(()=>{t&&n()},[t]);const m=f.exports.useRef(!0),S=f.exports.useCallback(zr(L=>{var J,z,P;const V=Math.abs((((J=p.current)==null?void 0:J.scrollTop)||0)-(((z=p.current)==null?void 0:z.scrollHeight)||0)+(((P=p.current)==null?void 0:P.offsetHeight)||0))<10;p.current&&V?m.current=!0:m.current=!1,L.length<40&&d(L)},300),[]),{readyState:T}=wn(es(),{onMessage:L=>{Le.push(L.data),Le.length>hr&&(Le=Le.splice(0,Le.length-hr)),S([...Le])},shouldReconnect:()=>!0,reconnectAttempts:10,reconnectInterval:1e3});f.exports.useEffect(()=>{var L;p.current&&m.current&&(p.current.scrollTop=(L=p.current)==null?void 0:L.scrollHeight)},[C]),f.exports.useEffect(()=>()=>{Le=[]},[]);const g=Ko(T.toString()),{mutate:x,isLoading:W}=ct(u),$=({config:L})=>{o(L).then(()=>{w({title:c("core.successMessage"),status:"success",isClosable:!0,position:"top",duration:3e3})}).catch(V=>{let J=c("core.generalErrorMessage");typeof V.response._data.detail=="object"&&(J=V.response._data.detail[Object.keys(V.response._data.detail)[0]]),typeof V.response._data.detail=="string"&&(J=V.response._data.detail),w({title:J,status:"error",isClosable:!0,position:"top",duration:3e3})})},I=f.exports.useRef(null),[A,Y]=f.exports.useState(!1),q=()=>{var L;document.fullscreenElement?(document.exitFullscreen(),Y(!1)):((L=I.current)==null||L.requestFullscreen(),Y(!0))};return r("form",{onSubmit:v.handleSubmit($),children:[r(ce,{children:[r(R,{children:[r(_,{justifyContent:"space-between",alignItems:"flex-start",children:[r(H,{children:[c("core.configuration")," ",s&&e(Dr,{isIndeterminate:!0,size:"15px"})]}),e(_,{gap:0,children:e(ne,{label:"Xray Version",placement:"top",children:e(U,{height:"100%",textTransform:"lowercase",children:l&&`v${l}`})})})]}),r(D,{position:"relative",ref:I,minHeight:"300px",children:[e(pe,{control:v.control,name:"config",render:({field:L})=>e(Zo,{json:i,onChange:L.onChange})}),e(Z,{size:"xs","aria-label":"full screen",variant:"ghost",position:"absolute",top:"2",right:"4",onClick:q,children:A?e(Jo,{}):e(Xo,{})})]})]}),r(R,{mt:"4",children:[r(_,{justifyContent:"space-between",children:[e(H,{children:c("core.logs")}),e(h,{as:H,children:c(`core.socket.${g}`)})]}),e(D,{border:"1px solid",borderColor:"gray.300",bg:"#F9F9F9",_dark:{borderColor:"gray.500",bg:"#2e3440"},borderRadius:5,minHeight:"200px",maxHeight:"250px",p:2,overflowY:"auto",ref:p,children:C.map((L,V)=>e(h,{fontSize:"xs",opacity:.8,whiteSpace:"pre-line",children:L},V))})]})]}),e(Re,{children:r(_,{w:"full",justifyContent:"space-between",children:[e(D,{children:e(F,{size:"sm",leftIcon:e(qo,{className:Rt({"animate-spin":W})}),onClick:()=>x(),children:c(W?"core.restarting":"core.restartCore")})}),e(_,{children:e(F,{size:"sm",variant:"solid",colorScheme:"primary",px:"5",type:"submit",isDisabled:s||a,isLoading:a,children:c("core.save")})})]})})]})},rs=()=>{const{isEditingCore:t}=E(),n=E.setState.bind(null,{isEditingCore:!1}),{t:o}=j();return r(oe,{isOpen:t,onClose:n,size:"3xl",children:[e(se,{bg:"blackAlpha.300",backdropFilter:"blur(10px)"}),r(ae,{mx:"3",w:"full",children:[e(ie,{pt:6,children:r(_,{gap:2,children:[e(de,{color:"primary",children:e(Qo,{color:"white"})}),e(h,{fontWeight:"semibold",fontSize:"lg",children:o("core.title")})]})}),e(le,{mt:3}),e(ts,{})]})]})},gt=y(_n,{baseStyle:{w:5,h:5}}),ns=()=>{const[t,n]=f.exports.useState(!1),{deletingUser:o,onDeletingUser:s,deleteUser:i}=E(),{t:a}=j(),l=fe(),u=()=>{s(null)},p=()=>{o&&(n(!0),i(o).then(()=>{l({title:a("deleteUser.deleteSuccess",{username:o.username}),status:"success",isClosable:!0,position:"top",duration:3e3})}).then(u).finally(n.bind(null,!1)))};return r(oe,{isCentered:!0,isOpen:!!o,onClose:u,size:"sm",children:[e(se,{bg:"blackAlpha.300",backdropFilter:"blur(10px)"}),r(ae,{mx:"3",children:[e(ie,{pt:6,children:e(de,{color:"red",children:e(gt,{})})}),e(le,{mt:3}),r(ce,{children:[e(h,{fontWeight:"semibold",fontSize:"lg",children:a("deleteUser.title")}),o&&e(h,{mt:1,fontSize:"sm",_dark:{color:"gray.400"},color:"gray.600",children:e(Ee,{components:{b:e("b",{})},children:a("deleteUser.prompt",{username:o.username})})})]}),r(Re,{display:"flex",children:[e(F,{size:"sm",onClick:u,mr:3,w:"full",variant:"outline",children:a("cancel")}),e(F,{size:"sm",w:"full",colorScheme:"red",onClick:p,leftIcon:t?e(Ne,{size:"xs"}):void 0,children:a("delete")})]})]})]})},Zt={baseStyle:{w:4,h:4}},os=y(kn,Zt),ss=y(Er,Zt),Xr=y(Ut,Zt),as=zr(t=>{E.getState().onFilterChange({...E.getState().filters,offset:0,search:t})},300),is=({...t})=>{const{loading:n,filters:o,onFilterChange:s,refetchUsers:i,onCreateUser:a}=E(),{t:l}=j(),[u,p]=f.exports.useState(""),C=c=>{p(c.target.value),as(c.target.value)},d=()=>{p(""),s({...o,offset:0,search:""})};return r(Ur,{id:"filters",templateColumns:{lg:"repeat(3, 1fr)",md:"repeat(4, 1fr)",base:"repeat(1, 1fr)"},position:"sticky",top:0,mx:"-6",px:"6",rowGap:4,gap:{lg:4,base:0},bg:"var(--chakra-colors-chakra-body-bg)",py:4,zIndex:"docked",...t,children:[e(at,{colSpan:{base:1,md:2,lg:1},order:{base:2,md:1},children:r(Ct,{children:[e(vn,{pointerEvents:"none",children:e(os,{})}),e(je,{placeholder:l("search"),value:u,borderColor:"light-border",onChange:C}),r(wt,{children:[n&&e(Ne,{size:"xs"}),o.search&&o.search.length>0&&e(Z,{onClick:d,"aria-label":"clear",size:"xs",variant:"ghost",children:e(ss,{})})]})]})}),e(at,{colSpan:2,order:{base:1,md:2},children:r(_,{justifyContent:"flex-end",alignItems:"center",h:"full",children:[e(Z,{"aria-label":"refresh users",disabled:n,onClick:i,size:"sm",variant:"outline",children:e(Xr,{className:Rt({"animate-spin":n})})}),e(F,{colorScheme:"primary",size:"sm",onClick:()=>a(!0),px:5,children:l("createUser")})]})})]})},Jr="https://github.com/Gozargah/Marzban",ls="https://github.com/Gozargah",cs="https://github.com/Gozargah/Marzban#donation",Kr=t=>{const{version:n}=E();return e(_,{w:"full",py:"0",position:"relative",...t,children:r(h,{display:"inline-block",flexGrow:1,textAlign:"center",color:"gray.500",fontSize:"xs",children:[e(Jt,{color:"blue.400",href:Jr,children:"Marzban"}),n?` (v${n}), `:", ","Made with \u2764\uFE0F in"," ",e(Jt,{color:"blue.400",href:ls,children:"Gozargah"})]})})},ds=y(In,{baseStyle:{w:4,h:4}}),en=({actions:t})=>{const{i18n:n}=j();var o=s=>{n.changeLanguage(s)};return r(Rr,{placement:"bottom-end",children:[e(Lr,{as:Z,size:"sm",variant:"outline",icon:e(ds,{}),position:"relative"}),r(Tr,{minW:"100px",zIndex:9999,children:[e(me,{maxW:"100px",fontSize:"sm",onClick:()=>o("en"),children:"English"}),e(me,{maxW:"100px",fontSize:"sm",onClick:()=>o("fa"),children:"\u0641\u0627\u0631\u0633\u06CC"}),e(me,{maxW:"100px",fontSize:"sm",onClick:()=>o("zh-cn"),children:"\u7B80\u4F53\u4E2D\u6587"}),e(me,{maxW:"100px",fontSize:"sm",onClick:()=>o("ru"),children:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439"})]})]})},be={baseStyle:{w:4,h:4}},hs=y(zn,be),us=y(Dn,be),ps=y(Ir,be),ms=y(En,be),gs=y(Un,be),fs=y(Rn,be),bs=y($t,be),xs=y(Ar,be),ys=y(Et,be),Ss=y(Mr,be),ur=y(D,{baseStyle:{bg:"yellow.500",w:"2",h:"2",rounded:"full",position:"absolute"}}),tn="marzban-menu-notification",Cs=()=>{const t=localStorage.getItem(tn);if(!t)return!0;try{return t&&Tn(parseInt(t))?An(new Date,new Date(parseInt(t)))>=7:!0}catch{return!0}},ws=({actions:t})=>{const{onEditingHosts:n,onResetAllUsage:o,onEditingNodes:s,onShowingNodesUsage:i}=E(),{t:a}=j(),{colorMode:l,toggleColorMode:u}=ut(),[p,C]=f.exports.useState(Cs()),d=l==="dark"?"dark_dimmed":l,c=()=>{localStorage.setItem(tn,new Date().getTime().toString()),C(!1)};return r(_,{gap:2,justifyContent:"space-between",__css:{"& .menuList":{direction:"ltr"}},position:"relative",children:[e(h,{as:"h1",fontWeight:"semibold",fontSize:"2xl",children:a("users")}),p&&e(ur,{top:"0",right:"0",zIndex:9999}),e(D,{overflow:"auto",css:{direction:"rtl"},children:r(_,{alignItems:"center",children:[r(Rr,{children:[e(Lr,{as:Z,size:"sm",variant:"outline",icon:e(ge,{children:e(ms,{})}),position:"relative"}),r(Tr,{minW:"170px",zIndex:99999,className:"menuList",children:[e(me,{maxW:"170px",fontSize:"sm",icon:e(bs,{}),onClick:n.bind(null,!0),children:a("header.hostSettings")}),e(me,{maxW:"170px",fontSize:"sm",icon:e(xs,{}),onClick:s.bind(null,!0),children:a("header.nodeSettings")}),e(me,{maxW:"170px",fontSize:"sm",icon:e(ys,{}),onClick:i.bind(null,!0),children:a("header.nodesUsage")}),e(me,{maxW:"170px",fontSize:"sm",icon:e(Ss,{}),onClick:o.bind(null,!0),children:a("resetAllUsage")}),e(Kt,{to:cs,target:"_blank",children:r(me,{maxW:"170px",fontSize:"sm",icon:e(fs,{}),position:"relative",onClick:c,children:[a("header.donation")," ",p&&e(ur,{top:"3",right:"2"})]})}),e(Kt,{to:"/login",children:e(me,{maxW:"170px",fontSize:"sm",icon:e(gs,{}),children:a("header.logout")})})]})]}),e(Z,{size:"sm",variant:"outline","aria-label":"core settings",onClick:()=>{E.setState({isEditingCore:!0})},children:e(ps,{})}),e(en,{}),e(Z,{size:"sm",variant:"outline","aria-label":"switch theme",onClick:()=>{Qr(l=="dark"?"light":"dark"),u()},children:l==="light"?e(hs,{}):e(us,{})}),e(D,{css:{direction:"ltr"},display:"flex",alignItems:"center",pr:"2",__css:{"& span":{display:"inline-flex"}},children:e(Ln,{href:Jr,"data-color-scheme":`no-preference: ${d}; light: ${d}; dark: ${d};`,"data-size":"large","data-show-count":"true","aria-label":"Star Marzban on GitHub",children:"Star"})})]})})]})},_s=[{title:"Inbound's default",value:"inbound_default"},{title:"TLS",value:"tls"},{title:"None",value:"none"}],ks=[{title:"",value:""},{title:"h3",value:"h3"},{title:"h2",value:"h2"},{title:"http/1.1",value:"http/1.1"},{title:"h3,h2,http/1.1",value:"h3,h2,http/1.1"},{title:"h3,h2",value:"h3,h2"},{title:"h2,http/1.1",value:"h2,http/1.1"}],vs=[{title:"",value:""},...["chrome","firefox","safari","ios","android","edge","360","qq","random","randomized"].map(t=>({title:t,value:t}))],Is=[{title:"none",value:""},{title:"xtls-rprx-vision",value:"xtls-rprx-vision"}],zs=["aes-128-gcm","aes-256-gcm","chacha20-ietf-poly1305"],Ds=Dt(t=>({isLoading:!1,isPostLoading:!1,hosts:{},fetchHosts:()=>{t({isLoading:!0}),O("/hosts").then(n=>t({hosts:n})).finally(()=>t({isLoading:!1}))},setHosts:n=>(t({isPostLoading:!0}),O("/hosts",{method:"PUT",body:n}).finally(()=>{t({isPostLoading:!1})}))}));const Es=y(Er,{baseStyle:{w:4,h:4}}),Ue=Ft.forwardRef(({disabled:t,step:n,label:o,className:s,startAdornment:i,endAdornment:a,type:l="text",placeholder:u,onChange:p,onBlur:C,name:d,value:c,onClick:w,error:v,clearable:m=!1,...S},T)=>{const g=()=>{p&&p({target:{value:"",name:d}})},{size:x="md"}=S,W=l=="number"?jn:je,$=l=="number"?Mn:Ft.Fragment,I=l=="number"?{keepWithinRange:!0,precision:5,format:A=>isNaN(parseFloat(String(A)))||Number(parseFloat(String(A)).toFixed(5))===0?A:Number(parseFloat(String(A)).toFixed(5)),min:0,step:n,name:d,type:l,placeholder:u,onChange:A=>{p&&p(A)},onBlur:C,value:c,onClick:w,disabled:t,flexGrow:1,size:x}:{};return r(R,{isInvalid:!!v,children:[o&&e(H,{children:o}),r(Ct,{size:x,w:"full",rounded:"md",_focusWithin:{outline:"2px solid",outlineColor:"primary.200"},bg:t?"gray.100":"transparent",_dark:{bg:t?"gray.600":"transparent"},children:[i&&e(Nn,{children:i}),r($,{...I,children:[e(W,{name:d,ref:T,step:n,className:Rt(s),type:l,placeholder:u,onChange:p,onBlur:C,value:c,onClick:w,disabled:t,flexGrow:1,_focusVisible:{outline:"none",borderTopColor:"transparent",borderRightColor:"transparent",borderBottomColor:"transparent"},_disabled:{cursor:"not-allowed"},...S,roundedLeft:i?"0":"md",roundedRight:a?"0":"md"}),l=="number"&&e(ge,{children:r(Fn,{children:[e(Pn,{}),e(Wn,{})]})})]}),a&&e(On,{borderLeftRadius:0,borderRightRadius:"6px",bg:"transparent",children:a}),m&&c&&c.length&&e(wt,{borderLeftRadius:0,borderRightRadius:"6px",bg:"transparent",onClick:g,cursor:"pointer",children:e(Es,{})})]}),!!v&&e(_t,{children:v})]})}),At=y(Me,{baseStyle:{bg:"white",_dark:{bg:"gray.700"}}}),Te=y(Ue,{baseStyle:{bg:"white",_dark:{bg:"gray.700"}}}),Us=y($t,{baseStyle:{w:5,h:5}}),De=y(Hn,{baseStyle:{w:4,h:4,color:"gray.400",cursor:"pointer"}}),Rs=b.record(b.string().min(1),b.array(b.object({remark:b.string().min(1,"Remark is required"),address:b.string().min(1,"Address is required"),port:b.string().or(b.number()).nullable().transform(t=>typeof t=="number"?t:t!==null&&!isNaN(parseInt(t))?Number(parseInt(t)):null),path:b.string().nullable(),sni:b.string().nullable(),host:b.string().nullable(),mux_enable:b.boolean().default(!1),allowinsecure:b.boolean().nullable().default(!1),is_disabled:b.boolean().default(!0),fragment_setting:b.string().nullable(),random_user_agent:b.boolean().default(!1),security:b.string(),alpn:b.string(),fingerprint:b.string()}))),Se=y(_t,{baseStyle:{color:"red.400",display:"block",textAlign:"left",w:"100%"}}),Ls=({hostKey:t,isOpen:n,toggleAccordion:o})=>{const{inbounds:s}=E(),i=[...s.values()].flat().filter(v=>v.tag===t)[0],a=Vt(),{fields:l,append:u,remove:p}=Bn({control:a.control,name:t}),{errors:C}=a.formState,{t:d}=j(),c=C[t],w=()=>{u({host:"",sni:"",port:null,path:null,address:"",remark:"",mux_enable:!1,allowinsecure:!1,is_disabled:!1,fragment_setting:"",random_user_agent:!1,security:"inbound_default",alpn:"",fingerprint:""})};return f.exports.useEffect(()=>{c&&!n&&o()},[c]),r(He,{border:"1px solid",_dark:{borderColor:"gray.600"},_light:{borderColor:"gray.200"},borderRadius:"4px",p:1,w:"full",children:[r(Be,{px:2,borderRadius:"3px",onClick:o,children:[e(h,{as:"span",fontWeight:"medium",fontSize:"sm",flex:"1",textAlign:"left",color:"gray.700",_dark:{color:"gray.300"},children:t}),e(Pt,{})]}),e($e,{px:2,pb:2,children:r(N,{gap:3,children:[l.map((v,m)=>{var S,T,g,x,W,$,I,A,Y,q,L,V,J,z,P,K,Fe,xt,yt,ee,Pe,Ye,Ze,Qe,qe,Xe,k,M,te,xe,he,ye,G,Je,Ke,et,tt;return r(N,{border:"1px solid",_dark:{borderColor:"gray.600",bg:"#273142"},_light:{borderColor:"gray.200",bg:"#fcfbfb"},p:2,w:"full",borderRadius:"4px",children:[e(_,{w:"100%",alignItems:"flex-start",children:r(R,{position:"relative",zIndex:10,isInvalid:!!(c&&((S=c[m])==null?void 0:S.remark)),children:[r(Ct,{children:[e(Te,{...a.register(t+"."+m+".remark"),size:"sm",borderRadius:"4px",placeholder:"Remark"}),e(wt,{children:r(Ce,{isLazy:!0,placement:"right",children:[e(we,{children:e(D,{mt:"-8px",children:e(De,{})})}),e(_e,{children:r(ke,{children:[e(ve,{}),e(Ie,{}),e(er,{children:r(D,{fontSize:"xs",children:[e(h,{pr:"20px",children:d("hostsDialog.desc")}),r(h,{children:[r(U,{children:["{","SERVER_IP","}"]})," ",d("hostsDialog.currentServer")]}),r(h,{mt:1,children:[r(U,{children:["{","SERVER_IPV6","}"]})," ",d("hostsDialog.currentServerv6")]}),r(h,{mt:1,children:[r(U,{children:["{","USERNAME","}"]})," ",d("hostsDialog.username")]}),r(h,{mt:1,children:[r(U,{children:["{","DATA_USAGE","}"]})," ",d("hostsDialog.dataUsage")]}),r(h,{mt:1,children:[r(U,{children:["{","DATA_LEFT","}"]})," ",d("hostsDialog.remainingData")]}),r(h,{mt:1,children:[r(U,{children:["{","DATA_LIMIT","}"]})," ",d("hostsDialog.dataLimit")]}),r(h,{mt:1,children:[r(U,{children:["{","DAYS_LEFT","}"]})," ",d("hostsDialog.remainingDays")]}),r(h,{mt:1,children:[r(U,{children:["{","EXPIRE_DATE","}"]})," ",d("hostsDialog.expireDate")]}),r(h,{mt:1,children:[r(U,{children:["{","JALALI_EXPIRE_DATE","}"]})," ",d("hostsDialog.jalaliExpireDate")]}),r(h,{mt:1,children:[r(U,{children:["{","TIME_LEFT","}"]})," ",d("hostsDialog.remainingTime")]}),r(h,{mt:1,children:[r(U,{children:["{","STATUS_TEXT","}"]})," ",d("hostsDialog.statusText")]}),r(h,{mt:1,children:[r(U,{children:["{","STATUS_EMOJI","}"]})," ",d("hostsDialog.statusEmoji")]}),r(h,{mt:1,children:[r(U,{children:["{","PROTOCOL","}"]})," ",d("hostsDialog.proxyProtocol")]}),r(h,{mt:1,children:[r(U,{children:["{","TRANSPORT","}"]})," ",d("hostsDialog.proxyMethod")]})]})})]})})]})})]}),c&&((T=c[m])==null?void 0:T.remark)&&e(Se,{children:(x=(g=c[m])==null?void 0:g.remark)==null?void 0:x.message})]})}),r(R,{isInvalid:!!(c&&((W=c[m])==null?void 0:W.address)),children:[r(Ct,{children:[e(Te,{size:"sm",borderRadius:"4px",placeholder:"Address (e.g. example.com)",...a.register(t+"."+m+".address")}),e(wt,{children:r(Ce,{isLazy:!0,placement:"right",children:[e(we,{children:e(D,{mt:"-8px",children:e(De,{})})}),e(_e,{children:r(ke,{children:[e(ve,{}),e(Ie,{}),e(er,{children:r(D,{fontSize:"xs",children:[e(h,{pr:"20px",children:d("hostsDialog.desc")}),r(h,{children:[r(U,{children:["{","SERVER_IP","}"]})," ",d("hostsDialog.currentServer")]}),r(h,{mt:1,children:[r(U,{children:["{","SERVER_IPV6","}"]})," ",d("hostsDialog.currentServerv6")]}),r(h,{mt:1,children:[r(U,{children:["{","USERNAME","}"]})," ",d("hostsDialog.username")]}),r(h,{mt:1,children:[r(U,{children:["{","DATA_USAGE","}"]})," ",d("hostsDialog.dataUsage")]}),r(h,{mt:1,children:[r(U,{children:["{","DATA_LEFT","}"]})," ",d("hostsDialog.remainingData")]}),r(h,{mt:1,children:[r(U,{children:["{","DATA_LIMIT","}"]})," ",d("hostsDialog.dataLimit")]}),r(h,{mt:1,children:[r(U,{children:["{","DAYS_LEFT","}"]})," ",d("hostsDialog.remainingDays")]}),r(h,{mt:1,children:[r(U,{children:["{","EXPIRE_DATE","}"]})," ",d("hostsDialog.expireDate")]}),r(h,{mt:1,children:[r(U,{children:["{","JALALI_EXPIRE_DATE","}"]})," ",d("hostsDialog.jalaliExpireDate")]}),r(h,{mt:1,children:[r(U,{children:["{","TIME_LEFT","}"]})," ",d("hostsDialog.remainingTime")]}),r(h,{mt:1,children:[r(U,{children:["{","STATUS_TEXT","}"]})," ",d("hostsDialog.statusText")]}),r(h,{mt:1,children:[r(U,{children:["{","STATUS_EMOJI","}"]})," ",d("hostsDialog.statusEmoji")]}),r(h,{mt:1,children:[r(U,{children:["{","PROTOCOL","}"]})," ",d("hostsDialog.proxyProtocol")]}),r(h,{mt:1,children:[r(U,{children:["{","TRANSPORT","}"]})," ",d("hostsDialog.proxyMethod")]})]})})]})})]})})]}),c&&(($=c[m])==null?void 0:$.address)&&e(Se,{children:(A=(I=c[m])==null?void 0:I.address)==null?void 0:A.message})]}),e(mt,{w:"full",allowToggle:!0,children:r(He,{border:"0",children:[r(Be,{display:"flex",px:0,py:1,borderRadius:3,_hover:{bg:"transparent"},children:[r(h,{flex:"3",align:"start",fontSize:"xs",color:"gray.600",_dark:{color:"gray.500"},pl:1,children:[d("hostsDialog.advancedOptions"),e(Pt,{fontSize:"sm",ml:1})]}),r($n,{flex:"1",px:"0",children:[e(pe,{control:a.control,name:`${t}.${m}.is_disabled`,render:({field:Q})=>e(kt,{mx:"1.5",colorScheme:"primary",...Q,value:void 0,isChecked:!Q.value,onChange:We=>{console.log(We.target.checked),Q.onChange(!We.target.checked)}})}),e(ne,{label:"Delete",placement:"top",children:e(Z,{"aria-label":"Delete",size:"sm",colorScheme:"red",variant:"ghost",onClick:p.bind(null,m),children:e(gt,{})})})]})]}),e($e,{w:"full",p:1,children:r(N,{w:"full",borderRadius:"4px",children:[r(R,{isInvalid:!!(c&&((Y=c[m])==null?void 0:Y.port)),children:[r(H,{display:"flex",pb:1,alignItems:"center",justifyContent:"space-between",gap:1,m:"0",children:[e("span",{children:d("hostsDialog.port")}),r(Ce,{isLazy:!0,placement:"right",children:[e(we,{children:e(De,{})}),e(_e,{children:r(ke,{p:2,children:[e(ve,{}),e(Ie,{}),e(h,{fontSize:"xs",pr:5,children:d("hostsDialog.port.info")})]})})]})]}),e(Te,{size:"sm",borderRadius:"4px",placeholder:String(i.port||"8080"),type:"number",...a.register(t+"."+m+".port")})]}),r(R,{isInvalid:!!(c&&((q=c[m])==null?void 0:q.sni)),children:[r(H,{display:"flex",pb:1,alignItems:"center",gap:1,justifyContent:"space-between",m:"0",children:[e("span",{children:d("hostsDialog.sni")}),r(Ce,{isLazy:!0,placement:"right",children:[e(we,{children:e(De,{})}),e(_e,{children:r(ke,{p:2,children:[e(ve,{}),e(Ie,{}),e(h,{fontSize:"xs",pr:5,children:d("hostsDialog.sni.info")}),e(h,{fontSize:"xs",mt:"2",children:e(Ee,{i18nKey:"hostsDialog.host.wildcard",components:{badge:e(U,{})}})}),e(h,{fontSize:"xs",children:e(Ee,{i18nKey:"hostsDialog.host.multiHost",components:{badge:e(U,{})}})})]})})]})]}),e(Te,{size:"sm",borderRadius:"4px",placeholder:"SNI (e.g. example.com)",...a.register(t+"."+m+".sni")}),c&&((L=c[m])==null?void 0:L.sni)&&e(Se,{children:(J=(V=c[m])==null?void 0:V.sni)==null?void 0:J.message})]}),r(R,{isInvalid:!!(c&&((z=c[m])==null?void 0:z.host)),children:[r(H,{display:"flex",pb:1,alignItems:"center",gap:1,justifyContent:"space-between",m:"0",children:[e("span",{children:d("hostsDialog.host")}),r(Ce,{isLazy:!0,placement:"right",children:[e(we,{children:e(De,{})}),e(_e,{children:r(ke,{p:2,children:[e(ve,{}),e(Ie,{}),e(h,{fontSize:"xs",pr:5,children:d("hostsDialog.host.info")}),e(h,{fontSize:"xs",mt:"2",children:e(Ee,{i18nKey:"hostsDialog.host.wildcard",components:{badge:e(U,{})}})}),e(h,{fontSize:"xs",children:e(Ee,{i18nKey:"hostsDialog.host.multiHost",components:{badge:e(U,{})}})})]})})]})]}),e(Te,{size:"sm",borderRadius:"4px",placeholder:"Host (e.g. example.com)",...a.register(t+"."+m+".host")}),c&&((P=c[m])==null?void 0:P.host)&&e(Se,{children:(Fe=(K=c[m])==null?void 0:K.host)==null?void 0:Fe.message})]}),r(R,{isInvalid:!!(c&&((xt=c[m])==null?void 0:xt.path)),children:[r(H,{display:"flex",pb:1,alignItems:"center",gap:1,justifyContent:"space-between",m:"0",children:[e("span",{children:d("hostsDialog.path")}),r(Ce,{isLazy:!0,placement:"right",children:[e(we,{children:e(De,{})}),e(_e,{children:r(ke,{p:2,children:[e(ve,{}),e(Ie,{}),e(h,{fontSize:"xs",pr:5,children:d("hostsDialog.path.info")})]})})]})]}),e(Te,{size:"sm",borderRadius:"4px",placeholder:"path (e.g. /vless)",...a.register(t+"."+m+".path")}),c&&((yt=c[m])==null?void 0:yt.path)&&e(Se,{children:(Pe=(ee=c[m])==null?void 0:ee.path)==null?void 0:Pe.message})]}),r(R,{height:"66px",children:[r(H,{display:"flex",pb:1,alignItems:"center",gap:1,justifyContent:"space-between",m:"0",children:[e("span",{children:d("hostsDialog.security")}),r(Ce,{isLazy:!0,placement:"right",children:[e(we,{children:e(De,{})}),e(_e,{children:r(ke,{p:2,children:[e(ve,{}),e(Ie,{}),e(h,{fontSize:"xs",pr:5,children:d("hostsDialog.security.info")})]})})]})]}),e(At,{size:"sm",...a.register(t+"."+m+".security"),children:_s.map(Q=>e("option",{value:Q.value,children:Q.title},Q.value))})]}),r(R,{height:"66px",children:[e(H,{display:"flex",pb:1,alignItems:"center",gap:1,justifyContent:"space-between",m:"0",children:e("span",{children:d("hostsDialog.alpn")})}),e(At,{size:"sm",...a.register(t+"."+m+".alpn"),children:ks.map(Q=>e("option",{value:Q.value,children:Q.title},Q.value))})]}),r(R,{height:"66px",children:[e(H,{display:"flex",pb:1,alignItems:"center",gap:1,justifyContent:"space-between",m:"0",children:e("span",{children:d("hostsDialog.fingerprint")})}),e(At,{size:"sm",...a.register(t+"."+m+".fingerprint"),children:vs.map(Q=>e("option",{value:Q.value,children:Q.title},Q.value))})]}),r(R,{isInvalid:!!(c&&((Ye=c[m])==null?void 0:Ye.fragment_setting)),children:[r(H,{display:"flex",pb:1,alignItems:"center",gap:1,justifyContent:"space-between",m:"0",children:[e("span",{children:d("hostsDialog.fragment")}),r(Ce,{isLazy:!0,placement:"right",children:[e(we,{children:e(De,{})}),e(_e,{children:r(ke,{p:2,children:[e(ve,{}),e(Ie,{}),e(h,{fontSize:"xs",pr:5,children:d("hostsDialog.fragment.info")}),e(h,{fontSize:"xs",pr:5,pt:2,pb:1,children:d("hostsDialog.fragment.info.examples")}),e(h,{fontSize:"xs",pr:5,children:"100-200,10-20,tlshello"}),e(h,{fontSize:"xs",pr:5,children:"100-200,10-20,1-3"}),e(h,{fontSize:"xs",pr:5,pt:"3",children:d("hostsDialog.fragment.info.attention")})]})})]})]}),e(Te,{size:"sm",borderRadius:"4px",placeholder:"Fragment settings by pattern",...a.register(t+"."+m+".fragment_setting")}),c&&((Ze=c[m])==null?void 0:Ze.fragment_setting)&&e(Se,{children:(qe=(Qe=c[m])==null?void 0:Qe.fragment_setting)==null?void 0:qe.message})]}),e(R,{isInvalid:!!(c&&((Xe=c[m])==null?void 0:Xe.allowinsecure)),children:r(it,{...a.register(t+"."+m+".allowinsecure"),name:t+"."+m+".allowinsecure",children:[e(H,{children:d("hostsDialog.allowinsecure")}),c&&((k=c[m])==null?void 0:k.allowinsecure)&&e(Se,{children:(te=(M=c[m])==null?void 0:M.allowinsecure)==null?void 0:te.message})]})}),r(R,{isInvalid:!!(c&&((xe=c[m])==null?void 0:xe.mux_enable)),children:[e(it,{...a.register(t+"."+m+".mux_enable"),children:e(H,{children:d("hostsDialog.muxEnable")})}),c&&((he=c[m])==null?void 0:he.mux_enable)&&e(Se,{children:(G=(ye=c[m])==null?void 0:ye.mux_enable)==null?void 0:G.message})]}),r(R,{isInvalid:!!(c&&((Je=c[m])==null?void 0:Je.random_user_agent)),children:[e(it,{...a.register(t+"."+m+".random_user_agent"),children:e(H,{children:d("hostsDialog.randomUserAgent")})}),c&&((Ke=c[m])==null?void 0:Ke.random_user_agent)&&e(Se,{children:(tt=(et=c[m])==null?void 0:et.random_user_agent)==null?void 0:tt.message})]})]},m)})]})})]},m)}),e(F,{variant:"outline",w:"full",size:"sm",color:"",fontWeight:"normal",onClick:w,children:d("hostsDialog.addHost")})]})})]})},Ts=()=>{const{isEditingHosts:t,onEditingHosts:n,refetchUsers:o,inbounds:s}=E(),{isLoading:i,hosts:a,fetchHosts:l,isPostLoading:u,setHosts:p}=Ds(),C=fe(),{t:d}=j(),[c,w]=f.exports.useState({});f.exports.useEffect(()=>{t&&l()},[t]);const v=Ve({resolver:pt(Rs)});f.exports.useEffect(()=>{a&&t&&v.reset(a)},[a]);const m=()=>{w({}),n(!1)},S=g=>{p(g).then(()=>{C({title:d("hostsDialog.savedSuccess"),status:"success",isClosable:!0,position:"top",duration:3e3}),o()}).catch(x=>{var W,$,I,A,Y;(((W=x==null?void 0:x.response)==null?void 0:W.status)===409||(($=x==null?void 0:x.response)==null?void 0:$.status)===400)&&C({title:(A=(I=x.response)==null?void 0:I._data)==null?void 0:A.detail,status:"error",isClosable:!0,position:"top",duration:3e3}),((Y=x==null?void 0:x.response)==null?void 0:Y.status)===422&&Object.keys(x.response._data.detail).forEach(q=>{C({title:x.response._data.detail[q]+" ("+q+")",status:"error",isClosable:!0,position:"top",duration:3e3})})})},T=g=>{c[String(g)]?delete c[String(g)]:c[String(g)]={},w({...c})};return r(oe,{isOpen:t,onClose:m,children:[e(se,{bg:"blackAlpha.300",backdropFilter:"blur(10px)"}),r(ae,{mx:"3",w:"fit-content",maxW:"3xl",children:[e(ie,{pt:6,children:e(de,{color:"primary",children:e(Us,{color:"white"})})}),e(le,{mt:3}),e(ce,{w:"440px",pb:3,pt:3,children:e(Nr,{...v,children:r("form",{onSubmit:v.handleSubmit(S),children:[e(h,{mb:3,opacity:.8,fontSize:"sm",children:d("hostsDialog.title")}),i&&d("hostsDialog.loading"),!i&&a&&(Object.keys(a).length>0?e(mt,{w:"full",allowToggle:!0,allowMultiple:!0,index:Object.keys(c).map(g=>parseInt(g)),children:e(N,{w:"full",children:Object.keys(a).map((g,x)=>e(Ls,{toggleAccordion:()=>T(x),isOpen:c[String(x)],hostKey:g},g))})}):"No inbound found. Please check your Xray config file."),e(_,{justifyContent:"flex-end",py:2,children:e(F,{variant:"solid",mt:"2",type:"submit",colorScheme:"primary",size:"sm",px:5,isLoading:u,disabled:u,children:d("hostsDialog.apply")})})]})})})]})]})},rn=b.object({name:b.string().min(1),address:b.string().min(1),port:b.number().min(1).or(b.string().transform(t=>parseFloat(t))),api_port:b.number().min(1).or(b.string().transform(t=>parseFloat(t))),xray_version:b.string().nullable().optional(),id:b.number().nullable().optional(),status:b.enum(["connected","connecting","error","disabled"]).nullable().optional(),message:b.string().nullable().optional(),add_as_new_host:b.boolean().optional(),usage_coefficient:b.number().or(b.string().transform(t=>parseFloat(t)))}),As=()=>({name:"",address:"",port:62050,api_port:62051,xray_version:"",usage_coefficient:1}),ht="fetch-nodes-query-key",Ms=()=>{const{isEditingNodes:t}=E();return Bt({queryKey:ht,queryFn:ft.getState().fetchNodes,refetchInterval:t?3e3:void 0,refetchOnWindowFocus:!1})},ft=Dt((t,n)=>({nodes:[],addNode(o){return O("/node",{method:"POST",body:o})},fetchNodes(){return O("/nodes")},fetchNodesUsage(o){return O("/nodes/usage",{query:o})},updateNode(o){return O(`/node/${o.id}`,{method:"PUT",body:o})},setDeletingNode(o){t({deletingNode:o})},reconnectNode(o){return O(`/node/${o.id}/reconnect`,{method:"POST"})},deleteNode:()=>{var o;return O(`/node/${(o=n().deletingNode)==null?void 0:o.id}`,{method:"DELETE"})}})),Qt=(t,n,o)=>{if(t.response&&t.response._data){if(typeof t.response._data.detail=="string")return n({title:t.response._data.detail,status:"error",isClosable:!0,position:"top",duration:3e3});if(typeof t.response._data.detail=="object"&&o){Object.keys(t.response._data.detail).forEach(s=>o.setError(s,{message:t.response._data.detail[s]}));return}}return n({title:"Something went wrong!",status:"error",isClosable:!0,position:"top",duration:3e3})},qt=(t,n)=>n({title:t,status:"success",isClosable:!0,position:"top",duration:3e3}),Ns=({deleteCallback:t})=>{const{deleteNode:n,deletingNode:o,setDeletingNode:s}=ft(),{t:i}=j(),a=fe(),l=Gt(),u=()=>{s(null)},{isLoading:p,mutate:C}=ct(n,{onSuccess:()=>{qt(i("deleteNode.deleteSuccess",{name:o&&o.name}),a),s(null),l.invalidateQueries(ht),t&&t()},onError:d=>{Qt(d,a)}});return r(oe,{isCentered:!0,isOpen:!!o,onClose:u,size:"sm",children:[e(se,{bg:"blackAlpha.300",backdropFilter:"blur(10px)"}),r(ae,{mx:"3",children:[e(ie,{pt:6,children:e(de,{color:"red",children:e(gt,{})})}),e(le,{mt:3}),r(ce,{children:[e(h,{fontWeight:"semibold",fontSize:"lg",children:i("deleteNode.title")}),o&&e(h,{mt:1,fontSize:"sm",_dark:{color:"gray.400"},color:"gray.600",children:e(Ee,{components:{b:e("b",{})},children:i("deleteNode.prompt",{name:o.name})})})]}),r(Re,{display:"flex",children:[e(F,{size:"sm",onClick:u,mr:3,w:"full",variant:"outline",children:i("cancel")}),e(F,{size:"sm",w:"full",colorScheme:"red",onClick:()=>C(),leftIcon:p?e(Ne,{size:"xs"}):void 0,children:i("delete")})]})]})]})},bt={baseStyle:{strokeWidth:"2px",w:4,h:4}},pr=y(Vn,bt),Fs=y(Gn,bt),mr=y(Yn,bt),gr=y(Fr,bt),Ps=y(Fr,bt),jt=[{title:"No",value:"no_reset"},{title:"Daily",value:"day"},{title:"Weekly",value:"week"},{title:"Monthly",value:"month"},{title:"Annually",value:"year"}],lt={active:{statusColor:"green",bandWidthColor:"primary",icon:pr},connected:{statusColor:"green",bandWidthColor:"primary",icon:pr},disabled:{statusColor:"gray",bandWidthColor:"gray",icon:Fs},expired:{statusColor:"orange",bandWidthColor:"orange",icon:gr},on_hold:{statusColor:"purple",bandWidthColor:"purple",icon:Ps},connecting:{statusColor:"orange",bandWidthColor:"orange",icon:gr},limited:{statusColor:"red",bandWidthColor:"red",icon:mr},error:{statusColor:"red",bandWidthColor:"red",icon:mr}},Xt=t=>{let n={status:"",time:""};if(t){B(t*1e3).utc().isAfter(B().utc())?n.status="expires":n.status="expired";const o=[],s=B.duration(B(t*1e3).utc().diff(B()));s.years()!=0&&o.push(Math.abs(s.years())+" year"+(Math.abs(s.years())!=1?"s":"")),s.months()!=0&&o.push(Math.abs(s.months())+" month"+(Math.abs(s.months())!=1?"s":"")),s.days()!=0&&o.push(Math.abs(s.days())+" day"+(Math.abs(s.days())!=1?"s":"")),o.length===0&&(s.hours()!=0&&o.push(Math.abs(s.hours())+" hour"+(Math.abs(s.hours())!=1?"s":"")),s.minutes()!=0&&o.push(Math.abs(s.minutes())+" min"+(Math.abs(s.minutes())!=1?"s":""))),n.time=o.join(", ")}return n},St=({expiryDate:t,status:n,compact:o=!1,showDetail:s=!0,extraText:i})=>{const{t:a}=j(),l=Xt(t),u=lt[n].icon;return r(ge,{children:[r(U,{colorScheme:lt[n].statusColor,rounded:"full",display:"inline-flex",px:3,py:1,columnGap:o?1:2,alignItems:"center",children:[e(u,{w:o?3:4}),s&&r(h,{textTransform:"capitalize",fontSize:o?".7rem":".875rem",lineHeight:o?"1rem":"1.25rem",fontWeight:"medium",letterSpacing:"tighter",children:[n&&a(`status.${n}`),i&&`: ${i}`]})]}),s&&t&&e(h,{display:"inline-block",fontSize:"xs",fontWeight:"medium",ml:"2",color:"gray.600",_dark:{color:"gray.400"},children:a(l.status,{time:l.time})})]})},nt=y(Ue,{baseStyle:{bg:"white",_dark:{bg:"gray.700"}}}),Ws=y(Ar,{baseStyle:{w:5,h:5}}),Os=y(Zn,{baseStyle:{w:5,h:5,strokeWidth:2}}),js=({toggleAccordion:t,node:n})=>{const{updateNode:o,reconnectNode:s,setDeletingNode:i}=ft(),{t:a}=j(),l=Gt(),u=fe(),p=Ve({defaultValues:n,resolver:pt(rn)}),C=i.bind(null,n),{isLoading:d,mutate:c}=ct(o,{onSuccess:()=>{qt("Node updated successfully",u),l.invalidateQueries(ht)},onError:S=>{Qt(S,u,p)}}),{isLoading:w,mutate:v}=ct(s.bind(null,n),{onSuccess:()=>{l.invalidateQueries(ht)}}),m=w?"connecting":n.status?n.status:"error";return r(He,{border:"1px solid",_dark:{borderColor:"gray.600"},_light:{borderColor:"gray.200"},borderRadius:"4px",p:1,w:"full",children:[r(Be,{px:2,borderRadius:"3px",onClick:t,children:[r(_,{w:"full",justifyContent:"space-between",pr:2,children:[e(h,{as:"span",fontWeight:"medium",fontSize:"sm",flex:"1",textAlign:"left",color:"gray.700",_dark:{color:"gray.300"},children:n.name}),r(_,{children:[n.xray_version&&e(U,{colorScheme:"blue",rounded:"full",display:"inline-flex",px:3,py:1,children:r(h,{textTransform:"capitalize",fontSize:"0.7rem",fontWeight:"medium",letterSpacing:"tighter",children:["Xray ",n.xray_version]})}),n.status&&e(St,{status:m,compact:!0})]})]}),e(Pt,{})]}),r($e,{px:2,pb:2,children:[e(N,{pb:3,alignItems:"flex-start",children:m==="error"&&e(dt,{status:"error",size:"xs",children:r(D,{children:[r(_,{w:"full",children:[e(vt,{w:4}),e(h,{marginInlineEnd:0,children:n.message})]}),e(_,{justifyContent:"flex-end",w:"full",children:e(F,{size:"sm","aria-label":"reconnect node",leftIcon:e(Xr,{}),onClick:()=>v(),disabled:w,children:a(w?"nodes.reconnecting":"nodes.reconnect")})})]})})}),e(nn,{form:p,mutate:c,isLoading:d,submitBtnText:a("nodes.editNode"),btnLeftAdornment:e(ne,{label:a("delete"),placement:"top",children:e(Z,{colorScheme:"red",variant:"ghost",size:"sm","aria-label":"delete node",onClick:C,children:e(gt,{})})})})]})]})},Hs=({toggleAccordion:t,resetAccordions:n})=>{const o=fe(),{t:s}=j(),i=Gt(),{addNode:a}=ft(),l=Ve({resolver:pt(rn),defaultValues:{...As(),add_as_new_host:!0}}),{isLoading:u,mutate:p}=ct(a,{onSuccess:()=>{qt(s("nodes.addNodeSuccess",{name:l.getValues("name")}),o),i.invalidateQueries(ht),l.reset(),n()},onError:C=>{Qt(C,o,l)}});return r(He,{border:"1px solid",_dark:{borderColor:"gray.600"},_light:{borderColor:"gray.200"},borderRadius:"4px",p:1,w:"full",children:[e(Be,{px:2,borderRadius:"3px",onClick:t,children:r(h,{as:"span",fontWeight:"medium",fontSize:"sm",flex:"1",textAlign:"left",color:"gray.700",_dark:{color:"gray.300"},display:"flex",gap:1,children:[e(Os,{display:"inline-block"})," ",e("span",{children:s("nodes.addNewMarzbanNode")})]})}),e($e,{px:2,py:4,children:e(nn,{form:l,mutate:p,isLoading:u,submitBtnText:s("nodes.addNode"),btnProps:{variant:"solid"},addAsHost:!0})})]})},nn=({form:t,mutate:n,isLoading:o,submitBtnText:s,btnProps:i={},btnLeftAdornment:a,addAsHost:l=!1})=>{var v,m,S,T,g,x,W,$,I,A,Y,q,L,V,J;const{t:u}=j(),[p,C]=f.exports.useState(!1),{data:d,isLoading:c}=Bt({queryKey:"node-settings",queryFn:()=>O("/node/settings")});function w(z){if(document.body.createTextRange){const P=document.body.createTextRange();P.moveToElementText(z),P.select()}else if(window.getSelection){const P=window.getSelection(),K=document.createRange();K.selectNodeContents(z),P.removeAllRanges(),P.addRange(K)}else console.warn("Could not select text in node: Unsupported browser.")}return e("form",{onSubmit:t.handleSubmit(z=>n(z)),children:r(N,{children:[d&&d.certificate&&e(dt,{status:"info",alignItems:"start",children:r(Pr,{display:"flex",flexDirection:"column",overflow:"hidden",children:[e("span",{children:u("nodes.connection-hint")}),r(_,{justify:"end",py:2,children:[e(F,{as:"a",colorScheme:"primary",size:"xs",download:"ssl_client_cert.pem",href:URL.createObjectURL(new Blob([d.certificate],{type:"text/plain"})),children:u("nodes.download-certificate")}),e(ne,{placement:"top",label:u("nodes.show-certificate"),children:e(Z,{"aria-label":u("nodes.show-certificate"),onClick:C.bind(null,!p),colorScheme:"whiteAlpha",color:"primary",size:"xs",children:p?e(qn,{width:"15px"}):e(Qn,{width:"15px"})})})]}),e(Wr,{in:p,animateOpacity:!0,children:e(h,{bg:"rgba(255,255,255,.5)",_dark:{bg:"rgba(255,255,255,.2)"},rounded:"md",p:"2",lineHeight:"1.2",fontSize:"10px",fontFamily:"Courier",whiteSpace:"pre",overflow:"auto",onClick:z=>{w(z.target)},children:d.certificate})})]})}),r(_,{w:"full",children:[e(R,{children:e(nt,{label:u("nodes.nodeName"),size:"sm",placeholder:"Marzban-S2",...t.register("name"),error:(S=(m=(v=t.formState)==null?void 0:v.errors)==null?void 0:m.name)==null?void 0:S.message})}),e(_,{px:1,children:e(pe,{name:"status",control:t.control,render:({field:z})=>e(ne,{placement:"top",label:`${u("usersTable.status")}: `+(z.value!=="disabled"?u("active"):u("disabled")),textTransform:"capitalize",children:e(D,{mt:"6",children:e(kt,{colorScheme:"primary",isChecked:z.value!=="disabled",onChange:P=>{P.target.checked?z.onChange("connecting"):z.onChange("disabled")}})})},z.value)})})]}),e(_,{alignItems:"flex-start",w:"100%",children:e(D,{w:"100%",children:e(nt,{label:u("nodes.nodeAddress"),size:"sm",placeholder:"51.20.12.13",...t.register("address"),error:(x=(g=(T=t.formState)==null?void 0:T.errors)==null?void 0:g.address)==null?void 0:x.message})})}),r(_,{alignItems:"flex-start",w:"100%",children:[e(D,{children:e(nt,{label:u("nodes.nodePort"),size:"sm",placeholder:"62050",...t.register("port"),error:(I=($=(W=t.formState)==null?void 0:W.errors)==null?void 0:$.port)==null?void 0:I.message})}),e(D,{children:e(nt,{label:u("nodes.nodeAPIPort"),size:"sm",placeholder:"62051",...t.register("api_port"),error:(q=(Y=(A=t.formState)==null?void 0:A.errors)==null?void 0:Y.api_port)==null?void 0:q.message})}),e(D,{children:e(nt,{label:u("nodes.usageCoefficient"),size:"sm",placeholder:"1",...t.register("usage_coefficient"),error:(J=(V=(L=t.formState)==null?void 0:L.errors)==null?void 0:V.usage_coefficient)==null?void 0:J.message})})]}),l&&e(R,{py:1,children:e(it,{...t.register("add_as_new_host"),children:e(H,{m:0,children:u("nodes.addHostForEveryInbound")})})}),r(_,{w:"full",children:[a,e(F,{flexGrow:1,type:"submit",colorScheme:"primary",size:"sm",px:5,w:"full",isLoading:o,...i,children:s})]})]})})},Bs=()=>{const{isEditingNodes:t,onEditingNodes:n}=E(),{t:o}=j(),[s,i]=f.exports.useState({}),{data:a,isLoading:l}=Ms(),u=()=>{i({}),n(!1)},p=C=>{s[String(C)]?delete s[String(C)]:s[String(C)]={},i({...s})};return r(ge,{children:[r(oe,{isOpen:t,onClose:u,children:[e(se,{bg:"blackAlpha.300",backdropFilter:"blur(10px)"}),r(ae,{mx:"3",w:"fit-content",maxW:"3xl",children:[e(ie,{pt:6,children:e(de,{color:"primary",children:e(Ws,{color:"white"})})}),e(le,{mt:3}),r(ce,{w:"440px",pb:6,pt:3,children:[e(h,{mb:3,opacity:.8,fontSize:"sm",children:o("nodes.title")}),l&&"loading...",e(mt,{w:"full",allowToggle:!0,index:Object.keys(s).map(C=>parseInt(C)),children:r(N,{w:"full",children:[!l&&a&&a.map((C,d)=>e(js,{toggleAccordion:()=>p(d),node:C},C.name)),e(Hs,{toggleAccordion:()=>p((a||[]).length),resetAccordions:()=>i({})})]})})]})]})]}),e(Ns,{deleteCallback:()=>i({})})]})};function $s(t){const n=360/t,o=90,s=47,i=[];for(let a=0;a(w<0&&(w+=1),w>1&&(w-=1),w<.16666666666666666?d+(c-d)*6*w:w<.5?c:w<.6666666666666666?d+(c-d)*(.6666666666666666-w)*6:d),p=o<.5?o*(1+n):o+n-o*n,C=2*o-p;s=Math.round(u(C,p,t+1/3)*255),i=Math.round(u(C,p,t)*255),a=Math.round(u(C,p,t-1/3)*255)}const l=u=>{const p=u.toString(16);return p.length===1?"0"+p:p};return`#${l(s)}${l(i)}${l(a)}`}const fr=({border:t,...n})=>{const{getInputProps:o,getRadioProps:s}=no(n),i=Ae({base:"xs",md:"sm"});return r(D,{as:"label",children:[e("input",{...o()}),e(D,{...s(),minW:"48px",w:"full",h:"full",textAlign:"center",cursor:"pointer",fontSize:i,borderWidth:t?"1px":"0px",borderRadius:"md",_checked:{bg:"primary.500",color:"white",borderColor:"primary.500"},_focus:{boxShadow:"outline"},px:3,py:1,children:n.children})]})},on=({onChange:t,defaultValue:n,...o})=>{const{t:s,i18n:i}=j();ut();const a=Ae({base:["7h","1d","3d","1w"],md:["7h","1d","3d","1w","1m","3m"]}),l={h:"hour",d:"day",w:"week",m:"month",y:"year"},u=Ae({base:[{title:"hours",options:["1h","3h","6h","12h"]},{title:"days",options:["1d","2d","3d","4d"]},{title:"weeks",options:["1w","2w","3w","4w"]},{title:"months",options:["1m","2m","3m","6m"]}],md:[{title:"hours",options:["1h","2h","3h","6h","8h","12h"]},{title:"days",options:["1d","2d","3d","4d","5d","6d"]},{title:"weeks",options:["1w","2w","3w","4w"]},{title:"months",options:["1m","2m","3m","6m","8m"]}]}),{getRootProps:p,getRadioProps:C,setValue:d}=Xn({name:"filter",defaultValue:n,onChange:z=>{if(z==="custom")return;v(),a.indexOf(z)>=0?(T(s("userDialog.custom")),x(!1)):(T(s("userDialog.custom")+` (${z})`),x(!0));const P=Number(z.substring(0,z.length-1)),K=l[z[z.length-1]];t(z,{start:B().utc().subtract(P,K).format("YYYY-MM-DDTHH:00:00")})}}),{isOpen:c,onOpen:w,onClose:v}=Jn(),m=f.exports.useRef(null);Kn({ref:m,handler:v});const[S,T]=f.exports.useState(s("userDialog.custom")),[g,x]=f.exports.useState(!1),[W,$]=f.exports.useState(0),I=Ae({base:1,md:2}),A=Ae({base:"xs",md:"sm"}),[Y,q]=f.exports.useState(null),[L,V]=f.exports.useState(null),J=z=>{const[P,K]=z;L&&!K?(q(null),V(null)):(q(P),V(K),P&&K&&(v(),t("custom",{start:B(P).format("YYYY-MM-DDT00:00:00"),end:B(K).format("YYYY-MM-DDT23:59:59")})))};return r(N,{...o,children:[W==0&&r(Yt,{...p(),gap:0,display:"flex",borderWidth:"1px",borderRadius:"md",minW:{base:"320px",md:"400px"},children:[a.map(z=>e(fr,{...C({value:z}),children:z},z)),e(D,{onClick:()=>{q(null),V(null),w()},cursor:"pointer",borderRadius:"md",w:"full",fontSize:A,px:3,py:1,bg:g?"primary.500":"unset",color:g?"white":"unset",borderColor:g?"primary.500":"unset",children:r(_,{children:[e(h,{children:S}),e(Lt,{as:tr,boxSize:"18px"})]})})]}),W==1&&r(_,{onClick:w,cursor:"pointer",fontSize:A,borderRadius:"md",px:3,py:1,minW:{base:"320px",md:"400px"},borderWidth:"1px",children:[e(h,{w:"full",color:Y?"unset":"gray.500",children:Y?B(Y).format("YYYY-MM-DD (00:00)"):s("userDialog.startDate")}),e(Lt,{as:Or,boxSize:"18px"}),e(h,{w:"full",color:L?"unset":"gray.500",children:L?B(L).format("YYYY-MM-DD (23:59)"):s("userDialog.endDate")}),e(Lt,{as:tr,boxSize:"18px"})]}),e(N,{ref:m,marginTop:"40px !important",borderRadius:"md",borderWidth:"1px",position:"absolute",zIndex:"1",backgroundColor:"white",_dark:{backgroundColor:"gray.700"},display:c?"unset":"none",children:r(eo,{onChange:z=>$(z),children:[r(to,{children:[e(rr,{fontSize:A,children:s("userDialog.relative")}),e(rr,{fontSize:A,children:s("userDialog.absolute")})]}),r(ro,{children:[e(nr,{children:u.map(z=>e(N,{alignItems:"start",pl:2,pr:2,children:r(_,{justifyItems:"flex-start",mb:4,children:[e(h,{fontSize:A,minW:"60px",children:s("userDialog."+z.title)}),z.options.map(P=>e(fr,{border:!0,...C({value:P}),children:P},P+".custom"))]})},z.title))}),e(nr,{className:"datepicker-panel",children:e(N,{children:e(jr,{locale:i.language.toLocaleLowerCase(),selected:Y,onChange:J,startDate:Y,endDate:L,selectsRange:!0,maxDate:new Date,monthsShown:I,peekNextMonth:!1,inline:!0})})})]})]})})]})};function zt(t,n,o=[],s=[]){const i=re(o.reduce((a,l)=>a+=l,0));return{series:o,options:{labels:s,chart:{width:"100%",height:"100%",type:"donut",animations:{enabled:!1}},title:{text:`${n}${i}`,align:"center",style:{fontWeight:"var(--chakra-fontWeights-medium)",color:t==="dark"?"var(--chakra-colors-gray-300)":void 0}},legend:{position:"bottom",labels:{colors:t==="dark"?"#CBD5E0":void 0,useSeriesColors:!1}},stroke:{width:1,colors:void 0},dataLabels:{formatter:(a,{seriesIndex:l,w:u})=>re(u.config.series[l],1)},tooltip:{custom:({series:a,seriesIndex:l,dataPointIndex:u,w:p})=>{const C=re(a[l],1),d=Math.max(a.reduce((w,v)=>w+=v),1),c=Math.round(a[l]/d*1e3)/10+"%";return`
{o(S).then(T=>{const g=[],b=[];for(const W in T.usages){const $=T.usages[W];b.push($.uplink+$.downlink),g.push($.node_name)}C(It(l,u,b,g))})};f.exports.useEffect(()=>{t&&w({start:B().utc().subtract(30,"day").format("YYYY-MM-DDTHH:00:00")})},[t]);const v=()=>{n(!1),c("1m")},m=i;return r(oe,{isOpen:t,onClose:v,size:"2xl",children:[e(se,{bg:"blackAlpha.300",backdropFilter:"blur(10px)"}),r(ae,{mx:"3",w:"full",children:[e(ie,{pt:6,children:r(_,{gap:2,children:[e(de,{color:"primary",children:e(Gs,{color:"white"})}),e(h,{fontWeight:"semibold",fontSize:"lg",children:s("header.nodesUsage")})]})}),e(le,{mt:3,disabled:m}),e(ce,{children:r(N,{gap:4,children:[e(on,{defaultValue:d,onChange:(S,T)=>{c(S),w(T)}}),e(D,{justifySelf:"center",w:"full",maxW:"300px",mt:"4",children:e(f.exports.Suspense,{fallback:e(Dr,{isIndeterminate:!0}),children:e(Hr,{options:p.options,series:p.series,type:"donut",height:"500px"})})})]})}),e(Re,{mt:"3"})]})]})},br=y(oo),Zs=y(Or,{baseStyle:{w:6,h:6,color:"gray.600",_dark:{color:"white"}}}),Qs=y(so,{baseStyle:{w:6,h:6,color:"gray.600",_dark:{color:"white"}}}),qs=y(Br,{baseStyle:{w:5,h:5}}),Xs=()=>{const{QRcodeLinks:t,setQRCode:n,setSubLink:o,subscribeUrl:s}=E(),i=t!==null,[a,l]=f.exports.useState(0),{t:u}=j(),p=()=>{n(null),o(null)},C=String(s).startsWith("/")?window.location.origin+s:String(s);return r(oe,{isOpen:i,onClose:p,children:[e(se,{bg:"blackAlpha.300",backdropFilter:"blur(10px)"}),r(ae,{mx:"3",w:"fit-content",maxW:"3xl",children:[e(ie,{pt:6,children:e(de,{color:"primary",children:e(qs,{color:"white"})})}),e(le,{mt:3}),t&&r(ce,{gap:{base:"20px",lg:"50px"},pr:{lg:"60px"},px:{base:"50px"},display:"flex",justifyContent:"center",flexDirection:{base:"column",lg:"row"},children:[s&&r(N,{children:[e(br,{mx:"auto",size:300,p:"2",level:"L",includeMargin:!1,value:C,bg:"white"}),e(h,{display:"block",textAlign:"center",pb:3,mt:1,children:u("qrcodeDialog.sublink")})]}),r(D,{w:"300px",children:[e(ao,{centerPadding:"0px",centerMode:!0,slidesToShow:1,slidesToScroll:1,dots:!1,afterChange:l,onInit:()=>l(0),nextArrow:e(Z,{size:"sm",position:"absolute",display:"flex !important",_before:{content:'""'},"aria-label":"next",mr:"-4",children:e(Zs,{})}),prevArrow:e(Z,{size:"sm",position:"absolute",display:"flex !important",_before:{content:'""'},"aria-label":"prev",ml:"-4",children:e(Qs,{})}),children:t.map((d,c)=>e(_,{children:e(br,{mx:"auto",size:300,p:"2",level:"L",includeMargin:!1,value:d,bg:"white"})},c))}),r(h,{display:"block",textAlign:"center",pb:3,mt:1,children:[a+1," / ",t.length]})]})]})]})]})},Js=y(Mr,{baseStyle:{w:5,h:5}}),Ks=()=>{const[t,n]=f.exports.useState(!1),{isResetingAllUsage:o,onResetAllUsage:s,resetAllUsage:i}=E(),{t:a}=j(),l=fe(),u=()=>{s(!1)},p=()=>{n(!0),i().then(()=>{l({title:a("resetAllUsage.success"),status:"success",isClosable:!0,position:"top",duration:3e3})}).catch(()=>{l({title:a("resetAllUsage.error"),status:"error",isClosable:!0,position:"top",duration:3e3})}).finally(()=>{n(!1)})};return r(oe,{isCentered:!0,isOpen:o,onClose:u,size:"sm",children:[e(se,{bg:"blackAlpha.300",backdropFilter:"blur(10px)"}),r(ae,{mx:"3",children:[e(ie,{pt:6,children:e(de,{color:"red",children:e(Js,{})})}),e(le,{mt:3}),r(ce,{children:[e(h,{fontWeight:"semibold",fontSize:"lg",children:a("resetAllUsage.title")}),o&&e(h,{mt:1,fontSize:"sm",_dark:{color:"gray.400"},color:"gray.600",children:a("resetAllUsage.prompt")})]}),r(Re,{display:"flex",children:[e(F,{size:"sm",onClick:u,mr:3,w:"full",variant:"outline",children:a("cancel")}),e(F,{size:"sm",w:"full",colorScheme:"red",onClick:p,leftIcon:t?e(Ne,{size:"xs"}):void 0,children:a("reset")})]})]})]})},ea=y(Et,{baseStyle:{w:5,h:5}}),ta=()=>{const[t,n]=f.exports.useState(!1),{resetUsageUser:o,resetDataUsage:s}=E(),{t:i}=j(),a=fe(),l=()=>{E.setState({resetUsageUser:null})},u=()=>{o&&(n(!0),s(o).then(()=>{a({title:i("resetUserUsage.success",{username:o.username}),status:"success",isClosable:!0,position:"top",duration:3e3})}).catch(()=>{a({title:i("resetUserUsage.error"),status:"error",isClosable:!0,position:"top",duration:3e3})}).finally(()=>{n(!1)}))};return r(oe,{isCentered:!0,isOpen:!!o,onClose:l,size:"sm",children:[e(se,{bg:"blackAlpha.300",backdropFilter:"blur(10px)"}),r(ae,{mx:"3",children:[e(ie,{pt:6,children:e(de,{color:"blue",children:e(ea,{})})}),e(le,{mt:3}),r(ce,{children:[e(h,{fontWeight:"semibold",fontSize:"lg",children:i("resetUserUsage.title")}),o&&e(h,{mt:1,fontSize:"sm",_dark:{color:"gray.400"},color:"gray.600",children:e(Ee,{components:{b:e("b",{})},children:i("resetUserUsage.prompt",{username:o.username})})})]}),r(Re,{display:"flex",children:[e(F,{size:"sm",onClick:l,mr:3,w:"full",variant:"outline",children:i("cancel")}),e(F,{size:"sm",w:"full",colorScheme:"blue",onClick:u,leftIcon:t?e(Ne,{size:"xs"}):void 0,children:i("reset")})]})]})]})},ra=y(Et,{baseStyle:{w:5,h:5}}),na=()=>{const[t,n]=f.exports.useState(!1),{revokeSubscriptionUser:o,revokeSubscription:s}=E(),{t:i}=j(),a=fe(),l=()=>{E.setState({revokeSubscriptionUser:null})},u=()=>{o&&(n(!0),s(o).then(()=>{a({title:i("revokeUserSub.success",{username:o.username}),status:"success",isClosable:!0,position:"top",duration:3e3})}).catch(()=>{a({title:i("revokeUserSub.error"),status:"error",isClosable:!0,position:"top",duration:3e3})}).finally(()=>{n(!1)}))};return r(oe,{isCentered:!0,isOpen:!!o,onClose:l,size:"sm",children:[e(se,{bg:"blackAlpha.300",backdropFilter:"blur(10px)"}),r(ae,{mx:"3",children:[e(ie,{pt:6,children:e(de,{color:"blue",children:e(ra,{})})}),e(le,{mt:3}),r(ce,{children:[e(h,{fontWeight:"semibold",fontSize:"lg",children:i("revokeUserSub.title")}),o&&e(h,{mt:1,fontSize:"sm",_dark:{color:"gray.400"},color:"gray.600",children:e(Ee,{components:{b:e("b",{})},children:i("revokeUserSub.prompt",{username:o.username})})})]}),r(Re,{display:"flex",children:[e(F,{size:"sm",onClick:l,mr:3,w:"full",variant:"outline",children:i("cancel")}),e(F,{size:"sm",w:"full",colorScheme:"blue",onClick:u,leftIcon:t?e(Ne,{size:"xs"}):void 0,children:i("revoke")})]})]})]})},oa=y(io,{baseStyle:{strokeWidth:"2px",w:5,h:5}}),sa=({inbound:t,...n})=>{const{getCheckboxProps:o,getInputProps:s,getLabelProps:i,htmlProps:a}=Vr(n),l=s();return r(D,{as:"label",children:[e("input",{...l}),r(D,{w:"fll",position:"relative",...a,cursor:"pointer",borderRadius:"sm",border:"1px solid",borderColor:"gray.200",_dark:{borderColor:"gray.600"},display:"flex",alignItems:"center",justifyContent:"space-between",overflow:"hidden",_checked:{bg:"gray.50",outline:"2px",boxShadow:"outline",outlineColor:"primary.500",borderColor:"transparent",fontWeight:"medium",_dark:{bg:"gray.750",borderColor:"transparent"},"& p":{opacity:1}},__css:{"& p":{opacity:.8}},textTransform:"capitalize",px:3,py:2,fontWeight:"medium",...o(),children:[e(at,{size:"sm",w:"full",maxW:"full",color:"gray.700",_dark:{color:"gray.300"},textTransform:"uppercase",colorScheme:"primary",className:"inbound-item",isChecked:l.checked,pointerEvents:"none",flexGrow:1,children:e(_,{justify:"space-between",w:"full",maxW:"calc(100% - 20px)",spacing:0,gap:2,overflow:"hidden",children:r(h,{isTruncated:!0,...i(),fontSize:"xs",children:[t.tag," ",r(h,{as:"span",children:["(",t.network,")"]})]})})}),t.tls&&t.tls!="none"&&e(U,{fontSize:"xs",opacity:".8",size:"xs",children:t.tls})]})]})},aa=({disabled:t,title:n,description:o,toggleAccordion:s,isSelected:i,...a})=>{const l=Vt(),{inbounds:u}=E(),{getCheckboxProps:p,getInputProps:C,getLabelProps:d,htmlProps:c}=Vr(a),w=C(),[v]=Gr({name:[`inbounds.${n}`],control:l.control}),{getCheckboxProps:m}=$r({value:v,onChange:b=>{if(l.setValue(`inbounds.${n}`,b),b.length===0){const W=l.getValues("selected_proxies");l.setValue("selected_proxies",W.filter($=>$!==n)),s()}}}),S=v&&i&&(E.getState().inbounds.get(n)||[]).length!==v.length,T=(E.getState().inbounds.get(n)||[]).length>0,g=!i&&!T;return r(He,{isDisabled:!T,borderRadius:"md",borderStyle:"solid",border:"1px",borderColor:"gray.200",bg:g?"gray.100":"transparent",_dark:{borderColor:"gray.600",bg:g?"#364154":"transparent"},_checked:{bg:"gray.50",outline:"2px",boxShadow:"outline",outlineColor:"primary.500",borderColor:"transparent"},...p(),children:[r(D,{as:g?"span":"label",position:"relative",children:[S&&e(D,{position:"absolute",w:"2",h:"2",bg:"yellow.500",top:"-1",right:"-1",rounded:"full",zIndex:999}),e("input",{...w}),r(D,{w:"fll",position:"relative",...c,borderRadius:"md",cursor:g?"not-allowed":"pointer",_checked:{fontWeight:"medium",_dark:{bg:"gray.750",borderColor:"transparent"},"& > svg":{opacity:1,"&.checked":{display:"block"},"&.unchecked":{display:"none"}},"& p":{opacity:1}},__css:{"& > svg":{opacity:.3,"&.checked":{display:"none"},"&.unchecked":{display:"block"}},"& p":{opacity:.8}},textTransform:"capitalize",px:3,py:2,fontWeight:"medium",...p(),children:[e(Be,{display:w.checked&&T?"block":"none",as:"span",className:"checked",color:"primary.200",position:"absolute",right:"3",top:"3",w:"auto",p:0,onClick:s,children:e(Z,{size:"sm","aria-label":"inbound settings",children:e(oa,{})})}),e(h,{fontSize:"sm",color:g?"gray.400":"gray.700",_dark:{color:g?"gray.500":"gray.300"},...d(),children:n}),e(h,{fontWeight:"medium",color:g?"gray.400":"gray.600",_dark:{color:g?"gray.500":"gray.400"},fontSize:"xs",children:o})]})]}),e($e,{px:2,pb:3,roundedBottom:"5px",pt:3,_dark:{bg:w.checked&&"gray.750"},children:r(N,{w:"full",rowGap:2,borderStyle:"solid",borderWidth:"1px",borderRadius:"md",pl:3,pr:3,pt:1.5,_dark:{bg:"gray.700"},children:[r(N,{alignItems:"flex-start",w:"full",children:[e(h,{fontSize:"sm",children:X("inbound")}),e(Yt,{gap:2,alignItems:"flex-start",w:"full",columns:1,spacing:1,children:(u.get(n)||[]).map(b=>e(sa,{...m({value:b.tag}),inbound:b},b.tag))})]}),n==="vmess"&&i&&e(N,{alignItems:"flex-start",w:"full",children:r(R,{height:"66px",children:[e(h,{fontSize:"sm",pb:1,children:"ID"}),e(je,{fontSize:"xs",size:"sm",borderRadius:"6px",pl:2,pr:2,placeholder:X("userDialog.generatedByDefault"),...l.register("proxies.vmess.id")})]})}),n==="vless"&&i&&r(N,{alignItems:"flex-start",w:"full",children:[r(R,{height:"66px",children:[e(h,{fontSize:"sm",pb:1,children:"ID"}),e(je,{fontSize:"xs",size:"sm",borderRadius:"6px",pl:2,pr:2,placeholder:X("userDialog.generatedByDefault"),...l.register("proxies.vless.id")})]}),r(R,{height:"66px",children:[e(h,{fontSize:"sm",pb:1,children:"Flow"}),e(Me,{fontSize:"xs",size:"sm",borderRadius:"6px",...l.register("proxies.vless.flow"),children:Is.map(b=>e("option",{value:b.value,children:b.title},b.title))})]})]}),n==="trojan"&&i&&e(N,{alignItems:"flex-start",w:"full",children:r(R,{height:"66px",children:[e(h,{fontSize:"sm",pb:1,children:X("password")}),e(je,{fontSize:"xs",size:"sm",borderRadius:"6px",pl:2,pr:2,placeholder:X("userDialog.generatedByDefault"),...l.register("proxies.trojan.password")})]})}),n==="shadowsocks"&&i&&r(N,{alignItems:"flex-start",w:"full",children:[r(R,{height:"66px",children:[e(h,{fontSize:"sm",pb:1,children:X("password")}),e(je,{fontSize:"xs",size:"sm",borderRadius:"6px",pl:2,pr:2,placeholder:X("userDialog.generatedByDefault"),...l.register("proxies.shadowsocks.password")})]}),r(R,{height:"66px",children:[e(h,{fontSize:"sm",pb:1,children:X("userDialog.method")}),e(Me,{fontSize:"xs",size:"sm",borderRadius:"6px",...l.register("proxies.shadowsocks.method"),children:zs.map(b=>e("option",{value:b,children:b},b))})]})]})]})})]})},ia=f.exports.forwardRef(({name:t,list:n,onChange:o,disabled:s,...i},a)=>{const l=Vt(),[u,p]=f.exports.useState([]),C=c=>{u.includes(c)?u.splice(u.indexOf(c),1):u.push(c),p([...u])},{getCheckboxProps:d}=$r({value:i.value,onChange:c=>{var v;const w=c.filter(m=>!i.value.includes(m));w[0]&&l.setValue(`inbounds.${w[0]}`,(v=E.getState().inbounds.get(w[0]))==null?void 0:v.map(m=>m.tag)),p(u.filter(m=>c.find(S=>S===n[m].title))),o({target:{value:c,name:t}})}});return e(pt,{allowToggle:!0,index:u,children:e(Yt,{ref:a,gap:2,alignItems:"flex-start",columns:1,spacing:1,children:n.map((c,w)=>e(aa,{toggleAccordion:C.bind(null,w),disabled:s,title:c.title,description:c.description,isSelected:!!i.value.find(v=>v===c.title),...d({value:c.title})},c.title))})})}),la=y(lo,{baseStyle:{w:5,h:5}}),ca=y(Yr,{baseStyle:{w:5,h:5}}),da=y(Dt,{baseStyle:{w:5,h:5}}),ha=t=>({...t,data_limit:t.data_limit?Number((t.data_limit/1073741824).toFixed(5)):t.data_limit,on_hold_expire_duration:t.on_hold_expire_duration?Number(t.on_hold_expire_duration/(24*60*60)):t.on_hold_expire_duration,selected_proxies:Object.keys(t.proxies)}),At=()=>{const t=Object.fromEntries(E.getState().inbounds),n={};for(const o in t)n[o]=t[o].map(s=>s.tag);return{selected_proxies:Object.keys(t),data_limit:null,expire:null,username:"",data_limit_reset_strategy:"no_reset",status:"active",on_hold_expire_duration:null,note:"",inbounds:n,proxies:{vless:{id:"",flow:""},vmess:{id:""},trojan:{password:""},shadowsocks:{password:"",method:"chacha20-ietf-poly1305"}}}},ua=(t,n)=>{const o=t.reduce((s,i)=>({...s,[i]:{}}),{});return n&&t.forEach(s=>{n[s]&&(o[s]=n[s])}),o},Mt={username:x.string().min(1,{message:"Required"}),selected_proxies:x.array(x.string()).refine(t=>t.length>0,{message:"userDialog.selectOneProtocol"}),note:x.string().nullable(),proxies:x.record(x.string(),x.record(x.string(),x.any())).transform(t=>{const n=(o,s)=>{o&&o[s]===""&&delete o[s]};return n(t.vmess,"id"),n(t.vless,"id"),n(t.trojan,"password"),n(t.shadowsocks,"password"),n(t.shadowsocks,"method"),t}),data_limit:x.string().min(0).or(x.number()).nullable().transform(t=>t?Number((parseFloat(String(t))*1073741824).toFixed(5)):0),expire:x.number().nullable(),data_limit_reset_strategy:x.string(),inbounds:x.record(x.string(),x.array(x.string())).transform(t=>(Object.keys(t).forEach(n=>{var o;Array.isArray(t[n])&&!((o=t[n])!=null&&o.length)&&delete t[n]}),t))},pa=x.discriminatedUnion("status",[x.object({status:x.literal("active"),...Mt}),x.object({status:x.literal("disabled"),...Mt}),x.object({status:x.literal("on_hold"),on_hold_expire_duration:x.coerce.number().min(.1,"Required").transform(t=>t*(24*60*60)),...Mt})]),ma=()=>{var Ye,Ze,Qe,qe,Xe;const{editingUser:t,isCreatingNewUser:n,onCreateUser:o,editUser:s,fetchUserUsage:i,onEditingUser:a,createUser:l,onDeletingUser:u}=E(),p=!!t,C=n||p,[d,c]=f.exports.useState(!1),[w,v]=f.exports.useState(""),m=fe(),{t:S,i18n:T}=j(),{colorMode:g}=ht(),[b,W]=f.exports.useState(!1),$=()=>{W(k=>!k)},I=Ve({defaultValues:At(),resolver:ut(pa)});f.exports.useEffect(()=>E.subscribe(k=>k.inbounds,()=>{I.reset(At())}),[]);const[A,Y]=Gr({control:I.control,name:["data_limit","status"]}),q=S("userDialog.total"),[L,V]=f.exports.useState(It(g,q)),[J,z]=f.exports.useState("1m"),P=k=>{i(t,k).then(M=>{const te=[],xe=[];for(const he in M.usages)xe.push(M.usages[he].used_traffic),te.push(M.usages[he].node_name);V(It(g,q,xe,te))})};f.exports.useEffect(()=>{t&&(I.reset(ha(t)),P({start:B().utc().subtract(30,"day").format("YYYY-MM-DDTHH:00:00")}))},[t]);const K=k=>{c(!0);const M={edited:s,created:l},te=p?"edited":"created";v(null);const{selected_proxies:xe,...he}=k;let ye={...he,data_limit:k.data_limit,proxies:ua(xe,k.proxies),data_limit_reset_strategy:k.data_limit&&k.data_limit>0?k.data_limit_reset_strategy:"no_reset",status:k.status==="active"||k.status==="disabled"||k.status==="on_hold"?k.status:"active"};M[te](ye).then(()=>{m({title:S(p?"userDialog.userEdited":"userDialog.userCreated",{username:k.username}),status:"success",isClosable:!0,position:"top",duration:3e3}),Fe()}).catch(G=>{var Je,Ke,et,tt,Q;(((Je=G==null?void 0:G.response)==null?void 0:Je.status)===409||((Ke=G==null?void 0:G.response)==null?void 0:Ke.status)===400)&&v((tt=(et=G==null?void 0:G.response)==null?void 0:et._data)==null?void 0:tt.detail),((Q=G==null?void 0:G.response)==null?void 0:Q.status)===422&&Object.keys(G.response._data.detail).forEach(We=>{v(G==null?void 0:G.response._data.detail[We]),I.setError(We,{type:"custom",message:G.response._data.detail[We]})})}).finally(()=>{c(!1)})},Fe=()=>{I.reset(At()),o(!1),a(null),v(null),W(!1),z("1m")},bt=()=>{E.setState({resetUsageUser:t})},xt=()=>{E.setState({revokeSubscriptionUser:t})},ee=d,Pe=Y==="on_hold";return r(oe,{isOpen:C,onClose:Fe,size:"2xl",children:[e(se,{bg:"blackAlpha.300",backdropFilter:"blur(10px)"}),e(Nr,{...I,children:e(ae,{mx:"3",children:r("form",{onSubmit:I.handleSubmit(K),children:[e(ie,{pt:6,children:r(_,{gap:2,children:[e(de,{color:"primary",children:p?e(ca,{color:"white"}):e(la,{color:"white"})}),e(h,{fontWeight:"semibold",fontSize:"lg",children:S(p?"userDialog.editUserTitle":"createNewUser")})]})}),e(le,{mt:3,disabled:ee}),r(ce,{children:[r(Ur,{templateColumns:{base:"repeat(1, 1fr)",md:"repeat(2, 1fr)"},gap:3,children:[e(st,{children:r(N,{justifyContent:"space-between",children:[r(or,{flexDirection:"column",gridAutoRows:"min-content",w:"full",children:[r(or,{flexDirection:"row",w:"full",gap:2,children:[r(R,{mb:"10px",children:[e(H,{children:S("username")}),r(_,{children:[e(Ue,{size:"sm",type:"text",borderRadius:"6px",error:(Ye=I.formState.errors.username)==null?void 0:Ye.message,disabled:ee||p,...I.register("username")}),p&&e(_,{px:1,children:e(pe,{name:"status",control:I.control,render:({field:k})=>e(ne,{placement:"top",label:"status: "+S(k.value),textTransform:"capitalize",children:e(D,{children:e(_t,{colorScheme:"primary",isChecked:k.value==="active",onChange:M=>{M.target.checked?k.onChange("active"):k.onChange("disabled")}})})})})})]})]}),!p&&r(R,{flex:"1",children:[e(H,{whiteSpace:"nowrap",children:S("userDialog.onHold")}),e(pe,{name:"status",control:I.control,render:({field:k})=>{const M=k.value;return e(ge,{children:M?e(_t,{colorScheme:"primary",isChecked:M==="on_hold",onChange:te=>{te.target.checked?k.onChange("on_hold"):k.onChange("active")}}):""})}})]})]}),r(R,{mb:"10px",children:[e(H,{children:S("userDialog.dataLimit")}),e(pe,{control:I.control,name:"data_limit",render:({field:k})=>{var M;return e(Ue,{endAdornment:"GB",type:"number",size:"sm",borderRadius:"6px",onChange:k.onChange,disabled:ee,error:(M=I.formState.errors.data_limit)==null?void 0:M.message,value:k.value?String(k.value):""})}})]}),e(Wr,{in:!!(A&&A>0),animateOpacity:!0,style:{width:"100%"},children:r(R,{height:"66px",children:[e(H,{children:S("userDialog.periodicUsageReset")}),e(pe,{control:I.control,name:"data_limit_reset_strategy",render:({field:k})=>e(Me,{size:"sm",...k,disabled:ee,bg:ee?"gray.100":"transparent",_dark:{bg:ee?"gray.600":"transparent"},children:jt.map(M=>e("option",{value:M.value,children:S("userDialog.resetStrategy"+M.title)},M.value))})})]})}),r(R,{mb:"10px",children:[e(H,{children:S(Pe?"userDialog.onHoldExpireDuration":"userDialog.expiryDate")}),Pe&&e(pe,{control:I.control,name:"on_hold_expire_duration",render:({field:k})=>{var M;return e(Ue,{endAdornment:"Days",type:"number",size:"sm",borderRadius:"6px",onChange:te=>{I.setValue("expire",null),k.onChange({target:{value:te}})},disabled:ee,error:(M=I.formState.errors.on_hold_expire_duration)==null?void 0:M.message,value:k.value?String(k.value):""})}}),!Pe&&e(pe,{name:"expire",control:I.control,render:({field:k})=>{var he;function M(ye){return B(B(ye*1e3).utc()).toDate()}const{status:te,time:xe}=Xt(k.value);return r(ge,{children:[e(jr,{locale:T.language.toLocaleLowerCase(),dateFormat:S("dateFormat"),minDate:new Date,selected:k.value?M(k.value):void 0,onChange:ye=>{I.setValue("on_hold_expire_duration",null),k.onChange({target:{value:ye?B(B(ye).set("hour",23).set("minute",59).set("second",59)).utc().valueOf()/1e3:0,name:"expire"}})},customInput:e(Ue,{size:"sm",type:"text",borderRadius:"6px",clearable:!0,disabled:ee,error:(he=I.formState.errors.expire)==null?void 0:he.message})}),k.value?e(co,{children:S(te,{time:xe})}):""]})}})]}),r(R,{mb:"10px",isInvalid:!!I.formState.errors.note,children:[e(H,{children:S("userDialog.note")}),e(ho,{...I.register("note")}),e(wt,{children:(Qe=(Ze=I.formState.errors)==null?void 0:Ze.note)==null?void 0:Qe.message})]})]}),w&&r(ct,{status:"error",display:{base:"none",md:"flex"},children:[e(kt,{}),w]})]})}),e(st,{children:r(R,{isInvalid:!!((qe=I.formState.errors.selected_proxies)!=null&&qe.message),children:[e(H,{children:S("userDialog.protocols")}),e(pe,{control:I.control,name:"selected_proxies",render:({field:k})=>e(ia,{list:[{title:"vmess",description:S("userDialog.vmessDesc")},{title:"vless",description:S("userDialog.vlessDesc")},{title:"trojan",description:S("userDialog.trojanDesc")},{title:"shadowsocks",description:S("userDialog.shadowsocksDesc")}],disabled:ee,...k})}),e(wt,{children:S((Xe=I.formState.errors.selected_proxies)==null?void 0:Xe.message)})]})}),p&&b&&e(st,{pt:6,colSpan:{base:1,md:2},children:r(N,{gap:4,children:[e(on,{defaultValue:J,onChange:(k,M)=>{z(k),P(M)}}),e(D,{width:{base:"100%",md:"70%"},justifySelf:"center",children:e(Hr,{options:L.options,series:L.series,type:"donut"})})]})})]}),w&&r(ct,{mt:"3",status:"error",display:{base:"flex",md:"none"},children:[e(kt,{}),w]})]}),e(Re,{mt:"3",children:r(_,{justifyContent:"space-between",w:"full",gap:3,flexDirection:{base:"column",sm:"row"},children:[e(_,{justifyContent:"flex-start",w:{base:"full",sm:"unset"},children:p&&r(ge,{children:[e(ne,{label:S("delete"),placement:"top",children:e(Z,{"aria-label":"Delete",size:"sm",onClick:()=>{u(t),Fe()},children:e(mt,{})})}),e(ne,{label:S("userDialog.usage"),placement:"top",children:e(Z,{"aria-label":"usage",size:"sm",onClick:$,children:e(da,{})})}),e(F,{onClick:bt,size:"sm",children:S("userDialog.resetUsage")}),e(F,{onClick:xt,size:"sm",children:S("userDialog.revokeSubscription")})]})}),e(_,{w:"full",maxW:{md:"50%",base:"full"},justify:"end",children:e(F,{type:"submit",size:"sm",px:"8",colorScheme:"primary",leftIcon:d?e(Ne,{size:"xs"}):void 0,disabled:ee,children:S(p?"userDialog.editUser":"createUser")})})]})})]})})})]})},ga=t=>f.exports.createElement("svg",{xmlns:"http://www.w3.org/2000/svg","data-name":"Layer 1",width:782.04441,height:701.88002,viewBox:"0 0 782.04441 701.88002",xmlnsXlink:"http://www.w3.org/1999/xlink",...t},f.exports.createElement("path",{d:"M609.48783,100.59015l-25.44631,6.56209L270.53735,187.9987,245.091,194.56079A48.17927,48.17927,0,0,0,210.508,253.17865L320.849,681.05606a48.17924,48.17924,0,0,0,58.61776,34.58317l.06572-.01695,364.26536-93.93675.06572-.01695a48.17923,48.17923,0,0,0,34.58309-58.6178l-110.341-427.87741A48.17928,48.17928,0,0,0,609.48783,100.59015Z",transform:"translate(-208.9778 -99.05999)",fill:"#f2f2f2"}),f.exports.createElement("path",{d:"M612.94784,114.00532l-30.13945,7.77236L278.68955,200.20385l-30.139,7.77223a34.30949,34.30949,0,0,0-24.6275,41.74308l110.341,427.87741a34.30946,34.30946,0,0,0,41.7431,24.62736l.06572-.01695,364.26536-93.93674.06619-.01707a34.30935,34.30935,0,0,0,24.627-41.7429l-110.341-427.87741A34.30938,34.30938,0,0,0,612.94784,114.00532Z",transform:"translate(-208.9778 -99.05999)",fill:"#fff"}),f.exports.createElement("path",{d:"M590.19,252.56327,405.917,300.08359a8.01411,8.01411,0,0,1-4.00241-15.52046l184.273-47.52033A8.01412,8.01412,0,0,1,590.19,252.56327Z",transform:"translate(-208.9778 -99.05999)",fill:"#f2f2f2"}),f.exports.createElement("path",{d:"M628.955,270.49906,412.671,326.27437a8.01411,8.01411,0,1,1-4.00241-15.52046l216.284-55.77531a8.01411,8.01411,0,0,1,4.00242,15.52046Z",transform:"translate(-208.9778 -99.05999)",fill:"#f2f2f2"}),f.exports.createElement("path",{d:"M620.45825,369.93676l-184.273,47.52032a8.01411,8.01411,0,1,1-4.00242-15.52046l184.273-47.52032a8.01411,8.01411,0,1,1,4.00241,15.52046Z",transform:"translate(-208.9778 -99.05999)",fill:"#f2f2f2"}),f.exports.createElement("path",{d:"M659.22329,387.87255l-216.284,55.77531a8.01411,8.01411,0,1,1-4.00242-15.52046l216.284-55.77531a8.01411,8.01411,0,0,1,4.00242,15.52046Z",transform:"translate(-208.9778 -99.05999)",fill:"#f2f2f2"}),f.exports.createElement("path",{d:"M650.72653,487.31025l-184.273,47.52033a8.01412,8.01412,0,0,1-4.00242-15.52047l184.273-47.52032a8.01411,8.01411,0,0,1,4.00242,15.52046Z",transform:"translate(-208.9778 -99.05999)",fill:"#f2f2f2"}),f.exports.createElement("path",{d:"M689.49156,505.246l-216.284,55.77532a8.01412,8.01412,0,1,1-4.00241-15.52047l216.284-55.77531a8.01411,8.01411,0,0,1,4.00242,15.52046Z",transform:"translate(-208.9778 -99.05999)",fill:"#f2f2f2"}),f.exports.createElement("path",{d:"M374.45884,348.80871l-65.21246,16.817a3.847,3.847,0,0,1-4.68062-2.76146L289.5963,304.81607a3.847,3.847,0,0,1,2.76145-4.68061l65.21247-16.817a3.847,3.847,0,0,1,4.68061,2.76145l14.96947,58.04817A3.847,3.847,0,0,1,374.45884,348.80871Z",transform:"translate(-208.9778 -99.05999)",fill:"#e6e6e6"}),f.exports.createElement("path",{d:"M404.72712,466.1822l-65.21247,16.817a3.847,3.847,0,0,1-4.68062-2.76146l-14.96946-58.04816A3.847,3.847,0,0,1,322.626,417.509l65.21246-16.817a3.847,3.847,0,0,1,4.68062,2.76145l14.96946,58.04817A3.847,3.847,0,0,1,404.72712,466.1822Z",transform:"translate(-208.9778 -99.05999)",fill:"#e6e6e6"}),f.exports.createElement("path",{d:"M434.99539,583.55569l-65.21246,16.817a3.847,3.847,0,0,1-4.68062-2.76145l-14.96946-58.04817a3.847,3.847,0,0,1,2.76145-4.68062l65.21247-16.817a3.847,3.847,0,0,1,4.68061,2.76146l14.96947,58.04816A3.847,3.847,0,0,1,434.99539,583.55569Z",transform:"translate(-208.9778 -99.05999)",fill:"#e6e6e6"}),f.exports.createElement("path",{d:"M863.63647,209.0517H487.31811a48.17928,48.17928,0,0,0-48.125,48.12512V699.05261a48.17924,48.17924,0,0,0,48.125,48.12507H863.63647a48.17924,48.17924,0,0,0,48.125-48.12507V257.17682A48.17928,48.17928,0,0,0,863.63647,209.0517Z",transform:"translate(-208.9778 -99.05999)",fill:"#e6e6e6"}),f.exports.createElement("path",{d:"M863.637,222.90589H487.31811a34.30948,34.30948,0,0,0-34.271,34.27093V699.05261a34.30947,34.30947,0,0,0,34.271,34.27088H863.637a34.30936,34.30936,0,0,0,34.27051-34.27088V257.17682A34.30937,34.30937,0,0,0,863.637,222.90589Z",transform:"translate(-208.9778 -99.05999)",fill:"#fff"}),f.exports.createElement("circle",{cx:694.19401,cy:614.02963,r:87.85039,fill:"#3182CE"}),f.exports.createElement("path",{d:"M945.18722,701.63087H914.63056V671.07421a11.45875,11.45875,0,0,0-22.9175,0v30.55666H861.1564a11.45875,11.45875,0,0,0,0,22.9175h30.55666V755.105a11.45875,11.45875,0,1,0,22.9175,0V724.54837h30.55666a11.45875,11.45875,0,0,0,0-22.9175Z",transform:"translate(-208.9778 -99.05999)",fill:"#fff"}),f.exports.createElement("path",{d:"M807.00068,465.71551H616.699a8.01412,8.01412,0,1,1,0-16.02823H807.00068a8.01412,8.01412,0,0,1,0,16.02823Z",transform:"translate(-208.9778 -99.05999)",fill:"#e6e6e6"}),f.exports.createElement("path",{d:"M840.05889,492.76314H616.699a8.01412,8.01412,0,1,1,0-16.02823H840.05889a8.01411,8.01411,0,1,1,0,16.02823Z",transform:"translate(-208.9778 -99.05999)",fill:"#e6e6e6"}),f.exports.createElement("path",{d:"M807.00068,586.929H616.699a8.01412,8.01412,0,1,1,0-16.02823H807.00068a8.01411,8.01411,0,0,1,0,16.02823Z",transform:"translate(-208.9778 -99.05999)",fill:"#e6e6e6"}),f.exports.createElement("path",{d:"M840.05889,613.97661H616.699a8.01412,8.01412,0,1,1,0-16.02823H840.05889a8.01412,8.01412,0,1,1,0,16.02823Z",transform:"translate(-208.9778 -99.05999)",fill:"#e6e6e6"}),f.exports.createElement("path",{d:"M574.07028,505.04162H506.72434a3.847,3.847,0,0,1-3.84278-3.84278V441.25158a3.847,3.847,0,0,1,3.84278-3.84278h67.34594a3.847,3.847,0,0,1,3.84278,3.84278v59.94726A3.847,3.847,0,0,1,574.07028,505.04162Z",transform:"translate(-208.9778 -99.05999)",fill:"#e6e6e6"}),f.exports.createElement("path",{d:"M574.07028,626.25509H506.72434a3.847,3.847,0,0,1-3.84278-3.84278V562.46505a3.847,3.847,0,0,1,3.84278-3.84278h67.34594a3.847,3.847,0,0,1,3.84278,3.84278v59.94726A3.847,3.847,0,0,1,574.07028,626.25509Z",transform:"translate(-208.9778 -99.05999)",fill:"#e6e6e6"}),f.exports.createElement("path",{d:"M807.21185,330.781H666.91017a8.01411,8.01411,0,0,1,0-16.02823H807.21185a8.01411,8.01411,0,0,1,0,16.02823Z",transform:"translate(-208.9778 -99.05999)",fill:"#ccc"}),f.exports.createElement("path",{d:"M840.27007,357.82862H666.91017a8.01411,8.01411,0,1,1,0-16.02822h173.3599a8.01411,8.01411,0,0,1,0,16.02822Z",transform:"translate(-208.9778 -99.05999)",fill:"#ccc"}),f.exports.createElement("path",{d:"M635.85911,390.6071H506.51316a3.847,3.847,0,0,1-3.84277-3.84277V285.81706a3.847,3.847,0,0,1,3.84277-3.84277H635.85911a3.847,3.847,0,0,1,3.84277,3.84277V386.76433A3.847,3.847,0,0,1,635.85911,390.6071Z",transform:"translate(-208.9778 -99.05999)",fill:"#ccc"})),fa=t=>{if(!t)return null;const n=new Date(t+"Z");return Math.floor(n.getTime()/1e3)},xr=({lastOnline:t})=>{const n=Math.floor(Date.now()/1e3),o=fa(t);if(typeof t>"u"||t===null)return e("div",{className:"circle pulse orange"});const s=o?n-o:1/0;return s>0&&s<=60?e("div",{className:"circle pulse green"}):e("div",{className:"circle pulse red"})},ba=t=>{if(!t)return null;const n=new Date(t+"Z");return Math.floor(n.getTime()/1e3)},yr=({lastOnline:t})=>{const n=Math.floor(Date.now()/1e3),o=ba(t),s=o?n-o:null,i=o?Xt(o):{status:"",time:"Not Connected Yet"};return e(h,{display:"inline-block",fontSize:"xs",fontWeight:"medium",ml:"2",color:"gray.600",_dark:{color:"gray.400"},children:s&&s<=60?"Online":s?`${i.time} ago`:i.time})},xa=y(uo,{baseStyle:{w:4,h:4}}),ya=y(po,{baseStyle:{w:4,h:4}}),Sr=5;function Sa(t,n,o){if(o0&&(i[0]=0,i[1]="prev-more"),i[i.length-1]{const{filters:t,onFilterChange:n,users:{total:o}}=E(),{limit:s,offset:i}=t,a=(i||0)/(s||1),l=Math.ceil(o/(s||1)),u=Sa(l,a,7),p=c=>{n({...t,offset:c*s})},C=c=>{n({...t,limit:parseInt(c.target.value)}),Vo(c.target.value)},{t:d}=j();return r(_,{justifyContent:"space-between",mt:4,w:"full",display:"flex",columnGap:{lg:4,md:0},rowGap:{md:0,base:4},flexDirection:{md:"row",base:"column"},children:[e(D,{order:{base:2,md:1},children:r(_,{children:[r(Me,{minW:"60px",value:s,onChange:C,size:"sm",rounded:"md",children:[e("option",{children:"10"}),e("option",{children:"20"}),e("option",{children:"30"})]}),e(h,{whiteSpace:"nowrap",fontSize:"sm",children:d("itemsPerPage")})]})}),r(mo,{size:"sm",isAttached:!0,variant:"outline",order:{base:1,md:2},children:[e(F,{leftIcon:e(xa,{}),onClick:p.bind(null,a-1),isDisabled:a===0||l===0,children:d("previous")}),u.map(c=>typeof c=="string"?e(F,{children:"..."},c):e(F,{variant:c===a?"solid":"outline",onClick:p.bind(null,c),children:c+1},c)),e(F,{rightIcon:e(ya,{}),onClick:p.bind(null,a+1),isDisabled:a+1===l||l===0,children:d("next")})]})]})},wa=y(ga),Ge={baseStyle:{w:{base:4,md:5},h:{base:4,md:5}}},_a=y(go,Ge),ka=y(Zr,Ge),Cr=y(fo,Ge),va=y($t,Ge),Ia=y(Br,Ge),za=y(Yr,Ge),Da=y(Zr,{baseStyle:{width:"15px",height:"15px"}}),Ea=t=>{for(var n=0;n{const{used:n,total:o,dataLimitResetStrategy:s,totalUsedTraffic:i}=t,a=o===0||o===null;return e(_,{justifyContent:"space-between",fontSize:"xs",fontWeight:"medium",color:"gray.600",_dark:{color:"gray.400"},children:r(h,{children:[re(n)," /"," ",a?e(h,{as:"span",fontFamily:"system-ui",children:"\u221E"}):re(o)]})})},wr=t=>{const{used:n,total:o,dataLimitResetStrategy:s,totalUsedTraffic:i,...a}=t,l=o===0||o===null,u=!l&&n/o*100>=100;return r(ge,{children:[e(bo,{orientation:"horizontal",value:l?100:Math.min(n/o*100,100),colorScheme:u?"red":"primary",...a,children:e(xo,{h:"6px",borderRadius:"full",children:e(yo,{borderRadius:"full"})})}),r(_,{justifyContent:"space-between",fontSize:"xs",fontWeight:"medium",color:"gray.600",_dark:{color:"gray.400"},children:[r(h,{children:[re(n)," /"," ",l?e(h,{as:"span",fontFamily:"system-ui",children:"\u221E"}):re(o)+(s&&s!=="no_reset"?" "+X("userDialog.resetStrategy"+Ea(s)):"")]}),r(h,{children:[X("usersTable.total"),": ",re(i)]})]})]})},ot=({sort:t,column:n})=>t.includes(n)?e(Da,{transform:t.startsWith("-")?void 0:"rotate(180deg)"}):null,Ra=t=>{const{filters:n,users:{users:o},users:s,onEditingUser:i,onFilterChange:a}=E(),{t:l}=j(),[u,p]=f.exports.useState(void 0),C=Ae({base:120,lg:72})||72,[d,c]=f.exports.useState(`${C}px`),w=Ae({base:!1,md:!0});f.exports.useEffect(()=>{const g=()=>{const b=document.querySelectorAll("#filters")[0];c(`${b.offsetHeight}px`)};window.addEventListener("scroll",g)},[]);const v=o.length!==s.total,m=g=>{let b=n.sort;b.includes(g)?b.startsWith("-")?b="-created_at":b="-"+g:b=g,a({sort:b})},S=g=>{a({status:g.target.value.length>0?g.target.value:void 0})},T=g=>{p(g===u?void 0:g)};return r(D,{id:"users-table",overflowX:{base:"unset",md:"unset"},children:[e(pt,{allowMultiple:!0,display:{base:"block",md:"none"},index:u,children:r(sr,{orientation:"vertical",zIndex:"docked",...t,children:[e(ar,{zIndex:"docked",position:"relative",children:r(Oe,{children:[e(ze,{position:"sticky",top:d,minW:"120px",pl:4,pr:4,cursor:"pointer",onClick:m.bind(null,"username"),children:r(_,{children:[e("span",{children:l("users")}),e(ot,{sort:n.sort,column:"username"})]})}),e(ze,{position:"sticky",top:d,minW:"50px",pl:0,pr:0,w:"140px",cursor:"pointer",children:r(_,{spacing:0,position:"relative",children:[r(h,{position:"absolute",_dark:{bg:"gray.750"},_light:{bg:"#F9FAFB"},userSelect:"none",pointerEvents:"none",zIndex:1,w:"100%",children:[l("usersTable.status"),n.status?": "+n.status:""]}),r(Me,{value:n.sort,fontSize:"xs",fontWeight:"extrabold",textTransform:"uppercase",cursor:"pointer",p:0,border:0,h:"auto",w:"auto",icon:e(ge,{}),_focusVisible:{border:"0 !important"},onChange:S,children:[e("option",{}),e("option",{children:"active"}),e("option",{children:"on_hold"}),e("option",{children:"disabled"}),e("option",{children:"limited"}),e("option",{children:"expired"})]})]})}),e(ze,{position:"sticky",top:d,minW:"100px",cursor:"pointer",pr:0,onClick:m.bind(null,"used_traffic"),children:r(_,{children:[e("span",{children:l("usersTable.dataUsage")}),e(ot,{sort:n.sort,column:"used_traffic"})]})}),e(ze,{position:"sticky",top:d,minW:"32px",w:"32px",p:0,cursor:"pointer"})]})}),e(ir,{children:!w&&(o==null?void 0:o.map((g,b)=>r(f.exports.Fragment,{children:[r(Oe,{onClick:T.bind(null,b),cursor:"pointer",children:[e(ue,{borderBottom:0,minW:"100px",pl:4,pr:4,maxW:"calc(100vw - 50px - 32px - 100px - 48px)",children:r("div",{className:"flex-status",children:[e(xr,{lastOnline:g.online_at}),e(h,{isTruncated:!0,children:g.username})]})}),e(ue,{borderBottom:0,minW:"50px",pl:0,pr:0,children:e(yt,{compact:!0,showDetail:!1,expiryDate:g.expire,status:g.status})}),e(ue,{borderBottom:0,minW:"100px",pr:0,children:e(Ua,{totalUsedTraffic:g.lifetime_used_traffic,dataLimitResetStrategy:g.data_limit_reset_strategy,used:g.used_traffic,total:g.data_limit,colorScheme:it[g.status].bandWidthColor})}),e(ue,{p:0,borderBottom:0,w:"32px",minW:"32px",children:e(ka,{color:"gray.600",_dark:{color:"gray.400"},transition:"transform .2s ease-out",transform:u===b?"rotate(180deg)":"0deg"})})]}),e(Oe,{className:"collapsible",onClick:T.bind(null,b),children:e(ue,{p:0,colSpan:4,children:r(He,{border:0,children:[e(Be,{display:"none"}),e($e,{border:0,cursor:"pointer",px:6,py:3,children:r(N,{justifyContent:"space-between",spacing:"4",children:[r(N,{alignItems:"flex-start",w:"full",spacing:-1,children:[e(h,{textTransform:"capitalize",fontSize:"xs",fontWeight:"bold",color:"gray.600",_dark:{color:"gray.400"},children:l("usersTable.dataUsage")}),e(D,{width:"full",minW:"230px",children:e(wr,{totalUsedTraffic:g.lifetime_used_traffic,dataLimitResetStrategy:g.data_limit_reset_strategy,used:g.used_traffic,total:g.data_limit,colorScheme:it[g.status].bandWidthColor})})]}),r(_,{w:"full",justifyContent:"space-between",children:[r(D,{width:"full",children:[e(yt,{compact:!0,expiryDate:g.expire,status:g.status}),e(yr,{lastOnline:g.online_at})]}),r(_,{children:[e(_r,{user:g}),e(ne,{label:l("userDialog.editUser"),placement:"top",children:e(Z,{p:"0 !important","aria-label":"Edit user",bg:"transparent",_dark:{_hover:{bg:"gray.700"}},size:{base:"sm",md:"md"},onClick:W=>{W.stopPropagation(),i(g)},children:e(za,{})})})]})]})]})})]})})})]},g.username)))})]})}),r(sr,{orientation:"vertical",display:{base:"none",md:"table"},...t,children:[e(ar,{zIndex:"docked",position:"relative",children:r(Oe,{children:[e(ze,{position:"sticky",top:{base:"unset",md:d},minW:"140px",cursor:"pointer",onClick:m.bind(null,"username"),children:r(_,{children:[e("span",{children:l("username")}),e(ot,{sort:n.sort,column:"username"})]})}),e(ze,{position:"sticky",top:{base:"unset",md:d},width:"400px",minW:"150px",cursor:"pointer",children:r(_,{position:"relative",gap:"5px",children:[r(h,{_dark:{bg:"gray.750"},_light:{bg:"#F9FAFB"},userSelect:"none",pointerEvents:"none",zIndex:1,children:[l("usersTable.status"),n.status?": "+n.status:""]}),e(h,{children:"/"}),e(ot,{sort:n.sort,column:"expire"}),e(_,{onClick:m.bind(null,"expire"),children:e(h,{children:"Sort by expire"})}),r(Me,{fontSize:"xs",fontWeight:"extrabold",textTransform:"uppercase",cursor:"pointer",position:"absolute",p:0,left:"-40px",border:0,h:"auto",w:"auto",icon:e(ge,{}),_focusVisible:{border:"0 !important"},value:n.sort,onChange:S,children:[e("option",{}),e("option",{children:"active"}),e("option",{children:"on_hold"}),e("option",{children:"disabled"}),e("option",{children:"limited"}),e("option",{children:"expired"})]})]})}),e(ze,{position:"sticky",top:{base:"unset",md:d},width:"350px",minW:"230px",cursor:"pointer",onClick:m.bind(null,"used_traffic"),children:r(_,{children:[e("span",{children:l("usersTable.dataUsage")}),e(ot,{sort:n.sort,column:"used_traffic"})]})}),e(ze,{position:"sticky",top:{base:"unset",md:d},width:"200px",minW:"180px"})]})}),r(ir,{children:[w&&(o==null?void 0:o.map((g,b)=>r(Oe,{className:Ut("interactive",{"last-row":b===o.length-1}),onClick:()=>i(g),children:[e(ue,{minW:"140px",children:r("div",{className:"flex-status",children:[e(xr,{lastOnline:g.online_at}),g.username,e(yr,{lastOnline:g.online_at})]})}),e(ue,{width:"400px",minW:"150px",children:e(yt,{expiryDate:g.expire,status:g.status})}),e(ue,{width:"350px",minW:"230px",children:e(wr,{totalUsedTraffic:g.lifetime_used_traffic,dataLimitResetStrategy:g.data_limit_reset_strategy,used:g.used_traffic,total:g.data_limit,colorScheme:it[g.status].bandWidthColor})}),e(ue,{width:"200px",minW:"180px",children:e(_r,{user:g})})]},g.username))),o.length==0&&e(Oe,{children:e(ue,{colSpan:4,children:e(La,{isFiltered:v})})})]})]}),e(Ca,{})]})},_r=({user:t})=>{const{setQRCode:n,setSubLink:o}=E(),s=t.links.join(`\r -`),[i,a]=f.exports.useState([-1,!1]);return f.exports.useEffect(()=>{i[1]&&setTimeout(()=>{a([-1,!1])},1e3)},[i]),r(_,{justifyContent:"flex-end",onClick:l=>{l.preventDefault(),l.stopPropagation()},children:[e(lr,{text:t.subscription_url.startsWith("/")?window.location.origin+t.subscription_url:t.subscription_url,onCopy:()=>{a([0,!0])},children:e("div",{children:e(ne,{label:i[0]==0&&i[1]?X("usersTable.copied"):X("usersTable.copyLink"),placement:"top",children:e(Z,{p:"0 !important","aria-label":"copy subscription link",bg:"transparent",_dark:{_hover:{bg:"gray.700"}},size:{base:"sm",md:"md"},children:i[0]==0&&i[1]?e(Cr,{}):e(va,{})})})})}),e(lr,{text:s,onCopy:()=>{a([1,!0])},children:e("div",{children:e(ne,{label:i[0]==1&&i[1]?X("usersTable.copied"):X("usersTable.copyConfigs"),placement:"top",children:e(Z,{p:"0 !important","aria-label":"copy configs",bg:"transparent",_dark:{_hover:{bg:"gray.700"}},size:{base:"sm",md:"md"},children:i[0]==1&&i[1]?e(Cr,{}):e(_a,{})})})})}),e(ne,{label:"QR Code",placement:"top",children:e(Z,{p:"0 !important","aria-label":"qr code",bg:"transparent",_dark:{_hover:{bg:"gray.700"}},size:{base:"sm",md:"md"},onClick:()=>{n(t.links),o(t.subscription_url)},children:e(Ia,{})})})]})},La=({isFiltered:t})=>{const{onCreateUser:n}=E();return r(D,{padding:"5",py:"8",display:"flex",alignItems:"center",flexDirection:"column",gap:4,w:"full",children:[e(wa,{maxHeight:"200px",maxWidth:"200px",_dark:{'path[fill="#fff"]':{fill:"gray.800"},'path[fill="#f2f2f2"], path[fill="#e6e6e6"], path[fill="#ccc"]':{fill:"gray.700"},'circle[fill="#3182CE"]':{fill:"primary.300"}},_light:{'path[fill="#f2f2f2"], path[fill="#e6e6e6"], path[fill="#ccc"]':{fill:"gray.300"},'circle[fill="#3182CE"]':{fill:"primary.500"}}}),e(h,{fontWeight:"medium",color:"gray.600",_dark:{color:"gray.400"},children:t?X("usersTable.noUserMatched"):X("usersTable.noUser")}),!t&&e(F,{size:"sm",colorScheme:"primary",onClick:()=>n(!0),children:X("createUser")})]})},Ta=()=>(f.exports.useEffect(()=>{E.getState().refetchUsers(),Yo()},[]),r(N,{justifyContent:"space-between",minH:"100vh",p:"6",rowGap:4,children:[r(D,{w:"full",children:[e(ws,{}),e(Bo,{mt:"4"}),e(is,{}),e(Ra,{}),e(ma,{}),e(ns,{}),e(Xs,{}),e(Ts,{}),e(ta,{}),e(na,{}),e(Bs,{}),e(Ys,{}),e(Ks,{}),e(rs,{})]}),e(Kr,{})]})),Aa=t=>f.exports.createElement("svg",{viewBox:"0 0 747 747",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},f.exports.createElement("path",{d:"M746.671 209.652V77.6572C746.671 72.9384 743.827 68.6832 739.468 66.8811C735.108 65.0738 730.093 66.0739 726.754 69.4072L579.354 216.807C577.453 202.386 570.203 189.203 559.037 179.87C547.875 170.542 533.615 165.744 519.083 166.432C504.551 167.12 490.807 173.24 480.573 183.583L414.375 249.776C412.417 235.391 405.141 222.25 393.985 212.959C382.823 203.662 368.594 198.88 354.083 199.552C339.578 200.224 325.849 206.302 315.594 216.588L274.343 257.828L19.9167 3.41515C16.5781 0.0818157 11.5625 -0.918184 7.20306 0.889149C2.84373 2.69648 0 6.94648 0 11.6651V143.649C0 146.743 1.22917 149.712 3.41667 151.899L191.843 340.339L3.41667 528.753C1.2292 530.94 0 533.909 0 537.003V668.997C0 673.716 2.84373 677.971 7.20306 679.773C11.5624 681.581 16.578 680.58 19.9167 677.247L167.317 529.847C169.285 544.233 176.561 557.358 187.718 566.65C198.869 575.947 213.098 580.728 227.603 580.066C242.103 579.404 255.838 573.342 266.098 563.071L332.295 496.874V496.879C334.259 511.264 341.535 524.395 352.691 533.686C363.853 542.977 378.082 547.759 392.587 547.092C407.093 546.421 420.822 540.348 431.077 530.066L472.327 488.826L726.754 743.239C728.941 745.427 731.91 746.656 735.004 746.656C736.535 746.661 738.056 746.359 739.473 745.77C743.832 743.963 746.671 739.708 746.671 734.989V602.994C746.671 599.901 745.442 596.932 743.254 594.744L554.827 406.318L743.254 217.904H743.259C745.447 215.717 746.676 212.748 746.676 209.654L746.671 209.652ZM23.3373 39.8118L257.844 274.318L208.328 323.818L23.3413 138.818L23.3373 39.8118ZM723.337 706.825L488.831 472.318L538.347 422.818L723.333 607.818L723.337 706.825ZM23.3373 541.825L332.097 233.078C338.764 226.719 347.624 223.172 356.843 223.172C366.056 223.172 374.916 226.719 381.588 233.078C388.151 239.641 391.838 248.548 391.838 257.828C391.838 267.114 388.151 276.016 381.588 282.577L23.3347 640.831L23.3373 541.825ZM249.604 546.575C240.755 555.419 227.864 558.872 215.781 555.638C203.703 552.398 194.265 542.961 191.027 530.883C187.792 518.8 191.245 505.91 200.089 497.06L497.076 200.074C505.92 191.23 518.811 187.772 530.893 191.011C542.971 194.246 552.409 203.678 555.648 215.76C558.888 227.839 555.434 240.73 546.591 249.572L249.604 546.575ZM723.337 204.815L414.577 513.562C407.911 519.926 399.051 523.473 389.832 523.473C380.618 523.473 371.753 519.926 365.087 513.562C358.529 506.999 354.842 498.098 354.842 488.816C354.842 479.535 358.529 470.634 365.087 464.071L723.34 105.818L723.337 204.815Z",fill:"currentColor"})),Ma=x.object({username:x.string().min(1,"login.fieldRequired"),password:x.string().min(1,"login.fieldRequired")}),Na=y(Aa,{baseStyle:{strokeWidth:"10px",w:12,h:12}}),Fa=y(So,{baseStyle:{w:5,h:5,strokeWidth:"2px"}}),kr=()=>{var c,w;const[t,n]=f.exports.useState(""),[o,s]=f.exports.useState(!1),i=Co(),{t:a}=j();let l=wo();const{register:u,formState:{errors:p},handleSubmit:C}=Ve({resolver:ut(Ma)});f.exports.useEffect(()=>{No(),l.pathname!=="/login"&&i("/login",{replace:!0})},[]);const d=v=>{n("");const m=new FormData;m.append("username",v.username),m.append("password",v.password),m.append("grant_type","password"),s(!0),O("/admin/token",{method:"post",body:m}).then(({access_token:S})=>{Mo(S),i("/")}).catch(S=>{n(S.response._data.detail)}).finally(s.bind(null,!1))};return r(N,{justifyContent:"space-between",minH:"100vh",p:"6",w:"full",children:[r(D,{w:"full",children:[e(_,{justifyContent:"end",w:"full",children:e(en,{})}),e(_,{w:"full",justifyContent:"center",alignItems:"center",children:r(D,{w:"full",maxW:"340px",mt:"6",children:[r(N,{alignItems:"center",w:"full",children:[e(Na,{}),e(h,{fontSize:"2xl",fontWeight:"semibold",children:a("login.loginYourAccount")}),e(h,{color:"gray.600",_dark:{color:"gray.400"},children:a("login.welcomeBack")})]}),e(D,{w:"full",maxW:"300px",m:"auto",pt:"4",children:e("form",{onSubmit:C(d),children:r(N,{mt:4,rowGap:2,children:[e(R,{children:e(Ue,{w:"full",placeholder:a("username"),...u("username"),error:a((c=p==null?void 0:p.username)==null?void 0:c.message)})}),e(R,{children:e(Ue,{w:"full",type:"password",placeholder:a("password"),...u("password"),error:a((w=p==null?void 0:p.password)==null?void 0:w.message)})}),t&&r(ct,{status:"error",rounded:"md",children:[e(kt,{}),e(Pr,{children:t})]}),r(F,{isLoading:o,type:"submit",w:"full",colorScheme:"primary",children:[e(Fa,{marginRight:1}),a("login")]})]})})})]})})]}),e(Kr,{})]})},Pa=()=>O("/admin",{headers:{Authorization:`Bearer ${vt()}`}}),Wa=_o([{path:"/",element:e(Ta,{}),errorElement:e(kr,{}),loader:Pa},{path:"/login/",element:e(kr,{})}],{basename:"/dashboard/"});function Oa(){return e("main",{className:"p-8",children:e(ko,{router:Wa})})}B.extend(vo);B.extend(Io);B.extend(zo);B.extend(Do);B.extend(Eo);Qr(Uo.get()||"light");Ro.createRoot(document.getElementById("root")).render(e(Ft.StrictMode,{children:e(Lo,{theme:Ao,children:e(To,{client:Wt,children:e(Oa,{})})})})); + `}},colors:$s(o.length)}}}const Gs=y(Et,{baseStyle:{w:5,h:5}}),Ys=()=>{const{isShowingNodesUsage:t,onShowingNodesUsage:n}=E(),{fetchNodesUsage:o}=ft(),{t:s}=j(),[i,a]=f.exports.useState(!1),{colorMode:l}=ut(),u=s("userDialog.total"),[p,C]=f.exports.useState(zt(l,u)),[d,c]=f.exports.useState("1m"),w=S=>{o(S).then(T=>{const g=[],x=[];for(const W in T.usages){const $=T.usages[W];x.push($.uplink+$.downlink),g.push($.node_name)}C(zt(l,u,x,g))})};f.exports.useEffect(()=>{t&&w({start:B().utc().subtract(30,"day").format("YYYY-MM-DDTHH:00:00")})},[t]);const v=()=>{n(!1),c("1m")},m=i;return r(oe,{isOpen:t,onClose:v,size:"2xl",children:[e(se,{bg:"blackAlpha.300",backdropFilter:"blur(10px)"}),r(ae,{mx:"3",w:"full",children:[e(ie,{pt:6,children:r(_,{gap:2,children:[e(de,{color:"primary",children:e(Gs,{color:"white"})}),e(h,{fontWeight:"semibold",fontSize:"lg",children:s("header.nodesUsage")})]})}),e(le,{mt:3,disabled:m}),e(ce,{children:r(N,{gap:4,children:[e(on,{defaultValue:d,onChange:(S,T)=>{c(S),w(T)}}),e(D,{justifySelf:"center",w:"full",maxW:"300px",mt:"4",children:e(f.exports.Suspense,{fallback:e(Dr,{isIndeterminate:!0}),children:e(Hr,{options:p.options,series:p.series,type:"donut",height:"500px"})})})]})}),e(Re,{mt:"3"})]})]})},br=y(oo),Zs=y(Or,{baseStyle:{w:6,h:6,color:"gray.600",_dark:{color:"white"}}}),Qs=y(so,{baseStyle:{w:6,h:6,color:"gray.600",_dark:{color:"white"}}}),qs=y(Br,{baseStyle:{w:5,h:5}}),Xs=()=>{const{QRcodeLinks:t,setQRCode:n,setSubLink:o,subscribeUrl:s}=E(),i=t!==null,[a,l]=f.exports.useState(0),{t:u}=j(),p=()=>{n(null),o(null)},C=String(s).startsWith("/")?window.location.origin+s:String(s);return r(oe,{isOpen:i,onClose:p,children:[e(se,{bg:"blackAlpha.300",backdropFilter:"blur(10px)"}),r(ae,{mx:"3",w:"fit-content",maxW:"3xl",children:[e(ie,{pt:6,children:e(de,{color:"primary",children:e(qs,{color:"white"})})}),e(le,{mt:3}),t&&r(ce,{gap:{base:"20px",lg:"50px"},pr:{lg:"60px"},px:{base:"50px"},display:"flex",justifyContent:"center",flexDirection:{base:"column",lg:"row"},children:[s&&r(N,{children:[e(br,{mx:"auto",size:300,p:"2",level:"L",includeMargin:!1,value:C,bg:"white"}),e(h,{display:"block",textAlign:"center",pb:3,mt:1,children:u("qrcodeDialog.sublink")})]}),r(D,{w:"300px",children:[e(ao,{centerPadding:"0px",centerMode:!0,slidesToShow:1,slidesToScroll:1,dots:!1,afterChange:l,onInit:()=>l(0),nextArrow:e(Z,{size:"sm",position:"absolute",display:"flex !important",_before:{content:'""'},"aria-label":"next",mr:"-4",children:e(Zs,{})}),prevArrow:e(Z,{size:"sm",position:"absolute",display:"flex !important",_before:{content:'""'},"aria-label":"prev",ml:"-4",children:e(Qs,{})}),children:t.map((d,c)=>e(_,{children:e(br,{mx:"auto",size:300,p:"2",level:"L",includeMargin:!1,value:d,bg:"white"})},c))}),r(h,{display:"block",textAlign:"center",pb:3,mt:1,children:[a+1," / ",t.length]})]})]})]})]})},Js=y(Mr,{baseStyle:{w:5,h:5}}),Ks=()=>{const[t,n]=f.exports.useState(!1),{isResetingAllUsage:o,onResetAllUsage:s,resetAllUsage:i}=E(),{t:a}=j(),l=fe(),u=()=>{s(!1)},p=()=>{n(!0),i().then(()=>{l({title:a("resetAllUsage.success"),status:"success",isClosable:!0,position:"top",duration:3e3})}).catch(()=>{l({title:a("resetAllUsage.error"),status:"error",isClosable:!0,position:"top",duration:3e3})}).finally(()=>{n(!1)})};return r(oe,{isCentered:!0,isOpen:o,onClose:u,size:"sm",children:[e(se,{bg:"blackAlpha.300",backdropFilter:"blur(10px)"}),r(ae,{mx:"3",children:[e(ie,{pt:6,children:e(de,{color:"red",children:e(Js,{})})}),e(le,{mt:3}),r(ce,{children:[e(h,{fontWeight:"semibold",fontSize:"lg",children:a("resetAllUsage.title")}),o&&e(h,{mt:1,fontSize:"sm",_dark:{color:"gray.400"},color:"gray.600",children:a("resetAllUsage.prompt")})]}),r(Re,{display:"flex",children:[e(F,{size:"sm",onClick:u,mr:3,w:"full",variant:"outline",children:a("cancel")}),e(F,{size:"sm",w:"full",colorScheme:"red",onClick:p,leftIcon:t?e(Ne,{size:"xs"}):void 0,children:a("reset")})]})]})]})},ea=y(Ut,{baseStyle:{w:5,h:5}}),ta=()=>{const[t,n]=f.exports.useState(!1),{resetUsageUser:o,resetDataUsage:s}=E(),{t:i}=j(),a=fe(),l=()=>{E.setState({resetUsageUser:null})},u=()=>{o&&(n(!0),s(o).then(()=>{a({title:i("resetUserUsage.success",{username:o.username}),status:"success",isClosable:!0,position:"top",duration:3e3})}).catch(()=>{a({title:i("resetUserUsage.error"),status:"error",isClosable:!0,position:"top",duration:3e3})}).finally(()=>{n(!1)}))};return r(oe,{isCentered:!0,isOpen:!!o,onClose:l,size:"sm",children:[e(se,{bg:"blackAlpha.300",backdropFilter:"blur(10px)"}),r(ae,{mx:"3",children:[e(ie,{pt:6,children:e(de,{color:"blue",children:e(ea,{})})}),e(le,{mt:3}),r(ce,{children:[e(h,{fontWeight:"semibold",fontSize:"lg",children:i("resetUserUsage.title")}),o&&e(h,{mt:1,fontSize:"sm",_dark:{color:"gray.400"},color:"gray.600",children:e(Ee,{components:{b:e("b",{})},children:i("resetUserUsage.prompt",{username:o.username})})})]}),r(Re,{display:"flex",children:[e(F,{size:"sm",onClick:l,mr:3,w:"full",variant:"outline",children:i("cancel")}),e(F,{size:"sm",w:"full",colorScheme:"blue",onClick:u,leftIcon:t?e(Ne,{size:"xs"}):void 0,children:i("reset")})]})]})]})},ra=y(Ut,{baseStyle:{w:5,h:5}}),na=()=>{const[t,n]=f.exports.useState(!1),{revokeSubscriptionUser:o,revokeSubscription:s}=E(),{t:i}=j(),a=fe(),l=()=>{E.setState({revokeSubscriptionUser:null})},u=()=>{o&&(n(!0),s(o).then(()=>{a({title:i("revokeUserSub.success",{username:o.username}),status:"success",isClosable:!0,position:"top",duration:3e3})}).catch(()=>{a({title:i("revokeUserSub.error"),status:"error",isClosable:!0,position:"top",duration:3e3})}).finally(()=>{n(!1)}))};return r(oe,{isCentered:!0,isOpen:!!o,onClose:l,size:"sm",children:[e(se,{bg:"blackAlpha.300",backdropFilter:"blur(10px)"}),r(ae,{mx:"3",children:[e(ie,{pt:6,children:e(de,{color:"blue",children:e(ra,{})})}),e(le,{mt:3}),r(ce,{children:[e(h,{fontWeight:"semibold",fontSize:"lg",children:i("revokeUserSub.title")}),o&&e(h,{mt:1,fontSize:"sm",_dark:{color:"gray.400"},color:"gray.600",children:e(Ee,{components:{b:e("b",{})},children:i("revokeUserSub.prompt",{username:o.username})})})]}),r(Re,{display:"flex",children:[e(F,{size:"sm",onClick:l,mr:3,w:"full",variant:"outline",children:i("cancel")}),e(F,{size:"sm",w:"full",colorScheme:"blue",onClick:u,leftIcon:t?e(Ne,{size:"xs"}):void 0,children:i("revoke")})]})]})]})},oa=y(io,{baseStyle:{strokeWidth:"2px",w:5,h:5}}),sa=({inbound:t,...n})=>{const{getCheckboxProps:o,getInputProps:s,getLabelProps:i,htmlProps:a}=Vr(n),l=s();return r(D,{as:"label",children:[e("input",{...l}),r(D,{w:"fll",position:"relative",...a,cursor:"pointer",borderRadius:"sm",border:"1px solid",borderColor:"gray.200",_dark:{borderColor:"gray.600"},display:"flex",alignItems:"center",justifyContent:"space-between",overflow:"hidden",_checked:{bg:"gray.50",outline:"2px",boxShadow:"outline",outlineColor:"primary.500",borderColor:"transparent",fontWeight:"medium",_dark:{bg:"gray.750",borderColor:"transparent"},"& p":{opacity:1}},__css:{"& p":{opacity:.8}},textTransform:"capitalize",px:3,py:2,fontWeight:"medium",...o(),children:[e(it,{size:"sm",w:"full",maxW:"full",color:"gray.700",_dark:{color:"gray.300"},textTransform:"uppercase",colorScheme:"primary",className:"inbound-item",isChecked:l.checked,pointerEvents:"none",flexGrow:1,children:e(_,{justify:"space-between",w:"full",maxW:"calc(100% - 20px)",spacing:0,gap:2,overflow:"hidden",children:r(h,{isTruncated:!0,...i(),fontSize:"xs",children:[t.tag," ",r(h,{as:"span",children:["(",t.network,")"]})]})})}),t.tls&&t.tls!="none"&&e(U,{fontSize:"xs",opacity:".8",size:"xs",children:t.tls})]})]})},aa=({disabled:t,title:n,description:o,toggleAccordion:s,isSelected:i,...a})=>{const l=Vt(),{inbounds:u}=E(),{getCheckboxProps:p,getInputProps:C,getLabelProps:d,htmlProps:c}=Vr(a),w=C(),[v]=Gr({name:[`inbounds.${n}`],control:l.control}),{getCheckboxProps:m}=$r({value:v,onChange:x=>{if(l.setValue(`inbounds.${n}`,x),x.length===0){const W=l.getValues("selected_proxies");l.setValue("selected_proxies",W.filter($=>$!==n)),s()}}}),S=v&&i&&(E.getState().inbounds.get(n)||[]).length!==v.length,T=(E.getState().inbounds.get(n)||[]).length>0,g=!i&&!T;return r(He,{isDisabled:!T,borderRadius:"md",borderStyle:"solid",border:"1px",borderColor:"gray.200",bg:g?"gray.100":"transparent",_dark:{borderColor:"gray.600",bg:g?"#364154":"transparent"},_checked:{bg:"gray.50",outline:"2px",boxShadow:"outline",outlineColor:"primary.500",borderColor:"transparent"},...p(),children:[r(D,{as:g?"span":"label",position:"relative",children:[S&&e(D,{position:"absolute",w:"2",h:"2",bg:"yellow.500",top:"-1",right:"-1",rounded:"full",zIndex:999}),e("input",{...w}),r(D,{w:"fll",position:"relative",...c,borderRadius:"md",cursor:g?"not-allowed":"pointer",_checked:{fontWeight:"medium",_dark:{bg:"gray.750",borderColor:"transparent"},"& > svg":{opacity:1,"&.checked":{display:"block"},"&.unchecked":{display:"none"}},"& p":{opacity:1}},__css:{"& > svg":{opacity:.3,"&.checked":{display:"none"},"&.unchecked":{display:"block"}},"& p":{opacity:.8}},textTransform:"capitalize",px:3,py:2,fontWeight:"medium",...p(),children:[e(Be,{display:w.checked&&T?"block":"none",as:"span",className:"checked",color:"primary.200",position:"absolute",right:"3",top:"3",w:"auto",p:0,onClick:s,children:e(Z,{size:"sm","aria-label":"inbound settings",children:e(oa,{})})}),e(h,{fontSize:"sm",color:g?"gray.400":"gray.700",_dark:{color:g?"gray.500":"gray.300"},...d(),children:n}),e(h,{fontWeight:"medium",color:g?"gray.400":"gray.600",_dark:{color:g?"gray.500":"gray.400"},fontSize:"xs",children:o})]})]}),e($e,{px:2,pb:3,roundedBottom:"5px",pt:3,_dark:{bg:w.checked&&"gray.750"},children:r(N,{w:"full",rowGap:2,borderStyle:"solid",borderWidth:"1px",borderRadius:"md",pl:3,pr:3,pt:1.5,_dark:{bg:"gray.700"},children:[r(N,{alignItems:"flex-start",w:"full",children:[e(h,{fontSize:"sm",children:X("inbound")}),e(Yt,{gap:2,alignItems:"flex-start",w:"full",columns:1,spacing:1,children:(u.get(n)||[]).map(x=>e(sa,{...m({value:x.tag}),inbound:x},x.tag))})]}),n==="vmess"&&i&&e(N,{alignItems:"flex-start",w:"full",children:r(R,{height:"66px",children:[e(h,{fontSize:"sm",pb:1,children:"ID"}),e(je,{fontSize:"xs",size:"sm",borderRadius:"6px",pl:2,pr:2,placeholder:X("userDialog.generatedByDefault"),...l.register("proxies.vmess.id")})]})}),n==="vless"&&i&&r(N,{alignItems:"flex-start",w:"full",children:[r(R,{height:"66px",children:[e(h,{fontSize:"sm",pb:1,children:"ID"}),e(je,{fontSize:"xs",size:"sm",borderRadius:"6px",pl:2,pr:2,placeholder:X("userDialog.generatedByDefault"),...l.register("proxies.vless.id")})]}),r(R,{height:"66px",children:[e(h,{fontSize:"sm",pb:1,children:"Flow"}),e(Me,{fontSize:"xs",size:"sm",borderRadius:"6px",...l.register("proxies.vless.flow"),children:Is.map(x=>e("option",{value:x.value,children:x.title},x.title))})]})]}),n==="trojan"&&i&&e(N,{alignItems:"flex-start",w:"full",children:r(R,{height:"66px",children:[e(h,{fontSize:"sm",pb:1,children:X("password")}),e(je,{fontSize:"xs",size:"sm",borderRadius:"6px",pl:2,pr:2,placeholder:X("userDialog.generatedByDefault"),...l.register("proxies.trojan.password")})]})}),n==="shadowsocks"&&i&&r(N,{alignItems:"flex-start",w:"full",children:[r(R,{height:"66px",children:[e(h,{fontSize:"sm",pb:1,children:X("password")}),e(je,{fontSize:"xs",size:"sm",borderRadius:"6px",pl:2,pr:2,placeholder:X("userDialog.generatedByDefault"),...l.register("proxies.shadowsocks.password")})]}),r(R,{height:"66px",children:[e(h,{fontSize:"sm",pb:1,children:X("userDialog.method")}),e(Me,{fontSize:"xs",size:"sm",borderRadius:"6px",...l.register("proxies.shadowsocks.method"),children:zs.map(x=>e("option",{value:x,children:x},x))})]})]})]})})]})},ia=f.exports.forwardRef(({name:t,list:n,onChange:o,disabled:s,...i},a)=>{const l=Vt(),[u,p]=f.exports.useState([]),C=c=>{u.includes(c)?u.splice(u.indexOf(c),1):u.push(c),p([...u])},{getCheckboxProps:d}=$r({value:i.value,onChange:c=>{var v;const w=c.filter(m=>!i.value.includes(m));w[0]&&l.setValue(`inbounds.${w[0]}`,(v=E.getState().inbounds.get(w[0]))==null?void 0:v.map(m=>m.tag)),p(u.filter(m=>c.find(S=>S===n[m].title))),o({target:{value:c,name:t}})}});return e(mt,{allowToggle:!0,index:u,children:e(Yt,{ref:a,gap:2,alignItems:"flex-start",columns:1,spacing:1,children:n.map((c,w)=>e(aa,{toggleAccordion:C.bind(null,w),disabled:s,title:c.title,description:c.description,isSelected:!!i.value.find(v=>v===c.title),...d({value:c.title})},c.title))})})}),la=y(lo,{baseStyle:{w:5,h:5}}),ca=y(Yr,{baseStyle:{w:5,h:5}}),da=y(Et,{baseStyle:{w:5,h:5}}),ha=t=>({...t,data_limit:t.data_limit?Number((t.data_limit/1073741824).toFixed(5)):t.data_limit,on_hold_expire_duration:t.on_hold_expire_duration?Number(t.on_hold_expire_duration/(24*60*60)):t.on_hold_expire_duration,selected_proxies:Object.keys(t.proxies)}),Mt=()=>{const t=Object.fromEntries(E.getState().inbounds),n={};for(const o in t)n[o]=t[o].map(s=>s.tag);return{selected_proxies:Object.keys(t),data_limit:null,expire:null,username:"",data_limit_reset_strategy:"no_reset",status:"active",on_hold_expire_duration:null,note:"",inbounds:n,proxies:{vless:{id:"",flow:""},vmess:{id:""},trojan:{password:""},shadowsocks:{password:"",method:"chacha20-ietf-poly1305"}}}},ua=(t,n)=>{const o=t.reduce((s,i)=>({...s,[i]:{}}),{});return n&&t.forEach(s=>{n[s]&&(o[s]=n[s])}),o},ot={username:b.string().min(1,{message:"Required"}),selected_proxies:b.array(b.string()).refine(t=>t.length>0,{message:"userDialog.selectOneProtocol"}),note:b.string().nullable(),proxies:b.record(b.string(),b.record(b.string(),b.any())).transform(t=>{const n=(o,s)=>{o&&o[s]===""&&delete o[s]};return n(t.vmess,"id"),n(t.vless,"id"),n(t.trojan,"password"),n(t.shadowsocks,"password"),n(t.shadowsocks,"method"),t}),data_limit:b.string().min(0).or(b.number()).nullable().transform(t=>t?Number((parseFloat(String(t))*1073741824).toFixed(5)):0),expire:b.number().nullable(),data_limit_reset_strategy:b.string(),inbounds:b.record(b.string(),b.array(b.string())).transform(t=>(Object.keys(t).forEach(n=>{var o;Array.isArray(t[n])&&!((o=t[n])!=null&&o.length)&&delete t[n]}),t))},pa=b.discriminatedUnion("status",[b.object({status:b.literal("active"),...ot}),b.object({status:b.literal("disabled"),...ot}),b.object({status:b.literal("limited"),...ot}),b.object({status:b.literal("expired"),...ot}),b.object({status:b.literal("on_hold"),on_hold_expire_duration:b.coerce.number().min(.1,"Required").transform(t=>t*(24*60*60)),...ot})]),ma=()=>{var Ye,Ze,Qe,qe,Xe;const{editingUser:t,isCreatingNewUser:n,onCreateUser:o,editUser:s,fetchUserUsage:i,onEditingUser:a,createUser:l,onDeletingUser:u}=E(),p=!!t,C=n||p,[d,c]=f.exports.useState(!1),[w,v]=f.exports.useState(""),m=fe(),{t:S,i18n:T}=j(),{colorMode:g}=ut(),[x,W]=f.exports.useState(!1),$=()=>{W(k=>!k)},I=Ve({defaultValues:Mt(),resolver:pt(pa)});f.exports.useEffect(()=>E.subscribe(k=>k.inbounds,()=>{I.reset(Mt())}),[]);const[A,Y]=Gr({control:I.control,name:["data_limit","status"]}),q=S("userDialog.total"),[L,V]=f.exports.useState(zt(g,q)),[J,z]=f.exports.useState("1m"),P=k=>{i(t,k).then(M=>{const te=[],xe=[];for(const he in M.usages)xe.push(M.usages[he].used_traffic),te.push(M.usages[he].node_name);V(zt(g,q,xe,te))})};f.exports.useEffect(()=>{t&&(I.reset(ha(t)),P({start:B().utc().subtract(30,"day").format("YYYY-MM-DDTHH:00:00")}))},[t]);const K=k=>{c(!0);const M={edited:s,created:l},te=p?"edited":"created";v(null);const{selected_proxies:xe,...he}=k;let ye={...he,data_limit:k.data_limit,proxies:ua(xe,k.proxies),data_limit_reset_strategy:k.data_limit&&k.data_limit>0?k.data_limit_reset_strategy:"no_reset",status:k.status==="active"||k.status==="disabled"||k.status==="on_hold"?k.status:"active"};M[te](ye).then(()=>{m({title:S(p?"userDialog.userEdited":"userDialog.userCreated",{username:k.username}),status:"success",isClosable:!0,position:"top",duration:3e3}),Fe()}).catch(G=>{var Je,Ke,et,tt,Q;(((Je=G==null?void 0:G.response)==null?void 0:Je.status)===409||((Ke=G==null?void 0:G.response)==null?void 0:Ke.status)===400)&&v((tt=(et=G==null?void 0:G.response)==null?void 0:et._data)==null?void 0:tt.detail),((Q=G==null?void 0:G.response)==null?void 0:Q.status)===422&&Object.keys(G.response._data.detail).forEach(We=>{v(G==null?void 0:G.response._data.detail[We]),I.setError(We,{type:"custom",message:G.response._data.detail[We]})})}).finally(()=>{c(!1)})},Fe=()=>{I.reset(Mt()),o(!1),a(null),v(null),W(!1),z("1m")},xt=()=>{E.setState({resetUsageUser:t})},yt=()=>{E.setState({revokeSubscriptionUser:t})},ee=d,Pe=Y==="on_hold";return r(oe,{isOpen:C,onClose:Fe,size:"2xl",children:[e(se,{bg:"blackAlpha.300",backdropFilter:"blur(10px)"}),e(Nr,{...I,children:e(ae,{mx:"3",children:r("form",{onSubmit:I.handleSubmit(K),children:[e(ie,{pt:6,children:r(_,{gap:2,children:[e(de,{color:"primary",children:p?e(ca,{color:"white"}):e(la,{color:"white"})}),e(h,{fontWeight:"semibold",fontSize:"lg",children:S(p?"userDialog.editUserTitle":"createNewUser")})]})}),e(le,{mt:3,disabled:ee}),r(ce,{children:[r(Ur,{templateColumns:{base:"repeat(1, 1fr)",md:"repeat(2, 1fr)"},gap:3,children:[e(at,{children:r(N,{justifyContent:"space-between",children:[r(or,{flexDirection:"column",gridAutoRows:"min-content",w:"full",children:[r(or,{flexDirection:"row",w:"full",gap:2,children:[r(R,{mb:"10px",children:[e(H,{children:S("username")}),r(_,{children:[e(Ue,{size:"sm",type:"text",borderRadius:"6px",error:(Ye=I.formState.errors.username)==null?void 0:Ye.message,disabled:ee||p,...I.register("username")}),p&&e(_,{px:1,children:e(pe,{name:"status",control:I.control,render:({field:k})=>e(ne,{placement:"top",label:"status: "+S(`status.${k.value}`),textTransform:"capitalize",children:e(D,{children:e(kt,{colorScheme:"primary",isChecked:k.value==="active",onChange:M=>{M.target.checked?k.onChange("active"):k.onChange("disabled")}})})})})})]})]}),!p&&r(R,{flex:"1",children:[e(H,{whiteSpace:"nowrap",children:S("userDialog.onHold")}),e(pe,{name:"status",control:I.control,render:({field:k})=>{const M=k.value;return e(ge,{children:M?e(kt,{colorScheme:"primary",isChecked:M==="on_hold",onChange:te=>{te.target.checked?k.onChange("on_hold"):k.onChange("active")}}):""})}})]})]}),r(R,{mb:"10px",children:[e(H,{children:S("userDialog.dataLimit")}),e(pe,{control:I.control,name:"data_limit",render:({field:k})=>{var M;return e(Ue,{endAdornment:"GB",type:"number",size:"sm",borderRadius:"6px",onChange:k.onChange,disabled:ee,error:(M=I.formState.errors.data_limit)==null?void 0:M.message,value:k.value?String(k.value):""})}})]}),e(Wr,{in:!!(A&&A>0),animateOpacity:!0,style:{width:"100%"},children:r(R,{height:"66px",children:[e(H,{children:S("userDialog.periodicUsageReset")}),e(pe,{control:I.control,name:"data_limit_reset_strategy",render:({field:k})=>e(Me,{size:"sm",...k,disabled:ee,bg:ee?"gray.100":"transparent",_dark:{bg:ee?"gray.600":"transparent"},children:jt.map(M=>e("option",{value:M.value,children:S("userDialog.resetStrategy"+M.title)},M.value))})})]})}),r(R,{mb:"10px",children:[e(H,{children:S(Pe?"userDialog.onHoldExpireDuration":"userDialog.expiryDate")}),Pe&&e(pe,{control:I.control,name:"on_hold_expire_duration",render:({field:k})=>{var M;return e(Ue,{endAdornment:"Days",type:"number",size:"sm",borderRadius:"6px",onChange:te=>{I.setValue("expire",null),k.onChange({target:{value:te}})},disabled:ee,error:(M=I.formState.errors.on_hold_expire_duration)==null?void 0:M.message,value:k.value?String(k.value):""})}}),!Pe&&e(pe,{name:"expire",control:I.control,render:({field:k})=>{var he;function M(ye){return B(B(ye*1e3).utc()).toDate()}const{status:te,time:xe}=Xt(k.value);return r(ge,{children:[e(jr,{locale:T.language.toLocaleLowerCase(),dateFormat:S("dateFormat"),minDate:new Date,selected:k.value?M(k.value):void 0,onChange:ye=>{I.setValue("on_hold_expire_duration",null),k.onChange({target:{value:ye?B(B(ye).set("hour",23).set("minute",59).set("second",59)).utc().valueOf()/1e3:0,name:"expire"}})},customInput:e(Ue,{size:"sm",type:"text",borderRadius:"6px",clearable:!0,disabled:ee,error:(he=I.formState.errors.expire)==null?void 0:he.message})}),k.value?e(co,{children:S(te,{time:xe})}):""]})}})]}),r(R,{mb:"10px",isInvalid:!!I.formState.errors.note,children:[e(H,{children:S("userDialog.note")}),e(ho,{...I.register("note")}),e(_t,{children:(Qe=(Ze=I.formState.errors)==null?void 0:Ze.note)==null?void 0:Qe.message})]})]}),w&&r(dt,{status:"error",display:{base:"none",md:"flex"},children:[e(vt,{}),w]})]})}),e(at,{children:r(R,{isInvalid:!!((qe=I.formState.errors.selected_proxies)!=null&&qe.message),children:[e(H,{children:S("userDialog.protocols")}),e(pe,{control:I.control,name:"selected_proxies",render:({field:k})=>e(ia,{list:[{title:"vmess",description:S("userDialog.vmessDesc")},{title:"vless",description:S("userDialog.vlessDesc")},{title:"trojan",description:S("userDialog.trojanDesc")},{title:"shadowsocks",description:S("userDialog.shadowsocksDesc")}],disabled:ee,...k})}),e(_t,{children:S((Xe=I.formState.errors.selected_proxies)==null?void 0:Xe.message)})]})}),p&&x&&e(at,{pt:6,colSpan:{base:1,md:2},children:r(N,{gap:4,children:[e(on,{defaultValue:J,onChange:(k,M)=>{z(k),P(M)}}),e(D,{width:{base:"100%",md:"70%"},justifySelf:"center",children:e(Hr,{options:L.options,series:L.series,type:"donut"})})]})})]}),w&&r(dt,{mt:"3",status:"error",display:{base:"flex",md:"none"},children:[e(vt,{}),w]})]}),e(Re,{mt:"3",children:r(_,{justifyContent:"space-between",w:"full",gap:3,flexDirection:{base:"column",sm:"row"},children:[e(_,{justifyContent:"flex-start",w:{base:"full",sm:"unset"},children:p&&r(ge,{children:[e(ne,{label:S("delete"),placement:"top",children:e(Z,{"aria-label":"Delete",size:"sm",onClick:()=>{u(t),Fe()},children:e(gt,{})})}),e(ne,{label:S("userDialog.usage"),placement:"top",children:e(Z,{"aria-label":"usage",size:"sm",onClick:$,children:e(da,{})})}),e(F,{onClick:xt,size:"sm",children:S("userDialog.resetUsage")}),e(F,{onClick:yt,size:"sm",children:S("userDialog.revokeSubscription")})]})}),e(_,{w:"full",maxW:{md:"50%",base:"full"},justify:"end",children:e(F,{type:"submit",size:"sm",px:"8",colorScheme:"primary",leftIcon:d?e(Ne,{size:"xs"}):void 0,disabled:ee,children:S(p?"userDialog.editUser":"createUser")})})]})})]})})})]})},ga=t=>f.exports.createElement("svg",{xmlns:"http://www.w3.org/2000/svg","data-name":"Layer 1",width:782.04441,height:701.88002,viewBox:"0 0 782.04441 701.88002",xmlnsXlink:"http://www.w3.org/1999/xlink",...t},f.exports.createElement("path",{d:"M609.48783,100.59015l-25.44631,6.56209L270.53735,187.9987,245.091,194.56079A48.17927,48.17927,0,0,0,210.508,253.17865L320.849,681.05606a48.17924,48.17924,0,0,0,58.61776,34.58317l.06572-.01695,364.26536-93.93675.06572-.01695a48.17923,48.17923,0,0,0,34.58309-58.6178l-110.341-427.87741A48.17928,48.17928,0,0,0,609.48783,100.59015Z",transform:"translate(-208.9778 -99.05999)",fill:"#f2f2f2"}),f.exports.createElement("path",{d:"M612.94784,114.00532l-30.13945,7.77236L278.68955,200.20385l-30.139,7.77223a34.30949,34.30949,0,0,0-24.6275,41.74308l110.341,427.87741a34.30946,34.30946,0,0,0,41.7431,24.62736l.06572-.01695,364.26536-93.93674.06619-.01707a34.30935,34.30935,0,0,0,24.627-41.7429l-110.341-427.87741A34.30938,34.30938,0,0,0,612.94784,114.00532Z",transform:"translate(-208.9778 -99.05999)",fill:"#fff"}),f.exports.createElement("path",{d:"M590.19,252.56327,405.917,300.08359a8.01411,8.01411,0,0,1-4.00241-15.52046l184.273-47.52033A8.01412,8.01412,0,0,1,590.19,252.56327Z",transform:"translate(-208.9778 -99.05999)",fill:"#f2f2f2"}),f.exports.createElement("path",{d:"M628.955,270.49906,412.671,326.27437a8.01411,8.01411,0,1,1-4.00241-15.52046l216.284-55.77531a8.01411,8.01411,0,0,1,4.00242,15.52046Z",transform:"translate(-208.9778 -99.05999)",fill:"#f2f2f2"}),f.exports.createElement("path",{d:"M620.45825,369.93676l-184.273,47.52032a8.01411,8.01411,0,1,1-4.00242-15.52046l184.273-47.52032a8.01411,8.01411,0,1,1,4.00241,15.52046Z",transform:"translate(-208.9778 -99.05999)",fill:"#f2f2f2"}),f.exports.createElement("path",{d:"M659.22329,387.87255l-216.284,55.77531a8.01411,8.01411,0,1,1-4.00242-15.52046l216.284-55.77531a8.01411,8.01411,0,0,1,4.00242,15.52046Z",transform:"translate(-208.9778 -99.05999)",fill:"#f2f2f2"}),f.exports.createElement("path",{d:"M650.72653,487.31025l-184.273,47.52033a8.01412,8.01412,0,0,1-4.00242-15.52047l184.273-47.52032a8.01411,8.01411,0,0,1,4.00242,15.52046Z",transform:"translate(-208.9778 -99.05999)",fill:"#f2f2f2"}),f.exports.createElement("path",{d:"M689.49156,505.246l-216.284,55.77532a8.01412,8.01412,0,1,1-4.00241-15.52047l216.284-55.77531a8.01411,8.01411,0,0,1,4.00242,15.52046Z",transform:"translate(-208.9778 -99.05999)",fill:"#f2f2f2"}),f.exports.createElement("path",{d:"M374.45884,348.80871l-65.21246,16.817a3.847,3.847,0,0,1-4.68062-2.76146L289.5963,304.81607a3.847,3.847,0,0,1,2.76145-4.68061l65.21247-16.817a3.847,3.847,0,0,1,4.68061,2.76145l14.96947,58.04817A3.847,3.847,0,0,1,374.45884,348.80871Z",transform:"translate(-208.9778 -99.05999)",fill:"#e6e6e6"}),f.exports.createElement("path",{d:"M404.72712,466.1822l-65.21247,16.817a3.847,3.847,0,0,1-4.68062-2.76146l-14.96946-58.04816A3.847,3.847,0,0,1,322.626,417.509l65.21246-16.817a3.847,3.847,0,0,1,4.68062,2.76145l14.96946,58.04817A3.847,3.847,0,0,1,404.72712,466.1822Z",transform:"translate(-208.9778 -99.05999)",fill:"#e6e6e6"}),f.exports.createElement("path",{d:"M434.99539,583.55569l-65.21246,16.817a3.847,3.847,0,0,1-4.68062-2.76145l-14.96946-58.04817a3.847,3.847,0,0,1,2.76145-4.68062l65.21247-16.817a3.847,3.847,0,0,1,4.68061,2.76146l14.96947,58.04816A3.847,3.847,0,0,1,434.99539,583.55569Z",transform:"translate(-208.9778 -99.05999)",fill:"#e6e6e6"}),f.exports.createElement("path",{d:"M863.63647,209.0517H487.31811a48.17928,48.17928,0,0,0-48.125,48.12512V699.05261a48.17924,48.17924,0,0,0,48.125,48.12507H863.63647a48.17924,48.17924,0,0,0,48.125-48.12507V257.17682A48.17928,48.17928,0,0,0,863.63647,209.0517Z",transform:"translate(-208.9778 -99.05999)",fill:"#e6e6e6"}),f.exports.createElement("path",{d:"M863.637,222.90589H487.31811a34.30948,34.30948,0,0,0-34.271,34.27093V699.05261a34.30947,34.30947,0,0,0,34.271,34.27088H863.637a34.30936,34.30936,0,0,0,34.27051-34.27088V257.17682A34.30937,34.30937,0,0,0,863.637,222.90589Z",transform:"translate(-208.9778 -99.05999)",fill:"#fff"}),f.exports.createElement("circle",{cx:694.19401,cy:614.02963,r:87.85039,fill:"#3182CE"}),f.exports.createElement("path",{d:"M945.18722,701.63087H914.63056V671.07421a11.45875,11.45875,0,0,0-22.9175,0v30.55666H861.1564a11.45875,11.45875,0,0,0,0,22.9175h30.55666V755.105a11.45875,11.45875,0,1,0,22.9175,0V724.54837h30.55666a11.45875,11.45875,0,0,0,0-22.9175Z",transform:"translate(-208.9778 -99.05999)",fill:"#fff"}),f.exports.createElement("path",{d:"M807.00068,465.71551H616.699a8.01412,8.01412,0,1,1,0-16.02823H807.00068a8.01412,8.01412,0,0,1,0,16.02823Z",transform:"translate(-208.9778 -99.05999)",fill:"#e6e6e6"}),f.exports.createElement("path",{d:"M840.05889,492.76314H616.699a8.01412,8.01412,0,1,1,0-16.02823H840.05889a8.01411,8.01411,0,1,1,0,16.02823Z",transform:"translate(-208.9778 -99.05999)",fill:"#e6e6e6"}),f.exports.createElement("path",{d:"M807.00068,586.929H616.699a8.01412,8.01412,0,1,1,0-16.02823H807.00068a8.01411,8.01411,0,0,1,0,16.02823Z",transform:"translate(-208.9778 -99.05999)",fill:"#e6e6e6"}),f.exports.createElement("path",{d:"M840.05889,613.97661H616.699a8.01412,8.01412,0,1,1,0-16.02823H840.05889a8.01412,8.01412,0,1,1,0,16.02823Z",transform:"translate(-208.9778 -99.05999)",fill:"#e6e6e6"}),f.exports.createElement("path",{d:"M574.07028,505.04162H506.72434a3.847,3.847,0,0,1-3.84278-3.84278V441.25158a3.847,3.847,0,0,1,3.84278-3.84278h67.34594a3.847,3.847,0,0,1,3.84278,3.84278v59.94726A3.847,3.847,0,0,1,574.07028,505.04162Z",transform:"translate(-208.9778 -99.05999)",fill:"#e6e6e6"}),f.exports.createElement("path",{d:"M574.07028,626.25509H506.72434a3.847,3.847,0,0,1-3.84278-3.84278V562.46505a3.847,3.847,0,0,1,3.84278-3.84278h67.34594a3.847,3.847,0,0,1,3.84278,3.84278v59.94726A3.847,3.847,0,0,1,574.07028,626.25509Z",transform:"translate(-208.9778 -99.05999)",fill:"#e6e6e6"}),f.exports.createElement("path",{d:"M807.21185,330.781H666.91017a8.01411,8.01411,0,0,1,0-16.02823H807.21185a8.01411,8.01411,0,0,1,0,16.02823Z",transform:"translate(-208.9778 -99.05999)",fill:"#ccc"}),f.exports.createElement("path",{d:"M840.27007,357.82862H666.91017a8.01411,8.01411,0,1,1,0-16.02822h173.3599a8.01411,8.01411,0,0,1,0,16.02822Z",transform:"translate(-208.9778 -99.05999)",fill:"#ccc"}),f.exports.createElement("path",{d:"M635.85911,390.6071H506.51316a3.847,3.847,0,0,1-3.84277-3.84277V285.81706a3.847,3.847,0,0,1,3.84277-3.84277H635.85911a3.847,3.847,0,0,1,3.84277,3.84277V386.76433A3.847,3.847,0,0,1,635.85911,390.6071Z",transform:"translate(-208.9778 -99.05999)",fill:"#ccc"})),fa=t=>{if(!t)return null;const n=new Date(t+"Z");return Math.floor(n.getTime()/1e3)},xr=({lastOnline:t})=>{const n=Math.floor(Date.now()/1e3),o=fa(t);if(typeof t>"u"||t===null)return e("div",{className:"circle pulse orange"});const s=o?n-o:1/0;return s>0&&s<=60?e("div",{className:"circle pulse green"}):e("div",{className:"circle pulse red"})},ba=t=>{if(!t)return null;const n=new Date(t+"Z");return Math.floor(n.getTime()/1e3)},yr=({lastOnline:t})=>{const n=Math.floor(Date.now()/1e3),o=ba(t),s=o?n-o:null,i=o?Xt(o):{status:"",time:"Not Connected Yet"};return e(h,{display:"inline-block",fontSize:"xs",fontWeight:"medium",ml:"2",color:"gray.600",_dark:{color:"gray.400"},children:s&&s<=60?"Online":s?`${i.time} ago`:i.time})},xa=y(uo,{baseStyle:{w:4,h:4}}),ya=y(po,{baseStyle:{w:4,h:4}}),Sr=5;function Sa(t,n,o){if(o0&&(i[0]=0,i[1]="prev-more"),i[i.length-1]{const{filters:t,onFilterChange:n,users:{total:o}}=E(),{limit:s,offset:i}=t,a=(i||0)/(s||1),l=Math.ceil(o/(s||1)),u=Sa(l,a,7),p=c=>{n({...t,offset:c*s})},C=c=>{n({...t,limit:parseInt(c.target.value)}),Vo(c.target.value)},{t:d}=j();return r(_,{justifyContent:"space-between",mt:4,w:"full",display:"flex",columnGap:{lg:4,md:0},rowGap:{md:0,base:4},flexDirection:{md:"row",base:"column"},children:[e(D,{order:{base:2,md:1},children:r(_,{children:[r(Me,{minW:"60px",value:s,onChange:C,size:"sm",rounded:"md",children:[e("option",{children:"10"}),e("option",{children:"20"}),e("option",{children:"30"})]}),e(h,{whiteSpace:"nowrap",fontSize:"sm",children:d("itemsPerPage")})]})}),r(mo,{size:"sm",isAttached:!0,variant:"outline",order:{base:1,md:2},children:[e(F,{leftIcon:e(xa,{}),onClick:p.bind(null,a-1),isDisabled:a===0||l===0,children:d("previous")}),u.map(c=>typeof c=="string"?e(F,{children:"..."},c):e(F,{variant:c===a?"solid":"outline",onClick:p.bind(null,c),children:c+1},c)),e(F,{rightIcon:e(ya,{}),onClick:p.bind(null,a+1),isDisabled:a+1===l||l===0,children:d("next")})]})]})},wa=y(ga),Ge={baseStyle:{w:{base:4,md:5},h:{base:4,md:5}}},_a=y(go,Ge),ka=y(Zr,Ge),Cr=y(fo,Ge),va=y($t,Ge),Ia=y(Br,Ge),za=y(Yr,Ge),Da=y(Zr,{baseStyle:{width:"15px",height:"15px"}}),Ea=t=>{for(var n=0;n{const{used:n,total:o,dataLimitResetStrategy:s,totalUsedTraffic:i}=t,a=o===0||o===null;return e(_,{justifyContent:"space-between",fontSize:"xs",fontWeight:"medium",color:"gray.600",_dark:{color:"gray.400"},children:r(h,{children:[re(n)," /"," ",a?e(h,{as:"span",fontFamily:"system-ui",children:"\u221E"}):re(o)]})})},wr=t=>{const{used:n,total:o,dataLimitResetStrategy:s,totalUsedTraffic:i,...a}=t,l=o===0||o===null,u=!l&&n/o*100>=100;return r(ge,{children:[e(bo,{orientation:"horizontal",value:l?100:Math.min(n/o*100,100),colorScheme:u?"red":"primary",...a,children:e(xo,{h:"6px",borderRadius:"full",children:e(yo,{borderRadius:"full"})})}),r(_,{justifyContent:"space-between",fontSize:"xs",fontWeight:"medium",color:"gray.600",_dark:{color:"gray.400"},children:[r(h,{children:[re(n)," /"," ",l?e(h,{as:"span",fontFamily:"system-ui",children:"\u221E"}):re(o)+(s&&s!=="no_reset"?" "+X("userDialog.resetStrategy"+Ea(s)):"")]}),r(h,{children:[X("usersTable.total"),": ",re(i)]})]})]})},st=({sort:t,column:n})=>t.includes(n)?e(Da,{transform:t.startsWith("-")?void 0:"rotate(180deg)"}):null,Ra=t=>{const{filters:n,users:{users:o},users:s,onEditingUser:i,onFilterChange:a}=E(),{t:l}=j(),[u,p]=f.exports.useState(void 0),C=Ae({base:120,lg:72})||72,[d,c]=f.exports.useState(`${C}px`),w=Ae({base:!1,md:!0});f.exports.useEffect(()=>{const g=()=>{const x=document.querySelectorAll("#filters")[0];c(`${x.offsetHeight}px`)};window.addEventListener("scroll",g)},[]);const v=o.length!==s.total,m=g=>{let x=n.sort;x.includes(g)?x.startsWith("-")?x="-created_at":x="-"+g:x=g,a({sort:x})},S=g=>{a({status:g.target.value.length>0?g.target.value:void 0})},T=g=>{p(g===u?void 0:g)};return r(D,{id:"users-table",overflowX:{base:"unset",md:"unset"},children:[e(mt,{allowMultiple:!0,display:{base:"block",md:"none"},index:u,children:r(sr,{orientation:"vertical",zIndex:"docked",...t,children:[e(ar,{zIndex:"docked",position:"relative",children:r(Oe,{children:[e(ze,{position:"sticky",top:d,minW:"120px",pl:4,pr:4,cursor:"pointer",onClick:m.bind(null,"username"),children:r(_,{children:[e("span",{children:l("users")}),e(st,{sort:n.sort,column:"username"})]})}),e(ze,{position:"sticky",top:d,minW:"50px",pl:0,pr:0,w:"140px",cursor:"pointer",children:r(_,{spacing:0,position:"relative",children:[r(h,{position:"absolute",_dark:{bg:"gray.750"},_light:{bg:"#F9FAFB"},userSelect:"none",pointerEvents:"none",zIndex:1,w:"100%",children:[l("usersTable.status"),n.status?": "+n.status:""]}),r(Me,{value:n.sort,fontSize:"xs",fontWeight:"extrabold",textTransform:"uppercase",cursor:"pointer",p:0,border:0,h:"auto",w:"auto",icon:e(ge,{}),_focusVisible:{border:"0 !important"},onChange:S,children:[e("option",{}),e("option",{children:"active"}),e("option",{children:"on_hold"}),e("option",{children:"disabled"}),e("option",{children:"limited"}),e("option",{children:"expired"})]})]})}),e(ze,{position:"sticky",top:d,minW:"100px",cursor:"pointer",pr:0,onClick:m.bind(null,"used_traffic"),children:r(_,{children:[e("span",{children:l("usersTable.dataUsage")}),e(st,{sort:n.sort,column:"used_traffic"})]})}),e(ze,{position:"sticky",top:d,minW:"32px",w:"32px",p:0,cursor:"pointer"})]})}),e(ir,{children:!w&&(o==null?void 0:o.map((g,x)=>r(f.exports.Fragment,{children:[r(Oe,{onClick:T.bind(null,x),cursor:"pointer",children:[e(ue,{borderBottom:0,minW:"100px",pl:4,pr:4,maxW:"calc(100vw - 50px - 32px - 100px - 48px)",children:r("div",{className:"flex-status",children:[e(xr,{lastOnline:g.online_at}),e(h,{isTruncated:!0,children:g.username})]})}),e(ue,{borderBottom:0,minW:"50px",pl:0,pr:0,children:e(St,{compact:!0,showDetail:!1,expiryDate:g.expire,status:g.status})}),e(ue,{borderBottom:0,minW:"100px",pr:0,children:e(Ua,{totalUsedTraffic:g.lifetime_used_traffic,dataLimitResetStrategy:g.data_limit_reset_strategy,used:g.used_traffic,total:g.data_limit,colorScheme:lt[g.status].bandWidthColor})}),e(ue,{p:0,borderBottom:0,w:"32px",minW:"32px",children:e(ka,{color:"gray.600",_dark:{color:"gray.400"},transition:"transform .2s ease-out",transform:u===x?"rotate(180deg)":"0deg"})})]}),e(Oe,{className:"collapsible",onClick:T.bind(null,x),children:e(ue,{p:0,colSpan:4,children:r(He,{border:0,children:[e(Be,{display:"none"}),e($e,{border:0,cursor:"pointer",px:6,py:3,children:r(N,{justifyContent:"space-between",spacing:"4",children:[r(N,{alignItems:"flex-start",w:"full",spacing:-1,children:[e(h,{textTransform:"capitalize",fontSize:"xs",fontWeight:"bold",color:"gray.600",_dark:{color:"gray.400"},children:l("usersTable.dataUsage")}),e(D,{width:"full",minW:"230px",children:e(wr,{totalUsedTraffic:g.lifetime_used_traffic,dataLimitResetStrategy:g.data_limit_reset_strategy,used:g.used_traffic,total:g.data_limit,colorScheme:lt[g.status].bandWidthColor})})]}),r(_,{w:"full",justifyContent:"space-between",children:[r(D,{width:"full",children:[e(St,{compact:!0,expiryDate:g.expire,status:g.status}),e(yr,{lastOnline:g.online_at})]}),r(_,{children:[e(_r,{user:g}),e(ne,{label:l("userDialog.editUser"),placement:"top",children:e(Z,{p:"0 !important","aria-label":"Edit user",bg:"transparent",_dark:{_hover:{bg:"gray.700"}},size:{base:"sm",md:"md"},onClick:W=>{W.stopPropagation(),i(g)},children:e(za,{})})})]})]})]})})]})})})]},g.username)))})]})}),r(sr,{orientation:"vertical",display:{base:"none",md:"table"},...t,children:[e(ar,{zIndex:"docked",position:"relative",children:r(Oe,{children:[e(ze,{position:"sticky",top:{base:"unset",md:d},minW:"140px",cursor:"pointer",onClick:m.bind(null,"username"),children:r(_,{children:[e("span",{children:l("username")}),e(st,{sort:n.sort,column:"username"})]})}),e(ze,{position:"sticky",top:{base:"unset",md:d},width:"400px",minW:"150px",cursor:"pointer",children:r(_,{position:"relative",gap:"5px",children:[r(h,{_dark:{bg:"gray.750"},_light:{bg:"#F9FAFB"},userSelect:"none",pointerEvents:"none",zIndex:1,children:[l("usersTable.status"),n.status?": "+n.status:""]}),e(h,{children:"/"}),e(st,{sort:n.sort,column:"expire"}),e(_,{onClick:m.bind(null,"expire"),children:e(h,{children:"Sort by expire"})}),r(Me,{fontSize:"xs",fontWeight:"extrabold",textTransform:"uppercase",cursor:"pointer",position:"absolute",p:0,left:"-40px",border:0,h:"auto",w:"auto",icon:e(ge,{}),_focusVisible:{border:"0 !important"},value:n.sort,onChange:S,children:[e("option",{}),e("option",{children:"active"}),e("option",{children:"on_hold"}),e("option",{children:"disabled"}),e("option",{children:"limited"}),e("option",{children:"expired"})]})]})}),e(ze,{position:"sticky",top:{base:"unset",md:d},width:"350px",minW:"230px",cursor:"pointer",onClick:m.bind(null,"used_traffic"),children:r(_,{children:[e("span",{children:l("usersTable.dataUsage")}),e(st,{sort:n.sort,column:"used_traffic"})]})}),e(ze,{position:"sticky",top:{base:"unset",md:d},width:"200px",minW:"180px"})]})}),r(ir,{children:[w&&(o==null?void 0:o.map((g,x)=>r(Oe,{className:Rt("interactive",{"last-row":x===o.length-1}),onClick:()=>i(g),children:[e(ue,{minW:"140px",children:r("div",{className:"flex-status",children:[e(xr,{lastOnline:g.online_at}),g.username,e(yr,{lastOnline:g.online_at})]})}),e(ue,{width:"400px",minW:"150px",children:e(St,{expiryDate:g.expire,status:g.status})}),e(ue,{width:"350px",minW:"230px",children:e(wr,{totalUsedTraffic:g.lifetime_used_traffic,dataLimitResetStrategy:g.data_limit_reset_strategy,used:g.used_traffic,total:g.data_limit,colorScheme:lt[g.status].bandWidthColor})}),e(ue,{width:"200px",minW:"180px",children:e(_r,{user:g})})]},g.username))),o.length==0&&e(Oe,{children:e(ue,{colSpan:4,children:e(La,{isFiltered:v})})})]})]}),e(Ca,{})]})},_r=({user:t})=>{const{setQRCode:n,setSubLink:o}=E(),s=t.links.join(`\r +`),[i,a]=f.exports.useState([-1,!1]);return f.exports.useEffect(()=>{i[1]&&setTimeout(()=>{a([-1,!1])},1e3)},[i]),r(_,{justifyContent:"flex-end",onClick:l=>{l.preventDefault(),l.stopPropagation()},children:[e(lr,{text:t.subscription_url.startsWith("/")?window.location.origin+t.subscription_url:t.subscription_url,onCopy:()=>{a([0,!0])},children:e("div",{children:e(ne,{label:i[0]==0&&i[1]?X("usersTable.copied"):X("usersTable.copyLink"),placement:"top",children:e(Z,{p:"0 !important","aria-label":"copy subscription link",bg:"transparent",_dark:{_hover:{bg:"gray.700"}},size:{base:"sm",md:"md"},children:i[0]==0&&i[1]?e(Cr,{}):e(va,{})})})})}),e(lr,{text:s,onCopy:()=>{a([1,!0])},children:e("div",{children:e(ne,{label:i[0]==1&&i[1]?X("usersTable.copied"):X("usersTable.copyConfigs"),placement:"top",children:e(Z,{p:"0 !important","aria-label":"copy configs",bg:"transparent",_dark:{_hover:{bg:"gray.700"}},size:{base:"sm",md:"md"},children:i[0]==1&&i[1]?e(Cr,{}):e(_a,{})})})})}),e(ne,{label:"QR Code",placement:"top",children:e(Z,{p:"0 !important","aria-label":"qr code",bg:"transparent",_dark:{_hover:{bg:"gray.700"}},size:{base:"sm",md:"md"},onClick:()=>{n(t.links),o(t.subscription_url)},children:e(Ia,{})})})]})},La=({isFiltered:t})=>{const{onCreateUser:n}=E();return r(D,{padding:"5",py:"8",display:"flex",alignItems:"center",flexDirection:"column",gap:4,w:"full",children:[e(wa,{maxHeight:"200px",maxWidth:"200px",_dark:{'path[fill="#fff"]':{fill:"gray.800"},'path[fill="#f2f2f2"], path[fill="#e6e6e6"], path[fill="#ccc"]':{fill:"gray.700"},'circle[fill="#3182CE"]':{fill:"primary.300"}},_light:{'path[fill="#f2f2f2"], path[fill="#e6e6e6"], path[fill="#ccc"]':{fill:"gray.300"},'circle[fill="#3182CE"]':{fill:"primary.500"}}}),e(h,{fontWeight:"medium",color:"gray.600",_dark:{color:"gray.400"},children:t?X("usersTable.noUserMatched"):X("usersTable.noUser")}),!t&&e(F,{size:"sm",colorScheme:"primary",onClick:()=>n(!0),children:X("createUser")})]})},Ta=()=>(f.exports.useEffect(()=>{E.getState().refetchUsers(),Yo()},[]),r(N,{justifyContent:"space-between",minH:"100vh",p:"6",rowGap:4,children:[r(D,{w:"full",children:[e(ws,{}),e(Bo,{mt:"4"}),e(is,{}),e(Ra,{}),e(ma,{}),e(ns,{}),e(Xs,{}),e(Ts,{}),e(ta,{}),e(na,{}),e(Bs,{}),e(Ys,{}),e(Ks,{}),e(rs,{})]}),e(Kr,{})]})),Aa=t=>f.exports.createElement("svg",{viewBox:"0 0 747 747",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},f.exports.createElement("path",{d:"M746.671 209.652V77.6572C746.671 72.9384 743.827 68.6832 739.468 66.8811C735.108 65.0738 730.093 66.0739 726.754 69.4072L579.354 216.807C577.453 202.386 570.203 189.203 559.037 179.87C547.875 170.542 533.615 165.744 519.083 166.432C504.551 167.12 490.807 173.24 480.573 183.583L414.375 249.776C412.417 235.391 405.141 222.25 393.985 212.959C382.823 203.662 368.594 198.88 354.083 199.552C339.578 200.224 325.849 206.302 315.594 216.588L274.343 257.828L19.9167 3.41515C16.5781 0.0818157 11.5625 -0.918184 7.20306 0.889149C2.84373 2.69648 0 6.94648 0 11.6651V143.649C0 146.743 1.22917 149.712 3.41667 151.899L191.843 340.339L3.41667 528.753C1.2292 530.94 0 533.909 0 537.003V668.997C0 673.716 2.84373 677.971 7.20306 679.773C11.5624 681.581 16.578 680.58 19.9167 677.247L167.317 529.847C169.285 544.233 176.561 557.358 187.718 566.65C198.869 575.947 213.098 580.728 227.603 580.066C242.103 579.404 255.838 573.342 266.098 563.071L332.295 496.874V496.879C334.259 511.264 341.535 524.395 352.691 533.686C363.853 542.977 378.082 547.759 392.587 547.092C407.093 546.421 420.822 540.348 431.077 530.066L472.327 488.826L726.754 743.239C728.941 745.427 731.91 746.656 735.004 746.656C736.535 746.661 738.056 746.359 739.473 745.77C743.832 743.963 746.671 739.708 746.671 734.989V602.994C746.671 599.901 745.442 596.932 743.254 594.744L554.827 406.318L743.254 217.904H743.259C745.447 215.717 746.676 212.748 746.676 209.654L746.671 209.652ZM23.3373 39.8118L257.844 274.318L208.328 323.818L23.3413 138.818L23.3373 39.8118ZM723.337 706.825L488.831 472.318L538.347 422.818L723.333 607.818L723.337 706.825ZM23.3373 541.825L332.097 233.078C338.764 226.719 347.624 223.172 356.843 223.172C366.056 223.172 374.916 226.719 381.588 233.078C388.151 239.641 391.838 248.548 391.838 257.828C391.838 267.114 388.151 276.016 381.588 282.577L23.3347 640.831L23.3373 541.825ZM249.604 546.575C240.755 555.419 227.864 558.872 215.781 555.638C203.703 552.398 194.265 542.961 191.027 530.883C187.792 518.8 191.245 505.91 200.089 497.06L497.076 200.074C505.92 191.23 518.811 187.772 530.893 191.011C542.971 194.246 552.409 203.678 555.648 215.76C558.888 227.839 555.434 240.73 546.591 249.572L249.604 546.575ZM723.337 204.815L414.577 513.562C407.911 519.926 399.051 523.473 389.832 523.473C380.618 523.473 371.753 519.926 365.087 513.562C358.529 506.999 354.842 498.098 354.842 488.816C354.842 479.535 358.529 470.634 365.087 464.071L723.34 105.818L723.337 204.815Z",fill:"currentColor"})),Ma=b.object({username:b.string().min(1,"login.fieldRequired"),password:b.string().min(1,"login.fieldRequired")}),Na=y(Aa,{baseStyle:{strokeWidth:"10px",w:12,h:12}}),Fa=y(So,{baseStyle:{w:5,h:5,strokeWidth:"2px"}}),kr=()=>{var c,w;const[t,n]=f.exports.useState(""),[o,s]=f.exports.useState(!1),i=Co(),{t:a}=j();let l=wo();const{register:u,formState:{errors:p},handleSubmit:C}=Ve({resolver:pt(Ma)});f.exports.useEffect(()=>{No(),l.pathname!=="/login"&&i("/login",{replace:!0})},[]);const d=v=>{n("");const m=new FormData;m.append("username",v.username),m.append("password",v.password),m.append("grant_type","password"),s(!0),O("/admin/token",{method:"post",body:m}).then(({access_token:S})=>{Mo(S),i("/")}).catch(S=>{n(S.response._data.detail)}).finally(s.bind(null,!1))};return r(N,{justifyContent:"space-between",minH:"100vh",p:"6",w:"full",children:[r(D,{w:"full",children:[e(_,{justifyContent:"end",w:"full",children:e(en,{})}),e(_,{w:"full",justifyContent:"center",alignItems:"center",children:r(D,{w:"full",maxW:"340px",mt:"6",children:[r(N,{alignItems:"center",w:"full",children:[e(Na,{}),e(h,{fontSize:"2xl",fontWeight:"semibold",children:a("login.loginYourAccount")}),e(h,{color:"gray.600",_dark:{color:"gray.400"},children:a("login.welcomeBack")})]}),e(D,{w:"full",maxW:"300px",m:"auto",pt:"4",children:e("form",{onSubmit:C(d),children:r(N,{mt:4,rowGap:2,children:[e(R,{children:e(Ue,{w:"full",placeholder:a("username"),...u("username"),error:a((c=p==null?void 0:p.username)==null?void 0:c.message)})}),e(R,{children:e(Ue,{w:"full",type:"password",placeholder:a("password"),...u("password"),error:a((w=p==null?void 0:p.password)==null?void 0:w.message)})}),t&&r(dt,{status:"error",rounded:"md",children:[e(vt,{}),e(Pr,{children:t})]}),r(F,{isLoading:o,type:"submit",w:"full",colorScheme:"primary",children:[e(Fa,{marginRight:1}),a("login")]})]})})})]})})]}),e(Kr,{})]})},Pa=()=>O("/admin",{headers:{Authorization:`Bearer ${It()}`}}),Wa=_o([{path:"/",element:e(Ta,{}),errorElement:e(kr,{}),loader:Pa},{path:"/login/",element:e(kr,{})}],{basename:"/dashboard/"});function Oa(){return e("main",{className:"p-8",children:e(ko,{router:Wa})})}B.extend(vo);B.extend(Io);B.extend(zo);B.extend(Do);B.extend(Eo);Qr(Uo.get()||"light");Ro.createRoot(document.getElementById("root")).render(e(Ft.StrictMode,{children:e(Lo,{theme:Ao,children:e(To,{client:Wt,children:e(Oa,{})})})})); diff --git a/app/dashboard/build/index.html b/app/dashboard/build/index.html index 128e9aed..d4138704 100644 --- a/app/dashboard/build/index.html +++ b/app/dashboard/build/index.html @@ -33,7 +33,7 @@ - + diff --git a/app/dashboard/build/locales/en.json b/app/dashboard/build/locales/en.json index 72a02412..ab37df8c 100644 --- a/app/dashboard/build/locales/en.json +++ b/app/dashboard/build/locales/en.json @@ -1,178 +1,183 @@ { - "password": "Password", - "login": "Login", - "cancel": "Cancel", + "active": "active", + "activeUsers": "active users", "apply": "Apply", - "delete": "Delete", - "reset": "Reset", + "cancel": "Cancel", + "core.configuration": "Configuration", + "core.generalErrorMessage": "Something went wrong, please check the configuration", + "core.logs": "Logs", + "core.restartCore": "Restart Core", + "core.restarting": "Restarting...", + "core.save": "Save", + "core.socket.closed": "Closed", + "core.socket.connected": "Connected", + "core.socket.connecting": "Connecting...", + "core.socket.not_connected": "Not Connected", + "core.successMessage": "Core settings updated successfully", + "core.title": "Core Settings", + "createNewUser": "Create new user", "createUser": "Create User", - "username": "Username", - "expires": "Expires in {{time}}", - "expired": "Expired {{time}} ago", + "dataUsage": "data usage", "dateFormat": "MMMM d, yyy", - "inbound": "Inbound", - "login.loginYourAccount": "Login to your account", - "login.welcomeBack": "Welcome back, please enter your details", - "login.fieldRequired": "This field is required", + "delete": "Delete", + "deleteNode.deleteSuccess": "Node {{name}} removed successfully", + "deleteNode.prompt": "Are you sure you want to delete the {{name}} node?", + "deleteNode.title": "Delete Node", + "deleteUser.deleteSuccess": "{{username}} deleted successfully.", + "deleteUser.prompt": "Are you sure you want to delete {{username}}?", + "deleteUser.title": "Delete User", + "disabled": "disabled", + "expired": "Expired {{time}} ago", + "expires": "Expires in {{time}}", + "header.donation": "Donation", "header.hostSettings": "Host Settings", + "header.logout": "Log out", "header.nodeSettings": "Node Settings", "header.nodesUsage": "Nodes Usage", - "header.donation": "Donation", - "header.logout": "Log out", - "deleteUser.title": "Delete User", - "deleteUser.prompt": "Are you sure you want to delete {{username}}?", - "deleteUser.deleteSuccess": "{{username}} deleted successfully.", - "usersTable.status": "status", - "usersTable.dataUsage": "data usage", - "usersTable.noUserMatched": "It seems there is no user matched with what you are looking for", - "usersTable.noUser": "There is no user added to the system", - "usersTable.copyLink": "Copy Subscription Link", - "usersTable.copied": "Copied", - "usersTable.copyConfigs": "Copy Configs", - "usersTable.total": "Total", - "userDialog.dataLimit": "Data Limit", - "userDialog.periodicUsageReset": "Periodic Usage Reset", - "userDialog.warningNoProtocol": "Please select at least one protocol", - "userDialog.expiryDate": "Expiry Date", - "userDialog.note": "Note", - "userDialog.resetUsage": "Reset Usage", - "userDialog.usage": "Usage", - "userDialog.protocols": "Protocols", - "userDialog.editUserTitle": "Edit user", - "userDialog.editUser": "Edit user", - "userDialog.userEdited": "User {{username}} edited.", - "userDialog.userCreated": "User {{username}} created.", - "userDialog.userAlreadyExists": "User already exists", - "userDialog.vmessDesc": "Fast and secure", - "userDialog.vlessDesc": "Lightweight, fast and secure", - "userDialog.trojanDesc": "Lightweight, secure and lightening fast", - "userDialog.shadowsocksDesc": "Fast and secure, but not efficient as others", - "userDialog.resetStrategyNo": "No", - "userDialog.resetStrategyDaily": "Daily", - "userDialog.resetStrategyWeekly": "Weekly", - "userDialog.resetStrategyMonthly": "Monthly", - "userDialog.resetStrategyAnnually": "Annually", - "userDialog.selectOneProtocol": "Please select at least one protocol", - "userDialog.optional": "optional", - "userDialog.method": "Method", - "userDialog.generatedByDefault": "Automatically generated by default", - "userDialog.hours": "Hours", - "userDialog.days": "Days", - "userDialog.weeks": "Weeks", - "userDialog.months": "Months", - "userDialog.relative": "Relative", - "userDialog.absolute": "Absolute", - "userDialog.custom": "Custom", - "userDialog.startDate": "Start date", - "userDialog.endDate": "End date", - "userDialog.revokeSubscription": "Revoke Subscription", - "revoke": "Revoke", - "userDialog.total": "Total: ", - "userDialog.onHold" : "On Hold", - "userDialog.onHoldExpireDuration":"Expire Duration", - "hostsDialog.title": "Using this setting, you are able to assign specific address for each inbound.", - "hostsDialog.desc": "Use these variables to make it dynamic", - "hostsDialog.username": "The username of the user", - "hostsDialog.dataUsage": "The current usage of the user", - "hostsDialog.remainingData": "Remaining data of the user", - "hostsDialog.dataLimit": "The usage limit of the user", - "hostsDialog.remainingDays": "Remaining days of the user", - "hostsDialog.expireDate": "Expiry date of the user", - "hostsDialog.jalaliExpireDate": "Expiry date of the user in solar calendar", - "hostsDialog.remainingTime": "Remaining time of the user", - "hostsDialog.statusEmoji": "User status as an emoji (✅,⌛️,🪫,❌,🔌)", - "hostsDialog.statusText": "User status", - "hostsDialog.proxyProtocol": "Proxy protocol (e.g. VMess)", - "hostsDialog.proxyMethod": "Proxy transport method (e.g. ws)", + "hostsDialog.addHost": "Add host", + "hostsDialog.advancedOptions": "Advanced options", + "hostsDialog.allowinsecure": "Allow Insecure", + "hostsDialog.alpn": "ALPN", + "hostsDialog.apply": "Apply", "hostsDialog.currentServer": "IP Address of current server", "hostsDialog.currentServerv6": "IPv6 of current server", - "hostsDialog.security": "Security Layer", + "hostsDialog.dataLimit": "The usage limit of the user", + "hostsDialog.dataUsage": "The current usage of the user", + "hostsDialog.desc": "Use these variables to make it dynamic", + "hostsDialog.expireDate": "Expiry date of the user", + "hostsDialog.fingerprint": "Fingerprint", + "hostsDialog.fragment": "Fragment pattern", + "hostsDialog.fragment.info": "Correct pattern: length,interval,packets", + "hostsDialog.fragment.info.attention": "Attention: currently, this feature only supported in streisand >= 1.6.12 and v2rayNG >= 1.8.16 (custom config)", + "hostsDialog.fragment.info.examples": "Examples:", "hostsDialog.host": "Request Host", - "hostsDialog.port": "Port", - "hostsDialog.path": "Path", - "hostsDialog.sni": "SNI", - "hostsDialog.advancedOptions": "Advanced options", - "hostsDialog.addHost": "Add host", - "hostsDialog.savedSuccess": "Hosts saved successfully", - "hostsDialog.loading": "loading...", - "hostsDialog.apply": "Apply", - "hostsDialog.port.info": "By default, a host uses the default port of the inbound. You can set a custom port in case this host is a server that forwards traffic from a port that differs from your server's port. For example, the server may forward traffic from port 8443 to the default port of your inbound server.", - "hostsDialog.path.info": "Set a path for host users, useful behind a reverse proxy.", - "hostsDialog.sni.info": "By default, a host uses the default SNI of the inbound. You can set a custom SNI in case this host is a server that has a different SNI. For example, the server may receive traffic with a different SSL certificate, perform SSL termination, and forward it to your inbound server.", "hostsDialog.host.info": "By default, if a request host is set in the Xray config, this host is used. However, you can set a custom request host here if needed.", - "hostsDialog.security.info": "If the middleware server of this host uses a different security layer than the inbound's default, you can set a custom security layer here.", - "hostsDialog.alpn": "ALPN", - "hostsDialog.fingerprint": "Fingerprint", "hostsDialog.host.multiHost": "To set multiple addresses, separate them with , Each time an address is chosen randomly.", "hostsDialog.host.wildcard": "Use * to generate a random string (works for wildcard domain names)", - "hostsDialog.sockopt": "Sockopt", + "hostsDialog.jalaliExpireDate": "Expiry date of the user in solar calendar", + "hostsDialog.loading": "loading...", "hostsDialog.muxEnable": "Enable MUX", - "hostsDialog.randomUserAgent":"Use random user agent", - "hostsDialog.allowinsecure": "Allow Insecure", - "hostsDialog.fragment": "Fragment pattern", - "hostsDialog.fragment.info": "Correct pattern: length,interval,packets", - "hostsDialog.fragment.info.examples": "Examples:", - "hostsDialog.fragment.info.attention": "Attention: currently, this feature only supported in streisand >= 1.6.12 and v2rayNG >= 1.8.16 (custom config)", + "hostsDialog.path": "Path", + "hostsDialog.path.info": "Set a path for host users, useful behind a reverse proxy.", + "hostsDialog.port": "Port", + "hostsDialog.port.info": "By default, a host uses the default port of the inbound. You can set a custom port in case this host is a server that forwards traffic from a port that differs from your server's port. For example, the server may forward traffic from port 8443 to the default port of your inbound server.", + "hostsDialog.proxyMethod": "Proxy transport method (e.g. ws)", "hostsDialog.proxyOutbound": "Proxy outbound json", "hostsDialog.proxyOutbound.info": "Extra outbound ( only in v2ray custom config )", - "nodes.title": "Using Marzban-Node, you are able to scale up your connection quality by adding different nodes on different servers.", + "hostsDialog.proxyProtocol": "Proxy protocol (e.g. VMess)", + "hostsDialog.randomUserAgent": "Use random user agent", + "hostsDialog.remainingData": "Remaining data of the user", + "hostsDialog.remainingDays": "Remaining days of the user", + "hostsDialog.remainingTime": "Remaining time of the user", + "hostsDialog.savedSuccess": "Hosts saved successfully", + "hostsDialog.security": "Security Layer", + "hostsDialog.security.info": "If the middleware server of this host uses a different security layer than the inbound's default, you can set a custom security layer here.", + "hostsDialog.sni": "SNI", + "hostsDialog.sni.info": "By default, a host uses the default SNI of the inbound. You can set a custom SNI in case this host is a server that has a different SNI. For example, the server may receive traffic with a different SSL certificate, perform SSL termination, and forward it to your inbound server.", + "hostsDialog.sockopt": "Sockopt", + "hostsDialog.statusEmoji": "User status as an emoji (\u2705,\u231b\ufe0f,\ud83e\udeab,\u274c,\ud83d\udd0c)", + "hostsDialog.statusText": "User status", + "hostsDialog.title": "Using this setting, you are able to assign specific address for each inbound.", + "hostsDialog.username": "The username of the user", + "inbound": "Inbound", + "itemsPerPage": "Items per page", + "login": "Login", + "login.fieldRequired": "This field is required", + "login.loginYourAccount": "Login to your account", + "login.welcomeBack": "Welcome back, please enter your details", + "memoryUsage": "memory usage", + "next": "Next", + "nodes.addHostForEveryInbound": "Add this node as a new host for every inbound", "nodes.addNewMarzbanNode": "Add New Marzban Node", + "nodes.addNode": "Add Node", + "nodes.addNodeSuccess": "Node {{name}} added successfully", + "nodes.apply": "editNode", "nodes.certificate": "Certificate", "nodes.connection-hint": "To setup a Marzban Node, you need to set this certificate on the node to initialize a secure connection between main server and the node", "nodes.download-certificate": "Download certificate", - "nodes.show-certificate": "Show certificate", + "nodes.editNode": "Update Node", "nodes.hide-certificate": "Hide certificate", - "nodes.addHostForEveryInbound": "Add this node as a new host for every inbound", - "nodes.addNode": "Add Node", - "nodes.addNodeSuccess": "Node {{name}} added successfully", - "nodes.apply": "editNode", - "nodes.nodeName": "Name", + "nodes.nodeAPIPort": "API Port", "nodes.nodeAddress": "Address", + "nodes.nodeName": "Name", "nodes.nodePort": "Port", - "nodes.nodeAPIPort": "API Port", - "nodes.editNode": "Update Node", "nodes.reconnect": "Reconnect", "nodes.reconnecting": "Reconnecting...", + "nodes.show-certificate": "Show certificate", + "nodes.title": "Using Marzban-Node, you are able to scale up your connection quality by adding different nodes on different servers.", "nodes.usageCoefficient": "Usage Ratio", - "deleteNode.title": "Delete Node", - "deleteNode.prompt": "Are you sure you want to delete the {{name}} node?", - "deleteNode.deleteSuccess": "Node {{name}} removed successfully", - "users": "Users", - "active": "active", - "disabled": "disabled", - "activeUsers": "active users", - "dataUsage": "data usage", - "memoryUsage": "memory usage", - "itemsPerPage": "Items per page", + "on_hold": "On Hold", + "password": "Password", "previous": "Previous", - "next": "Next", - "createNewUser": "Create new user", - "search": "Search", - "resetAllUsage": "Reset All Usages", "qrcodeDialog.sublink": "Subscribe Link", + "reset": "Reset", + "resetAllUsage": "Reset All Usages", + "resetAllUsage.error": "Usage reset failed, please try again.", + "resetAllUsage.prompt": "This action clears all of the users' data usage completely. Are you sure you want to reset all usage? THIS CANNOT BE UNDONE!", + "resetAllUsage.success": "All usage has reset successfully.", + "resetAllUsage.title": "Reset data usage for all users", + "resetUserUsage.error": "Usage reset failed, please try again.", "resetUserUsage.prompt": "Are you sure you want to reset {{username}}'s usage?", - "resetUserUsage.title": "Reset User Usage", "resetUserUsage.success": "{{username}}'s usage has reset successfully.", - "resetUserUsage.error": "Usage reset failed, please try again.", + "resetUserUsage.title": "Reset User Usage", + "revoke": "Revoke", + "revokeUserSub.error": "Subscription revoke failed, please try again.", "revokeUserSub.prompt": "Are you sure you want to revoke {{username}}'s subscription?", - "revokeUserSub.title": "Revoke User Subscription", "revokeUserSub.success": "{{username}}'s subscription has revoked successfully.", - "revokeUserSub.error": "Subscription revoke failed, please try again.", - "resetAllUsage.title": "Reset data usage for all users", - "resetAllUsage.prompt": "This action clears all of the users' data usage completely. Are you sure you want to reset all usage? THIS CANNOT BE UNDONE!", - "resetAllUsage.success": "All usage has reset successfully.", - "resetAllUsage.error": "Usage reset failed, please try again.", - "core.title": "Core Settings", - "core.socket.connecting": "Connecting...", - "core.socket.connected": "Connected", - "core.socket.not_connected": "Not Connected", - "core.socket.closed": "Closed", - "core.restarting": "Restarting...", - "core.restartCore": "Restart Core", - "core.save": "Save", - "core.logs": "Logs", - "core.configuration": "Configuration", - "core.generalErrorMessage": "Something went wrong, please check the configuration", - "core.successMessage": "Core settings updated successfully", - "on_hold": "On Hold" -} + "revokeUserSub.title": "Revoke User Subscription", + "search": "Search", + "status.active": "Active", + "status.disabled": "Disabled", + "status.expired": "Expired", + "status.limited": "Limited", + "status.on_hold": "On Hold", + "userDialog.absolute": "Absolute", + "userDialog.custom": "Custom", + "userDialog.dataLimit": "Data Limit", + "userDialog.days": "Days", + "userDialog.editUser": "Edit user", + "userDialog.editUserTitle": "Edit user", + "userDialog.endDate": "End date", + "userDialog.expiryDate": "Expiry Date", + "userDialog.generatedByDefault": "Automatically generated by default", + "userDialog.hours": "Hours", + "userDialog.method": "Method", + "userDialog.months": "Months", + "userDialog.note": "Note", + "userDialog.onHold": "On Hold", + "userDialog.onHoldExpireDuration": "Expire Duration", + "userDialog.optional": "optional", + "userDialog.periodicUsageReset": "Periodic Usage Reset", + "userDialog.protocols": "Protocols", + "userDialog.relative": "Relative", + "userDialog.resetStrategyAnnually": "Annually", + "userDialog.resetStrategyDaily": "Daily", + "userDialog.resetStrategyMonthly": "Monthly", + "userDialog.resetStrategyNo": "No", + "userDialog.resetStrategyWeekly": "Weekly", + "userDialog.resetUsage": "Reset Usage", + "userDialog.revokeSubscription": "Revoke Subscription", + "userDialog.selectOneProtocol": "Please select at least one protocol", + "userDialog.shadowsocksDesc": "Fast and secure, but not efficient as others", + "userDialog.startDate": "Start date", + "userDialog.total": "Total: ", + "userDialog.trojanDesc": "Lightweight, secure and lightening fast", + "userDialog.usage": "Usage", + "userDialog.userAlreadyExists": "User already exists", + "userDialog.userCreated": "User {{username}} created.", + "userDialog.userEdited": "User {{username}} edited.", + "userDialog.vlessDesc": "Lightweight, fast and secure", + "userDialog.vmessDesc": "Fast and secure", + "userDialog.warningNoProtocol": "Please select at least one protocol", + "userDialog.weeks": "Weeks", + "username": "Username", + "users": "Users", + "usersTable.copied": "Copied", + "usersTable.copyConfigs": "Copy Configs", + "usersTable.copyLink": "Copy Subscription Link", + "usersTable.dataUsage": "data usage", + "usersTable.noUser": "There is no user added to the system", + "usersTable.noUserMatched": "It seems there is no user matched with what you are looking for", + "usersTable.status": "status", + "usersTable.total": "Total" +} \ No newline at end of file diff --git a/app/dashboard/build/locales/fa.json b/app/dashboard/build/locales/fa.json index ae02d93e..9e1e22fb 100644 --- a/app/dashboard/build/locales/fa.json +++ b/app/dashboard/build/locales/fa.json @@ -1,173 +1,188 @@ -{ - "password": "گذرواژه", - "login": "ورود", - "cancel": "لغو", +{ + "active": "فعال", + "activeUsers": "کاربران فعال", "apply": "تایید", - "delete": "حذف", - "reset": "بازنشانی", + "cancel": "لغو", + "core.configuration": "پیکربندی", + "core.generalErrorMessage": "مشکلی پیش آمده، لطفا پیکربندی را بررسی کنید", + "core.logs": "گزارش", + "core.restartCore": "اجرا مجدد هسته", + "core.restarting": "درحال اجرا مجدد...", + "core.save": "ذخیره", + "core.socket.closed": "بسته شده", + "core.socket.connected": "متصل", + "core.socket.connecting": "در حال اتصال...", + "core.socket.not_connected": "عدم اتصال", + "core.successMessage": "تنظیمات هسته با موفقیت ثبت شد", + "core.title": "تنظیمات هسته", + "createNewUser": "ساخت کاربر", "createUser": "افزودن کاربر", - "username": "نام کاربری", - "dateInfo.year": " سال", - "dateInfo.month": " ماه", + "dataUsage": "مصرف داده", + "dateFormat": "MM/dd/yyyy", "dateInfo.day": " روز", "dateInfo.hour": " ساعت", "dateInfo.min": " دقیقه", - "expires": "پایان در {{time}}", + "dateInfo.month": " ماه", + "dateInfo.year": " سال", + "delete": "حذف", + "deleteNode.deleteSuccess": "گره {{name}} با موفقیت حذف شد", + "deleteNode.prompt": "از حذف گره {{name}} مطمئن هستید؟", + "deleteNode.title": "حذف گره", + "deleteUser.deleteSuccess": "{{username}} با موفقیت حذف شد.", + "deleteUser.prompt": "از حذف کاربر {{username}} مطمئن هستید?", + "deleteUser.title": "حذف کاربر", + "disabled": "غیر فعال", "expired": "{{time}} پیش به پایان رسیده", - "dateFormat": "MM/dd/yyyy", - "inbound": "ورودی", - "login.loginYourAccount": "وارد حساب خود شوید", - "login.welcomeBack": "خوش آمدید, لطفا اطلاعات خود را وارد کنید", - "login.fieldRequired": "This field is required", + "expires": "پایان در {{time}}", + "header.donation": "کمک مالی", "header.hostSettings": "تنظیمات هاست", + "header.logout": "خروج", "header.nodeSettings": "تنظیمات گره‌ها", "header.nodesUsage": "نمودار گره‌ها", - "header.donation": "کمک مالی", - "header.logout": "خروج", - "deleteUser.title": "حذف کاربر", - "deleteUser.prompt": "از حذف کاربر {{username}} مطمئن هستید?", - "deleteUser.deleteSuccess": "{{username}} با موفقیت حذف شد.", - "usersTable.status": "وضعیت", - "usersTable.dataUsage": "مصرف داده", - "usersTable.noUserMatched": "به‌نظر میرسه کاربری که جستجو کردید، وجود ندارد", - "usersTable.noUser": "کاربری افزوده نشده است", - "usersTable.copyLink": "کپی لینک اشتراک", - "usersTable.copied": "کپی شد", - "usersTable.copyConfigs": "تنظیمات کپی", - "usersTable.total": "مجموع", - "userDialog.dataLimit": "حد مصرف داده", - "userDialog.periodicUsageReset": "بازنشانی دوره‌ای مصرف", - "userDialog.warningNoProtocol": "لطفا حداقل یک پروتکل انتخاب کنید", - "userDialog.note": "توضیحات", - "userDialog.expiryDate": "تاریخ پایان", - "userDialog.resetUsage": "بازنشانی مصرف", - "userDialog.usage": "مصرف", - "userDialog.protocols": "پروتکل‌ها", - "userDialog.editUserTitle": "ویرایش کاربر", - "userDialog.editUser": "ویرایش کاربر", - "userDialog.userEdited": "کاربر {{username}} ویرایش شد.", - "userDialog.userCreated": "کاربر {{username}} ساخته شد.", - "userDialog.userAlreadyExists": "کاربر وجود دارد", - "userDialog.vmessDesc": "سریع و امن", - "userDialog.vlessDesc": "سبک، سریع و امن", - "userDialog.trojanDesc": "سبک، امن و فوق‌العاده سریع", - "userDialog.shadowsocksDesc": "سریع و امن، اما کارآمد کمتر از بقیه", - "userDialog.resetStrategyNo": "خیر", - "userDialog.resetStrategyDaily": "روزانه", - "userDialog.resetStrategyWeekly": "هفتگی", - "userDialog.resetStrategyMonthly": "ماهانه", - "userDialog.resetStrategyAnnually": "سالانه", - "userDialog.selectOneProtocol": "لطفا حداقل یک پروتکل انتخاب کنید", - "userDialog.optional": "اختیاری", - "userDialog.method": "روش", - "userDialog.generatedByDefault": "پیش‌فرض ساخته می‌شود", - "userDialog.hours": "ساعات", - "userDialog.days": "روزها", - "userDialog.weeks": "هفته‌ها", - "userDialog.months": "ماه‌ها", - "userDialog.relative": "نسبی", - "userDialog.absolute": "مطلق", - "userDialog.custom": "انتخابی", - "userDialog.startDate": "تاریخ شروع", - "userDialog.endDate": "تاریخ پایان", - "userDialog.total": "مجموع: ", - "userDialog.onHold": "در انتظار", - "userDialog.onHoldExpireDuration": "مدت انقضا", - "hostsDialog.title": "با انتخاب این تنظیمات، می‌توانید برای هر ورودی یک آدرس منحصر به فرد انتخاب کنید.", - "hostsDialog.desc": "برای ساخت نوشته پویا، از این متغیرها استفاده کنید", - "hostsDialog.username": "نام کاربری کاربر", - "hostsDialog.dataUsage": "مصرف کنونی کاربر", - "hostsDialog.remainingData": "حجم باقی‌مانده کاربر", - "hostsDialog.dataLimit": "حد مصرف کاربر", - "hostsDialog.remainingDays": "روزهای باقی مانده کاربر", - "hostsDialog.expireDate": "تاریخ انقضای کاربر به میلادی", - "hostsDialog.jalaliExpireDate": "تاریخ انقضای کاربر به شمسی", - "hostsDialog.remainingTime": "زمان باقی مانده کاربر", - "hostsDialog.statusEmoji": "وضعیت کاربر در قالب اموجی (✅,⌛️,🪫,❌,🔌)", - "hostsDialog.statusText": "وضعیت کاربر", - "hostsDialog.proxyProtocol": "پروتکل پروکسی (مانند VMess)", - "hostsDialog.proxyMethod": "روش انتقال پروکسی (مانند ws)", + "hostsDialog.addHost": "افزودن هاست", + "hostsDialog.advancedOptions": "تنظیمات پیشرفته", + "hostsDialog.allowinsecure": "Allow Insecure", + "hostsDialog.alpn": "ALPN", + "hostsDialog.apply": "اعمال", "hostsDialog.currentServer": "IP کنونی سرور", "hostsDialog.currentServerv6": "IPv6 کنونی سرور", - "hostsDialog.security": "لایه امنیت", + "hostsDialog.dataLimit": "حد مصرف کاربر", + "hostsDialog.dataUsage": "مصرف کنونی کاربر", + "hostsDialog.desc": "برای ساخت نوشته پویا، از این متغیرها استفاده کنید", + "hostsDialog.expireDate": "تاریخ انقضای کاربر به میلادی", + "hostsDialog.fingerprint": "اثرانگشت", + "hostsDialog.fragment": "الگو فرگمنت", + "hostsDialog.fragment.info": "length,interval,packet (e.g. 10-100,100-200,tlshello)", + "hostsDialog.fragment.info.attention": "توجه: در حال حاضر، این ویژگی فقط در streisand >= 1.6.12 و v2rayNG >= 1.8.16 (پیکربندی سفارشی) پشتیبانی می شود", + "hostsDialog.fragment.info.examples": "نمونه ها:", "hostsDialog.host": "هاست درخواست", - "hostsDialog.port": "پورت", - "hostsDialog.sni": "SNI", - "hostsDialog.advancedOptions": "تنظیمات پیشرفته", - "hostsDialog.addHost": "افزودن هاست", - "hostsDialog.savedSuccess": "هاست‌ها با موفقیت ذخیره شدند", - "hostsDialog.loading": "درحال بارگزاری...", - "hostsDialog.apply": "اعمال", - "hostsDialog.port.info": "به طور پیش‌فرض، هاست، از پورت پیش‌فرض ورودی استفاده میکند، در صورتی که این هاست ترافیک را از پورتی، متفاوت از پورت سرور، منتقل می‌کند، می‌توانید آن را تغییر دهید. برای مثال، ممکن از سرور ترافیک را از پورت 8443 به پورت پیش‌فرض سرور ورودی شما منتقل کند.", - "hostsDialog.sni.info": "به طور پیش‌فرض، هاست، از SNI پیش‌فرض ورودی استفاده میکند، در صورتی که این هاست یک SNI دیگری دارد، می‌توانید آن را تغییر دهید. برای مثال، ممکن است سرور ترافیک با SSL متفاوت را دریافت و منتقل کند.", "hostsDialog.host.info": "به‌طور پیش‌فرض، اگر هاست درخواستی در پیکربندی *** تنظیم شده باشد، این هاست استفاده می‌شود. اما می‌توانید یک هاست درخواستی متفاوت در اینجا قرار دهید.", - "hostsDialog.security.info": "اگر میان‌افزار سرور این هاست، از لایه امنیتی متفاوتی از ورودی استفاده می‌کند، می‌توانید اینجا انتخاب کنید", - "hostsDialog.alpn": "ALPN", - "hostsDialog.fingerprint": "اثرانگشت", "hostsDialog.host.multiHost": "برای تنظیم چند آدرس، با , از هم جدا کنید. هر دفعه آدرسی به صورت تصادفی قرار داده می‌شود.", "hostsDialog.host.wildcard": "از * برای ساخت عبارت تصادفی استفاده کنید (برای نام‌های wildcard کار می‌کند)", - "hostsDialog.sockopt": "Sockopt", + "hostsDialog.jalaliExpireDate": "تاریخ انقضای کاربر به شمسی", + "hostsDialog.loading": "درحال بارگزاری...", "hostsDialog.muxEnable": "فعالسازی MUX", - "hostsDialog.randomUserAgent": "استفاده از User Agent تصادفی", - "hostsDialog.allowinsecure": "Allow Insecure", - "hostsDialog.fragment": "الگو فرگمنت", - "hostsDialog.fragment.info": "length,interval,packet (e.g. 10-100,100-200,tlshello)", + "hostsDialog.path": "Path", + "hostsDialog.path.info": "می‌توانید برای این هاست مسیر تعریف کنید، مثلا برای زمانی که از reverse proxy استفاده ‌می‌کنید، کارآمد است.", + "hostsDialog.port": "پورت", + "hostsDialog.port.info": "به طور پیش‌فرض، هاست، از پورت پیش‌فرض ورودی استفاده میکند، در صورتی که این هاست ترافیک را از پورتی، متفاوت از پورت سرور، منتقل می‌کند، می‌توانید آن را تغییر دهید. برای مثال، ممکن از سرور ترافیک را از پورت 8443 به پورت پیش‌فرض سرور ورودی شما منتقل کند.", + "hostsDialog.proxyMethod": "روش انتقال پروکسی (مانند ws)", "hostsDialog.proxyOutbound": "جیسون پراکسی outbound", "hostsDialog.proxyOutbound.info": "outbound اضافه (تنها در کانفیگ دستی v2ray)", - "nodes.title": "با استفاده از Marzban-Node, شما می‌توانید با افزودن گره‌های متفاوت در سرورهای متفاوت، کیفیت اتصال خود را بالاتر ببرید.", - "nodes.addNewMarzbanNode": "افزودن گره مرزبان", - "nodes.certificate": "گواهی", + "hostsDialog.proxyProtocol": "پروتکل پروکسی (مانند VMess)", + "hostsDialog.randomUserAgent": "استفاده از User Agent تصادفی", + "hostsDialog.remainingData": "حجم باقی‌مانده کاربر", + "hostsDialog.remainingDays": "روزهای باقی مانده کاربر", + "hostsDialog.remainingTime": "زمان باقی مانده کاربر", + "hostsDialog.savedSuccess": "هاست‌ها با موفقیت ذخیره شدند", + "hostsDialog.security": "لایه امنیت", + "hostsDialog.security.info": "اگر میان‌افزار سرور این هاست، از لایه امنیتی متفاوتی از ورودی استفاده می‌کند، می‌توانید اینجا انتخاب کنید", + "hostsDialog.sni": "SNI", + "hostsDialog.sni.info": "به طور پیش‌فرض، هاست، از SNI پیش‌فرض ورودی استفاده میکند، در صورتی که این هاست یک SNI دیگری دارد، می‌توانید آن را تغییر دهید. برای مثال، ممکن است سرور ترافیک با SSL متفاوت را دریافت و منتقل کند.", + "hostsDialog.sockopt": "Sockopt", + "hostsDialog.statusEmoji": "وضعیت کاربر در قالب اموجی (✅,⌛️,🪫,❌,🔌)", + "hostsDialog.statusText": "وضعیت کاربر", + "hostsDialog.title": "با انتخاب این تنظیمات، می‌توانید برای هر ورودی یک آدرس منحصر به فرد انتخاب کنید.", + "hostsDialog.username": "نام کاربری کاربر", + "inbound": "ورودی", + "itemsPerPage": "تعداد در صفحه", + "login": "ورود", + "login.fieldRequired": "این فیلد باید پر شود!", + "login.loginYourAccount": "وارد حساب خود شوید", + "login.welcomeBack": "خوش آمدید, لطفا اطلاعات خود را وارد کنید", + "memoryUsage": "مصرف حافظه", + "next": "بعدی", "nodes.addHostForEveryInbound": "استفاده از این گره به عنوان میزبان تمام ورودی‌ها", + "nodes.addNewMarzbanNode": "افزودن گره مرزبان", "nodes.addNode": "افزودن گره", "nodes.addNodeSuccess": "گره {{name}} با موفقیت افزوده شد", "nodes.apply": "ویرایش گره", - "nodes.nodeName": "نام", - "nodes.nodeAddress": "آدرس", - "nodes.nodePort": "پورت", - "nodes.nodeAPIPort": "پورت API", - "nodes.editNode": "ویرایش گره", - "nodes.reconnect": "اتصال مجدد", + "nodes.certificate": "گواهی", "nodes.connection-hint": "برای راه اندازی یک گره جدید، لازم است گواهی زیر را روی گره تنظیم کنید تا یک اتصال امن بین سرور اصلی و گره ایجاد شود.", "nodes.download-certificate": "دانلود گواهی", - "nodes.show-certificate": "نمایش دادن گواهی", + "nodes.editNode": "ویرایش گره", "nodes.hide-certificate": "مخفی کردن گواهی", + "nodes.nodeAPIPort": "پورت API", + "nodes.nodeAddress": "آدرس", + "nodes.nodeName": "نام", + "nodes.nodePort": "پورت", + "nodes.reconnect": "اتصال مجدد", "nodes.reconnecting": "درحال اتصال مجدد...", + "nodes.show-certificate": "نمایش دادن گواهی", + "nodes.title": "با استفاده از Marzban-Node, شما می‌توانید با افزودن گره‌های متفاوت در سرورهای متفاوت، کیفیت اتصال خود را بالاتر ببرید.", "nodes.usageCoefficient": "ضریب گره", - "deleteNode.title": "حذف گره", - "deleteNode.prompt": "از حذف گره {{name}} مطمئن هستید؟", - "deleteNode.deleteSuccess": "گره {{name}} با موفقیت حذف شد", - "active": "فعال", - "disabled": "غیر فعال", - "users": "کاربران", - "activeUsers": "کاربران فعال", - "dataUsage": "مصرف داده", - "memoryUsage": "مصرف حافظه", - "itemsPerPage": "تعداد در صفحه", + "on_hold": "در انتظار اتصال", + "password": "گذرواژه", "previous": "قبلی", - "next": "بعدی", - "createNewUser": "ساخت کاربر", - "search": "جستجو", - "resetAllUsage": "بازنشانی کل مصرف", "qrcodeDialog.sublink": "لینک اشتراک", - "resetUserUsage.prompt": "از بازنشانی مصرف {{username}} مطئمن هستید؟", - "resetUserUsage.title": "بازنشانی مصرف کاربر", - "resetUserUsage.success": "مصرف {{username}} با موفقیت بازنشانی شد.", - "resetUserUsage.error": "بازنشانی مصرف انجام نشد، دوباره تلاش کنید.", - "resetAllUsage.title": "بازنشانی مصرف تمام کاربران", + "reset": "بازنشانی", + "resetAllUsage": "بازنشانی کل مصرف", + "resetAllUsage.error": "بازنشانی مصرف انجام نشد، دوباره تلاش کنید.", "resetAllUsage.prompt": "این عمل مصرف تمام کاربران را بازنشانی می‌کند. از این بازنشانی مطمئن هستید؟ این عمل قابل بازگشت نیست!", "resetAllUsage.success": "مصرف کل با موفقیت بازنشانی شد.", - "resetAllUsage.error": "بازنشانی مصرف انجام نشد، دوباره تلاش کنید.", - "core.title": "تنظیمات هسته", - "core.socket.connecting": "در حال اتصال...", - "core.socket.connected": "متصل", - "core.socket.not_connected": "عدم اتصال", - "core.socket.closed": "بسته شده", - "core.restarting": "درحال اجرا مجدد...", - "core.restartCore": "اجرا مجدد هسته", - "core.save": "ذخیره", - "core.logs": "گزارش", - "core.configuration": "پیکربندی", - "core.generalErrorMessage": "مشکلی پیش آمده، لطفا پیکربندی را بررسی کنید", - "core.successMessage": "تنظیمات هسته با موفقیت ثبت شد", - "on_hold": "در انتظار اتصال" -} + "resetAllUsage.title": "بازنشانی مصرف تمام کاربران", + "resetUserUsage.error": "بازنشانی مصرف انجام نشد، دوباره تلاش کنید.", + "resetUserUsage.prompt": "از بازنشانی مصرف {{username}} مطئمن هستید؟", + "resetUserUsage.success": "مصرف {{username}} با موفقیت بازنشانی شد.", + "resetUserUsage.title": "بازنشانی مصرف کاربر", + "revoke": "بازنشانی", + "revokeUserSub.error": "بازنشانی اشتراک انجام نشد، لطفاً دوباره امتحان کنید.", + "revokeUserSub.prompt": "آیا مطمئن هستید که می خواهید اشتراک {{username}} را بازنشانی کنید؟", + "revokeUserSub.success": "اشتراک {{username}} با موفقیت بازنشانی شد.", + "revokeUserSub.title": "بازنشانی اشتراک کاربر", + "search": "جستجو", + "status.active": "فعال", + "status.disabled": "غیرفعال", + "status.expired": "منقضی شده", + "status.limited": "اتمام حد مصرف", + "status.on_hold": "در انتظار اتصال", + "userDialog.absolute": "مطلق", + "userDialog.custom": "انتخابی", + "userDialog.dataLimit": "حد مصرف داده", + "userDialog.days": "روزها", + "userDialog.editUser": "ویرایش کاربر", + "userDialog.editUserTitle": "ویرایش کاربر", + "userDialog.endDate": "تاریخ پایان", + "userDialog.expiryDate": "تاریخ پایان", + "userDialog.generatedByDefault": "پیش‌فرض ساخته می‌شود", + "userDialog.hours": "ساعات", + "userDialog.method": "روش", + "userDialog.months": "ماه‌ها", + "userDialog.note": "توضیحات", + "userDialog.onHold": "در انتظار", + "userDialog.onHoldExpireDuration": "مدت انقضا", + "userDialog.optional": "اختیاری", + "userDialog.periodicUsageReset": "بازنشانی دوره‌ای مصرف", + "userDialog.protocols": "پروتکل‌ها", + "userDialog.relative": "نسبی", + "userDialog.resetStrategyAnnually": "سالانه", + "userDialog.resetStrategyDaily": "روزانه", + "userDialog.resetStrategyMonthly": "ماهانه", + "userDialog.resetStrategyNo": "خیر", + "userDialog.resetStrategyWeekly": "هفتگی", + "userDialog.resetUsage": "بازنشانی مصرف", + "userDialog.revokeSubscription": "بازنشانی اشتراک", + "userDialog.selectOneProtocol": "لطفا حداقل یک پروتکل انتخاب کنید", + "userDialog.shadowsocksDesc": "سریع و امن، اما کارآمد کمتر از بقیه", + "userDialog.startDate": "تاریخ شروع", + "userDialog.total": "مجموع: ", + "userDialog.trojanDesc": "سبک، امن و فوق‌العاده سریع", + "userDialog.usage": "مصرف", + "userDialog.userAlreadyExists": "کاربر وجود دارد", + "userDialog.userCreated": "کاربر {{username}} ساخته شد.", + "userDialog.userEdited": "کاربر {{username}} ویرایش شد.", + "userDialog.vlessDesc": "سبک، سریع و امن", + "userDialog.vmessDesc": "سریع و امن", + "userDialog.warningNoProtocol": "لطفا حداقل یک پروتکل انتخاب کنید", + "userDialog.weeks": "هفته‌ها", + "username": "نام کاربری", + "users": "کاربران", + "usersTable.copied": "کپی شد", + "usersTable.copyConfigs": "تنظیمات کپی", + "usersTable.copyLink": "کپی لینک اشتراک", + "usersTable.dataUsage": "مصرف داده", + "usersTable.noUser": "کاربری افزوده نشده است", + "usersTable.noUserMatched": "به‌نظر میرسه کاربری که جستجو کردید، وجود ندارد", + "usersTable.status": "وضعیت", + "usersTable.total": "مجموع" +} \ No newline at end of file diff --git a/app/dashboard/build/locales/ru.json b/app/dashboard/build/locales/ru.json index cc26c232..1ba128b4 100644 --- a/app/dashboard/build/locales/ru.json +++ b/app/dashboard/build/locales/ru.json @@ -1,171 +1,183 @@ { - "password": "Пароль", - "login": "Вход", - "cancel": "Отмена", + "active": "active", + "activeUsers": "Пользователи", "apply": "Применить", - "delete": "Удалить", - "reset": "Сбросить", + "cancel": "Отмена", + "core.configuration": "Конфигурация", + "core.generalErrorMessage": "Что-то пошло не так, пожалуйста, проверьте конфигурацию", + "core.logs": "Логи", + "core.restartCore": "Перезагрузить ядро", + "core.restarting": "Перезагрузка...", + "core.save": "Сохранить", + "core.socket.closed": "Закрыто", + "core.socket.connected": "Подключено", + "core.socket.connecting": "Соединение...", + "core.socket.not_connected": "Не подключено", + "core.successMessage": "Основные настройки успешно обновлены", + "core.title": "Основные настройки", + "createNewUser": "Создать нового пользователя", "createUser": "Создать", - "username": "Имя пользователя", - "expires": "Истекает через {{time}}", - "expired": "Истекло {{time}} назад", + "dataUsage": "Трафик", "dateFormat": "MMMM d, yyy", - "inbound": "inbound", - "login.loginYourAccount": "Войдите в свой аккаунт", - "login.welcomeBack": "Пожалуйста, введите свои данные", - "login.fieldRequired": "Это поле обязательно для заполнения", + "delete": "Удалить", + "deleteNode.deleteSuccess": "Узел {{name}} успешно удалён", + "deleteNode.prompt": "Вы уверены, что хотите удалить узел {{name}}?", + "deleteNode.title": "Удалить узел", + "deleteUser.deleteSuccess": "{{username}} успешно удалён.", + "deleteUser.prompt": "Вы уверены, что хотите удалить пользователя {{username}}?", + "deleteUser.title": "Удалить пользователя", + "disabled": "disabled", + "expired": "Истекло {{time}} назад", + "expires": "Истекает через {{time}}", + "header.donation": "Пожертвование", "header.hostSettings": "Настройки хоста", + "header.logout": "Выйти", "header.nodeSettings": "Настройки узлов", "header.nodesUsage": "Использование узлов", - "header.donation": "Пожертвование", - "header.logout": "Выйти", - "deleteUser.title": "Удалить пользователя", - "deleteUser.prompt": "Вы уверены, что хотите удалить пользователя {{username}}?", - "deleteUser.deleteSuccess": "{{username}} успешно удалён.", - "usersTable.status": "Статус", - "usersTable.dataUsage": "Расход трафика", - "usersTable.noUserMatched": "Похоже, нет пользователя, соответствующего вашему запросу", - "usersTable.noUser": "В системе нет созданных пользователей", - "usersTable.copyLink": "Скопировать ссылку на подписку", - "usersTable.copied": "Скопировано", - "usersTable.copyConfigs": "Скопировать конфигурации", - "usersTable.total": "Всего", - "userDialog.dataLimit": "Лимит трафика", - "userDialog.periodicUsageReset": "Период сброса трафика", - "userDialog.warningNoProtocol": "Пожалуйста, выберите хотя бы один протокол", - "userDialog.expiryDate": "Дата истечения срока", - "userDialog.note": "Примечание", - "userDialog.resetUsage": "Сбросить трафик", - "userDialog.usage": "Потребление", - "userDialog.protocols": "Протоколы", - "userDialog.editUserTitle": "Редактировать пользователя", - "userDialog.editUser": "Редактировать", - "userDialog.userEdited": "Пользователь {{username}} изменён.", - "userDialog.userCreated": "Пользователь {{username}} создан.", - "userDialog.userAlreadyExists": "Пользователь уже существует", - "userDialog.vmessDesc": "Быстрый и безопасный", - "userDialog.vlessDesc": "Легковесный, быстрый и безопасный", - "userDialog.trojanDesc": "Легковесный, безопасный и быстрый", - "userDialog.shadowsocksDesc": "Быстрый и безопасный, но не такой эффективный, как другие", - "userDialog.resetStrategyNo": "Нет", - "userDialog.resetStrategyDaily": "Ежедневно", - "userDialog.resetStrategyWeekly": "Еженедельно", - "userDialog.resetStrategyMonthly": "Ежемесячно", - "userDialog.resetStrategyAnnually": "Ежегодно", - "userDialog.selectOneProtocol": "Пожалуйста, выберите хотя бы один протокол", - "userDialog.optional": "необязательно", - "userDialog.method": "Метод", - "userDialog.generatedByDefault": "по умолчанию", - "userDialog.hours": "Часы", - "userDialog.days": "Дни", - "userDialog.weeks": "Недели", - "userDialog.months": "Месяцы", - "userDialog.relative": "Относительно", - "userDialog.absolute": "Абсолютно", - "userDialog.custom": "Пользовательский", - "userDialog.startDate": "Дата начала", - "userDialog.endDate": "Дата окончания", - "userDialog.revokeSubscription": "Отозвать подписку", - "revoke": "Отозвать", - "userDialog.total": "Всего: ", - "userDialog.onHold": "В режиме ожидания", - "userDialog.onHoldExpireDuration":"Продолжительность срока действия", - "hostsDialog.title": "Используя эту настройку, Вы можете настроить свои inbound.", - "hostsDialog.desc": "Используйте эти переменные, чтобы сделать его динамическим", - "hostsDialog.username": "Имя пользователя", - "hostsDialog.dataUsage": "Использованный трафик пользователя", - "hostsDialog.remainingData": "Оставшийся трафик пользователя", - "hostsDialog.dataLimit": "Лимит трафика пользователя", - "hostsDialog.remainingDays": "Оставшиеся дни пользователя", - "hostsDialog.expireDate": "Дата истечения срока пользователя", - "hostsDialog.jalaliExpireDate": "Дата истечения срока по солнечному календарю", - "hostsDialog.remainingTime": "Оставшееся время пользователя", - "hostsDialog.statusEmoji": "Статус пользователя в виде смайлика (✅,⌛️,🪫,❌,🔌)", - "hostsDialog.statusText": "Статус пользователя", - "hostsDialog.proxyProtocol": "Протокол прокси (например, VMess)", - "hostsDialog.proxyMethod": "Метод транспорта прокси (например, ws)", + "hostsDialog.addHost": "Добавить хост", + "hostsDialog.advancedOptions": "Дополнительные опции", + "hostsDialog.allowinsecure": "Allow Insecure", + "hostsDialog.alpn": "ALPN", + "hostsDialog.apply": "Применить", "hostsDialog.currentServer": "IP текущего сервера", "hostsDialog.currentServerv6": "IPv6 текущего сервера", - "hostsDialog.security": "Security Layer", + "hostsDialog.dataLimit": "Лимит трафика пользователя", + "hostsDialog.dataUsage": "Использованный трафик пользователя", + "hostsDialog.desc": "Используйте эти переменные, чтобы сделать его динамическим", + "hostsDialog.expireDate": "Дата истечения срока пользователя", + "hostsDialog.fingerprint": "Fingerprint", + "hostsDialog.fragment": "Шаблон фрагмента", + "hostsDialog.fragment.info": "length,interval,packet (e.g. 10-100,100-200,tlshello)", + "hostsDialog.fragment.info.attention": "Attention: currently, this feature only supported in streisand >= 1.6.12 and v2rayNG >= 1.8.16 (custom config)", + "hostsDialog.fragment.info.examples": "Examples:", "hostsDialog.host": "Host", - "hostsDialog.port": "Port", - "hostsDialog.sni": "SNI", - "hostsDialog.advancedOptions": "Дополнительные опции", - "hostsDialog.addHost": "Добавить хост", - "hostsDialog.savedSuccess": "Хосты успешно сохранены", - "hostsDialog.loading": "загрузка...", - "hostsDialog.apply": "Применить", - "hostsDialog.port.info": "По умолчанию хост использует порт, значение которого обьявленно в inbound. Вы можете установить своё значение порта, если с него трафик перенаправляется на другой порт. Например, сервер может перенаправлять трафик с порта 443 на порт по умолчанию Вашего inbound", - "hostsDialog.sni.info": "По умолчанию хост использует SNI, значение которого обьявленно в inbound. Вы можете установить своё значение SNI, если этот хост содержит другие SNI. Например, сервер может принимать трафик с другим SSL-сертификатом, выполнять SSL-терминацию и перенаправлять его на ваш inbound.", "hostsDialog.host.info": "По умолчанию, если в конфигурации XRAY задан запрашиваемый хост, то он и будет использоваться. Однако, если необходимо, вы можете установить здесь пользовательский запрашиваемый хост.", - "hostsDialog.security.info": "Если промежуточный сервер этого хоста использует другой security layer, отличный от security layer Вашего inbound по умолчанию, Вы можете установить его здесь", - "hostsDialog.alpn": "ALPN", - "hostsDialog.fingerprint": "Fingerprint", "hostsDialog.host.multiHost": "Чтобы установить несколько адресов, разделяйте их с помощью ,. Каждый раз будет выбран случайный адрес.", "hostsDialog.host.wildcard": "Используйте *, чтобы сгенерировать случайную строку (работает для wildcard доменов)", - "hostsDialog.sockopt": "Sockopt", + "hostsDialog.jalaliExpireDate": "Дата истечения срока по солнечному календарю", + "hostsDialog.loading": "загрузка...", "hostsDialog.muxEnable": "Давать возможность MUX", - "hostsDialog.randomUserAgent":"Use random user agent", - "hostsDialog.allowinsecure": "Allow Insecure", - "hostsDialog.fragment": "Шаблон фрагмента", - "hostsDialog.fragment.info": "length,interval,packet (e.g. 10-100,100-200,tlshello)", + "hostsDialog.path": "Path", + "hostsDialog.path.info": "Set a path for host users, useful behind a reverse proxy.", + "hostsDialog.port": "Port", + "hostsDialog.port.info": "По умолчанию хост использует порт, значение которого обьявленно в inbound. Вы можете установить своё значение порта, если с него трафик перенаправляется на другой порт. Например, сервер может перенаправлять трафик с порта 443 на порт по умолчанию Вашего inbound", + "hostsDialog.proxyMethod": "Метод транспорта прокси (например, ws)", "hostsDialog.proxyOutbound": "Исходящий прокси json", "hostsDialog.proxyOutbound.info": "Дополнительный исходящий трафик (только в пользовательской конфигурации v2ray)", - "nodes.title": "Используя Marzban-Node, Вы можете масштабировать инфраструктуру, добавляя узлы на разных серверах.", - "nodes.addNewMarzbanNode": "Добавить новый узел Marzban", - "nodes.certificate": "Сертификат", + "hostsDialog.proxyProtocol": "Протокол прокси (например, VMess)", + "hostsDialog.randomUserAgent": "Use random user agent", + "hostsDialog.remainingData": "Оставшийся трафик пользователя", + "hostsDialog.remainingDays": "Оставшиеся дни пользователя", + "hostsDialog.remainingTime": "Оставшееся время пользователя", + "hostsDialog.savedSuccess": "Хосты успешно сохранены", + "hostsDialog.security": "Security Layer", + "hostsDialog.security.info": "Если промежуточный сервер этого хоста использует другой security layer, отличный от security layer Вашего inbound по умолчанию, Вы можете установить его здесь", + "hostsDialog.sni": "SNI", + "hostsDialog.sni.info": "По умолчанию хост использует SNI, значение которого обьявленно в inbound. Вы можете установить своё значение SNI, если этот хост содержит другие SNI. Например, сервер может принимать трафик с другим SSL-сертификатом, выполнять SSL-терминацию и перенаправлять его на ваш inbound.", + "hostsDialog.sockopt": "Sockopt", + "hostsDialog.statusEmoji": "Статус пользователя в виде смайлика (✅,⌛️,🪫,❌,🔌)", + "hostsDialog.statusText": "Статус пользователя", + "hostsDialog.title": "Используя эту настройку, Вы можете настроить свои inbound.", + "hostsDialog.username": "Имя пользователя", + "inbound": "inbound", + "itemsPerPage": "Элементов на страницу", + "login": "Вход", + "login.fieldRequired": "Это поле обязательно для заполнения", + "login.loginYourAccount": "Войдите в свой аккаунт", + "login.welcomeBack": "Пожалуйста, введите свои данные", + "memoryUsage": "Память", + "next": "Вперед", "nodes.addHostForEveryInbound": "Добавить этот узел, как новый хост для каждого inbound", + "nodes.addNewMarzbanNode": "Добавить новый узел Marzban", "nodes.addNode": "Добавить узел", "nodes.addNodeSuccess": "Узел {{name}} успешно добавлен", "nodes.apply": "Настройки узла успешно обновлены", - "nodes.nodeName": "Имя", - "nodes.nodeAddress": "Адрес", - "nodes.nodePort": "Порт", - "nodes.nodeAPIPort": "API порт", - "nodes.editNode": "Редактировать узел", - "nodes.reconnect": "Переподключиться", + "nodes.certificate": "Сертификат", "nodes.connection-hint": "Для настройки узла Marzban, необходимо установить на нём данный сертификат, для инициализации безопасного соединения между главным сервером и узлом", "nodes.download-certificate": "Скачать сертификат", - "nodes.show-certificate": "Показать сертификат", + "nodes.editNode": "Редактировать узел", "nodes.hide-certificate": "Скрыть сертификат", + "nodes.nodeAPIPort": "API порт", + "nodes.nodeAddress": "Адрес", + "nodes.nodeName": "Имя", + "nodes.nodePort": "Порт", + "nodes.reconnect": "Переподключиться", "nodes.reconnecting": "Переподключение...", + "nodes.show-certificate": "Показать сертификат", + "nodes.title": "Используя Marzban-Node, Вы можете масштабировать инфраструктуру, добавляя узлы на разных серверах.", "nodes.usageCoefficient": "Коэффициент использования", - "deleteNode.title": "Удалить узел", - "deleteNode.prompt": "Вы уверены, что хотите удалить узел {{name}}?", - "deleteNode.deleteSuccess": "Узел {{name}} успешно удалён", - "users": "Пользователи", - "activeUsers": "Пользователи", - "dataUsage": "Трафик", - "memoryUsage": "Память", - "itemsPerPage": "Элементов на страницу", + "on_hold": "On Hold", + "password": "Пароль", "previous": "Назад", - "next": "Вперед", - "createNewUser": "Создать нового пользователя", - "search": "Поиск", - "resetAllUsage": "Сбросить расход трафика", "qrcodeDialog.sublink": "Ссылка на подписку", + "reset": "Сбросить", + "resetAllUsage": "Сбросить расход трафика", + "resetAllUsage.error": "Сброс расхода трафика не удался, пожалуйста, попробуйте ещё раз.", + "resetAllUsage.prompt": "Это действие полностью очищает весь расход трафика пользователей. Вы уверены? ЭТО ДЕЙСТВИЕ НЕОБРАТИМО!", + "resetAllUsage.success": "Расход трафика успешно сброшен.", + "resetAllUsage.title": "Сбросить расход трафика для всех пользователей", + "resetUserUsage.error": "Сброс расхода не удался, пожалуйста, попробуйте ещё раз.", "resetUserUsage.prompt": "Вы уверены, что хотите сбросить расход трафика для пользователя {{username}}?", - "resetUserUsage.title": "Сбросить расход трафика пользователя", "resetUserUsage.success": "Расход трафика пользователя {{username}} успешно сброшен.", - "resetUserUsage.error": "Сброс расхода не удался, пожалуйста, попробуйте ещё раз.", + "resetUserUsage.title": "Сбросить расход трафика пользователя", + "revoke": "Отозвать", + "revokeUserSub.error": "Отзыв подписки не удался, пожалуйста, попробуйте ещё раз.", "revokeUserSub.prompt": "Вы уверены, что хотите отозвать подписку для пользователя {{username}}?", - "revokeUserSub.title": "Отозвать подписку пользователя", "revokeUserSub.success": "Подписка пользователя {{username}} успешно отозвана.", - "revokeUserSub.error": "Отзыв подписки не удался, пожалуйста, попробуйте ещё раз.", - "resetAllUsage.title": "Сбросить расход трафика для всех пользователей", - "resetAllUsage.prompt": "Это действие полностью очищает весь расход трафика пользователей. Вы уверены? ЭТО ДЕЙСТВИЕ НЕОБРАТИМО!", - "resetAllUsage.success": "Расход трафика успешно сброшен.", - "resetAllUsage.error": "Сброс расхода трафика не удался, пожалуйста, попробуйте ещё раз.", - "core.title": "Основные настройки", - "core.socket.connecting": "Соединение...", - "core.socket.connected": "Подключено", - "core.socket.not_connected": "Не подключено", - "core.socket.closed": "Закрыто", - "core.restarting": "Перезагрузка...", - "core.restartCore": "Перезагрузить ядро", - "core.save": "Сохранить", - "core.logs": "Логи", - "core.configuration": "Конфигурация", - "core.generalErrorMessage": "Что-то пошло не так, пожалуйста, проверьте конфигурацию", - "core.successMessage": "Основные настройки успешно обновлены" -} + "revokeUserSub.title": "Отозвать подписку пользователя", + "search": "Поиск", + "status.active": "Active", + "status.disabled": "Disabled", + "status.expired": "Expired", + "status.limited": "Limited", + "status.on_hold": "On Hold", + "userDialog.absolute": "Абсолютно", + "userDialog.custom": "Пользовательский", + "userDialog.dataLimit": "Лимит трафика", + "userDialog.days": "Дни", + "userDialog.editUser": "Редактировать", + "userDialog.editUserTitle": "Редактировать пользователя", + "userDialog.endDate": "Дата окончания", + "userDialog.expiryDate": "Дата истечения срока", + "userDialog.generatedByDefault": "по умолчанию", + "userDialog.hours": "Часы", + "userDialog.method": "Метод", + "userDialog.months": "Месяцы", + "userDialog.note": "Примечание", + "userDialog.onHold": "В режиме ожидания", + "userDialog.onHoldExpireDuration": "Продолжительность срока действия", + "userDialog.optional": "необязательно", + "userDialog.periodicUsageReset": "Период сброса трафика", + "userDialog.protocols": "Протоколы", + "userDialog.relative": "Относительно", + "userDialog.resetStrategyAnnually": "Ежегодно", + "userDialog.resetStrategyDaily": "Ежедневно", + "userDialog.resetStrategyMonthly": "Ежемесячно", + "userDialog.resetStrategyNo": "Нет", + "userDialog.resetStrategyWeekly": "Еженедельно", + "userDialog.resetUsage": "Сбросить трафик", + "userDialog.revokeSubscription": "Отозвать подписку", + "userDialog.selectOneProtocol": "Пожалуйста, выберите хотя бы один протокол", + "userDialog.shadowsocksDesc": "Быстрый и безопасный, но не такой эффективный, как другие", + "userDialog.startDate": "Дата начала", + "userDialog.total": "Всего: ", + "userDialog.trojanDesc": "Легковесный, безопасный и быстрый", + "userDialog.usage": "Потребление", + "userDialog.userAlreadyExists": "Пользователь уже существует", + "userDialog.userCreated": "Пользователь {{username}} создан.", + "userDialog.userEdited": "Пользователь {{username}} изменён.", + "userDialog.vlessDesc": "Легковесный, быстрый и безопасный", + "userDialog.vmessDesc": "Быстрый и безопасный", + "userDialog.warningNoProtocol": "Пожалуйста, выберите хотя бы один протокол", + "userDialog.weeks": "Недели", + "username": "Имя пользователя", + "users": "Пользователи", + "usersTable.copied": "Скопировано", + "usersTable.copyConfigs": "Скопировать конфигурации", + "usersTable.copyLink": "Скопировать ссылку на подписку", + "usersTable.dataUsage": "Расход трафика", + "usersTable.noUser": "В системе нет созданных пользователей", + "usersTable.noUserMatched": "Похоже, нет пользователя, соответствующего вашему запросу", + "usersTable.status": "Статус", + "usersTable.total": "Всего" +} \ No newline at end of file diff --git a/app/dashboard/build/locales/zh.json b/app/dashboard/build/locales/zh.json index 827ac2b9..72fef4c9 100644 --- a/app/dashboard/build/locales/zh.json +++ b/app/dashboard/build/locales/zh.json @@ -1,148 +1,183 @@ { - "password": "密码", - "login": "登录", - "cancel": "取消", + "active": "active", + "activeUsers": "活跃用户", "apply": "应用", - "delete": "删除", - "reset": "重置", + "cancel": "取消", + "core.configuration": "Configuration", + "core.generalErrorMessage": "Something went wrong, please check the configuration", + "core.logs": "Logs", + "core.restartCore": "Restart Core", + "core.restarting": "Restarting...", + "core.save": "Save", + "core.socket.closed": "Closed", + "core.socket.connected": "Connected", + "core.socket.connecting": "Connecting...", + "core.socket.not_connected": "Not Connected", + "core.successMessage": "Core settings updated successfully", + "core.title": "Core Settings", + "createNewUser": "创建新用户", "createUser": "创建用户", - "username": "用户名", - "expires": "{{time}}有效", - "expired": "{{time}}失效", + "dataUsage": "总流量", "dateFormat": "MM/dd/yyyy", - "inbound": "入站", - "login.loginYourAccount": "登录您的帐号", - "login.welcomeBack": "欢迎回来,请输入您的详细信息", - "login.fieldRequired": "此项必填", + "delete": "删除", + "deleteNode.deleteSuccess": "节点 {{name}} 删除成功", + "deleteNode.prompt": "您确实要删除 {{name}} 节点吗?", + "deleteNode.title": "删除节点", + "deleteUser.deleteSuccess": "{{username}} 删除成功。", + "deleteUser.prompt": "您确定你要删除 {{username}}?", + "deleteUser.title": "删除用户", + "disabled": "disabled", + "expired": "{{time}}失效", + "expires": "{{time}}有效", + "header.donation": "捐赠", "header.hostSettings": "设置", + "header.logout": "退出", "header.nodeSettings": "节点设置", "header.nodesUsage": "节点统计", - "header.donation": "捐赠", - "header.logout": "退出", - "deleteUser.title": "删除用户", - "deleteUser.prompt": "您确定你要删除 {{username}}?", - "deleteUser.deleteSuccess": "{{username}} 删除成功。", - "usersTable.status": "状态", - "usersTable.dataUsage": "流量统计", - "usersTable.noUserMatched": "没有找到您搜索的用户", - "usersTable.noUser": "还没有添加任何用户", - "usersTable.copyLink": "复制订阅链接", - "usersTable.copied": "已复制", - "usersTable.copyConfigs": "复制配置", - "usersTable.total": "总共", - "userDialog.dataLimit": "流量限制", - "userDialog.periodicUsageReset": "定期重置流量", - "userDialog.expiryDate": "过期日期", - "userDialog.resetUsage": "重置流量", - "userDialog.usage": "流量详情", - "userDialog.protocols": "协议", - "userDialog.editUserTitle": "用户编辑", - "userDialog.editUser": "修改", - "userDialog.userEdited": "已更新用户 {{username}}。", - "userDialog.userCreated": "成功创建用户 {{username}}。", - "userDialog.userAlreadyExists": "用户已存在", - "userDialog.vmessDesc": "快速且安全", - "userDialog.vlessDesc": "轻量、快速且安全", - "userDialog.trojanDesc": "轻量、安全且非常快", - "userDialog.shadowsocksDesc": "快速且安全, 但效率不如其它", - "userDialog.resetStrategyNo": "无", - "userDialog.resetStrategyDaily": "每天", - "userDialog.resetStrategyWeekly": "每周", - "userDialog.resetStrategyMonthly": "每月", - "userDialog.resetStrategyAnnually": "每年", - "userDialog.selectOneProtocol": "请至少选择一个协议", - "userDialog.optional": "可以为空", - "userDialog.method": "加密方式", - "userDialog.generatedByDefault": "默认自动生成", - "userDialog.hours": "小时", - "userDialog.days": "天", - "userDialog.weeks": "周", - "userDialog.months": "月", - "userDialog.relative": "相对时间", - "userDialog.absolute": "选择范围", - "userDialog.custom": "自定义", - "userDialog.startDate": "开始日期", - "userDialog.endDate": "结束日期", - "userDialog.total": "总共:", - "userDialog.onHold" : "保持", - "userDialog.onHoldExpireDuration":"过期时间", - "hostsDialog.title": "使用此设置,您可以为每个入站分配特定的地址。", - "hostsDialog.desc": "使用这些变量使其可以动态替换", - "hostsDialog.username": "用户的用户名", - "hostsDialog.dataUsage": "用户当前流量情况", - "hostsDialog.remainingData": "用户剩余流量情况", + "hostsDialog.addHost": "添加主机", + "hostsDialog.advancedOptions": "高级选项", + "hostsDialog.allowinsecure": "Allow Insecure", + "hostsDialog.alpn": "ALPN", + "hostsDialog.apply": "保存", + "hostsDialog.currentServer": "当前服务器的 IP 地址", + "hostsDialog.currentServerv6": "当前服务器的 IPv6 地址", "hostsDialog.dataLimit": "用户的流量限制", - "hostsDialog.remainingDays": "用户的剩余天数", + "hostsDialog.dataUsage": "用户当前流量情况", + "hostsDialog.desc": "使用这些变量使其可以动态替换", "hostsDialog.expireDate": "用户的有效期", + "hostsDialog.fingerprint": "指纹", + "hostsDialog.fragment": "碎片图案", + "hostsDialog.fragment.info": "length,interval,packet (e.g. 10-100,100-200,tlshello)", + "hostsDialog.fragment.info.attention": "Attention: currently, this feature only supported in streisand >= 1.6.12 and v2rayNG >= 1.8.16 (custom config)", + "hostsDialog.fragment.info.examples": "Examples:", + "hostsDialog.host": "请求主机", + "hostsDialog.host.info": "默认情况下,如果在 Xray 配置中设置了请求主机,则使用该主机。但是,如果需要,您可以在此处设置自定义请求主机。", + "hostsDialog.host.multiHost": "To set multiple addresses, separate them with , Each time an address is chosen randomly.", + "hostsDialog.host.wildcard": "Use * to generate a random string (works for wildcard domain names)", "hostsDialog.jalaliExpireDate": "用户阳历有效日期", - "hostsDialog.remainingTime": "用户剩余时间", - "hostsDialog.statusEmoji": "用户状态作为表情符号 (✅,⌛️,🪫,❌,🔌)", - "hostsDialog.statusText": "用户状态", - "hostsDialog.proxyProtocol": "代理协议(例如 VMess)", + "hostsDialog.loading": "加载中...", + "hostsDialog.muxEnable": "使能够 MUX", + "hostsDialog.path": "Path", + "hostsDialog.path.info": "Set a path for host users, useful behind a reverse proxy.", + "hostsDialog.port": "端口", + "hostsDialog.port.info": "默认情况下,主机使用入站端口的默认端口。如果此主机是一个服务器,用于从与您的服务器端口不同的端口转发流量,则可以设置自定义端口。例如,服务器可能会将来自端口 8443 的流量转发到您入站服务器的默认端口。", "hostsDialog.proxyMethod": "代理传输方法(例如 ws)", - "hostsDialog.currentServer": "当前服务器的 IP 地址", - "hostsDialog.currentServerv6": "当前服务器的 IPv6 地址", + "hostsDialog.proxyOutbound": "代理出站 json", + "hostsDialog.proxyOutbound.info": "额外出站(仅在 v2ray 自定义配置中)", + "hostsDialog.proxyProtocol": "代理协议(例如 VMess)", + "hostsDialog.randomUserAgent": "Use random user agent", + "hostsDialog.remainingData": "用户剩余流量情况", + "hostsDialog.remainingDays": "用户的剩余天数", + "hostsDialog.remainingTime": "用户剩余时间", + "hostsDialog.savedSuccess": "设置保存成功", "hostsDialog.security": "安全层", - "hostsDialog.host": "请求主机", - "hostsDialog.port": "端口", + "hostsDialog.security.info": "如果此主机的中间件服务器使用的安全层与入站默认值不同,则可以在此处设置自定义安全层。", "hostsDialog.sni": "SNI", - "hostsDialog.advancedOptions": "高级选项", - "hostsDialog.addHost": "添加主机", - "hostsDialog.savedSuccess": "设置保存成功", - "hostsDialog.loading": "加载中...", - "hostsDialog.apply": "保存", - "hostsDialog.port.info": "默认情况下,主机使用入站端口的默认端口。如果此主机是一个服务器,用于从与您的服务器端口不同的端口转发流量,则可以设置自定义端口。例如,服务器可能会将来自端口 8443 的流量转发到您入站服务器的默认端口。", "hostsDialog.sni.info": "默认情况下,主机使用入站 SNI 的默认值。如果此主机是一个服务器且 SNI 不同,则可以设置自定义 SNI。例如,服务器可能会接收带有不同 SSL 证书的流量,执行 SSL 处理并将其转发到您的入站服务器。", - "hostsDialog.host.info": "默认情况下,如果在 Xray 配置中设置了请求主机,则使用该主机。但是,如果需要,您可以在此处设置自定义请求主机。", - "hostsDialog.security.info": "如果此主机的中间件服务器使用的安全层与入站默认值不同,则可以在此处设置自定义安全层。", - "hostsDialog.alpn": "ALPN", - "hostsDialog.fingerprint": "指纹", "hostsDialog.sockopt": "Sockopt", - "hostsDialog.muxEnable": "使能够 MUX", - "hostsDialog.randomUserAgent":"Use random user agent", - "hostsDialog.allowinsecure": "Allow Insecure", - "hostsDialog.fragment": "碎片图案", - "hostsDialog.fragment.info": "length,interval,packet (e.g. 10-100,100-200,tlshello)", - "hostsDialog.proxyOutbound": "代理出站 json", - "hostsDialog.proxyOutbound.info": "额外出站(仅在 v2ray 自定义配置中)", - "nodes.title": "使用 Marzban-Node,您可以通过在不同的服务器上添加不同的节点来提供多节点负载。", - "nodes.addNewMarzbanNode": "添加新的 Marzban 节点", - "nodes.certificate": "证书", + "hostsDialog.statusEmoji": "用户状态作为表情符号 (✅,⌛️,🪫,❌,🔌)", + "hostsDialog.statusText": "用户状态", + "hostsDialog.title": "使用此设置,您可以为每个入站分配特定的地址。", + "hostsDialog.username": "用户的用户名", + "inbound": "入站", + "itemsPerPage": "每页条数", + "login": "登录", + "login.fieldRequired": "此项必填", + "login.loginYourAccount": "登录您的帐号", + "login.welcomeBack": "欢迎回来,请输入您的详细信息", + "memoryUsage": "内存状态", + "next": "下一页", "nodes.addHostForEveryInbound": "为每个入站请求添加此节点作为新主机", + "nodes.addNewMarzbanNode": "添加新的 Marzban 节点", "nodes.addNode": "添加节点", "nodes.addNodeSuccess": "节点 {{name}} 添加成功", + "nodes.apply": "editNode", + "nodes.certificate": "证书", + "nodes.connection-hint": "要设置Marzban节点,您需要在节点上设置此证书以初始化主服务器和节点之间的安全连接", + "nodes.download-certificate": "下载证书", "nodes.editNode": "保存", - "nodes.nodeName": "名称", + "nodes.hide-certificate": "隐藏证书", + "nodes.nodeAPIPort": "API 端口", "nodes.nodeAddress": "地址", + "nodes.nodeName": "名称", "nodes.nodePort": "端口", - "nodes.nodeAPIPort": "API 端口", "nodes.reconnect": "重新连接", - "nodes.connection-hint": "要设置Marzban节点,您需要在节点上设置此证书以初始化主服务器和节点之间的安全连接", - "nodes.download-certificate": "下载证书", - "nodes.show-certificate": "如何证书", - "nodes.hide-certificate": "隐藏证书", "nodes.reconnecting": "重连中...", + "nodes.show-certificate": "如何证书", + "nodes.title": "使用 Marzban-Node,您可以通过在不同的服务器上添加不同的节点来提供多节点负载。", "nodes.usageCoefficient": "使用系数", - "deleteNode.title": "删除节点", - "deleteNode.prompt": "您确实要删除 {{name}} 节点吗?", - "deleteNode.deleteSuccess": "节点 {{name}} 删除成功", - "users": "用户", - "activeUsers": "活跃用户", - "dataUsage": "总流量", - "memoryUsage": "内存状态", - "itemsPerPage": "每页条数", + "on_hold": "On Hold", + "password": "密码", "previous": "上一页", - "next": "下一页", - "createNewUser": "创建新用户", - "search": "搜索", - "resetAllUsage": "重置所有统计", "qrcodeDialog.sublink": "订阅链接", - "resetUserUsage.prompt": "您确定要重置 {{username}} 的流量统计吗?", - "resetUserUsage.title": "重置用户流量统计", - "resetUserUsage.success": "{{username}} 的流量统计重置完成。", - "resetUserUsage.error": "重置失败,请稍候再试", - "resetAllUsage.title": "重置所有用户的数据使用情况", + "reset": "重置", + "resetAllUsage": "重置所有统计", + "resetAllUsage.error": "重置失败,请稍候再试!", "resetAllUsage.prompt": "此操作将清除所有用户统计,您确定要执行此操作吗? 这不能被撤消!", "resetAllUsage.success": "所有统计重置完成。", - "resetAllUsage.error": "重置失败,请稍候再试!" -} + "resetAllUsage.title": "重置所有用户的数据使用情况", + "resetUserUsage.error": "重置失败,请稍候再试", + "resetUserUsage.prompt": "您确定要重置 {{username}} 的流量统计吗?", + "resetUserUsage.success": "{{username}} 的流量统计重置完成。", + "resetUserUsage.title": "重置用户流量统计", + "revoke": "Revoke", + "revokeUserSub.error": "Subscription revoke failed, please try again.", + "revokeUserSub.prompt": "Are you sure you want to revoke {{username}}'s subscription?", + "revokeUserSub.success": "{{username}}'s subscription has revoked successfully.", + "revokeUserSub.title": "Revoke User Subscription", + "search": "搜索", + "status.active": "Active", + "status.disabled": "Disabled", + "status.expired": "Expired", + "status.limited": "Limited", + "status.on_hold": "On Hold", + "userDialog.absolute": "选择范围", + "userDialog.custom": "自定义", + "userDialog.dataLimit": "流量限制", + "userDialog.days": "天", + "userDialog.editUser": "修改", + "userDialog.editUserTitle": "用户编辑", + "userDialog.endDate": "结束日期", + "userDialog.expiryDate": "过期日期", + "userDialog.generatedByDefault": "默认自动生成", + "userDialog.hours": "小时", + "userDialog.method": "加密方式", + "userDialog.months": "月", + "userDialog.note": "Note", + "userDialog.onHold": "保持", + "userDialog.onHoldExpireDuration": "过期时间", + "userDialog.optional": "可以为空", + "userDialog.periodicUsageReset": "定期重置流量", + "userDialog.protocols": "协议", + "userDialog.relative": "相对时间", + "userDialog.resetStrategyAnnually": "每年", + "userDialog.resetStrategyDaily": "每天", + "userDialog.resetStrategyMonthly": "每月", + "userDialog.resetStrategyNo": "无", + "userDialog.resetStrategyWeekly": "每周", + "userDialog.resetUsage": "重置流量", + "userDialog.revokeSubscription": "Revoke Subscription", + "userDialog.selectOneProtocol": "请至少选择一个协议", + "userDialog.shadowsocksDesc": "快速且安全, 但效率不如其它", + "userDialog.startDate": "开始日期", + "userDialog.total": "总共:", + "userDialog.trojanDesc": "轻量、安全且非常快", + "userDialog.usage": "流量详情", + "userDialog.userAlreadyExists": "用户已存在", + "userDialog.userCreated": "成功创建用户 {{username}}。", + "userDialog.userEdited": "已更新用户 {{username}}。", + "userDialog.vlessDesc": "轻量、快速且安全", + "userDialog.vmessDesc": "快速且安全", + "userDialog.warningNoProtocol": "Please select at least one protocol", + "userDialog.weeks": "周", + "username": "用户名", + "users": "用户", + "usersTable.copied": "已复制", + "usersTable.copyConfigs": "复制配置", + "usersTable.copyLink": "复制订阅链接", + "usersTable.dataUsage": "流量统计", + "usersTable.noUser": "还没有添加任何用户", + "usersTable.noUserMatched": "没有找到您搜索的用户", + "usersTable.status": "状态", + "usersTable.total": "总共" +} \ No newline at end of file diff --git a/app/dashboard/public/locales/en.json b/app/dashboard/public/locales/en.json index 72a02412..ab37df8c 100644 --- a/app/dashboard/public/locales/en.json +++ b/app/dashboard/public/locales/en.json @@ -1,178 +1,183 @@ { - "password": "Password", - "login": "Login", - "cancel": "Cancel", + "active": "active", + "activeUsers": "active users", "apply": "Apply", - "delete": "Delete", - "reset": "Reset", + "cancel": "Cancel", + "core.configuration": "Configuration", + "core.generalErrorMessage": "Something went wrong, please check the configuration", + "core.logs": "Logs", + "core.restartCore": "Restart Core", + "core.restarting": "Restarting...", + "core.save": "Save", + "core.socket.closed": "Closed", + "core.socket.connected": "Connected", + "core.socket.connecting": "Connecting...", + "core.socket.not_connected": "Not Connected", + "core.successMessage": "Core settings updated successfully", + "core.title": "Core Settings", + "createNewUser": "Create new user", "createUser": "Create User", - "username": "Username", - "expires": "Expires in {{time}}", - "expired": "Expired {{time}} ago", + "dataUsage": "data usage", "dateFormat": "MMMM d, yyy", - "inbound": "Inbound", - "login.loginYourAccount": "Login to your account", - "login.welcomeBack": "Welcome back, please enter your details", - "login.fieldRequired": "This field is required", + "delete": "Delete", + "deleteNode.deleteSuccess": "Node {{name}} removed successfully", + "deleteNode.prompt": "Are you sure you want to delete the {{name}} node?", + "deleteNode.title": "Delete Node", + "deleteUser.deleteSuccess": "{{username}} deleted successfully.", + "deleteUser.prompt": "Are you sure you want to delete {{username}}?", + "deleteUser.title": "Delete User", + "disabled": "disabled", + "expired": "Expired {{time}} ago", + "expires": "Expires in {{time}}", + "header.donation": "Donation", "header.hostSettings": "Host Settings", + "header.logout": "Log out", "header.nodeSettings": "Node Settings", "header.nodesUsage": "Nodes Usage", - "header.donation": "Donation", - "header.logout": "Log out", - "deleteUser.title": "Delete User", - "deleteUser.prompt": "Are you sure you want to delete {{username}}?", - "deleteUser.deleteSuccess": "{{username}} deleted successfully.", - "usersTable.status": "status", - "usersTable.dataUsage": "data usage", - "usersTable.noUserMatched": "It seems there is no user matched with what you are looking for", - "usersTable.noUser": "There is no user added to the system", - "usersTable.copyLink": "Copy Subscription Link", - "usersTable.copied": "Copied", - "usersTable.copyConfigs": "Copy Configs", - "usersTable.total": "Total", - "userDialog.dataLimit": "Data Limit", - "userDialog.periodicUsageReset": "Periodic Usage Reset", - "userDialog.warningNoProtocol": "Please select at least one protocol", - "userDialog.expiryDate": "Expiry Date", - "userDialog.note": "Note", - "userDialog.resetUsage": "Reset Usage", - "userDialog.usage": "Usage", - "userDialog.protocols": "Protocols", - "userDialog.editUserTitle": "Edit user", - "userDialog.editUser": "Edit user", - "userDialog.userEdited": "User {{username}} edited.", - "userDialog.userCreated": "User {{username}} created.", - "userDialog.userAlreadyExists": "User already exists", - "userDialog.vmessDesc": "Fast and secure", - "userDialog.vlessDesc": "Lightweight, fast and secure", - "userDialog.trojanDesc": "Lightweight, secure and lightening fast", - "userDialog.shadowsocksDesc": "Fast and secure, but not efficient as others", - "userDialog.resetStrategyNo": "No", - "userDialog.resetStrategyDaily": "Daily", - "userDialog.resetStrategyWeekly": "Weekly", - "userDialog.resetStrategyMonthly": "Monthly", - "userDialog.resetStrategyAnnually": "Annually", - "userDialog.selectOneProtocol": "Please select at least one protocol", - "userDialog.optional": "optional", - "userDialog.method": "Method", - "userDialog.generatedByDefault": "Automatically generated by default", - "userDialog.hours": "Hours", - "userDialog.days": "Days", - "userDialog.weeks": "Weeks", - "userDialog.months": "Months", - "userDialog.relative": "Relative", - "userDialog.absolute": "Absolute", - "userDialog.custom": "Custom", - "userDialog.startDate": "Start date", - "userDialog.endDate": "End date", - "userDialog.revokeSubscription": "Revoke Subscription", - "revoke": "Revoke", - "userDialog.total": "Total: ", - "userDialog.onHold" : "On Hold", - "userDialog.onHoldExpireDuration":"Expire Duration", - "hostsDialog.title": "Using this setting, you are able to assign specific address for each inbound.", - "hostsDialog.desc": "Use these variables to make it dynamic", - "hostsDialog.username": "The username of the user", - "hostsDialog.dataUsage": "The current usage of the user", - "hostsDialog.remainingData": "Remaining data of the user", - "hostsDialog.dataLimit": "The usage limit of the user", - "hostsDialog.remainingDays": "Remaining days of the user", - "hostsDialog.expireDate": "Expiry date of the user", - "hostsDialog.jalaliExpireDate": "Expiry date of the user in solar calendar", - "hostsDialog.remainingTime": "Remaining time of the user", - "hostsDialog.statusEmoji": "User status as an emoji (✅,⌛️,🪫,❌,🔌)", - "hostsDialog.statusText": "User status", - "hostsDialog.proxyProtocol": "Proxy protocol (e.g. VMess)", - "hostsDialog.proxyMethod": "Proxy transport method (e.g. ws)", + "hostsDialog.addHost": "Add host", + "hostsDialog.advancedOptions": "Advanced options", + "hostsDialog.allowinsecure": "Allow Insecure", + "hostsDialog.alpn": "ALPN", + "hostsDialog.apply": "Apply", "hostsDialog.currentServer": "IP Address of current server", "hostsDialog.currentServerv6": "IPv6 of current server", - "hostsDialog.security": "Security Layer", + "hostsDialog.dataLimit": "The usage limit of the user", + "hostsDialog.dataUsage": "The current usage of the user", + "hostsDialog.desc": "Use these variables to make it dynamic", + "hostsDialog.expireDate": "Expiry date of the user", + "hostsDialog.fingerprint": "Fingerprint", + "hostsDialog.fragment": "Fragment pattern", + "hostsDialog.fragment.info": "Correct pattern: length,interval,packets", + "hostsDialog.fragment.info.attention": "Attention: currently, this feature only supported in streisand >= 1.6.12 and v2rayNG >= 1.8.16 (custom config)", + "hostsDialog.fragment.info.examples": "Examples:", "hostsDialog.host": "Request Host", - "hostsDialog.port": "Port", - "hostsDialog.path": "Path", - "hostsDialog.sni": "SNI", - "hostsDialog.advancedOptions": "Advanced options", - "hostsDialog.addHost": "Add host", - "hostsDialog.savedSuccess": "Hosts saved successfully", - "hostsDialog.loading": "loading...", - "hostsDialog.apply": "Apply", - "hostsDialog.port.info": "By default, a host uses the default port of the inbound. You can set a custom port in case this host is a server that forwards traffic from a port that differs from your server's port. For example, the server may forward traffic from port 8443 to the default port of your inbound server.", - "hostsDialog.path.info": "Set a path for host users, useful behind a reverse proxy.", - "hostsDialog.sni.info": "By default, a host uses the default SNI of the inbound. You can set a custom SNI in case this host is a server that has a different SNI. For example, the server may receive traffic with a different SSL certificate, perform SSL termination, and forward it to your inbound server.", "hostsDialog.host.info": "By default, if a request host is set in the Xray config, this host is used. However, you can set a custom request host here if needed.", - "hostsDialog.security.info": "If the middleware server of this host uses a different security layer than the inbound's default, you can set a custom security layer here.", - "hostsDialog.alpn": "ALPN", - "hostsDialog.fingerprint": "Fingerprint", "hostsDialog.host.multiHost": "To set multiple addresses, separate them with , Each time an address is chosen randomly.", "hostsDialog.host.wildcard": "Use * to generate a random string (works for wildcard domain names)", - "hostsDialog.sockopt": "Sockopt", + "hostsDialog.jalaliExpireDate": "Expiry date of the user in solar calendar", + "hostsDialog.loading": "loading...", "hostsDialog.muxEnable": "Enable MUX", - "hostsDialog.randomUserAgent":"Use random user agent", - "hostsDialog.allowinsecure": "Allow Insecure", - "hostsDialog.fragment": "Fragment pattern", - "hostsDialog.fragment.info": "Correct pattern: length,interval,packets", - "hostsDialog.fragment.info.examples": "Examples:", - "hostsDialog.fragment.info.attention": "Attention: currently, this feature only supported in streisand >= 1.6.12 and v2rayNG >= 1.8.16 (custom config)", + "hostsDialog.path": "Path", + "hostsDialog.path.info": "Set a path for host users, useful behind a reverse proxy.", + "hostsDialog.port": "Port", + "hostsDialog.port.info": "By default, a host uses the default port of the inbound. You can set a custom port in case this host is a server that forwards traffic from a port that differs from your server's port. For example, the server may forward traffic from port 8443 to the default port of your inbound server.", + "hostsDialog.proxyMethod": "Proxy transport method (e.g. ws)", "hostsDialog.proxyOutbound": "Proxy outbound json", "hostsDialog.proxyOutbound.info": "Extra outbound ( only in v2ray custom config )", - "nodes.title": "Using Marzban-Node, you are able to scale up your connection quality by adding different nodes on different servers.", + "hostsDialog.proxyProtocol": "Proxy protocol (e.g. VMess)", + "hostsDialog.randomUserAgent": "Use random user agent", + "hostsDialog.remainingData": "Remaining data of the user", + "hostsDialog.remainingDays": "Remaining days of the user", + "hostsDialog.remainingTime": "Remaining time of the user", + "hostsDialog.savedSuccess": "Hosts saved successfully", + "hostsDialog.security": "Security Layer", + "hostsDialog.security.info": "If the middleware server of this host uses a different security layer than the inbound's default, you can set a custom security layer here.", + "hostsDialog.sni": "SNI", + "hostsDialog.sni.info": "By default, a host uses the default SNI of the inbound. You can set a custom SNI in case this host is a server that has a different SNI. For example, the server may receive traffic with a different SSL certificate, perform SSL termination, and forward it to your inbound server.", + "hostsDialog.sockopt": "Sockopt", + "hostsDialog.statusEmoji": "User status as an emoji (\u2705,\u231b\ufe0f,\ud83e\udeab,\u274c,\ud83d\udd0c)", + "hostsDialog.statusText": "User status", + "hostsDialog.title": "Using this setting, you are able to assign specific address for each inbound.", + "hostsDialog.username": "The username of the user", + "inbound": "Inbound", + "itemsPerPage": "Items per page", + "login": "Login", + "login.fieldRequired": "This field is required", + "login.loginYourAccount": "Login to your account", + "login.welcomeBack": "Welcome back, please enter your details", + "memoryUsage": "memory usage", + "next": "Next", + "nodes.addHostForEveryInbound": "Add this node as a new host for every inbound", "nodes.addNewMarzbanNode": "Add New Marzban Node", + "nodes.addNode": "Add Node", + "nodes.addNodeSuccess": "Node {{name}} added successfully", + "nodes.apply": "editNode", "nodes.certificate": "Certificate", "nodes.connection-hint": "To setup a Marzban Node, you need to set this certificate on the node to initialize a secure connection between main server and the node", "nodes.download-certificate": "Download certificate", - "nodes.show-certificate": "Show certificate", + "nodes.editNode": "Update Node", "nodes.hide-certificate": "Hide certificate", - "nodes.addHostForEveryInbound": "Add this node as a new host for every inbound", - "nodes.addNode": "Add Node", - "nodes.addNodeSuccess": "Node {{name}} added successfully", - "nodes.apply": "editNode", - "nodes.nodeName": "Name", + "nodes.nodeAPIPort": "API Port", "nodes.nodeAddress": "Address", + "nodes.nodeName": "Name", "nodes.nodePort": "Port", - "nodes.nodeAPIPort": "API Port", - "nodes.editNode": "Update Node", "nodes.reconnect": "Reconnect", "nodes.reconnecting": "Reconnecting...", + "nodes.show-certificate": "Show certificate", + "nodes.title": "Using Marzban-Node, you are able to scale up your connection quality by adding different nodes on different servers.", "nodes.usageCoefficient": "Usage Ratio", - "deleteNode.title": "Delete Node", - "deleteNode.prompt": "Are you sure you want to delete the {{name}} node?", - "deleteNode.deleteSuccess": "Node {{name}} removed successfully", - "users": "Users", - "active": "active", - "disabled": "disabled", - "activeUsers": "active users", - "dataUsage": "data usage", - "memoryUsage": "memory usage", - "itemsPerPage": "Items per page", + "on_hold": "On Hold", + "password": "Password", "previous": "Previous", - "next": "Next", - "createNewUser": "Create new user", - "search": "Search", - "resetAllUsage": "Reset All Usages", "qrcodeDialog.sublink": "Subscribe Link", + "reset": "Reset", + "resetAllUsage": "Reset All Usages", + "resetAllUsage.error": "Usage reset failed, please try again.", + "resetAllUsage.prompt": "This action clears all of the users' data usage completely. Are you sure you want to reset all usage? THIS CANNOT BE UNDONE!", + "resetAllUsage.success": "All usage has reset successfully.", + "resetAllUsage.title": "Reset data usage for all users", + "resetUserUsage.error": "Usage reset failed, please try again.", "resetUserUsage.prompt": "Are you sure you want to reset {{username}}'s usage?", - "resetUserUsage.title": "Reset User Usage", "resetUserUsage.success": "{{username}}'s usage has reset successfully.", - "resetUserUsage.error": "Usage reset failed, please try again.", + "resetUserUsage.title": "Reset User Usage", + "revoke": "Revoke", + "revokeUserSub.error": "Subscription revoke failed, please try again.", "revokeUserSub.prompt": "Are you sure you want to revoke {{username}}'s subscription?", - "revokeUserSub.title": "Revoke User Subscription", "revokeUserSub.success": "{{username}}'s subscription has revoked successfully.", - "revokeUserSub.error": "Subscription revoke failed, please try again.", - "resetAllUsage.title": "Reset data usage for all users", - "resetAllUsage.prompt": "This action clears all of the users' data usage completely. Are you sure you want to reset all usage? THIS CANNOT BE UNDONE!", - "resetAllUsage.success": "All usage has reset successfully.", - "resetAllUsage.error": "Usage reset failed, please try again.", - "core.title": "Core Settings", - "core.socket.connecting": "Connecting...", - "core.socket.connected": "Connected", - "core.socket.not_connected": "Not Connected", - "core.socket.closed": "Closed", - "core.restarting": "Restarting...", - "core.restartCore": "Restart Core", - "core.save": "Save", - "core.logs": "Logs", - "core.configuration": "Configuration", - "core.generalErrorMessage": "Something went wrong, please check the configuration", - "core.successMessage": "Core settings updated successfully", - "on_hold": "On Hold" -} + "revokeUserSub.title": "Revoke User Subscription", + "search": "Search", + "status.active": "Active", + "status.disabled": "Disabled", + "status.expired": "Expired", + "status.limited": "Limited", + "status.on_hold": "On Hold", + "userDialog.absolute": "Absolute", + "userDialog.custom": "Custom", + "userDialog.dataLimit": "Data Limit", + "userDialog.days": "Days", + "userDialog.editUser": "Edit user", + "userDialog.editUserTitle": "Edit user", + "userDialog.endDate": "End date", + "userDialog.expiryDate": "Expiry Date", + "userDialog.generatedByDefault": "Automatically generated by default", + "userDialog.hours": "Hours", + "userDialog.method": "Method", + "userDialog.months": "Months", + "userDialog.note": "Note", + "userDialog.onHold": "On Hold", + "userDialog.onHoldExpireDuration": "Expire Duration", + "userDialog.optional": "optional", + "userDialog.periodicUsageReset": "Periodic Usage Reset", + "userDialog.protocols": "Protocols", + "userDialog.relative": "Relative", + "userDialog.resetStrategyAnnually": "Annually", + "userDialog.resetStrategyDaily": "Daily", + "userDialog.resetStrategyMonthly": "Monthly", + "userDialog.resetStrategyNo": "No", + "userDialog.resetStrategyWeekly": "Weekly", + "userDialog.resetUsage": "Reset Usage", + "userDialog.revokeSubscription": "Revoke Subscription", + "userDialog.selectOneProtocol": "Please select at least one protocol", + "userDialog.shadowsocksDesc": "Fast and secure, but not efficient as others", + "userDialog.startDate": "Start date", + "userDialog.total": "Total: ", + "userDialog.trojanDesc": "Lightweight, secure and lightening fast", + "userDialog.usage": "Usage", + "userDialog.userAlreadyExists": "User already exists", + "userDialog.userCreated": "User {{username}} created.", + "userDialog.userEdited": "User {{username}} edited.", + "userDialog.vlessDesc": "Lightweight, fast and secure", + "userDialog.vmessDesc": "Fast and secure", + "userDialog.warningNoProtocol": "Please select at least one protocol", + "userDialog.weeks": "Weeks", + "username": "Username", + "users": "Users", + "usersTable.copied": "Copied", + "usersTable.copyConfigs": "Copy Configs", + "usersTable.copyLink": "Copy Subscription Link", + "usersTable.dataUsage": "data usage", + "usersTable.noUser": "There is no user added to the system", + "usersTable.noUserMatched": "It seems there is no user matched with what you are looking for", + "usersTable.status": "status", + "usersTable.total": "Total" +} \ No newline at end of file diff --git a/app/dashboard/public/locales/fa.json b/app/dashboard/public/locales/fa.json index ae02d93e..9e1e22fb 100644 --- a/app/dashboard/public/locales/fa.json +++ b/app/dashboard/public/locales/fa.json @@ -1,173 +1,188 @@ -{ - "password": "گذرواژه", - "login": "ورود", - "cancel": "لغو", +{ + "active": "فعال", + "activeUsers": "کاربران فعال", "apply": "تایید", - "delete": "حذف", - "reset": "بازنشانی", + "cancel": "لغو", + "core.configuration": "پیکربندی", + "core.generalErrorMessage": "مشکلی پیش آمده، لطفا پیکربندی را بررسی کنید", + "core.logs": "گزارش", + "core.restartCore": "اجرا مجدد هسته", + "core.restarting": "درحال اجرا مجدد...", + "core.save": "ذخیره", + "core.socket.closed": "بسته شده", + "core.socket.connected": "متصل", + "core.socket.connecting": "در حال اتصال...", + "core.socket.not_connected": "عدم اتصال", + "core.successMessage": "تنظیمات هسته با موفقیت ثبت شد", + "core.title": "تنظیمات هسته", + "createNewUser": "ساخت کاربر", "createUser": "افزودن کاربر", - "username": "نام کاربری", - "dateInfo.year": " سال", - "dateInfo.month": " ماه", + "dataUsage": "مصرف داده", + "dateFormat": "MM/dd/yyyy", "dateInfo.day": " روز", "dateInfo.hour": " ساعت", "dateInfo.min": " دقیقه", - "expires": "پایان در {{time}}", + "dateInfo.month": " ماه", + "dateInfo.year": " سال", + "delete": "حذف", + "deleteNode.deleteSuccess": "گره {{name}} با موفقیت حذف شد", + "deleteNode.prompt": "از حذف گره {{name}} مطمئن هستید؟", + "deleteNode.title": "حذف گره", + "deleteUser.deleteSuccess": "{{username}} با موفقیت حذف شد.", + "deleteUser.prompt": "از حذف کاربر {{username}} مطمئن هستید?", + "deleteUser.title": "حذف کاربر", + "disabled": "غیر فعال", "expired": "{{time}} پیش به پایان رسیده", - "dateFormat": "MM/dd/yyyy", - "inbound": "ورودی", - "login.loginYourAccount": "وارد حساب خود شوید", - "login.welcomeBack": "خوش آمدید, لطفا اطلاعات خود را وارد کنید", - "login.fieldRequired": "This field is required", + "expires": "پایان در {{time}}", + "header.donation": "کمک مالی", "header.hostSettings": "تنظیمات هاست", + "header.logout": "خروج", "header.nodeSettings": "تنظیمات گره‌ها", "header.nodesUsage": "نمودار گره‌ها", - "header.donation": "کمک مالی", - "header.logout": "خروج", - "deleteUser.title": "حذف کاربر", - "deleteUser.prompt": "از حذف کاربر {{username}} مطمئن هستید?", - "deleteUser.deleteSuccess": "{{username}} با موفقیت حذف شد.", - "usersTable.status": "وضعیت", - "usersTable.dataUsage": "مصرف داده", - "usersTable.noUserMatched": "به‌نظر میرسه کاربری که جستجو کردید، وجود ندارد", - "usersTable.noUser": "کاربری افزوده نشده است", - "usersTable.copyLink": "کپی لینک اشتراک", - "usersTable.copied": "کپی شد", - "usersTable.copyConfigs": "تنظیمات کپی", - "usersTable.total": "مجموع", - "userDialog.dataLimit": "حد مصرف داده", - "userDialog.periodicUsageReset": "بازنشانی دوره‌ای مصرف", - "userDialog.warningNoProtocol": "لطفا حداقل یک پروتکل انتخاب کنید", - "userDialog.note": "توضیحات", - "userDialog.expiryDate": "تاریخ پایان", - "userDialog.resetUsage": "بازنشانی مصرف", - "userDialog.usage": "مصرف", - "userDialog.protocols": "پروتکل‌ها", - "userDialog.editUserTitle": "ویرایش کاربر", - "userDialog.editUser": "ویرایش کاربر", - "userDialog.userEdited": "کاربر {{username}} ویرایش شد.", - "userDialog.userCreated": "کاربر {{username}} ساخته شد.", - "userDialog.userAlreadyExists": "کاربر وجود دارد", - "userDialog.vmessDesc": "سریع و امن", - "userDialog.vlessDesc": "سبک، سریع و امن", - "userDialog.trojanDesc": "سبک، امن و فوق‌العاده سریع", - "userDialog.shadowsocksDesc": "سریع و امن، اما کارآمد کمتر از بقیه", - "userDialog.resetStrategyNo": "خیر", - "userDialog.resetStrategyDaily": "روزانه", - "userDialog.resetStrategyWeekly": "هفتگی", - "userDialog.resetStrategyMonthly": "ماهانه", - "userDialog.resetStrategyAnnually": "سالانه", - "userDialog.selectOneProtocol": "لطفا حداقل یک پروتکل انتخاب کنید", - "userDialog.optional": "اختیاری", - "userDialog.method": "روش", - "userDialog.generatedByDefault": "پیش‌فرض ساخته می‌شود", - "userDialog.hours": "ساعات", - "userDialog.days": "روزها", - "userDialog.weeks": "هفته‌ها", - "userDialog.months": "ماه‌ها", - "userDialog.relative": "نسبی", - "userDialog.absolute": "مطلق", - "userDialog.custom": "انتخابی", - "userDialog.startDate": "تاریخ شروع", - "userDialog.endDate": "تاریخ پایان", - "userDialog.total": "مجموع: ", - "userDialog.onHold": "در انتظار", - "userDialog.onHoldExpireDuration": "مدت انقضا", - "hostsDialog.title": "با انتخاب این تنظیمات، می‌توانید برای هر ورودی یک آدرس منحصر به فرد انتخاب کنید.", - "hostsDialog.desc": "برای ساخت نوشته پویا، از این متغیرها استفاده کنید", - "hostsDialog.username": "نام کاربری کاربر", - "hostsDialog.dataUsage": "مصرف کنونی کاربر", - "hostsDialog.remainingData": "حجم باقی‌مانده کاربر", - "hostsDialog.dataLimit": "حد مصرف کاربر", - "hostsDialog.remainingDays": "روزهای باقی مانده کاربر", - "hostsDialog.expireDate": "تاریخ انقضای کاربر به میلادی", - "hostsDialog.jalaliExpireDate": "تاریخ انقضای کاربر به شمسی", - "hostsDialog.remainingTime": "زمان باقی مانده کاربر", - "hostsDialog.statusEmoji": "وضعیت کاربر در قالب اموجی (✅,⌛️,🪫,❌,🔌)", - "hostsDialog.statusText": "وضعیت کاربر", - "hostsDialog.proxyProtocol": "پروتکل پروکسی (مانند VMess)", - "hostsDialog.proxyMethod": "روش انتقال پروکسی (مانند ws)", + "hostsDialog.addHost": "افزودن هاست", + "hostsDialog.advancedOptions": "تنظیمات پیشرفته", + "hostsDialog.allowinsecure": "Allow Insecure", + "hostsDialog.alpn": "ALPN", + "hostsDialog.apply": "اعمال", "hostsDialog.currentServer": "IP کنونی سرور", "hostsDialog.currentServerv6": "IPv6 کنونی سرور", - "hostsDialog.security": "لایه امنیت", + "hostsDialog.dataLimit": "حد مصرف کاربر", + "hostsDialog.dataUsage": "مصرف کنونی کاربر", + "hostsDialog.desc": "برای ساخت نوشته پویا، از این متغیرها استفاده کنید", + "hostsDialog.expireDate": "تاریخ انقضای کاربر به میلادی", + "hostsDialog.fingerprint": "اثرانگشت", + "hostsDialog.fragment": "الگو فرگمنت", + "hostsDialog.fragment.info": "length,interval,packet (e.g. 10-100,100-200,tlshello)", + "hostsDialog.fragment.info.attention": "توجه: در حال حاضر، این ویژگی فقط در streisand >= 1.6.12 و v2rayNG >= 1.8.16 (پیکربندی سفارشی) پشتیبانی می شود", + "hostsDialog.fragment.info.examples": "نمونه ها:", "hostsDialog.host": "هاست درخواست", - "hostsDialog.port": "پورت", - "hostsDialog.sni": "SNI", - "hostsDialog.advancedOptions": "تنظیمات پیشرفته", - "hostsDialog.addHost": "افزودن هاست", - "hostsDialog.savedSuccess": "هاست‌ها با موفقیت ذخیره شدند", - "hostsDialog.loading": "درحال بارگزاری...", - "hostsDialog.apply": "اعمال", - "hostsDialog.port.info": "به طور پیش‌فرض، هاست، از پورت پیش‌فرض ورودی استفاده میکند، در صورتی که این هاست ترافیک را از پورتی، متفاوت از پورت سرور، منتقل می‌کند، می‌توانید آن را تغییر دهید. برای مثال، ممکن از سرور ترافیک را از پورت 8443 به پورت پیش‌فرض سرور ورودی شما منتقل کند.", - "hostsDialog.sni.info": "به طور پیش‌فرض، هاست، از SNI پیش‌فرض ورودی استفاده میکند، در صورتی که این هاست یک SNI دیگری دارد، می‌توانید آن را تغییر دهید. برای مثال، ممکن است سرور ترافیک با SSL متفاوت را دریافت و منتقل کند.", "hostsDialog.host.info": "به‌طور پیش‌فرض، اگر هاست درخواستی در پیکربندی *** تنظیم شده باشد، این هاست استفاده می‌شود. اما می‌توانید یک هاست درخواستی متفاوت در اینجا قرار دهید.", - "hostsDialog.security.info": "اگر میان‌افزار سرور این هاست، از لایه امنیتی متفاوتی از ورودی استفاده می‌کند، می‌توانید اینجا انتخاب کنید", - "hostsDialog.alpn": "ALPN", - "hostsDialog.fingerprint": "اثرانگشت", "hostsDialog.host.multiHost": "برای تنظیم چند آدرس، با , از هم جدا کنید. هر دفعه آدرسی به صورت تصادفی قرار داده می‌شود.", "hostsDialog.host.wildcard": "از * برای ساخت عبارت تصادفی استفاده کنید (برای نام‌های wildcard کار می‌کند)", - "hostsDialog.sockopt": "Sockopt", + "hostsDialog.jalaliExpireDate": "تاریخ انقضای کاربر به شمسی", + "hostsDialog.loading": "درحال بارگزاری...", "hostsDialog.muxEnable": "فعالسازی MUX", - "hostsDialog.randomUserAgent": "استفاده از User Agent تصادفی", - "hostsDialog.allowinsecure": "Allow Insecure", - "hostsDialog.fragment": "الگو فرگمنت", - "hostsDialog.fragment.info": "length,interval,packet (e.g. 10-100,100-200,tlshello)", + "hostsDialog.path": "Path", + "hostsDialog.path.info": "می‌توانید برای این هاست مسیر تعریف کنید، مثلا برای زمانی که از reverse proxy استفاده ‌می‌کنید، کارآمد است.", + "hostsDialog.port": "پورت", + "hostsDialog.port.info": "به طور پیش‌فرض، هاست، از پورت پیش‌فرض ورودی استفاده میکند، در صورتی که این هاست ترافیک را از پورتی، متفاوت از پورت سرور، منتقل می‌کند، می‌توانید آن را تغییر دهید. برای مثال، ممکن از سرور ترافیک را از پورت 8443 به پورت پیش‌فرض سرور ورودی شما منتقل کند.", + "hostsDialog.proxyMethod": "روش انتقال پروکسی (مانند ws)", "hostsDialog.proxyOutbound": "جیسون پراکسی outbound", "hostsDialog.proxyOutbound.info": "outbound اضافه (تنها در کانفیگ دستی v2ray)", - "nodes.title": "با استفاده از Marzban-Node, شما می‌توانید با افزودن گره‌های متفاوت در سرورهای متفاوت، کیفیت اتصال خود را بالاتر ببرید.", - "nodes.addNewMarzbanNode": "افزودن گره مرزبان", - "nodes.certificate": "گواهی", + "hostsDialog.proxyProtocol": "پروتکل پروکسی (مانند VMess)", + "hostsDialog.randomUserAgent": "استفاده از User Agent تصادفی", + "hostsDialog.remainingData": "حجم باقی‌مانده کاربر", + "hostsDialog.remainingDays": "روزهای باقی مانده کاربر", + "hostsDialog.remainingTime": "زمان باقی مانده کاربر", + "hostsDialog.savedSuccess": "هاست‌ها با موفقیت ذخیره شدند", + "hostsDialog.security": "لایه امنیت", + "hostsDialog.security.info": "اگر میان‌افزار سرور این هاست، از لایه امنیتی متفاوتی از ورودی استفاده می‌کند، می‌توانید اینجا انتخاب کنید", + "hostsDialog.sni": "SNI", + "hostsDialog.sni.info": "به طور پیش‌فرض، هاست، از SNI پیش‌فرض ورودی استفاده میکند، در صورتی که این هاست یک SNI دیگری دارد، می‌توانید آن را تغییر دهید. برای مثال، ممکن است سرور ترافیک با SSL متفاوت را دریافت و منتقل کند.", + "hostsDialog.sockopt": "Sockopt", + "hostsDialog.statusEmoji": "وضعیت کاربر در قالب اموجی (✅,⌛️,🪫,❌,🔌)", + "hostsDialog.statusText": "وضعیت کاربر", + "hostsDialog.title": "با انتخاب این تنظیمات، می‌توانید برای هر ورودی یک آدرس منحصر به فرد انتخاب کنید.", + "hostsDialog.username": "نام کاربری کاربر", + "inbound": "ورودی", + "itemsPerPage": "تعداد در صفحه", + "login": "ورود", + "login.fieldRequired": "این فیلد باید پر شود!", + "login.loginYourAccount": "وارد حساب خود شوید", + "login.welcomeBack": "خوش آمدید, لطفا اطلاعات خود را وارد کنید", + "memoryUsage": "مصرف حافظه", + "next": "بعدی", "nodes.addHostForEveryInbound": "استفاده از این گره به عنوان میزبان تمام ورودی‌ها", + "nodes.addNewMarzbanNode": "افزودن گره مرزبان", "nodes.addNode": "افزودن گره", "nodes.addNodeSuccess": "گره {{name}} با موفقیت افزوده شد", "nodes.apply": "ویرایش گره", - "nodes.nodeName": "نام", - "nodes.nodeAddress": "آدرس", - "nodes.nodePort": "پورت", - "nodes.nodeAPIPort": "پورت API", - "nodes.editNode": "ویرایش گره", - "nodes.reconnect": "اتصال مجدد", + "nodes.certificate": "گواهی", "nodes.connection-hint": "برای راه اندازی یک گره جدید، لازم است گواهی زیر را روی گره تنظیم کنید تا یک اتصال امن بین سرور اصلی و گره ایجاد شود.", "nodes.download-certificate": "دانلود گواهی", - "nodes.show-certificate": "نمایش دادن گواهی", + "nodes.editNode": "ویرایش گره", "nodes.hide-certificate": "مخفی کردن گواهی", + "nodes.nodeAPIPort": "پورت API", + "nodes.nodeAddress": "آدرس", + "nodes.nodeName": "نام", + "nodes.nodePort": "پورت", + "nodes.reconnect": "اتصال مجدد", "nodes.reconnecting": "درحال اتصال مجدد...", + "nodes.show-certificate": "نمایش دادن گواهی", + "nodes.title": "با استفاده از Marzban-Node, شما می‌توانید با افزودن گره‌های متفاوت در سرورهای متفاوت، کیفیت اتصال خود را بالاتر ببرید.", "nodes.usageCoefficient": "ضریب گره", - "deleteNode.title": "حذف گره", - "deleteNode.prompt": "از حذف گره {{name}} مطمئن هستید؟", - "deleteNode.deleteSuccess": "گره {{name}} با موفقیت حذف شد", - "active": "فعال", - "disabled": "غیر فعال", - "users": "کاربران", - "activeUsers": "کاربران فعال", - "dataUsage": "مصرف داده", - "memoryUsage": "مصرف حافظه", - "itemsPerPage": "تعداد در صفحه", + "on_hold": "در انتظار اتصال", + "password": "گذرواژه", "previous": "قبلی", - "next": "بعدی", - "createNewUser": "ساخت کاربر", - "search": "جستجو", - "resetAllUsage": "بازنشانی کل مصرف", "qrcodeDialog.sublink": "لینک اشتراک", - "resetUserUsage.prompt": "از بازنشانی مصرف {{username}} مطئمن هستید؟", - "resetUserUsage.title": "بازنشانی مصرف کاربر", - "resetUserUsage.success": "مصرف {{username}} با موفقیت بازنشانی شد.", - "resetUserUsage.error": "بازنشانی مصرف انجام نشد، دوباره تلاش کنید.", - "resetAllUsage.title": "بازنشانی مصرف تمام کاربران", + "reset": "بازنشانی", + "resetAllUsage": "بازنشانی کل مصرف", + "resetAllUsage.error": "بازنشانی مصرف انجام نشد، دوباره تلاش کنید.", "resetAllUsage.prompt": "این عمل مصرف تمام کاربران را بازنشانی می‌کند. از این بازنشانی مطمئن هستید؟ این عمل قابل بازگشت نیست!", "resetAllUsage.success": "مصرف کل با موفقیت بازنشانی شد.", - "resetAllUsage.error": "بازنشانی مصرف انجام نشد، دوباره تلاش کنید.", - "core.title": "تنظیمات هسته", - "core.socket.connecting": "در حال اتصال...", - "core.socket.connected": "متصل", - "core.socket.not_connected": "عدم اتصال", - "core.socket.closed": "بسته شده", - "core.restarting": "درحال اجرا مجدد...", - "core.restartCore": "اجرا مجدد هسته", - "core.save": "ذخیره", - "core.logs": "گزارش", - "core.configuration": "پیکربندی", - "core.generalErrorMessage": "مشکلی پیش آمده، لطفا پیکربندی را بررسی کنید", - "core.successMessage": "تنظیمات هسته با موفقیت ثبت شد", - "on_hold": "در انتظار اتصال" -} + "resetAllUsage.title": "بازنشانی مصرف تمام کاربران", + "resetUserUsage.error": "بازنشانی مصرف انجام نشد، دوباره تلاش کنید.", + "resetUserUsage.prompt": "از بازنشانی مصرف {{username}} مطئمن هستید؟", + "resetUserUsage.success": "مصرف {{username}} با موفقیت بازنشانی شد.", + "resetUserUsage.title": "بازنشانی مصرف کاربر", + "revoke": "بازنشانی", + "revokeUserSub.error": "بازنشانی اشتراک انجام نشد، لطفاً دوباره امتحان کنید.", + "revokeUserSub.prompt": "آیا مطمئن هستید که می خواهید اشتراک {{username}} را بازنشانی کنید؟", + "revokeUserSub.success": "اشتراک {{username}} با موفقیت بازنشانی شد.", + "revokeUserSub.title": "بازنشانی اشتراک کاربر", + "search": "جستجو", + "status.active": "فعال", + "status.disabled": "غیرفعال", + "status.expired": "منقضی شده", + "status.limited": "اتمام حد مصرف", + "status.on_hold": "در انتظار اتصال", + "userDialog.absolute": "مطلق", + "userDialog.custom": "انتخابی", + "userDialog.dataLimit": "حد مصرف داده", + "userDialog.days": "روزها", + "userDialog.editUser": "ویرایش کاربر", + "userDialog.editUserTitle": "ویرایش کاربر", + "userDialog.endDate": "تاریخ پایان", + "userDialog.expiryDate": "تاریخ پایان", + "userDialog.generatedByDefault": "پیش‌فرض ساخته می‌شود", + "userDialog.hours": "ساعات", + "userDialog.method": "روش", + "userDialog.months": "ماه‌ها", + "userDialog.note": "توضیحات", + "userDialog.onHold": "در انتظار", + "userDialog.onHoldExpireDuration": "مدت انقضا", + "userDialog.optional": "اختیاری", + "userDialog.periodicUsageReset": "بازنشانی دوره‌ای مصرف", + "userDialog.protocols": "پروتکل‌ها", + "userDialog.relative": "نسبی", + "userDialog.resetStrategyAnnually": "سالانه", + "userDialog.resetStrategyDaily": "روزانه", + "userDialog.resetStrategyMonthly": "ماهانه", + "userDialog.resetStrategyNo": "خیر", + "userDialog.resetStrategyWeekly": "هفتگی", + "userDialog.resetUsage": "بازنشانی مصرف", + "userDialog.revokeSubscription": "بازنشانی اشتراک", + "userDialog.selectOneProtocol": "لطفا حداقل یک پروتکل انتخاب کنید", + "userDialog.shadowsocksDesc": "سریع و امن، اما کارآمد کمتر از بقیه", + "userDialog.startDate": "تاریخ شروع", + "userDialog.total": "مجموع: ", + "userDialog.trojanDesc": "سبک، امن و فوق‌العاده سریع", + "userDialog.usage": "مصرف", + "userDialog.userAlreadyExists": "کاربر وجود دارد", + "userDialog.userCreated": "کاربر {{username}} ساخته شد.", + "userDialog.userEdited": "کاربر {{username}} ویرایش شد.", + "userDialog.vlessDesc": "سبک، سریع و امن", + "userDialog.vmessDesc": "سریع و امن", + "userDialog.warningNoProtocol": "لطفا حداقل یک پروتکل انتخاب کنید", + "userDialog.weeks": "هفته‌ها", + "username": "نام کاربری", + "users": "کاربران", + "usersTable.copied": "کپی شد", + "usersTable.copyConfigs": "تنظیمات کپی", + "usersTable.copyLink": "کپی لینک اشتراک", + "usersTable.dataUsage": "مصرف داده", + "usersTable.noUser": "کاربری افزوده نشده است", + "usersTable.noUserMatched": "به‌نظر میرسه کاربری که جستجو کردید، وجود ندارد", + "usersTable.status": "وضعیت", + "usersTable.total": "مجموع" +} \ No newline at end of file diff --git a/app/dashboard/public/locales/ru.json b/app/dashboard/public/locales/ru.json index cc26c232..1ba128b4 100644 --- a/app/dashboard/public/locales/ru.json +++ b/app/dashboard/public/locales/ru.json @@ -1,171 +1,183 @@ { - "password": "Пароль", - "login": "Вход", - "cancel": "Отмена", + "active": "active", + "activeUsers": "Пользователи", "apply": "Применить", - "delete": "Удалить", - "reset": "Сбросить", + "cancel": "Отмена", + "core.configuration": "Конфигурация", + "core.generalErrorMessage": "Что-то пошло не так, пожалуйста, проверьте конфигурацию", + "core.logs": "Логи", + "core.restartCore": "Перезагрузить ядро", + "core.restarting": "Перезагрузка...", + "core.save": "Сохранить", + "core.socket.closed": "Закрыто", + "core.socket.connected": "Подключено", + "core.socket.connecting": "Соединение...", + "core.socket.not_connected": "Не подключено", + "core.successMessage": "Основные настройки успешно обновлены", + "core.title": "Основные настройки", + "createNewUser": "Создать нового пользователя", "createUser": "Создать", - "username": "Имя пользователя", - "expires": "Истекает через {{time}}", - "expired": "Истекло {{time}} назад", + "dataUsage": "Трафик", "dateFormat": "MMMM d, yyy", - "inbound": "inbound", - "login.loginYourAccount": "Войдите в свой аккаунт", - "login.welcomeBack": "Пожалуйста, введите свои данные", - "login.fieldRequired": "Это поле обязательно для заполнения", + "delete": "Удалить", + "deleteNode.deleteSuccess": "Узел {{name}} успешно удалён", + "deleteNode.prompt": "Вы уверены, что хотите удалить узел {{name}}?", + "deleteNode.title": "Удалить узел", + "deleteUser.deleteSuccess": "{{username}} успешно удалён.", + "deleteUser.prompt": "Вы уверены, что хотите удалить пользователя {{username}}?", + "deleteUser.title": "Удалить пользователя", + "disabled": "disabled", + "expired": "Истекло {{time}} назад", + "expires": "Истекает через {{time}}", + "header.donation": "Пожертвование", "header.hostSettings": "Настройки хоста", + "header.logout": "Выйти", "header.nodeSettings": "Настройки узлов", "header.nodesUsage": "Использование узлов", - "header.donation": "Пожертвование", - "header.logout": "Выйти", - "deleteUser.title": "Удалить пользователя", - "deleteUser.prompt": "Вы уверены, что хотите удалить пользователя {{username}}?", - "deleteUser.deleteSuccess": "{{username}} успешно удалён.", - "usersTable.status": "Статус", - "usersTable.dataUsage": "Расход трафика", - "usersTable.noUserMatched": "Похоже, нет пользователя, соответствующего вашему запросу", - "usersTable.noUser": "В системе нет созданных пользователей", - "usersTable.copyLink": "Скопировать ссылку на подписку", - "usersTable.copied": "Скопировано", - "usersTable.copyConfigs": "Скопировать конфигурации", - "usersTable.total": "Всего", - "userDialog.dataLimit": "Лимит трафика", - "userDialog.periodicUsageReset": "Период сброса трафика", - "userDialog.warningNoProtocol": "Пожалуйста, выберите хотя бы один протокол", - "userDialog.expiryDate": "Дата истечения срока", - "userDialog.note": "Примечание", - "userDialog.resetUsage": "Сбросить трафик", - "userDialog.usage": "Потребление", - "userDialog.protocols": "Протоколы", - "userDialog.editUserTitle": "Редактировать пользователя", - "userDialog.editUser": "Редактировать", - "userDialog.userEdited": "Пользователь {{username}} изменён.", - "userDialog.userCreated": "Пользователь {{username}} создан.", - "userDialog.userAlreadyExists": "Пользователь уже существует", - "userDialog.vmessDesc": "Быстрый и безопасный", - "userDialog.vlessDesc": "Легковесный, быстрый и безопасный", - "userDialog.trojanDesc": "Легковесный, безопасный и быстрый", - "userDialog.shadowsocksDesc": "Быстрый и безопасный, но не такой эффективный, как другие", - "userDialog.resetStrategyNo": "Нет", - "userDialog.resetStrategyDaily": "Ежедневно", - "userDialog.resetStrategyWeekly": "Еженедельно", - "userDialog.resetStrategyMonthly": "Ежемесячно", - "userDialog.resetStrategyAnnually": "Ежегодно", - "userDialog.selectOneProtocol": "Пожалуйста, выберите хотя бы один протокол", - "userDialog.optional": "необязательно", - "userDialog.method": "Метод", - "userDialog.generatedByDefault": "по умолчанию", - "userDialog.hours": "Часы", - "userDialog.days": "Дни", - "userDialog.weeks": "Недели", - "userDialog.months": "Месяцы", - "userDialog.relative": "Относительно", - "userDialog.absolute": "Абсолютно", - "userDialog.custom": "Пользовательский", - "userDialog.startDate": "Дата начала", - "userDialog.endDate": "Дата окончания", - "userDialog.revokeSubscription": "Отозвать подписку", - "revoke": "Отозвать", - "userDialog.total": "Всего: ", - "userDialog.onHold": "В режиме ожидания", - "userDialog.onHoldExpireDuration":"Продолжительность срока действия", - "hostsDialog.title": "Используя эту настройку, Вы можете настроить свои inbound.", - "hostsDialog.desc": "Используйте эти переменные, чтобы сделать его динамическим", - "hostsDialog.username": "Имя пользователя", - "hostsDialog.dataUsage": "Использованный трафик пользователя", - "hostsDialog.remainingData": "Оставшийся трафик пользователя", - "hostsDialog.dataLimit": "Лимит трафика пользователя", - "hostsDialog.remainingDays": "Оставшиеся дни пользователя", - "hostsDialog.expireDate": "Дата истечения срока пользователя", - "hostsDialog.jalaliExpireDate": "Дата истечения срока по солнечному календарю", - "hostsDialog.remainingTime": "Оставшееся время пользователя", - "hostsDialog.statusEmoji": "Статус пользователя в виде смайлика (✅,⌛️,🪫,❌,🔌)", - "hostsDialog.statusText": "Статус пользователя", - "hostsDialog.proxyProtocol": "Протокол прокси (например, VMess)", - "hostsDialog.proxyMethod": "Метод транспорта прокси (например, ws)", + "hostsDialog.addHost": "Добавить хост", + "hostsDialog.advancedOptions": "Дополнительные опции", + "hostsDialog.allowinsecure": "Allow Insecure", + "hostsDialog.alpn": "ALPN", + "hostsDialog.apply": "Применить", "hostsDialog.currentServer": "IP текущего сервера", "hostsDialog.currentServerv6": "IPv6 текущего сервера", - "hostsDialog.security": "Security Layer", + "hostsDialog.dataLimit": "Лимит трафика пользователя", + "hostsDialog.dataUsage": "Использованный трафик пользователя", + "hostsDialog.desc": "Используйте эти переменные, чтобы сделать его динамическим", + "hostsDialog.expireDate": "Дата истечения срока пользователя", + "hostsDialog.fingerprint": "Fingerprint", + "hostsDialog.fragment": "Шаблон фрагмента", + "hostsDialog.fragment.info": "length,interval,packet (e.g. 10-100,100-200,tlshello)", + "hostsDialog.fragment.info.attention": "Attention: currently, this feature only supported in streisand >= 1.6.12 and v2rayNG >= 1.8.16 (custom config)", + "hostsDialog.fragment.info.examples": "Examples:", "hostsDialog.host": "Host", - "hostsDialog.port": "Port", - "hostsDialog.sni": "SNI", - "hostsDialog.advancedOptions": "Дополнительные опции", - "hostsDialog.addHost": "Добавить хост", - "hostsDialog.savedSuccess": "Хосты успешно сохранены", - "hostsDialog.loading": "загрузка...", - "hostsDialog.apply": "Применить", - "hostsDialog.port.info": "По умолчанию хост использует порт, значение которого обьявленно в inbound. Вы можете установить своё значение порта, если с него трафик перенаправляется на другой порт. Например, сервер может перенаправлять трафик с порта 443 на порт по умолчанию Вашего inbound", - "hostsDialog.sni.info": "По умолчанию хост использует SNI, значение которого обьявленно в inbound. Вы можете установить своё значение SNI, если этот хост содержит другие SNI. Например, сервер может принимать трафик с другим SSL-сертификатом, выполнять SSL-терминацию и перенаправлять его на ваш inbound.", "hostsDialog.host.info": "По умолчанию, если в конфигурации XRAY задан запрашиваемый хост, то он и будет использоваться. Однако, если необходимо, вы можете установить здесь пользовательский запрашиваемый хост.", - "hostsDialog.security.info": "Если промежуточный сервер этого хоста использует другой security layer, отличный от security layer Вашего inbound по умолчанию, Вы можете установить его здесь", - "hostsDialog.alpn": "ALPN", - "hostsDialog.fingerprint": "Fingerprint", "hostsDialog.host.multiHost": "Чтобы установить несколько адресов, разделяйте их с помощью ,. Каждый раз будет выбран случайный адрес.", "hostsDialog.host.wildcard": "Используйте *, чтобы сгенерировать случайную строку (работает для wildcard доменов)", - "hostsDialog.sockopt": "Sockopt", + "hostsDialog.jalaliExpireDate": "Дата истечения срока по солнечному календарю", + "hostsDialog.loading": "загрузка...", "hostsDialog.muxEnable": "Давать возможность MUX", - "hostsDialog.randomUserAgent":"Use random user agent", - "hostsDialog.allowinsecure": "Allow Insecure", - "hostsDialog.fragment": "Шаблон фрагмента", - "hostsDialog.fragment.info": "length,interval,packet (e.g. 10-100,100-200,tlshello)", + "hostsDialog.path": "Path", + "hostsDialog.path.info": "Set a path for host users, useful behind a reverse proxy.", + "hostsDialog.port": "Port", + "hostsDialog.port.info": "По умолчанию хост использует порт, значение которого обьявленно в inbound. Вы можете установить своё значение порта, если с него трафик перенаправляется на другой порт. Например, сервер может перенаправлять трафик с порта 443 на порт по умолчанию Вашего inbound", + "hostsDialog.proxyMethod": "Метод транспорта прокси (например, ws)", "hostsDialog.proxyOutbound": "Исходящий прокси json", "hostsDialog.proxyOutbound.info": "Дополнительный исходящий трафик (только в пользовательской конфигурации v2ray)", - "nodes.title": "Используя Marzban-Node, Вы можете масштабировать инфраструктуру, добавляя узлы на разных серверах.", - "nodes.addNewMarzbanNode": "Добавить новый узел Marzban", - "nodes.certificate": "Сертификат", + "hostsDialog.proxyProtocol": "Протокол прокси (например, VMess)", + "hostsDialog.randomUserAgent": "Use random user agent", + "hostsDialog.remainingData": "Оставшийся трафик пользователя", + "hostsDialog.remainingDays": "Оставшиеся дни пользователя", + "hostsDialog.remainingTime": "Оставшееся время пользователя", + "hostsDialog.savedSuccess": "Хосты успешно сохранены", + "hostsDialog.security": "Security Layer", + "hostsDialog.security.info": "Если промежуточный сервер этого хоста использует другой security layer, отличный от security layer Вашего inbound по умолчанию, Вы можете установить его здесь", + "hostsDialog.sni": "SNI", + "hostsDialog.sni.info": "По умолчанию хост использует SNI, значение которого обьявленно в inbound. Вы можете установить своё значение SNI, если этот хост содержит другие SNI. Например, сервер может принимать трафик с другим SSL-сертификатом, выполнять SSL-терминацию и перенаправлять его на ваш inbound.", + "hostsDialog.sockopt": "Sockopt", + "hostsDialog.statusEmoji": "Статус пользователя в виде смайлика (✅,⌛️,🪫,❌,🔌)", + "hostsDialog.statusText": "Статус пользователя", + "hostsDialog.title": "Используя эту настройку, Вы можете настроить свои inbound.", + "hostsDialog.username": "Имя пользователя", + "inbound": "inbound", + "itemsPerPage": "Элементов на страницу", + "login": "Вход", + "login.fieldRequired": "Это поле обязательно для заполнения", + "login.loginYourAccount": "Войдите в свой аккаунт", + "login.welcomeBack": "Пожалуйста, введите свои данные", + "memoryUsage": "Память", + "next": "Вперед", "nodes.addHostForEveryInbound": "Добавить этот узел, как новый хост для каждого inbound", + "nodes.addNewMarzbanNode": "Добавить новый узел Marzban", "nodes.addNode": "Добавить узел", "nodes.addNodeSuccess": "Узел {{name}} успешно добавлен", "nodes.apply": "Настройки узла успешно обновлены", - "nodes.nodeName": "Имя", - "nodes.nodeAddress": "Адрес", - "nodes.nodePort": "Порт", - "nodes.nodeAPIPort": "API порт", - "nodes.editNode": "Редактировать узел", - "nodes.reconnect": "Переподключиться", + "nodes.certificate": "Сертификат", "nodes.connection-hint": "Для настройки узла Marzban, необходимо установить на нём данный сертификат, для инициализации безопасного соединения между главным сервером и узлом", "nodes.download-certificate": "Скачать сертификат", - "nodes.show-certificate": "Показать сертификат", + "nodes.editNode": "Редактировать узел", "nodes.hide-certificate": "Скрыть сертификат", + "nodes.nodeAPIPort": "API порт", + "nodes.nodeAddress": "Адрес", + "nodes.nodeName": "Имя", + "nodes.nodePort": "Порт", + "nodes.reconnect": "Переподключиться", "nodes.reconnecting": "Переподключение...", + "nodes.show-certificate": "Показать сертификат", + "nodes.title": "Используя Marzban-Node, Вы можете масштабировать инфраструктуру, добавляя узлы на разных серверах.", "nodes.usageCoefficient": "Коэффициент использования", - "deleteNode.title": "Удалить узел", - "deleteNode.prompt": "Вы уверены, что хотите удалить узел {{name}}?", - "deleteNode.deleteSuccess": "Узел {{name}} успешно удалён", - "users": "Пользователи", - "activeUsers": "Пользователи", - "dataUsage": "Трафик", - "memoryUsage": "Память", - "itemsPerPage": "Элементов на страницу", + "on_hold": "On Hold", + "password": "Пароль", "previous": "Назад", - "next": "Вперед", - "createNewUser": "Создать нового пользователя", - "search": "Поиск", - "resetAllUsage": "Сбросить расход трафика", "qrcodeDialog.sublink": "Ссылка на подписку", + "reset": "Сбросить", + "resetAllUsage": "Сбросить расход трафика", + "resetAllUsage.error": "Сброс расхода трафика не удался, пожалуйста, попробуйте ещё раз.", + "resetAllUsage.prompt": "Это действие полностью очищает весь расход трафика пользователей. Вы уверены? ЭТО ДЕЙСТВИЕ НЕОБРАТИМО!", + "resetAllUsage.success": "Расход трафика успешно сброшен.", + "resetAllUsage.title": "Сбросить расход трафика для всех пользователей", + "resetUserUsage.error": "Сброс расхода не удался, пожалуйста, попробуйте ещё раз.", "resetUserUsage.prompt": "Вы уверены, что хотите сбросить расход трафика для пользователя {{username}}?", - "resetUserUsage.title": "Сбросить расход трафика пользователя", "resetUserUsage.success": "Расход трафика пользователя {{username}} успешно сброшен.", - "resetUserUsage.error": "Сброс расхода не удался, пожалуйста, попробуйте ещё раз.", + "resetUserUsage.title": "Сбросить расход трафика пользователя", + "revoke": "Отозвать", + "revokeUserSub.error": "Отзыв подписки не удался, пожалуйста, попробуйте ещё раз.", "revokeUserSub.prompt": "Вы уверены, что хотите отозвать подписку для пользователя {{username}}?", - "revokeUserSub.title": "Отозвать подписку пользователя", "revokeUserSub.success": "Подписка пользователя {{username}} успешно отозвана.", - "revokeUserSub.error": "Отзыв подписки не удался, пожалуйста, попробуйте ещё раз.", - "resetAllUsage.title": "Сбросить расход трафика для всех пользователей", - "resetAllUsage.prompt": "Это действие полностью очищает весь расход трафика пользователей. Вы уверены? ЭТО ДЕЙСТВИЕ НЕОБРАТИМО!", - "resetAllUsage.success": "Расход трафика успешно сброшен.", - "resetAllUsage.error": "Сброс расхода трафика не удался, пожалуйста, попробуйте ещё раз.", - "core.title": "Основные настройки", - "core.socket.connecting": "Соединение...", - "core.socket.connected": "Подключено", - "core.socket.not_connected": "Не подключено", - "core.socket.closed": "Закрыто", - "core.restarting": "Перезагрузка...", - "core.restartCore": "Перезагрузить ядро", - "core.save": "Сохранить", - "core.logs": "Логи", - "core.configuration": "Конфигурация", - "core.generalErrorMessage": "Что-то пошло не так, пожалуйста, проверьте конфигурацию", - "core.successMessage": "Основные настройки успешно обновлены" -} + "revokeUserSub.title": "Отозвать подписку пользователя", + "search": "Поиск", + "status.active": "Active", + "status.disabled": "Disabled", + "status.expired": "Expired", + "status.limited": "Limited", + "status.on_hold": "On Hold", + "userDialog.absolute": "Абсолютно", + "userDialog.custom": "Пользовательский", + "userDialog.dataLimit": "Лимит трафика", + "userDialog.days": "Дни", + "userDialog.editUser": "Редактировать", + "userDialog.editUserTitle": "Редактировать пользователя", + "userDialog.endDate": "Дата окончания", + "userDialog.expiryDate": "Дата истечения срока", + "userDialog.generatedByDefault": "по умолчанию", + "userDialog.hours": "Часы", + "userDialog.method": "Метод", + "userDialog.months": "Месяцы", + "userDialog.note": "Примечание", + "userDialog.onHold": "В режиме ожидания", + "userDialog.onHoldExpireDuration": "Продолжительность срока действия", + "userDialog.optional": "необязательно", + "userDialog.periodicUsageReset": "Период сброса трафика", + "userDialog.protocols": "Протоколы", + "userDialog.relative": "Относительно", + "userDialog.resetStrategyAnnually": "Ежегодно", + "userDialog.resetStrategyDaily": "Ежедневно", + "userDialog.resetStrategyMonthly": "Ежемесячно", + "userDialog.resetStrategyNo": "Нет", + "userDialog.resetStrategyWeekly": "Еженедельно", + "userDialog.resetUsage": "Сбросить трафик", + "userDialog.revokeSubscription": "Отозвать подписку", + "userDialog.selectOneProtocol": "Пожалуйста, выберите хотя бы один протокол", + "userDialog.shadowsocksDesc": "Быстрый и безопасный, но не такой эффективный, как другие", + "userDialog.startDate": "Дата начала", + "userDialog.total": "Всего: ", + "userDialog.trojanDesc": "Легковесный, безопасный и быстрый", + "userDialog.usage": "Потребление", + "userDialog.userAlreadyExists": "Пользователь уже существует", + "userDialog.userCreated": "Пользователь {{username}} создан.", + "userDialog.userEdited": "Пользователь {{username}} изменён.", + "userDialog.vlessDesc": "Легковесный, быстрый и безопасный", + "userDialog.vmessDesc": "Быстрый и безопасный", + "userDialog.warningNoProtocol": "Пожалуйста, выберите хотя бы один протокол", + "userDialog.weeks": "Недели", + "username": "Имя пользователя", + "users": "Пользователи", + "usersTable.copied": "Скопировано", + "usersTable.copyConfigs": "Скопировать конфигурации", + "usersTable.copyLink": "Скопировать ссылку на подписку", + "usersTable.dataUsage": "Расход трафика", + "usersTable.noUser": "В системе нет созданных пользователей", + "usersTable.noUserMatched": "Похоже, нет пользователя, соответствующего вашему запросу", + "usersTable.status": "Статус", + "usersTable.total": "Всего" +} \ No newline at end of file diff --git a/app/dashboard/public/locales/zh.json b/app/dashboard/public/locales/zh.json index 827ac2b9..72fef4c9 100644 --- a/app/dashboard/public/locales/zh.json +++ b/app/dashboard/public/locales/zh.json @@ -1,148 +1,183 @@ { - "password": "密码", - "login": "登录", - "cancel": "取消", + "active": "active", + "activeUsers": "活跃用户", "apply": "应用", - "delete": "删除", - "reset": "重置", + "cancel": "取消", + "core.configuration": "Configuration", + "core.generalErrorMessage": "Something went wrong, please check the configuration", + "core.logs": "Logs", + "core.restartCore": "Restart Core", + "core.restarting": "Restarting...", + "core.save": "Save", + "core.socket.closed": "Closed", + "core.socket.connected": "Connected", + "core.socket.connecting": "Connecting...", + "core.socket.not_connected": "Not Connected", + "core.successMessage": "Core settings updated successfully", + "core.title": "Core Settings", + "createNewUser": "创建新用户", "createUser": "创建用户", - "username": "用户名", - "expires": "{{time}}有效", - "expired": "{{time}}失效", + "dataUsage": "总流量", "dateFormat": "MM/dd/yyyy", - "inbound": "入站", - "login.loginYourAccount": "登录您的帐号", - "login.welcomeBack": "欢迎回来,请输入您的详细信息", - "login.fieldRequired": "此项必填", + "delete": "删除", + "deleteNode.deleteSuccess": "节点 {{name}} 删除成功", + "deleteNode.prompt": "您确实要删除 {{name}} 节点吗?", + "deleteNode.title": "删除节点", + "deleteUser.deleteSuccess": "{{username}} 删除成功。", + "deleteUser.prompt": "您确定你要删除 {{username}}?", + "deleteUser.title": "删除用户", + "disabled": "disabled", + "expired": "{{time}}失效", + "expires": "{{time}}有效", + "header.donation": "捐赠", "header.hostSettings": "设置", + "header.logout": "退出", "header.nodeSettings": "节点设置", "header.nodesUsage": "节点统计", - "header.donation": "捐赠", - "header.logout": "退出", - "deleteUser.title": "删除用户", - "deleteUser.prompt": "您确定你要删除 {{username}}?", - "deleteUser.deleteSuccess": "{{username}} 删除成功。", - "usersTable.status": "状态", - "usersTable.dataUsage": "流量统计", - "usersTable.noUserMatched": "没有找到您搜索的用户", - "usersTable.noUser": "还没有添加任何用户", - "usersTable.copyLink": "复制订阅链接", - "usersTable.copied": "已复制", - "usersTable.copyConfigs": "复制配置", - "usersTable.total": "总共", - "userDialog.dataLimit": "流量限制", - "userDialog.periodicUsageReset": "定期重置流量", - "userDialog.expiryDate": "过期日期", - "userDialog.resetUsage": "重置流量", - "userDialog.usage": "流量详情", - "userDialog.protocols": "协议", - "userDialog.editUserTitle": "用户编辑", - "userDialog.editUser": "修改", - "userDialog.userEdited": "已更新用户 {{username}}。", - "userDialog.userCreated": "成功创建用户 {{username}}。", - "userDialog.userAlreadyExists": "用户已存在", - "userDialog.vmessDesc": "快速且安全", - "userDialog.vlessDesc": "轻量、快速且安全", - "userDialog.trojanDesc": "轻量、安全且非常快", - "userDialog.shadowsocksDesc": "快速且安全, 但效率不如其它", - "userDialog.resetStrategyNo": "无", - "userDialog.resetStrategyDaily": "每天", - "userDialog.resetStrategyWeekly": "每周", - "userDialog.resetStrategyMonthly": "每月", - "userDialog.resetStrategyAnnually": "每年", - "userDialog.selectOneProtocol": "请至少选择一个协议", - "userDialog.optional": "可以为空", - "userDialog.method": "加密方式", - "userDialog.generatedByDefault": "默认自动生成", - "userDialog.hours": "小时", - "userDialog.days": "天", - "userDialog.weeks": "周", - "userDialog.months": "月", - "userDialog.relative": "相对时间", - "userDialog.absolute": "选择范围", - "userDialog.custom": "自定义", - "userDialog.startDate": "开始日期", - "userDialog.endDate": "结束日期", - "userDialog.total": "总共:", - "userDialog.onHold" : "保持", - "userDialog.onHoldExpireDuration":"过期时间", - "hostsDialog.title": "使用此设置,您可以为每个入站分配特定的地址。", - "hostsDialog.desc": "使用这些变量使其可以动态替换", - "hostsDialog.username": "用户的用户名", - "hostsDialog.dataUsage": "用户当前流量情况", - "hostsDialog.remainingData": "用户剩余流量情况", + "hostsDialog.addHost": "添加主机", + "hostsDialog.advancedOptions": "高级选项", + "hostsDialog.allowinsecure": "Allow Insecure", + "hostsDialog.alpn": "ALPN", + "hostsDialog.apply": "保存", + "hostsDialog.currentServer": "当前服务器的 IP 地址", + "hostsDialog.currentServerv6": "当前服务器的 IPv6 地址", "hostsDialog.dataLimit": "用户的流量限制", - "hostsDialog.remainingDays": "用户的剩余天数", + "hostsDialog.dataUsage": "用户当前流量情况", + "hostsDialog.desc": "使用这些变量使其可以动态替换", "hostsDialog.expireDate": "用户的有效期", + "hostsDialog.fingerprint": "指纹", + "hostsDialog.fragment": "碎片图案", + "hostsDialog.fragment.info": "length,interval,packet (e.g. 10-100,100-200,tlshello)", + "hostsDialog.fragment.info.attention": "Attention: currently, this feature only supported in streisand >= 1.6.12 and v2rayNG >= 1.8.16 (custom config)", + "hostsDialog.fragment.info.examples": "Examples:", + "hostsDialog.host": "请求主机", + "hostsDialog.host.info": "默认情况下,如果在 Xray 配置中设置了请求主机,则使用该主机。但是,如果需要,您可以在此处设置自定义请求主机。", + "hostsDialog.host.multiHost": "To set multiple addresses, separate them with , Each time an address is chosen randomly.", + "hostsDialog.host.wildcard": "Use * to generate a random string (works for wildcard domain names)", "hostsDialog.jalaliExpireDate": "用户阳历有效日期", - "hostsDialog.remainingTime": "用户剩余时间", - "hostsDialog.statusEmoji": "用户状态作为表情符号 (✅,⌛️,🪫,❌,🔌)", - "hostsDialog.statusText": "用户状态", - "hostsDialog.proxyProtocol": "代理协议(例如 VMess)", + "hostsDialog.loading": "加载中...", + "hostsDialog.muxEnable": "使能够 MUX", + "hostsDialog.path": "Path", + "hostsDialog.path.info": "Set a path for host users, useful behind a reverse proxy.", + "hostsDialog.port": "端口", + "hostsDialog.port.info": "默认情况下,主机使用入站端口的默认端口。如果此主机是一个服务器,用于从与您的服务器端口不同的端口转发流量,则可以设置自定义端口。例如,服务器可能会将来自端口 8443 的流量转发到您入站服务器的默认端口。", "hostsDialog.proxyMethod": "代理传输方法(例如 ws)", - "hostsDialog.currentServer": "当前服务器的 IP 地址", - "hostsDialog.currentServerv6": "当前服务器的 IPv6 地址", + "hostsDialog.proxyOutbound": "代理出站 json", + "hostsDialog.proxyOutbound.info": "额外出站(仅在 v2ray 自定义配置中)", + "hostsDialog.proxyProtocol": "代理协议(例如 VMess)", + "hostsDialog.randomUserAgent": "Use random user agent", + "hostsDialog.remainingData": "用户剩余流量情况", + "hostsDialog.remainingDays": "用户的剩余天数", + "hostsDialog.remainingTime": "用户剩余时间", + "hostsDialog.savedSuccess": "设置保存成功", "hostsDialog.security": "安全层", - "hostsDialog.host": "请求主机", - "hostsDialog.port": "端口", + "hostsDialog.security.info": "如果此主机的中间件服务器使用的安全层与入站默认值不同,则可以在此处设置自定义安全层。", "hostsDialog.sni": "SNI", - "hostsDialog.advancedOptions": "高级选项", - "hostsDialog.addHost": "添加主机", - "hostsDialog.savedSuccess": "设置保存成功", - "hostsDialog.loading": "加载中...", - "hostsDialog.apply": "保存", - "hostsDialog.port.info": "默认情况下,主机使用入站端口的默认端口。如果此主机是一个服务器,用于从与您的服务器端口不同的端口转发流量,则可以设置自定义端口。例如,服务器可能会将来自端口 8443 的流量转发到您入站服务器的默认端口。", "hostsDialog.sni.info": "默认情况下,主机使用入站 SNI 的默认值。如果此主机是一个服务器且 SNI 不同,则可以设置自定义 SNI。例如,服务器可能会接收带有不同 SSL 证书的流量,执行 SSL 处理并将其转发到您的入站服务器。", - "hostsDialog.host.info": "默认情况下,如果在 Xray 配置中设置了请求主机,则使用该主机。但是,如果需要,您可以在此处设置自定义请求主机。", - "hostsDialog.security.info": "如果此主机的中间件服务器使用的安全层与入站默认值不同,则可以在此处设置自定义安全层。", - "hostsDialog.alpn": "ALPN", - "hostsDialog.fingerprint": "指纹", "hostsDialog.sockopt": "Sockopt", - "hostsDialog.muxEnable": "使能够 MUX", - "hostsDialog.randomUserAgent":"Use random user agent", - "hostsDialog.allowinsecure": "Allow Insecure", - "hostsDialog.fragment": "碎片图案", - "hostsDialog.fragment.info": "length,interval,packet (e.g. 10-100,100-200,tlshello)", - "hostsDialog.proxyOutbound": "代理出站 json", - "hostsDialog.proxyOutbound.info": "额外出站(仅在 v2ray 自定义配置中)", - "nodes.title": "使用 Marzban-Node,您可以通过在不同的服务器上添加不同的节点来提供多节点负载。", - "nodes.addNewMarzbanNode": "添加新的 Marzban 节点", - "nodes.certificate": "证书", + "hostsDialog.statusEmoji": "用户状态作为表情符号 (✅,⌛️,🪫,❌,🔌)", + "hostsDialog.statusText": "用户状态", + "hostsDialog.title": "使用此设置,您可以为每个入站分配特定的地址。", + "hostsDialog.username": "用户的用户名", + "inbound": "入站", + "itemsPerPage": "每页条数", + "login": "登录", + "login.fieldRequired": "此项必填", + "login.loginYourAccount": "登录您的帐号", + "login.welcomeBack": "欢迎回来,请输入您的详细信息", + "memoryUsage": "内存状态", + "next": "下一页", "nodes.addHostForEveryInbound": "为每个入站请求添加此节点作为新主机", + "nodes.addNewMarzbanNode": "添加新的 Marzban 节点", "nodes.addNode": "添加节点", "nodes.addNodeSuccess": "节点 {{name}} 添加成功", + "nodes.apply": "editNode", + "nodes.certificate": "证书", + "nodes.connection-hint": "要设置Marzban节点,您需要在节点上设置此证书以初始化主服务器和节点之间的安全连接", + "nodes.download-certificate": "下载证书", "nodes.editNode": "保存", - "nodes.nodeName": "名称", + "nodes.hide-certificate": "隐藏证书", + "nodes.nodeAPIPort": "API 端口", "nodes.nodeAddress": "地址", + "nodes.nodeName": "名称", "nodes.nodePort": "端口", - "nodes.nodeAPIPort": "API 端口", "nodes.reconnect": "重新连接", - "nodes.connection-hint": "要设置Marzban节点,您需要在节点上设置此证书以初始化主服务器和节点之间的安全连接", - "nodes.download-certificate": "下载证书", - "nodes.show-certificate": "如何证书", - "nodes.hide-certificate": "隐藏证书", "nodes.reconnecting": "重连中...", + "nodes.show-certificate": "如何证书", + "nodes.title": "使用 Marzban-Node,您可以通过在不同的服务器上添加不同的节点来提供多节点负载。", "nodes.usageCoefficient": "使用系数", - "deleteNode.title": "删除节点", - "deleteNode.prompt": "您确实要删除 {{name}} 节点吗?", - "deleteNode.deleteSuccess": "节点 {{name}} 删除成功", - "users": "用户", - "activeUsers": "活跃用户", - "dataUsage": "总流量", - "memoryUsage": "内存状态", - "itemsPerPage": "每页条数", + "on_hold": "On Hold", + "password": "密码", "previous": "上一页", - "next": "下一页", - "createNewUser": "创建新用户", - "search": "搜索", - "resetAllUsage": "重置所有统计", "qrcodeDialog.sublink": "订阅链接", - "resetUserUsage.prompt": "您确定要重置 {{username}} 的流量统计吗?", - "resetUserUsage.title": "重置用户流量统计", - "resetUserUsage.success": "{{username}} 的流量统计重置完成。", - "resetUserUsage.error": "重置失败,请稍候再试", - "resetAllUsage.title": "重置所有用户的数据使用情况", + "reset": "重置", + "resetAllUsage": "重置所有统计", + "resetAllUsage.error": "重置失败,请稍候再试!", "resetAllUsage.prompt": "此操作将清除所有用户统计,您确定要执行此操作吗? 这不能被撤消!", "resetAllUsage.success": "所有统计重置完成。", - "resetAllUsage.error": "重置失败,请稍候再试!" -} + "resetAllUsage.title": "重置所有用户的数据使用情况", + "resetUserUsage.error": "重置失败,请稍候再试", + "resetUserUsage.prompt": "您确定要重置 {{username}} 的流量统计吗?", + "resetUserUsage.success": "{{username}} 的流量统计重置完成。", + "resetUserUsage.title": "重置用户流量统计", + "revoke": "Revoke", + "revokeUserSub.error": "Subscription revoke failed, please try again.", + "revokeUserSub.prompt": "Are you sure you want to revoke {{username}}'s subscription?", + "revokeUserSub.success": "{{username}}'s subscription has revoked successfully.", + "revokeUserSub.title": "Revoke User Subscription", + "search": "搜索", + "status.active": "Active", + "status.disabled": "Disabled", + "status.expired": "Expired", + "status.limited": "Limited", + "status.on_hold": "On Hold", + "userDialog.absolute": "选择范围", + "userDialog.custom": "自定义", + "userDialog.dataLimit": "流量限制", + "userDialog.days": "天", + "userDialog.editUser": "修改", + "userDialog.editUserTitle": "用户编辑", + "userDialog.endDate": "结束日期", + "userDialog.expiryDate": "过期日期", + "userDialog.generatedByDefault": "默认自动生成", + "userDialog.hours": "小时", + "userDialog.method": "加密方式", + "userDialog.months": "月", + "userDialog.note": "Note", + "userDialog.onHold": "保持", + "userDialog.onHoldExpireDuration": "过期时间", + "userDialog.optional": "可以为空", + "userDialog.periodicUsageReset": "定期重置流量", + "userDialog.protocols": "协议", + "userDialog.relative": "相对时间", + "userDialog.resetStrategyAnnually": "每年", + "userDialog.resetStrategyDaily": "每天", + "userDialog.resetStrategyMonthly": "每月", + "userDialog.resetStrategyNo": "无", + "userDialog.resetStrategyWeekly": "每周", + "userDialog.resetUsage": "重置流量", + "userDialog.revokeSubscription": "Revoke Subscription", + "userDialog.selectOneProtocol": "请至少选择一个协议", + "userDialog.shadowsocksDesc": "快速且安全, 但效率不如其它", + "userDialog.startDate": "开始日期", + "userDialog.total": "总共:", + "userDialog.trojanDesc": "轻量、安全且非常快", + "userDialog.usage": "流量详情", + "userDialog.userAlreadyExists": "用户已存在", + "userDialog.userCreated": "成功创建用户 {{username}}。", + "userDialog.userEdited": "已更新用户 {{username}}。", + "userDialog.vlessDesc": "轻量、快速且安全", + "userDialog.vmessDesc": "快速且安全", + "userDialog.warningNoProtocol": "Please select at least one protocol", + "userDialog.weeks": "周", + "username": "用户名", + "users": "用户", + "usersTable.copied": "已复制", + "usersTable.copyConfigs": "复制配置", + "usersTable.copyLink": "复制订阅链接", + "usersTable.dataUsage": "流量统计", + "usersTable.noUser": "还没有添加任何用户", + "usersTable.noUserMatched": "没有找到您搜索的用户", + "usersTable.status": "状态", + "usersTable.total": "总共" +} \ No newline at end of file diff --git a/app/dashboard/src/components/StatusBadge.tsx b/app/dashboard/src/components/StatusBadge.tsx index 54774c66..e6af297e 100644 --- a/app/dashboard/src/components/StatusBadge.tsx +++ b/app/dashboard/src/components/StatusBadge.tsx @@ -43,7 +43,7 @@ export const StatusBadge: FC = ({ fontWeight="medium" letterSpacing="tighter" > - {userStatus === "on_hold" ? t(userStatus) : userStatus} + {userStatus && t(`status.${userStatus}`)} {extraText && `: ${extraText}`} )} diff --git a/app/dashboard/src/components/UserDialog.tsx b/app/dashboard/src/components/UserDialog.tsx index f097d94d..437a3d45 100644 --- a/app/dashboard/src/components/UserDialog.tsx +++ b/app/dashboard/src/components/UserDialog.tsx @@ -187,10 +187,18 @@ const schema = z.discriminatedUnion("status", [ status: z.literal("active"), ...baseSchema, }), -z.object({ + z.object({ status: z.literal("disabled"), ...baseSchema, }), + z.object({ + status: z.literal("limited"), + ...baseSchema, + }), + z.object({ + status: z.literal("expired"), + ...baseSchema, + }), z.object({ status: z.literal("on_hold"), on_hold_expire_duration: z.coerce @@ -292,8 +300,8 @@ export const UserDialog: FC = () => { : "no_reset", status: values.status === "active" || - values.status === "disabled" || - values.status === "on_hold" + values.status === "disabled" || + values.status === "on_hold" ? values.status : "active", }; @@ -412,7 +420,7 @@ export const UserDialog: FC = () => { return ( @@ -603,13 +611,13 @@ export const UserDialog: FC = () => { target: { value: date ? dayjs( - dayjs(date) - .set("hour", 23) - .set("minute", 59) - .set("second", 59) - ) - .utc() - .valueOf() / 1000 + dayjs(date) + .set("hour", 23) + .set("minute", 59) + .set("second", 59) + ) + .utc() + .valueOf() / 1000 : 0, name: "expire", },