commit 3360252d06b5f66e528587dcd85534c071464687 Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue Apr 18 02:45:52 2023 +0000 Deploy to GitHub pages diff --git a/404.html b/404.html new file mode 100644 index 0000000..f394121 --- /dev/null +++ b/404.html @@ -0,0 +1,33 @@ + + +
+ + + + + +后端默认使用内置的 Sqlite 来存储数据,如果不连接外部数据库,数据将在容器销毁后丢失。
chatgpt-ui-wsgi-server 镜像提供环境变量 DB_URL 来配置与外部数据库的连接,以下是 DB_URL 的链接格式对照表。
| 数据库 | 链接 |
|---|---|
| PostgreSQL | postgres://USER:PASSWORD@HOST:PORT/DATABASE_NAME |
| MySQL | mysql://USER:PASSWORD@HOST:PORT/DATABASE_NAME |
| SQLite | sqlite:///PATH |
例如我使用 PostgreSQL,则配置如下:
backend-wsgi-server:
+ image: wongsaang/chatgpt-ui-wsgi-server:latest
+ environment:
+ - DB_URL=postgres://postgres:postgrespw@localhost:49153/chatgpt
+如果你开放用户注册功能,并需要向用户发送邮箱激活链接,需要在 wsgi-server 服务中配置以下环境变量:
| 参数 | 说明 | 默认值 |
|---|---|---|
| ACCOUNT_EMAIL_VERIFICATION | 邮箱验证方式,可选值: none, optional, mandatory | optional |
| EMAIL_HOST | SMTP 服务器地址 | smtp.mailgun.org |
| EMAIL_PORT | SMTP 服务器端口号 | 587 |
| EMAIL_HOST_USER | 用户名 | - |
| EMAIL_HOST_PASSWORD | 密码 | - |
| EMAIL_USE_TLS | 是否加密 | True |
| EMAIL_FROM | 发件邮箱 | webmaster@localhost |
如果您的网络无法请求 OpenAI 的 API 地址,您可以在 wsgi-server 服务中配置代理,如何搭建代理服务,需要您自行搜索。
例如:
backend-wsgi-server:
+ image: wongsaang/chatgpt-ui-wsgi-server:latest
+ environment:
+ - OPENAI_API_PROXY=https://openai.proxy.com/v1 # 注意,域名后面需要带上 v1
+如果你在访问管理后台的时候遇到 CSRF verification failed,可能你的 APP_DOMAIN 没有配置对。在 wsgi-server 服务下有个环境变量 wsgi-server。 它的值应该是 backend-web-server 的地址+端口, 默认: localhost:9000。
假如我把 chagpt.com 这个域名解析到了服务器,并且我的 backend-web-server 服务绑定了 9000 这个端口。正确的配置如下:
backend-wsgi-server:
+ image: wongsaang/chatgpt-ui-wsgi-server:latest
+ environment:
+ - APP_DOMAIN=chagpt.com:9000
+| 参数 | 说明 | 默认值 |
|---|---|---|
| SERVER_DOMAIN | 服务端地址 | http://backend-web-server |
| DEFAULT_LOCALE | 默认语言 | en |
| NUXT_PUBLIC_APP_NAME | 应用名称 | ChatGPT UI |
| NUXT_PUBLIC_TYPEWRITER | 是否开启 打字机 效果[true/false] | true |
| NUXT_PUBLIC_TYPEWRITER_DELAY | 打字机效果的延迟时间,单位:毫秒 | 50 |
部署完整后,在管理后台的 Chat->Setting 下面有 open_registration 设置项,用于控制是否开放用户注册。默认是 True (允许用户注册),如果不需要,请改成 False。
该功能默认处于关闭状态,你可以在管理后台的 Chat->Settings 中开启它,在 Settings 中有一个 open_web_search 的设置项,把它的值设置为 True。
该功能默认处于开启状态,你可以在管理后台的 Chat->Settings 中关闭它,在 Settings 中有一个 open_frugal_mode_control 的设置项,把它的值设置为 False。
By default, the backend uses the built-in Sqlite to store data. If an external database is not connected, the data will be lost after the container is destroyed.
The chatgpt-ui-wsgi-server image provides the environment variable DB_URL to configure the connection to an external database. The following table shows the link format of the DB_URL.
| DB | LINK |
|---|---|
| PostgreSQL | postgres://USER:PASSWORD@HOST:PORT/DATABASE_NAME |
| MySQL | mysql://USER:PASSWORD@HOST:PORT/DATABASE_NAME |
| SQLite | sqlite:///PATH |
For example, if I am using PostgreSQL, the configuration is as follows:
backend-wsgi-server:
+ image: wongsaang/chatgpt-ui-wsgi-server:latest
+ environment:
+ - DB_URL=postgres://postgres:postgrespw@localhost:49153/chatgpt
+If you open the user registration feature and need to send email activation links to users, you need to configure the following environment variables in the wsgi-server service:
| Parameters | Description | Default |
|---|---|---|
| ACCOUNT_EMAIL_VERIFICATION | E-mail authentication method, optional value: none, optional, mandatory | optional |
| EMAIL_HOST | SMTP server address | smtp.mailgun.org |
| EMAIL_PORT | SMTP server port | 587 |
| EMAIL_HOST_USER | User name | - |
| EMAIL_HOST_PASSWORD | Password | - |
| EMAIL_USE_TLS | Whether to encrypt | True |
| EMAIL_FROM | From email | webmaster@localhost |
If you are unable to request the OpenAI API address due to network restrictions, you can configure a proxy in the wsgi-server service. You will need to search for how to set up a proxy server on your own.
For example:
backend-wsgi-server:
+ image: wongsaang/chatgpt-ui-wsgi-server:latest
+ environment:
+ - OPENAI_API_PROXY=https://openai.proxy.com/v1
+If you encounter CSRF verification failed while accessing the management background, your APP_DOMAIN may not be configured correctly. Under the wsgi-server service, there is an environment variable wsgi-server. Its value should be the address and port of backend-web-server, default: localhost:9000.
Suppose I have resolved the domain name chagpt.com to the server, and my backend-web-server service is bound to port 9000. The correct configuration is as follows:
backend-wsgi-server:
+ image: wongsaang/chatgpt-ui-wsgi-server:latest
+ environment:
+ - APP_DOMAIN=chagpt.com:9000
+| Parameter | Description | Default Value |
|---|---|---|
| SERVER_DOMAIN | Server Address | http://backend-web-server |
| DEFAULT_LOCALE | Default Language | en |
| NUXT_PUBLIC_APP_NAME | Application Name | ChatGPT UI |
| NUXT_PUBLIC_TYPEWRITER | Enable Typewriter Effect [true/false] | true |
| NUXT_PUBLIC_TYPEWRITER_DELAY | Typewriter Effect Delay in milliseconds | 50 |
After deployment, there is an open_registration setting under Chat->Settings in the admin panel to control whether user registration is allowed. The default value is True (allowing user registration). If not needed, please change it to False.
This feature is disabled by default. You can enable it in the admin panel under Chat->Settings. There is a setting called open_web_search, set its value to True.
This feature is enabled by default. You can disable it in the Chat->Settings section of the management backend. There is a setting called open_frugal_mode_control in Settings. Set its value to False.
安装最新稳定版 node.js,如果需要打包成 docker 镜像,还需要安装 docker。
yarn install
+yarn dev
+yarn build
+docker build -t image-name:latest .
+安装Python、pip/pipenv,如果需要打包成 docker 镜像,还需要安装 docker。
pip install -r requirements.txt
+python manage.py runserver
+docker build -t image-name:latest .
+Install the latest stable version of node.js. If you need to package it as a docker image, you also need to install docker.
yarn install
+yarn dev
+yarn build
+docker build -t image-name:latest .
+Install Python, pip/pipenv. If you need to package it as a docker image, you also need to install docker.
pip install -r requirements.txt
+python manage.py runserver
+docker build -t image-name:latest .
+{const{slotScopeIds:z}=y;z&&(U=U?U.concat(z):z);const S=o(g),q=_(i(g),y,S,P,$,U,J);return q&&dn(q)&&q.data==="]"?i(y.anchor=q):(Je=!0,c(y.anchor=a("]"),S,q),q)},A=(g,y,P,$,U,J)=>{if(Je=!0,y.el=null,J){const q=k(g);for(;;){const K=i(g);if(K&&K!==q)l(K);else break}}const z=i(g),S=o(g);return l(g),n(null,y,S,z,P,$,an(S),U),z},k=g=>{let y=0;for(;g;)if(g=i(g),g&&dn(g)&&(g.data==="["&&y++,g.data==="]")){if(y===0)return i(g);y--}return g};return[f,h]}const Ce=li;function Nl(e){return Fl(e,Il)}function Fl(e,t){const n=oo();n.__VUE__=!0;const{insert:s,remove:r,patchProp:i,createElement:o,createText:l,createComment:c,setText:a,setElementText:f,parentNode:h,nextSibling:p,setScopeId:_=He,insertStaticContent:C}=e,A=(u,d,m,b=null,E=null,R=null,M=!1,x=null,T=!!d.dynamicChildren)=>{if(u===d)return;u&&!dt(u,d)&&(b=O(u),Ee(u,E,R,!0),u=null),d.patchFlag===-2&&(T=!1,d.dynamicChildren=null);const{type:w,ref:j,shapeFlag:F}=d;switch(w){case Ot:k(u,d,m,b);break;case Ae:g(u,d,m,b);break;case Kt:u==null&&y(d,m,b,M);break;case we:N(u,d,m,b,E,R,M,x,T);break;default:F&1?U(u,d,m,b,E,R,M,x,T):F&6?Q(u,d,m,b,E,R,M,x,T):(F&64||F&128)&&w.process(u,d,m,b,E,R,M,x,T,ee)}j!=null&&E&&wn(j,u&&u.ref,R,d||u,!d)},k=(u,d,m,b)=>{if(u==null)s(d.el=l(d.children),m,b);else{const E=d.el=u.el;d.children!==u.children&&a(E,d.children)}},g=(u,d,m,b)=>{u==null?s(d.el=c(d.children||""),m,b):d.el=u.el},y=(u,d,m,b)=>{[u.el,u.anchor]=C(u.children,d,m,b,u.el,u.anchor)},P=({el:u,anchor:d},m,b)=>{let E;for(;u&&u!==d;)E=p(u),s(u,m,b),u=E;s(d,m,b)},$=({el:u,anchor:d})=>{let m;for(;u&&u!==d;)m=p(u),r(u),u=m;r(d)},U=(u,d,m,b,E,R,M,x,T)=>{M=M||d.type==="svg",u==null?J(d,m,b,E,R,M,x,T):q(u,d,E,R,M,x,T)},J=(u,d,m,b,E,R,M,x)=>{let T,w;const{type:j,props:F,shapeFlag:B,transition:W,dirs:X}=u;if(T=u.el=o(u.type,R,F&&F.is,F),B&8?f(T,u.children):B&16&&S(u.children,T,null,b,E,R&&j!=="foreignObject",M,x),X&&Ue(u,null,b,"created"),z(T,u,u.scopeId,M,b),F){for(const ie in F)ie!=="value"&&!Dt(ie)&&i(T,ie,null,F[ie],R,u.children,b,E,I);"value"in F&&i(T,"value",null,F.value),(w=F.onVnodeBeforeMount)&&Oe(w,b,u)}X&&Ue(u,null,b,"beforeMount");const le=(!E||E&&!E.pendingBranch)&&W&&!W.persisted;le&&W.beforeEnter(T),s(T,d,m),((w=F&&F.onVnodeMounted)||le||X)&&Ce(()=>{w&&Oe(w,b,u),le&&W.enter(T),X&&Ue(u,null,b,"mounted")},E)},z=(u,d,m,b,E)=>{if(m&&_(u,m),b)for(let R=0;R{for(let w=T;w {const x=d.el=u.el;let{patchFlag:T,dynamicChildren:w,dirs:j}=d;T|=u.patchFlag&16;const F=u.props||ce,B=d.props||ce;let W;m&<(m,!1),(W=B.onVnodeBeforeUpdate)&&Oe(W,m,d,u),j&&Ue(d,u,m,"beforeUpdate"),m&<(m,!0);const X=E&&d.type!=="foreignObject";if(w?K(u.dynamicChildren,w,x,m,b,X,R):M||re(u,d,x,null,m,b,X,R,!1),T>0){if(T&16)Z(x,d,F,B,m,b,E);else if(T&2&&F.class!==B.class&&i(x,"class",null,B.class,E),T&4&&i(x,"style",F.style,B.style,E),T&8){const le=d.dynamicProps;for(let ie=0;ie {W&&Oe(W,m,d,u),j&&Ue(d,u,m,"updated")},b)},K=(u,d,m,b,E,R,M)=>{for(let x=0;x {if(m!==b){if(m!==ce)for(const x in m)!Dt(x)&&!(x in b)&&i(u,x,m[x],null,M,d.children,E,R,I);for(const x in b){if(Dt(x))continue;const T=b[x],w=m[x];T!==w&&x!=="value"&&i(u,x,w,T,M,d.children,E,R,I)}"value"in b&&i(u,"value",m.value,b.value)}},N=(u,d,m,b,E,R,M,x,T)=>{const w=d.el=u?u.el:l(""),j=d.anchor=u?u.anchor:l("");let{patchFlag:F,dynamicChildren:B,slotScopeIds:W}=d;W&&(x=x?x.concat(W):W),u==null?(s(w,m,b),s(j,m,b),S(d.children,m,j,E,R,M,x,T)):F>0&&F&64&&B&&u.dynamicChildren?(K(u.dynamicChildren,B,m,E,R,M,x),(d.key!=null||E&&d===E.subTree)&&Ri(u,d,!0)):re(u,d,m,j,E,R,M,x,T)},Q=(u,d,m,b,E,R,M,x,T)=>{d.slotScopeIds=x,u==null?d.shapeFlag&512?E.ctx.activate(d,m,b,M,T):L(d,m,b,E,R,M,T):ye(u,d,T)},L=(u,d,m,b,E,R,M)=>{const x=u.component=Kl(u,b,E);if(nn(u)&&(x.ctx.renderer=ee),ql(x),x.asyncDep){if(E&&E.registerDep(x,G),!u.el){const T=x.subTree=de(Ae);g(null,T,d,m)}return}G(x,u,d,m,E,R,M)},ye=(u,d,m)=>{const b=d.component=u.component;if(tl(u,d,m))if(b.asyncDep&&!b.asyncResolved){oe(b,d,m);return}else b.next=d,Qo(b.update),b.update();else d.el=u.el,b.vnode=d},G=(u,d,m,b,E,R,M)=>{const x=()=>{if(u.isMounted){let{next:j,bu:F,u:B,parent:W,vnode:X}=u,le=j,ie;lt(u,!1),j?(j.el=X.el,oe(u,j,M)):j=X,F&&Hn(F),(ie=j.props&&j.props.onVnodeBeforeUpdate)&&Oe(ie,W,j,X),lt(u,!0);const he=jn(u),Fe=u.subTree;u.subTree=he,A(Fe,he,h(Fe.el),O(Fe),u,E,R),j.el=he.el,le===null&&nl(u,he.el),B&&Ce(B,E),(ie=j.props&&j.props.onVnodeUpdated)&&Ce(()=>Oe(ie,W,j,X),E)}else{let j;const{el:F,props:B}=d,{bm:W,m:X,parent:le}=u,ie=At(d);if(lt(u,!1),W&&Hn(W),!ie&&(j=B&&B.onVnodeBeforeMount)&&Oe(j,le,d),lt(u,!0),F&&Y){const he=()=>{u.subTree=jn(u),Y(F,u.subTree,u,E,null)};ie?d.type.__asyncLoader().then(()=>!u.isUnmounted&&he()):he()}else{const he=u.subTree=jn(u);A(null,he,m,b,u,E,R),d.el=he.el}if(X&&Ce(X,E),!ie&&(j=B&&B.onVnodeMounted)){const he=d;Ce(()=>Oe(j,le,he),E)}(d.shapeFlag&256||le&&At(le.vnode)&&le.vnode.shapeFlag&256)&&u.a&&Ce(u.a,E),u.isMounted=!0,d=m=b=null}},T=u.effect=new ys(x,()=>Sn(w),u.scope),w=u.update=()=>T.run();w.id=u.uid,lt(u,!0),w()},oe=(u,d,m)=>{d.component=u;const b=u.vnode.props;u.vnode=d,u.next=null,Pl(u,d.props,b,m),Ol(u,d.children,m),Ft(),Ws(),Lt()},re=(u,d,m,b,E,R,M,x,T=!1)=>{const w=u&&u.children,j=u?u.shapeFlag:0,F=d.children,{patchFlag:B,shapeFlag:W}=d;if(B>0){if(B&128){ot(w,F,m,b,E,R,M,x,T);return}else if(B&256){Ie(w,F,m,b,E,R,M,x,T);return}}W&8?(j&16&&I(w,E,R),F!==w&&f(m,F)):j&16?W&16?ot(w,F,m,b,E,R,M,x,T):I(w,E,R,!0):(j&8&&f(m,""),W&16&&S(F,m,b,E,R,M,x,T))},Ie=(u,d,m,b,E,R,M,x,T)=>{u=u||Ct,d=d||Ct;const w=u.length,j=d.length,F=Math.min(w,j);let B;for(B=0;B j?I(u,E,R,!0,!1,F):S(d,m,b,E,R,M,x,T,F)},ot=(u,d,m,b,E,R,M,x,T)=>{let w=0;const j=d.length;let F=u.length-1,B=j-1;for(;w<=F&&w<=B;){const W=u[w],X=d[w]=T?et(d[w]):Le(d[w]);if(dt(W,X))A(W,X,m,null,E,R,M,x,T);else break;w++}for(;w<=F&&w<=B;){const W=u[F],X=d[B]=T?et(d[B]):Le(d[B]);if(dt(W,X))A(W,X,m,null,E,R,M,x,T);else break;F--,B--}if(w>F){if(w<=B){const W=B+1,X=W B)for(;w<=F;)Ee(u[w],E,R,!0),w++;else{const W=w,X=w,le=new Map;for(w=X;w<=B;w++){const Re=d[w]=T?et(d[w]):Le(d[w]);Re.key!=null&&le.set(Re.key,w)}let ie,he=0;const Fe=B-X+1;let bt=!1,Ns=0;const kt=new Array(Fe);for(w=0;w =Fe){Ee(Re,E,R,!0);continue}let De;if(Re.key!=null)De=le.get(Re.key);else for(ie=X;ie<=B;ie++)if(kt[ie-X]===0&&dt(Re,d[ie])){De=ie;break}De===void 0?Ee(Re,E,R,!0):(kt[De-X]=w+1,De>=Ns?Ns=De:bt=!0,A(Re,d[De],m,null,E,R,M,x,T),he++)}const Fs=bt?Ll(kt):Ct;for(ie=Fs.length-1,w=Fe-1;w>=0;w--){const Re=X+w,De=d[Re],Ls=Re+1 {const{el:R,type:M,transition:x,children:T,shapeFlag:w}=u;if(w&6){Ne(u.component.subTree,d,m,b);return}if(w&128){u.suspense.move(d,m,b);return}if(w&64){M.move(u,d,m,ee);return}if(M===we){s(R,d,m);for(let F=0;F x.enter(R),E);else{const{leave:F,delayLeave:B,afterLeave:W}=x,X=()=>s(R,d,m),le=()=>{F(R,()=>{X(),W&&W()})};B?B(R,X,le):le()}else s(R,d,m)},Ee=(u,d,m,b=!1,E=!1)=>{const{type:R,props:M,ref:x,children:T,dynamicChildren:w,shapeFlag:j,patchFlag:F,dirs:B}=u;if(x!=null&&wn(x,null,m,u,!0),j&256){d.ctx.deactivate(u);return}const W=j&1&&B,X=!At(u);let le;if(X&&(le=M&&M.onVnodeBeforeUnmount)&&Oe(le,d,u),j&6)v(u.component,m,b);else{if(j&128){u.suspense.unmount(m,b);return}W&&Ue(u,null,d,"beforeUnmount"),j&64?u.type.remove(u,d,m,E,ee,b):w&&(R!==we||F>0&&F&64)?I(w,d,m,!1,!0):(R===we&&F&384||!E&&j&16)&&I(T,d,m),b&&yt(u)}(X&&(le=M&&M.onVnodeUnmounted)||W)&&Ce(()=>{le&&Oe(le,d,u),W&&Ue(u,null,d,"unmounted")},m)},yt=u=>{const{type:d,el:m,anchor:b,transition:E}=u;if(d===we){sn(m,b);return}if(d===Kt){$(u);return}const R=()=>{r(m),E&&!E.persisted&&E.afterLeave&&E.afterLeave()};if(u.shapeFlag&1&&E&&!E.persisted){const{leave:M,delayLeave:x}=E,T=()=>M(m,R);x?x(u.el,R,T):T()}else R()},sn=(u,d)=>{let m;for(;u!==d;)m=p(u),r(u),u=m;r(d)},v=(u,d,m)=>{const{bum:b,scope:E,update:R,subTree:M,um:x}=u;b&&Hn(b),E.stop(),R&&(R.active=!1,Ee(M,u,d,m)),x&&Ce(x,d),Ce(()=>{u.isUnmounted=!0},d),d&&d.pendingBranch&&!d.isUnmounted&&u.asyncDep&&!u.asyncResolved&&u.suspenseId===d.pendingId&&(d.deps--,d.deps===0&&d.resolve())},I=(u,d,m,b=!1,E=!1,R=0)=>{for(let M=R;M u.shapeFlag&6?O(u.component.subTree):u.shapeFlag&128?u.suspense.next():p(u.anchor||u.el),H=(u,d,m)=>{u==null?d._vnode&&Ee(d._vnode,null,null,!0):A(d._vnode||null,u,d,null,null,null,m),Ws(),vn(),d._vnode=u},ee={p:A,um:Ee,m:Ne,r:yt,mt:L,mc:S,pc:re,pbc:K,n:O,o:e};let fe,Y;return t&&([fe,Y]=t(ee)),{render:H,hydrate:fe,createApp:Ml(H,fe)}}function lt({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function Ri(e,t,n=!1){const s=e.children,r=t.children;if(D(s)&&D(r))for(let i=0;i >1,e[n[l]]0&&(t[s]=n[i-1]),n[i]=s)}}for(i=n.length,o=n[i-1];i-- >0;)n[i]=o,o=t[o];return n}const kl=e=>e.__isTeleport,we=Symbol(void 0),Ot=Symbol(void 0),Ae=Symbol(void 0),Kt=Symbol(void 0),Wt=[];let $e=null;function Pi(e=!1){Wt.push($e=e?null:[])}function $l(){Wt.pop(),$e=Wt[Wt.length-1]||null}let Xt=1;function er(e){Xt+=e}function Ai(e){return e.dynamicChildren=Xt>0?$e||Ct:null,$l(),Xt>0&&$e&&$e.push(e),e}function $u(e,t,n,s,r,i){return Ai(Si(e,t,n,s,r,i,!0))}function Ti(e,t,n,s,r){return Ai(de(e,t,n,s,r,!0))}function xn(e){return e?e.__v_isVNode===!0:!1}function dt(e,t){return e.type===t.type&&e.key===t.key}const Nn="__vInternal",Oi=({key:e})=>e??null,mn=({ref:e,ref_key:t,ref_for:n})=>e!=null?pe(e)||ge(e)||V(e)?{i:me,r:e,k:t,f:!!n}:e:null;function Si(e,t=null,n=null,s=0,r=null,i=e===we?0:1,o=!1,l=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Oi(t),ref:t&&mn(t),scopeId:oi,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:s,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:me};return l?(Os(c,n),i&128&&e.normalize(c)):n&&(c.shapeFlag|=pe(n)?8:16),Xt>0&&!o&&$e&&(c.patchFlag>0||i&6)&&c.patchFlag!==32&&$e.push(c),c}const de=Hl;function Hl(e,t=null,n=null,s=0,r=null,i=!1){if((!e||e===_l)&&(e=Ae),xn(e)){const l=it(e,t,!0);return n&&Os(l,n),Xt>0&&!i&&$e&&(l.shapeFlag&6?$e[$e.indexOf(e)]=l:$e.push(l)),l.patchFlag|=-2,l}if(Jl(e)&&(e=e.__vccOpts),t){t=jl(t);let{class:l,style:c}=t;l&&!pe(l)&&(t.class=ds(l)),ue(c)&&(Qr(c)&&!D(c)&&(c=_e({},c)),t.style=as(c))}const o=pe(e)?1:sl(e)?128:kl(e)?64:ue(e)?4:V(e)?2:0;return Si(e,t,n,s,r,o,i,!0)}function jl(e){return e?Qr(e)||Nn in e?_e({},e):e:null}function it(e,t,n=!1){const{props:s,ref:r,patchFlag:i,children:o}=e,l=t?Bl(s||{},t):s;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&Oi(l),ref:t&&t.ref?n&&r?D(r)?r.concat(mn(t)):[r,mn(t)]:mn(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:o,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==we?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&it(e.ssContent),ssFallback:e.ssFallback&&it(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce}}function Mi(e=" ",t=0){return de(Ot,null,e,t)}function Hu(e,t){const n=de(Kt,null,e);return n.staticCount=t,n}function ju(e="",t=!1){return t?(Pi(),Ti(Ae,null,e)):de(Ae,null,e)}function Le(e){return e==null||typeof e=="boolean"?de(Ae):D(e)?de(we,null,e.slice()):typeof e=="object"?et(e):de(Ot,null,String(e))}function et(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:it(e)}function Os(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(D(t))n=16;else if(typeof t=="object")if(s&65){const r=t.default;r&&(r._c&&(r._d=!1),Os(e,r()),r._c&&(r._d=!0));return}else{n=32;const r=t._;!r&&!(Nn in t)?t._ctx=me:r===3&&me&&(me.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else V(t)?(t={default:t,_ctx:me},n=32):(t=String(t),s&64?(n=16,t=[Mi(t)]):n=8);e.children=t,e.shapeFlag|=n}function Bl(...e){const t={};for(let n=0;n ae||me,St=e=>{ae=e,e.scope.on()},mt=()=>{ae&&ae.scope.off(),ae=null};function Ii(e){return e.vnode.shapeFlag&4}let Mt=!1;function ql(e,t=!1){Mt=t;const{props:n,children:s}=e.vnode,r=Ii(e);Rl(e,n,r,t),Tl(e,s);const i=r?Vl(e,t):void 0;return Mt=!1,i}function Vl(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=Yr(new Proxy(e.ctx,bl));const{setup:s}=n;if(s){const r=e.setupContext=s.length>1?Ql(e):null;St(e),Ft();const i=st(s,e,0,[e.props,r]);if(Lt(),mt(),Fr(i)){if(i.then(mt,mt),t)return i.then(o=>{tr(e,o,t)}).catch(o=>{tn(o,e,0)});e.asyncDep=i}else tr(e,i,t)}else Ni(e,t)}function tr(e,t,n){V(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ue(t)&&(e.setupState=Gr(t)),Ni(e,n)}let nr;function Ni(e,t,n){const s=e.type;if(!e.render){if(!t&&nr&&!s.render){const r=s.template||As(e).template;if(r){const{isCustomElement:i,compilerOptions:o}=e.appContext.config,{delimiters:l,compilerOptions:c}=s,a=_e(_e({isCustomElement:i,delimiters:l},o),c);s.render=nr(r,a)}}e.render=s.render||He}St(e),Ft(),vl(e),Lt(),mt()}function zl(e){return new Proxy(e.attrs,{get(t,n){return xe(e,"get","$attrs"),t[n]}})}function Ql(e){const t=s=>{e.exposed=s||{}};let n;return{get attrs(){return n||(n=zl(e))},slots:e.slots,emit:e.emit,expose:t}}function Fn(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(Gr(Yr(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Ut)return Ut[n](e)},has(t,n){return n in t||n in Ut}}))}function Yl(e,t=!0){return V(e)?e.displayName||e.name:e.name||t&&e.__name}function Jl(e){return V(e)&&"__vccOpts"in e}const Se=(e,t)=>qo(e,t,Mt);function Ss(e,t,n){const s=arguments.length;return s===2?ue(t)&&!D(t)?xn(t)?de(e,null,[t]):de(e,t):de(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&xn(n)&&(n=[n]),de(e,t,n))}const Xl=Symbol(""),Zl=()=>je(Xl),Gl="3.2.47",ec="http://www.w3.org/2000/svg",ht=typeof document<"u"?document:null,sr=ht&&ht.createElement("template"),tc={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const r=t?ht.createElementNS(ec,e):ht.createElement(e,n?{is:n}:void 0);return e==="select"&&s&&s.multiple!=null&&r.setAttribute("multiple",s.multiple),r},createText:e=>ht.createTextNode(e),createComment:e=>ht.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ht.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,r,i){const o=n?n.previousSibling:t.lastChild;if(r&&(r===i||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===i||!(r=r.nextSibling)););else{sr.innerHTML=s?``:e;const l=sr.content;if(s){const c=l.firstChild;for(;c.firstChild;)l.appendChild(c.firstChild);l.removeChild(c)}t.insertBefore(l,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}};function nc(e,t,n){const s=e._vtc;s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}function sc(e,t,n){const s=e.style,r=pe(n);if(n&&!r){if(t&&!pe(t))for(const i in t)n[i]==null&&os(s,i,"");for(const i in n)os(s,i,n[i])}else{const i=s.display;r?t!==n&&(s.cssText=n):t&&e.removeAttribute("style"),"_vod"in e&&(s.display=i)}}const rr=/\s*!important$/;function os(e,t,n){if(D(n))n.forEach(s=>os(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=rc(e,t);rr.test(n)?e.setProperty(_t(s),n.replace(rr,""),"important"):e[s]=n}}const ir=["Webkit","Moz","ms"],Kn={};function rc(e,t){const n=Kn[t];if(n)return n;let s=We(t);if(s!=="filter"&&s in e)return Kn[t]=s;s=Tn(s);for(let r=0;r Wn||(ac.then(()=>Wn=0),Wn=Date.now());function hc(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;Me(pc(s,n.value),t,5,[s])};return n.value=e,n.attached=dc(),n}function pc(e,t){if(D(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(s=>r=>!r._stopped&&s&&s(r))}else return t}const cr=/^on[a-z]/,gc=(e,t,n,s,r=!1,i,o,l,c)=>{t==="class"?nc(e,s,r):t==="style"?sc(e,n,s):Gt(t)?hs(t)||uc(e,t,n,s,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):mc(e,t,s,r))?oc(e,t,s,i,o,l,c):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),ic(e,t,s,r))};function mc(e,t,n,s){return s?!!(t==="innerHTML"||t==="textContent"||t in e&&cr.test(t)&&V(n)):t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA"||cr.test(t)&&pe(n)?!1:t in e}const Xe="transition",$t="animation",Fi=(e,{slots:t})=>Ss(ui,_c(e),t);Fi.displayName="Transition";const Li={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String};Fi.props=_e({},ui.props,Li);const ct=(e,t=[])=>{D(e)?e.forEach(n=>n(...t)):e&&e(...t)},ur=e=>e?D(e)?e.some(t=>t.length>1):e.length>1:!1;function _c(e){const t={};for(const N in e)N in Li||(t[N]=e[N]);if(e.css===!1)return t;const{name:n="v",type:s,duration:r,enterFromClass:i=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:c=i,appearActiveClass:a=o,appearToClass:f=l,leaveFromClass:h=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:_=`${n}-leave-to`}=e,C=yc(r),A=C&&C[0],k=C&&C[1],{onBeforeEnter:g,onEnter:y,onEnterCancelled:P,onLeave:$,onLeaveCancelled:U,onBeforeAppear:J=g,onAppear:z=y,onAppearCancelled:S=P}=t,q=(N,Q,L)=>{ut(N,Q?f:l),ut(N,Q?a:o),L&&L()},K=(N,Q)=>{N._isLeaving=!1,ut(N,h),ut(N,_),ut(N,p),Q&&Q()},Z=N=>(Q,L)=>{const ye=N?z:y,G=()=>q(Q,N,L);ct(ye,[Q,G]),fr(()=>{ut(Q,N?c:i),Ze(Q,N?f:l),ur(ye)||ar(Q,s,A,G)})};return _e(t,{onBeforeEnter(N){ct(g,[N]),Ze(N,i),Ze(N,o)},onBeforeAppear(N){ct(J,[N]),Ze(N,c),Ze(N,a)},onEnter:Z(!1),onAppear:Z(!0),onLeave(N,Q){N._isLeaving=!0;const L=()=>K(N,Q);Ze(N,h),Ec(),Ze(N,p),fr(()=>{N._isLeaving&&(ut(N,h),Ze(N,_),ur($)||ar(N,s,k,L))}),ct($,[N,L])},onEnterCancelled(N){q(N,!1),ct(P,[N])},onAppearCancelled(N){q(N,!0),ct(S,[N])},onLeaveCancelled(N){K(N),ct(U,[N])}})}function yc(e){if(e==null)return null;if(ue(e))return[qn(e.enter),qn(e.leave)];{const t=qn(e);return[t,t]}}function qn(e){return io(e)}function Ze(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e._vtc||(e._vtc=new Set)).add(t)}function ut(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const{_vtc:n}=e;n&&(n.delete(t),n.size||(e._vtc=void 0))}function fr(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let bc=0;function ar(e,t,n,s){const r=e._endId=++bc,i=()=>{r===e._endId&&s()};if(n)return setTimeout(i,n);const{type:o,timeout:l,propCount:c}=vc(e,t);if(!o)return s();const a=o+"end";let f=0;const h=()=>{e.removeEventListener(a,p),i()},p=_=>{_.target===e&&++f>=c&&h()};setTimeout(()=>{f (n[C]||"").split(", "),r=s(`${Xe}Delay`),i=s(`${Xe}Duration`),o=dr(r,i),l=s(`${$t}Delay`),c=s(`${$t}Duration`),a=dr(l,c);let f=null,h=0,p=0;t===Xe?o>0&&(f=Xe,h=o,p=i.length):t===$t?a>0&&(f=$t,h=a,p=c.length):(h=Math.max(o,a),f=h>0?o>a?Xe:$t:null,p=f?f===Xe?i.length:c.length:0);const _=f===Xe&&/\b(transform|all)(,|$)/.test(s(`${Xe}Property`).toString());return{type:f,timeout:h,propCount:p,hasTransform:_}}function dr(e,t){for(;e.length hr(n)+hr(e[s])))}function hr(e){return Number(e.slice(0,-1).replace(",","."))*1e3}function Ec(){return document.body.offsetHeight}const Cc={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Bu=(e,t)=>n=>{if(!("key"in n))return;const s=_t(n.key);if(t.some(r=>r===s||Cc[r]===s))return e(n)},Du={beforeMount(e,{value:t},{transition:n}){e._vod=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Ht(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:s}){!t!=!n&&(s?t?(s.beforeEnter(e),Ht(e,!0),s.enter(e)):s.leave(e,()=>{Ht(e,!1)}):Ht(e,t))},beforeUnmount(e,{value:t}){Ht(e,t)}};function Ht(e,t){e.style.display=t?e._vod:"none"}const wc=_e({patchProp:gc},tc);let Vn,pr=!1;function xc(){return Vn=pr?Vn:Nl(wc),pr=!0,Vn}const Uu=(...e)=>{const t=xc().createApp(...e),{mount:n}=t;return t.mount=s=>{const r=Rc(s);if(r)return n(r,!0,r instanceof SVGElement)},t};function Rc(e){return pe(e)?document.querySelector(e):e}var Pc=([e,t,n])=>e==="meta"&&t.name?`${e}.${t.name}`:["title","base"].includes(e)?e:e==="template"&&t.id?`${e}.${t.id}`:JSON.stringify([e,t,n]),Ku=e=>{const t=new Set,n=[];return e.forEach(s=>{const r=Pc(s);t.has(r)||(t.add(r),n.push(s))}),n},Wu=e=>/^(https?:)?\/\//.test(e),qu=e=>/^mailto:/.test(e),Vu=e=>/^tel:/.test(e),zu=e=>Object.prototype.toString.call(e)==="[object Object]",Qu=e=>e.replace(/\/$/,""),Yu=e=>e.replace(/^\//,""),Ju=(e,t)=>{const n=Object.keys(e).sort((s,r)=>{const i=r.split("/").length-s.split("/").length;return i!==0?i:r.length-s.length});for(const s of n)if(t.startsWith(s))return s;return"/"};/*! + * vue-router v4.1.6 + * (c) 2022 Eduardo San Martin Morote + * @license MIT + */const Et=typeof window<"u";function Ac(e){return e.__esModule||e[Symbol.toStringTag]==="Module"}const se=Object.assign;function zn(e,t){const n={};for(const s in t){const r=t[s];n[s]=Be(r)?r.map(e):e(r)}return n}const qt=()=>{},Be=Array.isArray,Tc=/\/$/,Oc=e=>e.replace(Tc,"");function Qn(e,t,n="/"){let s,r={},i="",o="";const l=t.indexOf("#");let c=t.indexOf("?");return l =0&&(c=-1),c>-1&&(s=t.slice(0,c),i=t.slice(c+1,l>-1?l:t.length),r=e(i)),l>-1&&(s=s||t.slice(0,l),o=t.slice(l,t.length)),s=Nc(s??t,n),{fullPath:s+(i&&"?")+i+o,path:s,query:r,hash:o}}function Sc(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function gr(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Mc(e,t,n){const s=t.matched.length-1,r=n.matched.length-1;return s>-1&&s===r&&It(t.matched[s],n.matched[r])&&ki(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function It(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function ki(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!Ic(e[n],t[n]))return!1;return!0}function Ic(e,t){return Be(e)?mr(e,t):Be(t)?mr(t,e):e===t}function mr(e,t){return Be(t)?e.length===t.length&&e.every((n,s)=>n===t[s]):e.length===1&&e[0]===t}function Nc(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),s=e.split("/");let r=n.length-1,i,o;for(i=0;i 1&&r--;else break;return n.slice(0,r).join("/")+"/"+s.slice(i-(i===s.length?1:0)).join("/")}var Zt;(function(e){e.pop="pop",e.push="push"})(Zt||(Zt={}));var Vt;(function(e){e.back="back",e.forward="forward",e.unknown=""})(Vt||(Vt={}));function Fc(e){if(!e)if(Et){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Oc(e)}const Lc=/^[^#]+#/;function kc(e,t){return e.replace(Lc,"#")+t}function $c(e,t){const n=document.documentElement.getBoundingClientRect(),s=e.getBoundingClientRect();return{behavior:t.behavior,left:s.left-n.left-(t.left||0),top:s.top-n.top-(t.top||0)}}const Ln=()=>({left:window.pageXOffset,top:window.pageYOffset});function Hc(e){let t;if("el"in e){const n=e.el,s=typeof n=="string"&&n.startsWith("#"),r=typeof n=="string"?s?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!r)return;t=$c(r,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.pageXOffset,t.top!=null?t.top:window.pageYOffset)}function _r(e,t){return(history.state?history.state.position-t:-1)+e}const ls=new Map;function jc(e,t){ls.set(e,t)}function Bc(e){const t=ls.get(e);return ls.delete(e),t}let Dc=()=>location.protocol+"//"+location.host;function $i(e,t){const{pathname:n,search:s,hash:r}=t,i=e.indexOf("#");if(i>-1){let l=r.includes(e.slice(i))?e.slice(i).length:1,c=r.slice(l);return c[0]!=="/"&&(c="/"+c),gr(c,"")}return gr(n,e)+s+r}function Uc(e,t,n,s){let r=[],i=[],o=null;const l=({state:p})=>{const _=$i(e,location),C=n.value,A=t.value;let k=0;if(p){if(n.value=_,t.value=p,o&&o===C){o=null;return}k=A?p.position-A.position:0}else s(_);r.forEach(g=>{g(n.value,C,{delta:k,type:Zt.pop,direction:k?k>0?Vt.forward:Vt.back:Vt.unknown})})};function c(){o=n.value}function a(p){r.push(p);const _=()=>{const C=r.indexOf(p);C>-1&&r.splice(C,1)};return i.push(_),_}function f(){const{history:p}=window;p.state&&p.replaceState(se({},p.state,{scroll:Ln()}),"")}function h(){for(const p of i)p();i=[],window.removeEventListener("popstate",l),window.removeEventListener("beforeunload",f)}return window.addEventListener("popstate",l),window.addEventListener("beforeunload",f),{pauseListeners:c,listen:a,destroy:h}}function yr(e,t,n,s=!1,r=!1){return{back:e,current:t,forward:n,replaced:s,position:window.history.length,scroll:r?Ln():null}}function Kc(e){const{history:t,location:n}=window,s={value:$i(e,n)},r={value:t.state};r.value||i(s.value,{back:null,current:s.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(c,a,f){const h=e.indexOf("#"),p=h>-1?(n.host&&document.querySelector("base")?e:e.slice(h))+c:Dc()+e+c;try{t[f?"replaceState":"pushState"](a,"",p),r.value=a}catch(_){console.error(_),n[f?"replace":"assign"](p)}}function o(c,a){const f=se({},t.state,yr(r.value.back,c,r.value.forward,!0),a,{position:r.value.position});i(c,f,!0),s.value=c}function l(c,a){const f=se({},r.value,t.state,{forward:c,scroll:Ln()});i(f.current,f,!0);const h=se({},yr(s.value,c,null),{position:f.position+1},a);i(c,h,!1),s.value=c}return{location:s,state:r,push:l,replace:o}}function Xu(e){e=Fc(e);const t=Kc(e),n=Uc(e,t.state,t.location,t.replace);function s(i,o=!0){o||n.pauseListeners(),history.go(i)}const r=se({location:"",base:e,go:s,createHref:kc.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}function Wc(e){return typeof e=="string"||e&&typeof e=="object"}function Hi(e){return typeof e=="string"||typeof e=="symbol"}const Ge={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},ji=Symbol("");var br;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(br||(br={}));function Nt(e,t){return se(new Error,{type:e,[ji]:!0},t)}function qe(e,t){return e instanceof Error&&ji in e&&(t==null||!!(e.type&t))}const vr="[^/]+?",qc={sensitive:!1,strict:!1,start:!0,end:!0},Vc=/[.+*?^${}()[\]/\\]/g;function zc(e,t){const n=se({},qc,t),s=[];let r=n.start?"^":"";const i=[];for(const a of e){const f=a.length?[]:[90];n.strict&&!a.length&&(r+="/");for(let h=0;h t.length?t.length===1&&t[0]===40+40?1:-1:0}function Yc(e,t){let n=0;const s=e.score,r=t.score;for(;n 0&&t[t.length-1]<0}const Jc={type:0,value:""},Xc=/[a-zA-Z0-9_]/;function Zc(e){if(!e)return[[]];if(e==="/")return[[Jc]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(_){throw new Error(`ERR (${n})/"${a}": ${_}`)}let n=0,s=n;const r=[];let i;function o(){i&&r.push(i),i=[]}let l=0,c,a="",f="";function h(){a&&(n===0?i.push({type:0,value:a}):n===1||n===2||n===3?(i.length>1&&(c==="*"||c==="+")&&t(`A repeatable param (${a}) must be alone in its segment. eg: '/:ids+.`),i.push({type:1,value:a,regexp:f,repeatable:c==="*"||c==="+",optional:c==="*"||c==="?"})):t("Invalid state to consume buffer"),a="")}function p(){a+=c}for(;l {o(y)}:qt}function o(f){if(Hi(f)){const h=s.get(f);h&&(s.delete(f),n.splice(n.indexOf(h),1),h.children.forEach(o),h.alias.forEach(o))}else{const h=n.indexOf(f);h>-1&&(n.splice(h,1),f.record.name&&s.delete(f.record.name),f.children.forEach(o),f.alias.forEach(o))}}function l(){return n}function c(f){let h=0;for(;h =0&&(f.record.path!==n[h].record.path||!Bi(f,n[h]));)h++;n.splice(h,0,f),f.record.name&&!wr(f)&&s.set(f.record.name,f)}function a(f,h){let p,_={},C,A;if("name"in f&&f.name){if(p=s.get(f.name),!p)throw Nt(1,{location:f});A=p.record.name,_=se(Cr(h.params,p.keys.filter(y=>!y.optional).map(y=>y.name)),f.params&&Cr(f.params,p.keys.map(y=>y.name))),C=p.stringify(_)}else if("path"in f)C=f.path,p=n.find(y=>y.re.test(C)),p&&(_=p.parse(C),A=p.record.name);else{if(p=h.name?s.get(h.name):n.find(y=>y.re.test(h.path)),!p)throw Nt(1,{location:f,currentLocation:h});A=p.record.name,_=se({},h.params,f.params),C=p.stringify(_)}const k=[];let g=p;for(;g;)k.unshift(g.record),g=g.parent;return{name:A,path:C,params:_,matched:k,meta:su(k)}}return e.forEach(f=>i(f)),{addRoute:i,resolve:a,removeRoute:o,getRoutes:l,getRecordMatcher:r}}function Cr(e,t){const n={};for(const s of t)s in e&&(n[s]=e[s]);return n}function tu(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:nu(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}}}function nu(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const s in e.components)t[s]=typeof n=="boolean"?n:n[s];return t}function wr(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function su(e){return e.reduce((t,n)=>se(t,n.meta),{})}function xr(e,t){const n={};for(const s in e)n[s]=s in t?t[s]:e[s];return n}function Bi(e,t){return t.children.some(n=>n===e||Bi(e,n))}const Di=/#/g,ru=/&/g,iu=/\//g,ou=/=/g,lu=/\?/g,Ui=/\+/g,cu=/%5B/g,uu=/%5D/g,Ki=/%5E/g,fu=/%60/g,Wi=/%7B/g,au=/%7C/g,qi=/%7D/g,du=/%20/g;function Ms(e){return encodeURI(""+e).replace(au,"|").replace(cu,"[").replace(uu,"]")}function hu(e){return Ms(e).replace(Wi,"{").replace(qi,"}").replace(Ki,"^")}function cs(e){return Ms(e).replace(Ui,"%2B").replace(du,"+").replace(Di,"%23").replace(ru,"%26").replace(fu,"`").replace(Wi,"{").replace(qi,"}").replace(Ki,"^")}function pu(e){return cs(e).replace(ou,"%3D")}function gu(e){return Ms(e).replace(Di,"%23").replace(lu,"%3F")}function mu(e){return e==null?"":gu(e).replace(iu,"%2F")}function Rn(e){try{return decodeURIComponent(""+e)}catch{}return""+e}function _u(e){const t={};if(e===""||e==="?")return t;const s=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;r i&&cs(i)):[s&&cs(s)]).forEach(i=>{i!==void 0&&(t+=(t.length?"&":"")+n,i!=null&&(t+="="+i))})}return t}function yu(e){const t={};for(const n in e){const s=e[n];s!==void 0&&(t[n]=Be(s)?s.map(r=>r==null?null:""+r):s==null?s:""+s)}return t}const bu=Symbol(""),Pr=Symbol(""),kn=Symbol(""),Is=Symbol(""),us=Symbol("");function jt(){let e=[];function t(s){return e.push(s),()=>{const r=e.indexOf(s);r>-1&&e.splice(r,1)}}function n(){e=[]}return{add:t,list:()=>e,reset:n}}function tt(e,t,n,s,r){const i=s&&(s.enterCallbacks[r]=s.enterCallbacks[r]||[]);return()=>new Promise((o,l)=>{const c=h=>{h===!1?l(Nt(4,{from:n,to:t})):h instanceof Error?l(h):Wc(h)?l(Nt(2,{from:t,to:h})):(i&&s.enterCallbacks[r]===i&&typeof h=="function"&&i.push(h),o())},a=e.call(s&&s.instances[r],t,n,c);let f=Promise.resolve(a);e.length<3&&(f=f.then(c)),f.catch(h=>l(h))})}function Yn(e,t,n,s){const r=[];for(const i of e)for(const o in i.components){let l=i.components[o];if(!(t!=="beforeRouteEnter"&&!i.instances[o]))if(vu(l)){const a=(l.__vccOpts||l)[t];a&&r.push(tt(a,n,s,i,o))}else{let c=l();r.push(()=>c.then(a=>{if(!a)return Promise.reject(new Error(`Couldn't resolve component "${o}" at "${i.path}"`));const f=Ac(a)?a.default:a;i.components[o]=f;const p=(f.__vccOpts||f)[t];return p&&tt(p,n,s,i,o)()}))}}return r}function vu(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Ar(e){const t=je(kn),n=je(Is),s=Se(()=>t.resolve(Rt(e.to))),r=Se(()=>{const{matched:c}=s.value,{length:a}=c,f=c[a-1],h=n.matched;if(!f||!h.length)return-1;const p=h.findIndex(It.bind(null,f));if(p>-1)return p;const _=Tr(c[a-2]);return a>1&&Tr(f)===_&&h[h.length-1].path!==_?h.findIndex(It.bind(null,c[a-2])):p}),i=Se(()=>r.value>-1&&xu(n.params,s.value.params)),o=Se(()=>r.value>-1&&r.value===n.matched.length-1&&ki(n.params,s.value.params));function l(c={}){return wu(c)?t[Rt(e.replace)?"replace":"push"](Rt(e.to)).catch(qt):Promise.resolve()}return{route:s,href:Se(()=>s.value.href),isActive:i,isExactActive:o,navigate:l}}const Eu=Ps({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:Ar,setup(e,{slots:t}){const n=en(Ar(e)),{options:s}=je(kn),r=Se(()=>({[Or(e.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[Or(e.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=t.default&&t.default(n);return e.custom?i:Ss("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},i)}}}),Cu=Eu;function wu(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function xu(e,t){for(const n in t){const s=t[n],r=e[n];if(typeof s=="string"){if(s!==r)return!1}else if(!Be(r)||r.length!==s.length||s.some((i,o)=>i!==r[o]))return!1}return!0}function Tr(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Or=(e,t,n)=>e??t??n,Ru=Ps({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const s=je(us),r=Se(()=>e.route||s.value),i=je(Pr,0),o=Se(()=>{let a=Rt(i);const{matched:f}=r.value;let h;for(;(h=f[a])&&!h.components;)a++;return a}),l=Se(()=>r.value.matched[o.value]);pn(Pr,Se(()=>o.value+1)),pn(bu,l),pn(us,r);const c=hn();return gn(()=>[c.value,l.value,e.name],([a,f,h],[p,_,C])=>{f&&(f.instances[h]=a,_&&_!==f&&a&&a===p&&(f.leaveGuards.size||(f.leaveGuards=_.leaveGuards),f.updateGuards.size||(f.updateGuards=_.updateGuards))),a&&f&&(!_||!It(f,_)||!p)&&(f.enterCallbacks[h]||[]).forEach(A=>A(a))},{flush:"post"}),()=>{const a=r.value,f=e.name,h=l.value,p=h&&h.components[f];if(!p)return Sr(n.default,{Component:p,route:a});const _=h.props[f],C=_?_===!0?a.params:typeof _=="function"?_(a):_:null,k=Ss(p,se({},C,t,{onVnodeUnmounted:g=>{g.component.isUnmounted&&(h.instances[f]=null)},ref:c}));return Sr(n.default,{Component:k,route:a})||k}}});function Sr(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Pu=Ru;function Zu(e){const t=eu(e.routes,e),n=e.parseQuery||_u,s=e.stringifyQuery||Rr,r=e.history,i=jt(),o=jt(),l=jt(),c=jo(Ge);let a=Ge;Et&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const f=zn.bind(null,v=>""+v),h=zn.bind(null,mu),p=zn.bind(null,Rn);function _(v,I){let O,H;return Hi(v)?(O=t.getRecordMatcher(v),H=I):H=v,t.addRoute(H,O)}function C(v){const I=t.getRecordMatcher(v);I&&t.removeRoute(I)}function A(){return t.getRoutes().map(v=>v.record)}function k(v){return!!t.getRecordMatcher(v)}function g(v,I){if(I=se({},I||c.value),typeof v=="string"){const u=Qn(n,v,I.path),d=t.resolve({path:u.path},I),m=r.createHref(u.fullPath);return se(u,d,{params:p(d.params),hash:Rn(u.hash),redirectedFrom:void 0,href:m})}let O;if("path"in v)O=se({},v,{path:Qn(n,v.path,I.path).path});else{const u=se({},v.params);for(const d in u)u[d]==null&&delete u[d];O=se({},v,{params:h(v.params)}),I.params=h(I.params)}const H=t.resolve(O,I),ee=v.hash||"";H.params=f(p(H.params));const fe=Sc(s,se({},v,{hash:hu(ee),path:H.path})),Y=r.createHref(fe);return se({fullPath:fe,hash:ee,query:s===Rr?yu(v.query):v.query||{}},H,{redirectedFrom:void 0,href:Y})}function y(v){return typeof v=="string"?Qn(n,v,c.value.path):se({},v)}function P(v,I){if(a!==v)return Nt(8,{from:I,to:v})}function $(v){return z(v)}function U(v){return $(se(y(v),{replace:!0}))}function J(v){const I=v.matched[v.matched.length-1];if(I&&I.redirect){const{redirect:O}=I;let H=typeof O=="function"?O(v):O;return typeof H=="string"&&(H=H.includes("?")||H.includes("#")?H=y(H):{path:H},H.params={}),se({query:v.query,hash:v.hash,params:"path"in H?{}:v.params},H)}}function z(v,I){const O=a=g(v),H=c.value,ee=v.state,fe=v.force,Y=v.replace===!0,u=J(O);if(u)return z(se(y(u),{state:typeof u=="object"?se({},ee,u.state):ee,force:fe,replace:Y}),I||O);const d=O;d.redirectedFrom=I;let m;return!fe&&Mc(s,H,O)&&(m=Nt(16,{to:d,from:H}),ot(H,H,!0,!1)),(m?Promise.resolve(m):q(d,H)).catch(b=>qe(b)?qe(b,2)?b:Ie(b):oe(b,d,H)).then(b=>{if(b){if(qe(b,2))return z(se({replace:Y},y(b.to),{state:typeof b.to=="object"?se({},ee,b.to.state):ee,force:fe}),I||d)}else b=Z(d,H,!0,Y,ee);return K(d,H,b),b})}function S(v,I){const O=P(v,I);return O?Promise.reject(O):Promise.resolve()}function q(v,I){let O;const[H,ee,fe]=Au(v,I);O=Yn(H.reverse(),"beforeRouteLeave",v,I);for(const u of H)u.leaveGuards.forEach(d=>{O.push(tt(d,v,I))});const Y=S.bind(null,v,I);return O.push(Y),vt(O).then(()=>{O=[];for(const u of i.list())O.push(tt(u,v,I));return O.push(Y),vt(O)}).then(()=>{O=Yn(ee,"beforeRouteUpdate",v,I);for(const u of ee)u.updateGuards.forEach(d=>{O.push(tt(d,v,I))});return O.push(Y),vt(O)}).then(()=>{O=[];for(const u of v.matched)if(u.beforeEnter&&!I.matched.includes(u))if(Be(u.beforeEnter))for(const d of u.beforeEnter)O.push(tt(d,v,I));else O.push(tt(u.beforeEnter,v,I));return O.push(Y),vt(O)}).then(()=>(v.matched.forEach(u=>u.enterCallbacks={}),O=Yn(fe,"beforeRouteEnter",v,I),O.push(Y),vt(O))).then(()=>{O=[];for(const u of o.list())O.push(tt(u,v,I));return O.push(Y),vt(O)}).catch(u=>qe(u,8)?u:Promise.reject(u))}function K(v,I,O){for(const H of l.list())H(v,I,O)}function Z(v,I,O,H,ee){const fe=P(v,I);if(fe)return fe;const Y=I===Ge,u=Et?history.state:{};O&&(H||Y?r.replace(v.fullPath,se({scroll:Y&&u&&u.scroll},ee)):r.push(v.fullPath,ee)),c.value=v,ot(v,I,O,Y),Ie()}let N;function Q(){N||(N=r.listen((v,I,O)=>{if(!sn.listening)return;const H=g(v),ee=J(H);if(ee){z(se(ee,{replace:!0}),H).catch(qt);return}a=H;const fe=c.value;Et&&jc(_r(fe.fullPath,O.delta),Ln()),q(H,fe).catch(Y=>qe(Y,12)?Y:qe(Y,2)?(z(Y.to,H).then(u=>{qe(u,20)&&!O.delta&&O.type===Zt.pop&&r.go(-1,!1)}).catch(qt),Promise.reject()):(O.delta&&r.go(-O.delta,!1),oe(Y,H,fe))).then(Y=>{Y=Y||Z(H,fe,!1),Y&&(O.delta&&!qe(Y,8)?r.go(-O.delta,!1):O.type===Zt.pop&&qe(Y,20)&&r.go(-1,!1)),K(H,fe,Y)}).catch(qt)}))}let L=jt(),ye=jt(),G;function oe(v,I,O){Ie(v);const H=ye.list();return H.length?H.forEach(ee=>ee(v,I,O)):console.error(v),Promise.reject(v)}function re(){return G&&c.value!==Ge?Promise.resolve():new Promise((v,I)=>{L.add([v,I])})}function Ie(v){return G||(G=!v,Q(),L.list().forEach(([I,O])=>v?O(v):I()),L.reset()),v}function ot(v,I,O,H){const{scrollBehavior:ee}=e;if(!Et||!ee)return Promise.resolve();const fe=!O&&Bc(_r(v.fullPath,0))||(H||!O)&&history.state&&history.state.scroll||null;return ni().then(()=>ee(v,I,fe)).then(Y=>Y&&Hc(Y)).catch(Y=>oe(Y,v,I))}const Ne=v=>r.go(v);let Ee;const yt=new Set,sn={currentRoute:c,listening:!0,addRoute:_,removeRoute:C,hasRoute:k,getRoutes:A,resolve:g,options:e,push:$,replace:U,go:Ne,back:()=>Ne(-1),forward:()=>Ne(1),beforeEach:i.add,beforeResolve:o.add,afterEach:l.add,onError:ye.add,isReady:re,install(v){const I=this;v.component("RouterLink",Cu),v.component("RouterView",Pu),v.config.globalProperties.$router=I,Object.defineProperty(v.config.globalProperties,"$route",{enumerable:!0,get:()=>Rt(c)}),Et&&!Ee&&c.value===Ge&&(Ee=!0,$(r.location).catch(ee=>{}));const O={};for(const ee in Ge)O[ee]=Se(()=>c.value[ee]);v.provide(kn,I),v.provide(Is,en(O)),v.provide(us,c);const H=v.unmount;yt.add(v),v.unmount=function(){yt.delete(v),yt.size<1&&(a=Ge,N&&N(),N=null,c.value=Ge,Ee=!1,G=!1),H()}}};return sn}function vt(e){return e.reduce((t,n)=>t.then(()=>n()),Promise.resolve())}function Au(e,t){const n=[],s=[],r=[],i=Math.max(t.matched.length,e.matched.length);for(let o=0;oIt(a,l))?s.push(l):n.push(l));const c=e.matched[o];c&&(t.matched.find(a=>It(a,c))||r.push(c))}return[n,s,r]}function Gu(){return je(kn)}function ef(){return je(Is)}const tf=(e,t)=>{const n=e.__vccOpts||e;for(const[s,r]of t)n[s]=r;return n};export{Du as $,gn as A,Wl as B,ni as C,uo as D,Ou as E,jo as F,Mu as G,pn as H,gi as I,V as J,zu as K,ef as L,Fu as M,de as N,we as O,Lu as P,ju as Q,Si as R,Su as S,Fi as T,Ti as U,Zo as V,Bl as W,qu as X,Vu as Y,Nu as Z,tf as _,zr as a,Qu as a0,Hu as a1,Bu as a2,Zu as a3,Ge as a4,Uu as a5,Xu as a6,Pu as a7,en as b,Ps as c,Iu as d,D as e,Ku as f,Ju as g,Se as h,pe as i,Ss as j,je as k,Wu as l,Yu as m,pi as n,hi as o,Pi as p,$u as q,hn as r,ku as s,Mi as t,Gu as u,Tu as v,ds as w,as as x,ge as y,Rt as z}; diff --git a/assets/index.html-18d42ac0.js b/assets/index.html-18d42ac0.js new file mode 100644 index 0000000..37e6eb2 --- /dev/null +++ b/assets/index.html-18d42ac0.js @@ -0,0 +1 @@ +import{_ as i,M as s,p as o,q as r,R as e,t,N as n,a1 as l}from"./framework-5866ffd3.js";const d={},c=e("h1",{id:"introduction",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#introduction","aria-hidden":"true"},"#"),t(" Introduction")],-1),h=e("p",null,"ChatGPT UI is an unofficial ChatGPT web client. It supports multiple users, multiple languages, and multiple database connections for persistent data storage, such as Mysql, PostgreSQL, and Sqlite.",-1),u=e("p",null,"This project consists of two parts, the client-side and the server-side:",-1),p={href:"https://nuxt.com/",target:"_blank",rel:"noopener noreferrer"},g={href:"https://github.com/WongSaang/chatgpt-ui",target:"_blank",rel:"noopener noreferrer"},m={href:"https://djangoproject.com/",target:"_blank",rel:"noopener noreferrer"},f={href:"https://github.com/WongSaang/chatgpt-ui-server",target:"_blank",rel:"noopener noreferrer"},_=l(' # Features
# Client-side
- User system, supporting user registration, login, password modification, and more.
- Multi-language user interface, supporting multiple languages.
- Persistent data storage, supporting Mysql, PostgreSQL, and Sqlite databases.
- Asynchronous conversation, supporting multiple conversations simultaneously.
- Management of historical conversations.
- Continuous chat, allowing ChatGPT clients to answer questions based on their historical chat records, resulting in better answers.
- Web search capability, allowing ChatGPT to retrieve the latest information.
- Convenient tools, supporting one-click message and code block copying, as well as message editing.
- Common command management, allowing users to store and edit their own common commands.
- PWA, supporting installation to the desktop.
- User Token Usage Statistics.
- Supports configuring multiple API Keys.
# Server-side
- The server-side has an administrative panel.
- User management.
- Conversation and message management.
- Common configurations.
# Original Intention
Since using ChatGPT, it has become a good helper in work. Unfortunately, as we all know, it cannot be accessed in some places. But fortunately, OpenAI has opened up its API, so I started to write a user interface for myself.
Nothing is difficult if you put your heart into it.
Later, several friends asked me how to use ChatGPT because they didn't have the technical skills. So I started to develop a multi-user system, which can not only be used by myself but also help my family and friends around me.
After the project was open-sourced, many people raised issues and some even submitted PRs, and the project has developed to its current state. I also learned a lot during this process, as I have always believed that helping others is also helping oneself.
',10);function b(v,y){const a=s("ExternalLinkIcon");return o(),r("div",null,[c,h,u,e("ul",null,[e("li",null,[t("Client-side, based on "),e("a",p,[t("Nuxt"),n(a)]),t(", project address: "),e("a",g,[t("https://github.com/WongSaang/chatgpt-ui"),n(a)])]),e("li",null,[t("Server-side, based on "),e("a",m,[t("Django"),n(a)]),t(", project address: "),e("a",f,[t("https://github.com/WongSaang/chatgpt-ui-server"),n(a)])])]),_])}const w=i(d,[["render",b],["__file","index.html.vue"]]);export{w as default}; diff --git a/assets/index.html-a9203641.js b/assets/index.html-a9203641.js new file mode 100644 index 0000000..b0aae9c --- /dev/null +++ b/assets/index.html-a9203641.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-2d0ad528","path":"/zh/","title":"介绍","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"功能与特性","slug":"功能与特性","link":"#功能与特性","children":[{"level":3,"title":"客户端","slug":"客户端","link":"#客户端","children":[]},{"level":3,"title":"服务端","slug":"服务端","link":"#服务端","children":[]}]},{"level":2,"title":"初衷","slug":"初衷","link":"#初衷","children":[]}],"git":{"updatedTime":1681536689000,"contributors":[{"name":"Rafi","email":"rafiwx@gmail.com","commits":23},{"name":"Wong Saang","email":"46235412+WongSaang@users.noreply.github.com","commits":1}]},"filePathRelative":"zh/README.md"}');export{e as data}; diff --git a/assets/index.html-d042d854.js b/assets/index.html-d042d854.js new file mode 100644 index 0000000..7937f3b --- /dev/null +++ b/assets/index.html-d042d854.js @@ -0,0 +1 @@ +import{_ as r,M as n,p as l,q as o,R as e,t,N as i,a1 as h}from"./framework-5866ffd3.js";const s={},c=e("h1",{id:"介绍",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#介绍","aria-hidden":"true"},"#"),t(" 介绍")],-1),d=e("p",null,"ChatGPT UI 是一个非官方的 ChatGPT Web 客户端。它支持多用户,多语言,多种数据库连接进行数据持久化存储,例如:Mysql、PostgreSQL 和 Sqlite 等。",-1),_=e("p",null,"本项目项目包括客户端和服务端两部分。",-1),p={href:"https://nuxt.com/",target:"_blank",rel:"noopener noreferrer"},u={href:"https://github.com/WongSaang/chatgpt-ui",target:"_blank",rel:"noopener noreferrer"},g={href:"https://djangoproject.com/",target:"_blank",rel:"noopener noreferrer"},f={href:"https://github.com/WongSaang/chatgpt-ui-server",target:"_blank",rel:"noopener noreferrer"},b=h('# 功能与特性
# 客户端
- 用户系统,支持用户注册、登录、修改密码等。
- 用户界面多语言,支持多种语言。
- 数据持久化,支持 Mysql、PostgreSQL 和 Sqlite 等数据库。
- 异步对话,支持多个对话同时进行。
- 历史对话管理。
- 持续聊天,让 ChatGPT 客户历史聊天记录回答问题,得出更好的答案。
- 网页搜索能力,让 ChatGPT 获取最新信息。
- 便捷的工具,支持一键复制消息和代码块,以及重新编辑消息等。
- 常用指令管理,用户可存储和编辑自己的常用指令。
- PWA,支持安装到桌面。
- 用户 Token 使用量统计
- 支持配置多个 API Key
# 服务端
- 服务端拥有一个管理面板
- 用户管理
- 对话和消息管理
- 常用配置
# 初衷
自从使用 ChatGPT ,它已经成为工作中的好帮手。可惜的是,就像大家知道的,它在有些地方无法访问。但好在 OpenAI 开放了 API,于是我开始为自己写用户界面。
世上无难事,只怕有心人。
后来,有多位朋友询问我怎么样才能使用 ChatGPT,因为他们没有技术能力。于是我又着手于多用户系统的开发,这样除了自己用,还能帮助到身边的亲朋好友。
项目开源后,有很多人提了 issue,也有人提了 PR,项目就发展到如今的样子。我在这个过程中也学到了很多,正如我一直坚信的,帮助他人也是帮助自己。
',10);function x(m,P){const a=n("ExternalLinkIcon");return l(),o("div",null,[c,d,_,e("ul",null,[e("li",null,[t("客户端,基于 "),e("a",p,[t("Nuxt"),i(a)]),t(",项目地址:"),e("a",u,[t("https://github.com/WongSaang/chatgpt-ui"),i(a)])]),e("li",null,[t("服务端,基于 "),e("a",g,[t("Django"),i(a)]),t(",项目地址:"),e("a",f,[t("https://github.com/WongSaang/chatgpt-ui-server"),i(a)])])]),b])}const S=r(s,[["render",x],["__file","index.html.vue"]]);export{S as default}; diff --git a/assets/index.html-f32af385.js b/assets/index.html-f32af385.js new file mode 100644 index 0000000..40b26ce --- /dev/null +++ b/assets/index.html-f32af385.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-8daa1a0e","path":"/","title":"Introduction","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Features","slug":"features","link":"#features","children":[{"level":3,"title":"Client-side","slug":"client-side","link":"#client-side","children":[]},{"level":3,"title":"Server-side","slug":"server-side","link":"#server-side","children":[]}]},{"level":2,"title":"Original Intention","slug":"original-intention","link":"#original-intention","children":[]}],"git":{"updatedTime":1681536689000,"contributors":[{"name":"Rafi","email":"rafiwx@gmail.com","commits":3}]},"filePathRelative":"README.md"}');export{e as data}; diff --git a/assets/problems.html-3485ea96.js b/assets/problems.html-3485ea96.js new file mode 100644 index 0000000..392d7ad --- /dev/null +++ b/assets/problems.html-3485ea96.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-7f374639","path":"/guide/problems.html","title":"Encountering Issues","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Searching for Issues","slug":"searching-for-issues","link":"#searching-for-issues","children":[]},{"level":2,"title":"Submitting an Issue","slug":"submitting-an-issue","link":"#submitting-an-issue","children":[]}],"git":{"updatedTime":1681222096000,"contributors":[{"name":"Rafi","email":"rafiwx@gmail.com","commits":1}]},"filePathRelative":"guide/problems.md"}');export{e as data}; diff --git a/assets/problems.html-84e6145b.js b/assets/problems.html-84e6145b.js new file mode 100644 index 0000000..4a59351 --- /dev/null +++ b/assets/problems.html-84e6145b.js @@ -0,0 +1 @@ +import{_ as o,M as a,p as i,q as r,R as e,t as s,N as t}from"./framework-5866ffd3.js";const c={},u=e("h1",{id:"encountering-issues",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#encountering-issues","aria-hidden":"true"},"#"),s(" Encountering Issues")],-1),h=e("h2",{id:"searching-for-issues",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#searching-for-issues","aria-hidden":"true"},"#"),s(" Searching for Issues")],-1),l={href:"https://github.com/WongSaang/chatgpt-ui/issues",target:"_blank",rel:"noopener noreferrer"},d=e("h2",{id:"submitting-an-issue",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#submitting-an-issue","aria-hidden":"true"},"#"),s(" Submitting an Issue")],-1),p={href:"https://github.com/WongSaang/chatgpt-ui/issues/new",target:"_blank",rel:"noopener noreferrer"},_=e("p",null,[e("strong",null,"Note")],-1),f=e("p",null,"The title should be clear and concise, and the description should provide as much detail as possible about the issue or suggestion. If possible, it is best to provide reproducible steps and screenshots.",-1);function g(b,m){const n=a("ExternalLinkIcon");return i(),r("div",null,[u,h,e("p",null,[s("If you encounter any issues while using the project, you can search for related keywords on the project's "),e("a",l,[s("Issues"),t(n)]),s(" page to see if others have faced similar issues and if there are any solutions available.")]),d,e("p",null,[s("If you cannot find a solution, you can communicate with the project maintainers by submitting an issue. "),e("a",p,[s("Submit an Issue"),t(n)])]),_,f])}const x=o(c,[["render",g],["__file","problems.html.vue"]]);export{x as default}; diff --git a/assets/problems.html-dabd58d0.js b/assets/problems.html-dabd58d0.js new file mode 100644 index 0000000..1834bbc --- /dev/null +++ b/assets/problems.html-dabd58d0.js @@ -0,0 +1 @@ +import{_ as a,M as o,p as r,q as c,R as e,t as s,N as n}from"./framework-5866ffd3.js";const i={},h=e("h1",{id:"遇到问题",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#遇到问题","aria-hidden":"true"},"#"),s(" 遇到问题")],-1),l=e("h2",{id:"搜索问题",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#搜索问题","aria-hidden":"true"},"#"),s(" 搜索问题")],-1),_={href:"https://github.com/WongSaang/chatgpt-ui/issues",target:"_blank",rel:"noopener noreferrer"},d=e("h2",{id:"提-issue",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#提-issue","aria-hidden":"true"},"#"),s(" 提 issue")],-1),u={href:"https://github.com/WongSaang/chatgpt-ui/issues/new",target:"_blank",rel:"noopener noreferrer"},p=e("p",null,[e("strong",null,"注意")],-1),f=e("p",null,"标题应该简单明了,描述应该尽可能详细地描述问题或者建议。如果可能,最好提供复现步骤和截图。",-1);function m(g,b){const t=o("ExternalLinkIcon");return r(),c("div",null,[h,l,e("p",null,[s("当你在使用项目时,如果遇到了问题,可以在项目的 "),e("a",_,[s("Issues"),n(t)]),s(" 页面搜索相关的关键词,看看其他人是否遇到过相同的问题以及解决方案。")]),d,e("p",null,[s("如果没有找到解决方案,可以通过提交 Issue 来与项目维护者交流。"),e("a",u,[s("提交Issue"),n(t)])]),p,f])}const k=a(i,[["render",m],["__file","problems.html.vue"]]);export{k as default}; diff --git a/assets/problems.html-f1039fc4.js b/assets/problems.html-f1039fc4.js new file mode 100644 index 0000000..786da6a --- /dev/null +++ b/assets/problems.html-f1039fc4.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-4eee7faa","path":"/zh/guide/problems.html","title":"遇到问题","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"搜索问题","slug":"搜索问题","link":"#搜索问题","children":[]},{"level":2,"title":"提 issue","slug":"提-issue","link":"#提-issue","children":[]}],"git":{"updatedTime":1681222096000,"contributors":[{"name":"Rafi","email":"rafiwx@gmail.com","commits":1}]},"filePathRelative":"zh/guide/problems.md"}');export{e as data}; diff --git a/assets/quick-start.html-5d24620c.js b/assets/quick-start.html-5d24620c.js new file mode 100644 index 0000000..ce3f1ed --- /dev/null +++ b/assets/quick-start.html-5d24620c.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-47700a83","path":"/guide/quick-start.html","title":"Quick Start","lang":"en-US","frontmatter":{},"headers":[{"level":2,"title":"Deploying","slug":"deploying","link":"#deploying","children":[{"level":3,"title":"Quickly deploy script","slug":"quickly-deploy-script","link":"#quickly-deploy-script","children":[]},{"level":3,"title":"Docker Compose","slug":"docker-compose","link":"#docker-compose","children":[]}]},{"level":2,"title":"After Deployment","slug":"after-deployment","link":"#after-deployment","children":[]}],"git":{"updatedTime":1681674749000,"contributors":[{"name":"Rafi","email":"rafiwx@gmail.com","commits":3},{"name":"AI&I","email":"iluozan@126.com","commits":1}]},"filePathRelative":"guide/quick-start.md"}');export{e as data}; diff --git a/assets/quick-start.html-91a3ce5d.js b/assets/quick-start.html-91a3ce5d.js new file mode 100644 index 0000000..c43fbc2 --- /dev/null +++ b/assets/quick-start.html-91a3ce5d.js @@ -0,0 +1 @@ +const e=JSON.parse('{"key":"v-62758f72","path":"/zh/guide/quick-start.html","title":"快速开始","lang":"zh-CN","frontmatter":{},"headers":[{"level":2,"title":"部署","slug":"部署","link":"#部署","children":[{"level":3,"title":"快速部署脚本","slug":"快速部署脚本","link":"#快速部署脚本","children":[]},{"level":3,"title":"Docker Compose","slug":"docker-compose","link":"#docker-compose","children":[]}]},{"level":2,"title":"部署完成之后","slug":"部署完成之后","link":"#部署完成之后","children":[]}],"git":{"updatedTime":1681674749000,"contributors":[{"name":"Rafi","email":"rafiwx@gmail.com","commits":3},{"name":"AI&I","email":"iluozan@126.com","commits":1}]},"filePathRelative":"zh/guide/quick-start.md"}');export{e as data}; diff --git a/assets/quick-start.html-b336d0c1.js b/assets/quick-start.html-b336d0c1.js new file mode 100644 index 0000000..80f3b05 --- /dev/null +++ b/assets/quick-start.html-b336d0c1.js @@ -0,0 +1,60 @@ +import{_ as s,M as r,p as o,q as d,R as n,t as e,N as t,a1 as a}from"./framework-5866ffd3.js";const l={},c=a(`# Quick Start
This project provides related docker images for deployment on a VPS or your local computer. Please note that if your network is unable to request the OpenAI API address, you need to configure a proxy. If you want to make it available to other users, it's best to have a domain name and resolve it to the server.
You also need an OpenAI API Key, and there are multiple ways to obtain it online, please search for it yourself.
# Deploying
# Quickly deploy script
Note: This script has only been verified on Ubuntu Server 22.04 LTS.
bash <(curl -Ls https://raw.githubusercontent.com/WongSaang/chatgpt-ui/main/deployment.sh) +# Docker Compose
# Prepare docker-compose.yml
`,9),u=n("code",null,"docker-compose.yml",-1),m={href:"/en/guide/configuration",target:"_blank",rel:"noopener noreferrer"},v=n("p",null,[e("You can download the "),n("code",null,"docker-compose.yml"),e(" template to your local machine or server by clicking on the link below:")],-1),h={href:"https://raw.githubusercontent.com/WongSaang/chatgpt-ui/main/docker-compose.yml",target:"_blank",rel:"noopener noreferrer"},p=a(`You can also manually create the
docker-compose.ymlfile and copy the following content into the file:version: '3' +services: + client: + platform: linux/x86_64 + image: wongsaang/chatgpt-ui-client:latest + environment: + - SERVER_DOMAIN=http://backend-web-server + - DEFAULT_LOCALE=en +# - NUXT_PUBLIC_APP_NAME='ChatGPT UI' # The name of the application +# - NUXT_PUBLIC_TYPEWRITER=true # Whether to enable the typewriter effect, default false +# - NUXT_PUBLIC_TYPEWRITER_DELAY=50 # The delay time of the typewriter effect, default 50ms + depends_on: + - backend-web-server + ports: + - '\${CLIENT_PORT:-80}:80' + networks: + - chatgpt_ui_network + restart: always + backend-wsgi-server: + platform: linux/x86_64 + image: wongsaang/chatgpt-ui-wsgi-server:latest + environment: + - APP_DOMAIN=\${APP_DOMAIN:-localhost:9000} + - SERVER_WORKERS=3 # The number of worker processes for handling requests. + # - DB_URL=postgres://postgres:postgrespw@localhost:49153/chatgpt # If this parameter is not set, the built-in Sqlite will be used by default. It should be noted that if you do not connect to an external database, the data will be lost after the container is destroyed. + - DJANGO_SUPERUSER_USERNAME=admin # default superuser name + - DJANGO_SUPERUSER_PASSWORD=password # default superuser password + - DJANGO_SUPERUSER_EMAIL=admin@example.com # default superuser email + - ACCOUNT_EMAIL_VERIFICATION=\${ACCOUNT_EMAIL_VERIFICATION:-none} # Determines the e-mail verification method during signup – choose one of "none", "optional", or "mandatory". Default is "optional". If you don't need to verify the email, you can set it to "none". + # If you want to use the email verification function, you need to configure the following parameters +# - EMAIL_HOST=SMTP server address +# - EMAIL_PORT=SMTP server port +# - EMAIL_HOST_USER= +# - EMAIL_HOST_PASSWORD= +# - EMAIL_USE_TLS=True +# - EMAIL_FROM=no-reply@example.com #Default sender email address + ports: + - '\${WSGI_PORT:-8000}:8000' + networks: + - chatgpt_ui_network + restart: always + backend-web-server: + platform: linux/x86_64 + image: wongsaang/chatgpt-ui-web-server:latest + environment: + - BACKEND_URL=http://backend-wsgi-server:8000 + ports: + - '\${SERVER_PORT:-9000}:80' + depends_on: + - backend-wsgi-server + networks: + - chatgpt_ui_network + restart: always + +networks: + chatgpt_ui_network: + driver: bridge +# Starting the Service
After modifying the configuration as needed, you can start the service by running the following command:
docker-compose up --pull always -d +This command is used to start the services specified in the Docker Compose configuration. The specific meanings of the parameters are as follows:
up: start the services specified in the Docker Compose configuration.--pull always: before starting the service each time, the latest version of the image will be pulled from the Docker image repository. This ensures that the image used is always up to date.-d: run the service in the background. If this parameter is not added, the service will run in the current terminal window until the user manually stops it.# After Deployment
Access the management panel at
http(s)://your.domain:9000/adminorhttp(s)://123.123.123.123:9000/adminusing the default superuser account:
- username: admin
- password: password
Before starting a chat, you need to add an OpenAI API key. In the management panel, in the "Settings" section, there is a record namedopenai_api_key. Set the value to your API key.In the latest version, a separate API Key management has been added to the admin panel, located under "Provider/Api keys". You can add multiple API Keys here, and the backend program will track the usage of each key's token and balance the usage based on token usage. To enable this feature, you need to delete the previous "openai_api_key" setting.
Now you can access the client at
http(s)://your.domainorhttp://123.123.123.123to start chatting.🎉🎉🎉 Have fun!
`,14);function b(g,f){const i=r("ExternalLinkIcon");return o(),d("div",null,[c,n("p",null,[e("The project provides a sample "),u,e(". If you want to customize the configuration, please refer to the "),n("a",m,[e("configuration reference"),t(i)]),e(" section.")]),v,n("p",null,[n("a",h,[e("https://raw.githubusercontent.com/WongSaang/chatgpt-ui/main/docker-compose.yml"),t(i)])]),p])}const y=s(l,[["render",b],["__file","quick-start.html.vue"]]);export{y as default}; diff --git a/assets/quick-start.html-fc1bc91c.js b/assets/quick-start.html-fc1bc91c.js new file mode 100644 index 0000000..ef6d3be --- /dev/null +++ b/assets/quick-start.html-fc1bc91c.js @@ -0,0 +1,55 @@ +import{_ as a,M as r,p as o,q as l,R as e,t as n,N as s,a1 as d}from"./framework-5866ffd3.js";const c={},t=d('# 快速开始
本项目提供了相关的 docker 镜像,你需要一个 vps 来部署,当然你也可以在本地的电脑上部署。需要注意的是,如果你的网络无法请求 OpenAI 的 API 地址,您需要配置代理。如果你想开放给其他用户使用,最好还需要一个域名,并将域名解析到服务器。
您还需要一个 OpenAI 的API Key,网上有获取多种方案,请自行搜索。
# 部署
# 快速部署脚本
',5),v={href:"https://wongsnotes.com/p/deploying-your-own-chatgpt-client-with-one-line-of-command/",target:"_blank",rel:"noopener noreferrer"},m=d(`注意:此脚本目前仅在 Ubuntu Server 22.04 LTS 上验证过。
bash <(curl -Ls https://raw.githubusercontent.com/WongSaang/chatgpt-ui/main/deployment.sh) +# Docker Compose
# 准备 docker-compose.yml
`,4),u=e("code",null,"docker-compose.yml",-1),p={href:"/zh/guide/configuration",target:"_blank",rel:"noopener noreferrer"},h=e("p",null,[n("你可以通过下方链接下载 "),e("code",null,"docker-compose.yml"),n(" 模板到本地或服务器:")],-1),b={href:"https://raw.githubusercontent.com/WongSaang/chatgpt-ui/main/docker-compose.yml",target:"_blank",rel:"noopener noreferrer"},_=d(`也可以手动创建
docker-compose.yml文件,然后复制下面的内容到文件中:version: '3' +services: + client: + image: wongsaang/chatgpt-ui-client:latest + environment: + - SERVER_DOMAIN=http://backend-web-server + - DEFAULT_LOCALE=zh + # - NUXT_PUBLIC_APP_NAME='ChatGPT UI' # APP 名称 + # - NUXT_PUBLIC_TYPEWRITER=true # 是否开启 打字机 效果 + # - NUXT_PUBLIC_TYPEWRITER_DELAY=50 # 打字机效果的延迟时间,单位:毫秒,默认:50 + depends_on: + - backend-web-server + ports: + - '80:80' + networks: + - chatgpt_ui_network + backend-wsgi-server: + image: wongsaang/chatgpt-ui-wsgi-server:latest + environment: + - APP_DOMAIN=\${APP_DOMAIN:-localhost:9000} # CSRF 白名单,在这里设置为 chatgpt-ui-web-server 的地址+端口, 默认: localhost:9000 + - SERVER_WORKERS=3 # gunicorn 的工作进程数,默认为 3 + #- DB_URL=postgres://postgres:postgrespw@localhost:49153/chatgpt # 连接外部数据库,如果不设置这个参数,则默认使用内置的 Sqlite。需要注意的是,如果不连接外部数据库,数据将在容器销毁后丢失。链接格式请看下面的 DB_URL 格式对照表 + #- OPENAI_API_PROXY=https://openai.proxy.com/v1 # https://api.openai.com/v1 的代理地址 + - DJANGO_SUPERUSER_USERNAME=admin # 默认超级用户 + - DJANGO_SUPERUSER_PASSWORD=password # 默认超级用户的密码 + - DJANGO_SUPERUSER_EMAIL=admin@example.com # 默认超级用户邮箱 + - ACCOUNT_EMAIL_VERIFICATION=none # 邮箱验证方式,可选值: none, optional, mandatory. 默认为 optional。如果你不需要验证用户的邮箱,可以设置为 none。 + # 如果您想使用电子邮件验证功能,需要配置以下参数: + # - EMAIL_HOST=SMTP server address + # - EMAIL_PORT=SMTP server port + # - EMAIL_HOST_USER= + # - EMAIL_HOST_PASSWORD= + # - EMAIL_USE_TLS=True + # - EMAIL_FROM=no-reply@example.com #默认发件邮箱地址 + ports: + - '8000:8000' + networks: + - chatgpt_ui_network + backend-web-server: + image: wongsaang/chatgpt-ui-web-server:latest + environment: + - BACKEND_URL=http://backend-wsgi-server:8000 + ports: + - '9000:80' + depends_on: + - backend-wsgi-server + networks: + - chatgpt_ui_network + +networks: + chatgpt_ui_network: + driver: bridge +# 启动服务
你可以自行修改配置后,运行下面的命令来启动服务。
docker-compose up --pull always -d +这个命令用于启动 Docker Compose 配置中的服务。具体的参数含义如下:
up:启动 Docker Compose 配置中的服务。--pull always:每次启动服务前,都会从 Docker 镜像仓库中拉取最新版本的镜像。这样可以确保使用的镜像始终是最新的。-d:在后台运行服务。如果不加这个参数,服务会在当前终端窗口中运行,直到用户手动停止服务。# 部署完成之后
访问
http(s)://your.domain:9000/admin或 IPhttp(s)://123.123.123.123:9000/admin登录管理面板。默认超级用户: admin
默认密码: password
在可以开始聊天之前,您需要添加一个 OpenAI 的 API 密钥。在管理面板的设置模型中,有一个名称为openai_api_key的记录,将值设置为您的 API 密钥。在最新版本中,管理面板增加了一个独立的 API Key 的管理,位于管理面板的
Provider/ Api keys。你可以在这里添加多个 API Key,后端程序会统计每个 Key 的 token 使用量,并根据 token 使用量来平衡使用 Key。想要这个功能生效,需要删除之前的openai_api_key设置现在可以访问客户端地址
http(s)://your.domain或 IPhttp://123.123.123.123开始聊天。🎉🎉🎉 祝开心!
`,15);function g(k,A){const i=r("ExternalLinkIcon");return o(),l("div",null,[t,e("p",null,[e("em",null,[n("对于技术知识了解不多的选手,如果你看不懂下面的内容,可以看我之前写的博客文章"),e("a",v,[n("《一行命令部署自己的ChatGPT客户端》"),s(i)])])]),m,e("p",null,[n("项目中提供了一个 "),u,n(" 示例,如果你想自定义配置,请看 "),e("a",p,[n("配置参考"),s(i)]),n(" 部分。")]),h,e("p",null,[e("a",b,[n("https://raw.githubusercontent.com/WongSaang/chatgpt-ui/main/docker-compose.yml"),s(i)])]),_])}const I=a(c,[["render",g],["__file","quick-start.html.vue"]]);export{I as default}; diff --git a/assets/style-ad6949cb.css b/assets/style-ad6949cb.css new file mode 100644 index 0000000..dc8c806 --- /dev/null +++ b/assets/style-ad6949cb.css @@ -0,0 +1 @@ +:root{--back-to-top-z-index: 5;--back-to-top-color: #3eaf7c;--back-to-top-color-hover: #71cda3}.back-to-top{cursor:pointer;position:fixed;bottom:2rem;right:2.5rem;width:2rem;height:1.2rem;background-color:var(--back-to-top-color);-webkit-mask:url(/chatgpt-ui/assets/back-to-top-8efcbe56.svg) no-repeat;mask:url(/chatgpt-ui/assets/back-to-top-8efcbe56.svg) no-repeat;z-index:var(--back-to-top-z-index)}.back-to-top:hover{background-color:var(--back-to-top-color-hover)}@media (max-width: 959px){.back-to-top{display:none}}@media print{.back-to-top{display:none}}.back-to-top-enter-active,.back-to-top-leave-active{transition:opacity .3s}.back-to-top-enter-from,.back-to-top-leave-to{opacity:0}:root{--external-link-icon-color: #aaa}.external-link-icon{position:relative;display:inline-block;color:var(--external-link-icon-color);vertical-align:middle;top:-1px}@media print{.external-link-icon{display:none}}.external-link-icon-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}:root{--medium-zoom-z-index: 100;--medium-zoom-bg-color: #ffffff;--medium-zoom-opacity: 1}.medium-zoom-overlay{background-color:var(--medium-zoom-bg-color)!important;z-index:var(--medium-zoom-z-index)}.medium-zoom-overlay~img{z-index:calc(var(--medium-zoom-z-index) + 1)}.medium-zoom--opened .medium-zoom-overlay{opacity:var(--medium-zoom-opacity)}:root{--nprogress-color: #29d;--nprogress-z-index: 1031}#nprogress{pointer-events:none}#nprogress .bar{background:var(--nprogress-color);position:fixed;z-index:var(--nprogress-z-index);top:0;left:0;width:100%;height:2px}:root{--c-brand: #3eaf7c;--c-brand-light: #4abf8a;--c-bg: #ffffff;--c-bg-light: #f3f4f5;--c-bg-lighter: #eeeeee;--c-bg-dark: #ebebec;--c-bg-darker: #e6e6e6;--c-bg-navbar: var(--c-bg);--c-bg-sidebar: var(--c-bg);--c-bg-arrow: #cccccc;--c-text: #2c3e50;--c-text-accent: var(--c-brand);--c-text-light: #3a5169;--c-text-lighter: #4e6e8e;--c-text-lightest: #6a8bad;--c-text-quote: #999999;--c-border: #eaecef;--c-border-dark: #dfe2e5;--c-tip: #42b983;--c-tip-bg: var(--c-bg-light);--c-tip-title: var(--c-text);--c-tip-text: var(--c-text);--c-tip-text-accent: var(--c-text-accent);--c-warning: #ffc310;--c-warning-bg: #fffae3;--c-warning-bg-light: #fff3ba;--c-warning-bg-lighter: #fff0b0;--c-warning-border-dark: #f7dc91;--c-warning-details-bg: #fff5ca;--c-warning-title: #f1b300;--c-warning-text: #746000;--c-warning-text-accent: #edb100;--c-warning-text-light: #c1971c;--c-warning-text-quote: #ccab49;--c-danger: #f11e37;--c-danger-bg: #ffe0e0;--c-danger-bg-light: #ffcfde;--c-danger-bg-lighter: #ffc9c9;--c-danger-border-dark: #f1abab;--c-danger-details-bg: #ffd4d4;--c-danger-title: #ed1e2c;--c-danger-text: #660000;--c-danger-text-accent: #bd1a1a;--c-danger-text-light: #b5474d;--c-danger-text-quote: #c15b5b;--c-details-bg: #eeeeee;--c-badge-tip: var(--c-tip);--c-badge-warning: #ecc808;--c-badge-warning-text: var(--c-bg);--c-badge-danger: #dc2626;--c-badge-danger-text: var(--c-bg);--t-color: .3s ease;--t-transform: .3s ease;--code-bg-color: #282c34;--code-hl-bg-color: rgba(0, 0, 0, .66);--code-ln-color: #9e9e9e;--code-ln-wrapper-width: 3.5rem;--font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;--font-family-code: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;--navbar-height: 3.6rem;--navbar-padding-v: .7rem;--navbar-padding-h: 1.5rem;--sidebar-width: 20rem;--sidebar-width-mobile: calc(var(--sidebar-width) * .82);--content-width: 740px;--homepage-width: 960px}.back-to-top{--back-to-top-color: var(--c-brand);--back-to-top-color-hover: var(--c-brand-light)}.DocSearch{--docsearch-primary-color: var(--c-brand);--docsearch-text-color: var(--c-text);--docsearch-highlight-color: var(--c-brand);--docsearch-muted-color: var(--c-text-quote);--docsearch-container-background: rgba(9, 10, 17, .8);--docsearch-modal-background: var(--c-bg-light);--docsearch-searchbox-background: var(--c-bg-lighter);--docsearch-searchbox-focus-background: var(--c-bg);--docsearch-searchbox-shadow: inset 0 0 0 2px var(--c-brand);--docsearch-hit-color: var(--c-text-light);--docsearch-hit-active-color: var(--c-bg);--docsearch-hit-background: var(--c-bg);--docsearch-hit-shadow: 0 1px 3px 0 var(--c-border-dark);--docsearch-footer-background: var(--c-bg)}.external-link-icon{--external-link-icon-color: var(--c-text-quote)}.medium-zoom-overlay{--medium-zoom-bg-color: var(--c-bg)}#nprogress{--nprogress-color: var(--c-brand)}.pwa-popup{--pwa-popup-text-color: var(--c-text);--pwa-popup-bg-color: var(--c-bg);--pwa-popup-border-color: var(--c-brand);--pwa-popup-shadow: 0 4px 16px var(--c-brand);--pwa-popup-btn-text-color: var(--c-bg);--pwa-popup-btn-bg-color: var(--c-brand);--pwa-popup-btn-hover-bg-color: var(--c-brand-light)}.search-box{--search-bg-color: var(--c-bg);--search-accent-color: var(--c-brand);--search-text-color: var(--c-text);--search-border-color: var(--c-border);--search-item-text-color: var(--c-text-lighter);--search-item-focus-bg-color: var(--c-bg-light)}html.dark{--c-brand: #3aa675;--c-brand-light: #349469;--c-bg: #22272e;--c-bg-light: #2b313a;--c-bg-lighter: #262c34;--c-bg-dark: #343b44;--c-bg-darker: #37404c;--c-text: #adbac7;--c-text-light: #96a7b7;--c-text-lighter: #8b9eb0;--c-text-lightest: #8094a8;--c-border: #3e4c5a;--c-border-dark: #34404c;--c-tip: #318a62;--c-warning: #e0ad15;--c-warning-bg: #2d2f2d;--c-warning-bg-light: #423e2a;--c-warning-bg-lighter: #44442f;--c-warning-border-dark: #957c35;--c-warning-details-bg: #39392d;--c-warning-title: #fdca31;--c-warning-text: #d8d96d;--c-warning-text-accent: #ffbf00;--c-warning-text-light: #ddb84b;--c-warning-text-quote: #ccab49;--c-danger: #fc1e38;--c-danger-bg: #39232c;--c-danger-bg-light: #4b2b35;--c-danger-bg-lighter: #553040;--c-danger-border-dark: #a25151;--c-danger-details-bg: #482936;--c-danger-title: #fc2d3b;--c-danger-text: #ea9ca0;--c-danger-text-accent: #fd3636;--c-danger-text-light: #d9777c;--c-danger-text-quote: #d56b6b;--c-details-bg: #323843;--c-badge-warning: var(--c-warning);--c-badge-warning-text: #3c2e05;--c-badge-danger: var(--c-danger);--c-badge-danger-text: #401416;--code-hl-bg-color: #363b46}html.dark .DocSearch{--docsearch-logo-color: var(--c-text);--docsearch-modal-shadow: inset 1px 1px 0 0 #2c2e40, 0 3px 8px 0 #000309;--docsearch-key-shadow: inset 0 -2px 0 0 #282d55, inset 0 0 1px 1px #51577d, 0 2px 2px 0 rgba(3, 4, 9, .3);--docsearch-key-gradient: linear-gradient(-225deg, #444950, #1c1e21);--docsearch-footer-shadow: inset 0 1px 0 0 rgba(73, 76, 106, .5), 0 -4px 8px 0 rgba(0, 0, 0, .2)}html,body{padding:0;margin:0;background-color:var(--c-bg);transition:background-color var(--t-color)}html.dark{color-scheme:dark}html{font-size:16px}body{font-family:var(--font-family);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:1rem;color:var(--c-text)}a{font-weight:500;color:var(--c-text-accent);text-decoration:none;overflow-wrap:break-word}p a code{font-weight:400;color:var(--c-text-accent)}kbd{font-family:var(--font-family-code);color:var(--c-text);background:var(--c-bg-lighter);border:solid .15rem var(--c-border-dark);border-bottom:solid .25rem var(--c-border-dark);border-radius:.15rem;padding:0 .15em}code{font-family:var(--font-family-code);color:var(--c-text-lighter);padding:.25rem .5rem;margin:0;font-size:.85em;background-color:var(--c-bg-light);border-radius:3px;overflow-wrap:break-word;transition:background-color var(--t-color)}blockquote{font-size:1rem;color:var(--c-text-quote);border-left:.2rem solid var(--c-border-dark);margin:1rem 0;padding:.25rem 0 .25rem 1rem;overflow-wrap:break-word}blockquote>p{margin:0}ul,ol{padding-left:1.2em}strong{font-weight:600}h1,h2,h3,h4,h5,h6{font-weight:600;line-height:1.25;overflow-wrap:break-word}h1:focus-visible,h2:focus-visible,h3:focus-visible,h4:focus-visible,h5:focus-visible,h6:focus-visible{outline:none}h1:hover .header-anchor,h2:hover .header-anchor,h3:hover .header-anchor,h4:hover .header-anchor,h5:hover .header-anchor,h6:hover .header-anchor{opacity:1}h1{font-size:2.2rem}h2{font-size:1.65rem;padding-bottom:.3rem;border-bottom:1px solid var(--c-border);transition:border-color var(--t-color)}h3{font-size:1.35rem}h4{font-size:1.15rem}h5{font-size:1.05rem}h6{font-size:1rem}a.header-anchor{font-size:.85em;float:left;margin-left:-.87em;padding-right:.23em;margin-top:.125em;opacity:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}@media print{a.header-anchor{display:none}}a.header-anchor:hover{text-decoration:none}a.header-anchor:focus-visible{opacity:1}@media print{a[href^="http://"]:after,a[href^="https://"]:after{content:" (" attr(href) ") "}}p,ul,ol{line-height:1.7;overflow-wrap:break-word}hr{border:0;border-top:1px solid var(--c-border)}table{border-collapse:collapse;margin:1rem 0;display:block;overflow-x:auto;transition:border-color var(--t-color)}tr{border-top:1px solid var(--c-border-dark);transition:border-color var(--t-color)}tr:nth-child(2n){background-color:var(--c-bg-light);transition:background-color var(--t-color)}tr:nth-child(2n) code{background-color:var(--c-bg-dark)}th,td{padding:.6em 1em;border:1px solid var(--c-border-dark);transition:border-color var(--t-color)}.arrow{display:inline-block;width:0;height:0}.arrow.up{border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:6px solid var(--c-bg-arrow)}.arrow.down{border-left:4px solid transparent;border-right:4px solid transparent;border-top:6px solid var(--c-bg-arrow)}.arrow.right{border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:6px solid var(--c-bg-arrow)}.arrow.left{border-top:4px solid transparent;border-bottom:4px solid transparent;border-right:6px solid var(--c-bg-arrow)}.badge{display:inline-block;font-size:14px;font-weight:600;height:18px;line-height:18px;border-radius:3px;padding:0 6px;color:var(--c-bg);vertical-align:top;transition:color var(--t-color),background-color var(--t-color)}.badge.tip{background-color:var(--c-badge-tip)}.badge.warning{background-color:var(--c-badge-warning);color:var(--c-badge-warning-text)}.badge.danger{background-color:var(--c-badge-danger);color:var(--c-badge-danger-text)}.badge+.badge{margin-left:5px}code[class*=language-],pre[class*=language-]{color:#ccc;background:none;font-family:var(--font-family-code);font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;hyphens:none}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#2d2d2d}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.comment,.token.block-comment,.token.prolog,.token.doctype,.token.cdata{color:#999}.token.punctuation{color:#ccc}.token.tag,.token.attr-name,.token.namespace,.token.deleted{color:#ec5975}.token.function-name{color:#6196cc}.token.boolean,.token.number,.token.function{color:#f08d49}.token.property,.token.class-name,.token.constant,.token.symbol{color:#f8c555}.token.selector,.token.important,.token.atrule,.token.keyword,.token.builtin{color:#cc99cd}.token.string,.token.char,.token.attr-value,.token.regex,.token.variable{color:#7ec699}.token.operator,.token.entity,.token.url{color:#67cdcc}.token.important,.token.bold{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.inserted{color:#3eaf7c}.theme-default-content pre,.theme-default-content pre[class*=language-]{line-height:1.375;padding:1.3rem 1.5rem;margin:.85rem 0;border-radius:6px;overflow:auto}.theme-default-content pre code,.theme-default-content pre[class*=language-] code{color:#fff;padding:0;background-color:transparent!important;border-radius:0;overflow-wrap:unset;-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto}.theme-default-content .line-number{font-family:var(--font-family-code)}div[class*=language-]{position:relative;background-color:var(--code-bg-color);border-radius:6px}div[class*=language-]:before{content:attr(data-ext);position:absolute;z-index:3;top:.8em;right:1em;font-size:.75rem;color:var(--code-ln-color)}div[class*=language-] pre,div[class*=language-] pre[class*=language-]{background:transparent!important;position:relative;z-index:1}div[class*=language-] .highlight-lines{-webkit-user-select:none;-moz-user-select:none;user-select:none;padding-top:1.3rem;position:absolute;top:0;left:0;width:100%;line-height:1.375}div[class*=language-] .highlight-lines .highlight-line{background-color:var(--code-hl-bg-color)}div[class*=language-]:not(.line-numbers-mode) .line-numbers{display:none}div[class*=language-].line-numbers-mode .highlight-lines .highlight-line{position:relative}div[class*=language-].line-numbers-mode .highlight-lines .highlight-line:before{content:" ";position:absolute;z-index:2;left:0;top:0;display:block;width:var(--code-ln-wrapper-width);height:100%}div[class*=language-].line-numbers-mode pre{margin-left:var(--code-ln-wrapper-width);padding-left:1rem;vertical-align:middle}div[class*=language-].line-numbers-mode .line-numbers{position:absolute;top:0;width:var(--code-ln-wrapper-width);text-align:center;color:var(--code-ln-color);padding-top:1.25rem;line-height:1.375;counter-reset:line-number}div[class*=language-].line-numbers-mode .line-numbers .line-number{position:relative;z-index:3;-webkit-user-select:none;-moz-user-select:none;user-select:none;height:1.375em}div[class*=language-].line-numbers-mode .line-numbers .line-number:before{counter-increment:line-number;content:counter(line-number);font-size:.85em}div[class*=language-].line-numbers-mode:after{content:"";position:absolute;top:0;left:0;width:var(--code-ln-wrapper-width);height:100%;border-radius:6px 0 0 6px;border-right:1px solid var(--code-hl-bg-color)}@media (max-width: 419px){.theme-default-content div[class*=language-]{margin:.85rem -1.5rem;border-radius:0}}.code-group__nav{margin-top:.85rem;margin-bottom:calc(-1.7rem - 6px);padding-bottom:calc(1.7rem - 6px);padding-left:10px;padding-top:10px;border-top-left-radius:6px;border-top-right-radius:6px;background-color:var(--code-bg-color)}.code-group__ul{margin:auto 0;padding-left:0;display:inline-flex;list-style:none}.code-group__nav-tab{border:0;padding:5px;cursor:pointer;background-color:transparent;font-size:.85em;line-height:1.4;color:#ffffffe6;font-weight:600}.code-group__nav-tab:focus{outline:none}.code-group__nav-tab:focus-visible{outline:1px solid rgba(255,255,255,.9)}.code-group__nav-tab-active{border-bottom:var(--c-brand) 1px solid}@media (max-width: 419px){.code-group__nav{margin-left:-1.5rem;margin-right:-1.5rem;border-radius:0}}.code-group-item{display:none}.code-group-item__active{display:block}.code-group-item>pre{background-color:orange}.custom-container{transition:color var(--t-color),border-color var(--t-color),background-color var(--t-color)}.custom-container .custom-container-title{font-weight:600}.custom-container .custom-container-title:not(:only-child){margin-bottom:-.4rem}.custom-container.tip,.custom-container.warning,.custom-container.danger{padding:.1rem 1.5rem;border-left-width:.5rem;border-left-style:solid;margin:1rem 0}.custom-container.tip{border-color:var(--c-tip);background-color:var(--c-tip-bg);color:var(--c-tip-text)}.custom-container.tip .custom-container-title{color:var(--c-tip-title)}.custom-container.tip a{color:var(--c-tip-text-accent)}.custom-container.tip code{background-color:var(--c-bg-dark)}.custom-container.warning{border-color:var(--c-warning);background-color:var(--c-warning-bg);color:var(--c-warning-text)}.custom-container.warning .custom-container-title{color:var(--c-warning-title)}.custom-container.warning a{color:var(--c-warning-text-accent)}.custom-container.warning blockquote{border-left-color:var(--c-warning-border-dark);color:var(--c-warning-text-quote)}.custom-container.warning code{color:var(--c-warning-text-light);background-color:var(--c-warning-bg-light)}.custom-container.warning details{background-color:var(--c-warning-details-bg)}.custom-container.warning details code{background-color:var(--c-warning-bg-lighter)}.custom-container.warning .external-link-icon{--external-link-icon-color: var(--c-warning-text-quote)}.custom-container.danger{border-color:var(--c-danger);background-color:var(--c-danger-bg);color:var(--c-danger-text)}.custom-container.danger .custom-container-title{color:var(--c-danger-title)}.custom-container.danger a{color:var(--c-danger-text-accent)}.custom-container.danger blockquote{border-left-color:var(--c-danger-border-dark);color:var(--c-danger-text-quote)}.custom-container.danger code{color:var(--c-danger-text-light);background-color:var(--c-danger-bg-light)}.custom-container.danger details{background-color:var(--c-danger-details-bg)}.custom-container.danger details code{background-color:var(--c-danger-bg-lighter)}.custom-container.danger .external-link-icon{--external-link-icon-color: var(--c-danger-text-quote)}.custom-container.details{display:block;position:relative;border-radius:2px;margin:1.6em 0;padding:1.6em;background-color:var(--c-details-bg)}.custom-container.details code{background-color:var(--c-bg-darker)}.custom-container.details h4{margin-top:0}.custom-container.details figure:last-child,.custom-container.details p:last-child{margin-bottom:0;padding-bottom:0}.custom-container.details summary{outline:none;cursor:pointer}.home{padding:var(--navbar-height) 2rem 0;max-width:var(--homepage-width);margin:0 auto;display:block}.home .hero{text-align:center}.home .hero img{max-width:100%;max-height:280px;display:block;margin:3rem auto 1.5rem}.home .hero h1{font-size:3rem}.home .hero h1,.home .hero .description,.home .hero .actions{margin:1.8rem auto}.home .hero .actions{display:flex;flex-wrap:wrap;gap:1rem;justify-content:center}.home .hero .description{max-width:35rem;font-size:1.6rem;line-height:1.3;color:var(--c-text-lightest)}.home .hero .action-button{display:inline-block;font-size:1.2rem;padding:.8rem 1.6rem;border-width:2px;border-style:solid;border-radius:4px;transition:background-color var(--t-color);box-sizing:border-box}.home .hero .action-button.primary{color:var(--c-bg);background-color:var(--c-brand);border-color:var(--c-brand)}.home .hero .action-button.primary:hover{background-color:var(--c-brand-light)}.home .hero .action-button.secondary{color:var(--c-brand);background-color:var(--c-bg);border-color:var(--c-brand)}.home .hero .action-button.secondary:hover{color:var(--c-bg);background-color:var(--c-brand-light)}.home .features{border-top:1px solid var(--c-border);transition:border-color var(--t-color);padding:1.2rem 0;margin-top:2.5rem;display:flex;flex-wrap:wrap;align-items:flex-start;align-content:stretch;justify-content:space-between}.home .feature{flex-grow:1;flex-basis:30%;max-width:30%}.home .feature h2{font-size:1.4rem;font-weight:500;border-bottom:none;padding-bottom:0;color:var(--c-text-light)}.home .feature p{color:var(--c-text-lighter)}.home .theme-default-content{padding:0;margin:0}.home .footer{padding:2.5rem;border-top:1px solid var(--c-border);text-align:center;color:var(--c-text-lighter);transition:border-color var(--t-color)}@media (max-width: 719px){.home .features{flex-direction:column}.home .feature{max-width:100%;padding:0 2.5rem}}@media (max-width: 419px){.home{padding-left:1.5rem;padding-right:1.5rem}.home .hero img{max-height:210px;margin:2rem auto 1.2rem}.home .hero h1{font-size:2rem}.home .hero h1,.home .hero .description,.home .hero .actions{margin:1.2rem auto}.home .hero .description{font-size:1.2rem}.home .hero .action-button{font-size:1rem;padding:.6rem 1.2rem}.home .feature h2{font-size:1.25rem}}.page{padding-top:var(--navbar-height);padding-left:var(--sidebar-width)}.navbar{position:fixed;z-index:20;top:0;left:0;right:0;height:var(--navbar-height);box-sizing:border-box;border-bottom:1px solid var(--c-border);background-color:var(--c-bg-navbar);transition:background-color var(--t-color),border-color var(--t-color)}.sidebar{font-size:16px;width:var(--sidebar-width);position:fixed;z-index:10;margin:0;top:var(--navbar-height);left:0;bottom:0;box-sizing:border-box;border-right:1px solid var(--c-border);overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--c-brand) var(--c-border);background-color:var(--c-bg-sidebar);transition:transform var(--t-transform),background-color var(--t-color),border-color var(--t-color)}.sidebar::-webkit-scrollbar{width:7px}.sidebar::-webkit-scrollbar-track{background-color:var(--c-border)}.sidebar::-webkit-scrollbar-thumb{background-color:var(--c-brand)}.sidebar-mask{position:fixed;z-index:9;top:0;left:0;width:100vw;height:100vh;display:none}.theme-container.sidebar-open .sidebar-mask{display:block}.theme-container.sidebar-open .navbar>.toggle-sidebar-button .icon span:nth-child(1){transform:rotate(45deg) translate3d(5.5px,5.5px,0)}.theme-container.sidebar-open .navbar>.toggle-sidebar-button .icon span:nth-child(2){transform:scale3d(0,1,1)}.theme-container.sidebar-open .navbar>.toggle-sidebar-button .icon span:nth-child(3){transform:rotate(-45deg) translate3d(6px,-6px,0)}.theme-container.sidebar-open .navbar>.toggle-sidebar-button .icon span:nth-child(1),.theme-container.sidebar-open .navbar>.toggle-sidebar-button .icon span:nth-child(3){transform-origin:center}.theme-container.no-navbar .theme-default-content h1,.theme-container.no-navbar .theme-default-content h2,.theme-container.no-navbar .theme-default-content h3,.theme-container.no-navbar .theme-default-content h4,.theme-container.no-navbar .theme-default-content h5,.theme-container.no-navbar .theme-default-content h6{margin-top:1.5rem;padding-top:0}.theme-container.no-navbar .page{padding-top:0}.theme-container.no-navbar .sidebar{top:0}.theme-container.no-sidebar .sidebar{display:none}@media (max-width: 719px){.theme-container.no-sidebar .sidebar{display:block}}.theme-container.no-sidebar .page{padding-left:0}.theme-default-content a:hover{text-decoration:underline}.theme-default-content img{max-width:100%}.theme-default-content h1,.theme-default-content h2,.theme-default-content h3,.theme-default-content h4,.theme-default-content h5,.theme-default-content h6{margin-top:calc(.5rem - var(--navbar-height));padding-top:calc(1rem + var(--navbar-height));margin-bottom:0}.theme-default-content h1:first-child,.theme-default-content h2:first-child,.theme-default-content h3:first-child,.theme-default-content h4:first-child,.theme-default-content h5:first-child,.theme-default-content h6:first-child{margin-bottom:1rem}.theme-default-content h1:first-child+p,.theme-default-content h1:first-child+pre,.theme-default-content h1:first-child+.custom-container,.theme-default-content h2:first-child+p,.theme-default-content h2:first-child+pre,.theme-default-content h2:first-child+.custom-container,.theme-default-content h3:first-child+p,.theme-default-content h3:first-child+pre,.theme-default-content h3:first-child+.custom-container,.theme-default-content h4:first-child+p,.theme-default-content h4:first-child+pre,.theme-default-content h4:first-child+.custom-container,.theme-default-content h5:first-child+p,.theme-default-content h5:first-child+pre,.theme-default-content h5:first-child+.custom-container,.theme-default-content h6:first-child+p,.theme-default-content h6:first-child+pre,.theme-default-content h6:first-child+.custom-container{margin-top:2rem}@media (max-width: 959px){.sidebar{font-size:15px;width:var(--sidebar-width-mobile)}.page{padding-left:var(--sidebar-width-mobile)}}@media (max-width: 719px){.sidebar{top:0;padding-top:var(--navbar-height);transform:translate(-100%)}.page{padding-left:0}.theme-container.sidebar-open .sidebar{transform:translate(0)}.theme-container.no-navbar .sidebar{padding-top:0}}@media (max-width: 419px){h1{font-size:1.9rem}}.navbar{--navbar-line-height: calc( var(--navbar-height) - 2 * var(--navbar-padding-v) );padding:var(--navbar-padding-v) var(--navbar-padding-h);line-height:var(--navbar-line-height)}.navbar .logo{height:var(--navbar-line-height);margin-right:var(--navbar-padding-v);vertical-align:top}.navbar .site-name{font-size:1.3rem;font-weight:600;color:var(--c-text);position:relative}.navbar .navbar-items-wrapper{display:flex;position:absolute;box-sizing:border-box;top:var(--navbar-padding-v);right:var(--navbar-padding-h);height:var(--navbar-line-height);padding-left:var(--navbar-padding-h);white-space:nowrap;font-size:.9rem}.navbar .navbar-items-wrapper .search-box{flex:0 0 auto;vertical-align:top}@media screen and (max-width: 719px){.navbar{padding-left:4rem}.navbar .site-name{display:block;width:calc(100vw - 11rem);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.navbar .can-hide{display:none}}.navbar-items{display:inline-block}@media print{.navbar-items{display:none}}.navbar-items a{display:inline-block;line-height:1.4rem;color:inherit}.navbar-items a:hover,.navbar-items a.router-link-active{color:var(--c-text)}.navbar-items .navbar-item{position:relative;display:inline-block;margin-left:1.5rem;line-height:var(--navbar-line-height)}.navbar-items .navbar-item:first-child{margin-left:0}.navbar-items .navbar-item>a:hover,.navbar-items .navbar-item>a.router-link-active{margin-bottom:-2px;border-bottom:2px solid var(--c-text-accent)}@media (max-width: 719px){.navbar-items .navbar-item{margin-left:0}.navbar-items .navbar-item>a:hover,.navbar-items .navbar-item>a.router-link-active{margin-bottom:0;border-bottom:none}.navbar-items a:hover,.navbar-items a.router-link-active{color:var(--c-text-accent)}}.toggle-sidebar-button{position:absolute;top:.6rem;left:1rem;display:none;padding:.6rem;cursor:pointer}.toggle-sidebar-button .icon{display:flex;flex-direction:column;justify-content:center;align-items:center;width:1.25rem;height:1.25rem;cursor:inherit}.toggle-sidebar-button .icon span{display:inline-block;width:100%;height:2px;border-radius:2px;background-color:var(--c-text);transition:transform var(--t-transform)}.toggle-sidebar-button .icon span:nth-child(2){margin:6px 0}@media screen and (max-width: 719px){.toggle-sidebar-button{display:block}}.toggle-color-mode-button{display:flex;margin:auto;margin-left:1rem;border:0;background:none;color:var(--c-text);opacity:.8;cursor:pointer}@media print{.toggle-color-mode-button{display:none}}.toggle-color-mode-button:hover{opacity:1}.toggle-color-mode-button .icon{width:1.25rem;height:1.25rem}.DocSearch{transition:background-color var(--t-color)}.navbar-dropdown-wrapper{cursor:pointer}.navbar-dropdown-wrapper .navbar-dropdown-title,.navbar-dropdown-wrapper .navbar-dropdown-title-mobile{display:block;font-size:.9rem;font-family:inherit;cursor:inherit;padding:inherit;line-height:1.4rem;background:transparent;border:none;font-weight:500;color:var(--c-text)}.navbar-dropdown-wrapper .navbar-dropdown-title:hover,.navbar-dropdown-wrapper .navbar-dropdown-title-mobile:hover{border-color:transparent}.navbar-dropdown-wrapper .navbar-dropdown-title .arrow,.navbar-dropdown-wrapper .navbar-dropdown-title-mobile .arrow{vertical-align:middle;margin-top:-1px;margin-left:.4rem}.navbar-dropdown-wrapper .navbar-dropdown-title-mobile{display:none;font-weight:600;font-size:inherit}.navbar-dropdown-wrapper .navbar-dropdown-title-mobile:hover{color:var(--c-text-accent)}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item{color:inherit;line-height:1.7rem}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item .navbar-dropdown-subtitle{margin:.45rem 0 0;border-top:1px solid var(--c-border);padding:1rem 0 .45rem;font-size:.9rem}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item .navbar-dropdown-subtitle>span{padding:0 1.5rem 0 1.25rem}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item .navbar-dropdown-subtitle>a{font-weight:inherit}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item .navbar-dropdown-subtitle>a.router-link-active:after{display:none}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item .navbar-dropdown-subitem-wrapper{padding:0;list-style:none}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item .navbar-dropdown-subitem-wrapper .navbar-dropdown-subitem{font-size:.9em}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item a{display:block;line-height:1.7rem;position:relative;border-bottom:none;font-weight:400;margin-bottom:0;padding:0 1.5rem 0 1.25rem}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item a:hover,.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item a.router-link-active{color:var(--c-text-accent)}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item a.router-link-active:after{content:"";width:0;height:0;border-left:5px solid var(--c-text-accent);border-top:3px solid transparent;border-bottom:3px solid transparent;position:absolute;top:calc(50% - 2px);left:9px}.navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item:first-child .navbar-dropdown-subtitle{margin-top:0;padding-top:0;border-top:0}.navbar-dropdown-wrapper.mobile.open .navbar-dropdown-title,.navbar-dropdown-wrapper.mobile.open .navbar-dropdown-title-mobile{margin-bottom:.5rem}.navbar-dropdown-wrapper.mobile .navbar-dropdown-title,.navbar-dropdown-wrapper.mobile .navbar-dropdown-title-mobile{display:none}.navbar-dropdown-wrapper.mobile .navbar-dropdown-title-mobile{display:block}.navbar-dropdown-wrapper.mobile .navbar-dropdown{transition:height .1s ease-out;overflow:hidden}.navbar-dropdown-wrapper.mobile .navbar-dropdown .navbar-dropdown-item .navbar-dropdown-subtitle{border-top:0;margin-top:0;padding-top:0;padding-bottom:0}.navbar-dropdown-wrapper.mobile .navbar-dropdown .navbar-dropdown-item .navbar-dropdown-subtitle,.navbar-dropdown-wrapper.mobile .navbar-dropdown .navbar-dropdown-item>a{font-size:15px;line-height:2rem}.navbar-dropdown-wrapper.mobile .navbar-dropdown .navbar-dropdown-item .navbar-dropdown-subitem{font-size:14px;padding-left:1rem}.navbar-dropdown-wrapper:not(.mobile){height:1.8rem}.navbar-dropdown-wrapper:not(.mobile):hover .navbar-dropdown,.navbar-dropdown-wrapper:not(.mobile).open .navbar-dropdown{display:block!important}.navbar-dropdown-wrapper:not(.mobile).open:blur{display:none}.navbar-dropdown-wrapper:not(.mobile) .navbar-dropdown{display:none;height:auto!important;box-sizing:border-box;max-height:calc(100vh - 2.7rem);overflow-y:auto;position:absolute;top:100%;right:0;background-color:var(--c-bg-navbar);padding:.6rem 0;border:1px solid var(--c-border);border-bottom-color:var(--c-border-dark);text-align:left;border-radius:.25rem;white-space:nowrap;margin:0}.page{padding-bottom:2rem;display:block}.page .theme-default-content{max-width:var(--content-width);margin:0 auto;padding:2rem 2.5rem;padding-top:0}@media (max-width: 959px){.page .theme-default-content{padding:2rem}}@media (max-width: 419px){.page .theme-default-content{padding:1.5rem}}.page-meta{max-width:var(--content-width);margin:0 auto;padding:1rem 2.5rem;overflow:auto}@media (max-width: 959px){.page-meta{padding:2rem}}@media (max-width: 419px){.page-meta{padding:1.5rem}}.page-meta .meta-item{cursor:default;margin-top:.8rem}.page-meta .meta-item .meta-item-label{font-weight:500;color:var(--c-text-lighter)}.page-meta .meta-item .meta-item-info{font-weight:400;color:var(--c-text-quote)}.page-meta .edit-link{display:inline-block;margin-right:.25rem}@media print{.page-meta .edit-link{display:none}}.page-meta .last-updated{float:right}@media (max-width: 719px){.page-meta .last-updated{font-size:.8em;float:none}.page-meta .contributors{font-size:.8em}}.page-nav{max-width:var(--content-width);margin:0 auto;padding:1rem 2.5rem 2rem;padding-bottom:0}@media (max-width: 959px){.page-nav{padding:2rem}}@media (max-width: 419px){.page-nav{padding:1.5rem}}.page-nav .inner{min-height:2rem;margin-top:0;border-top:1px solid var(--c-border);transition:border-color var(--t-color);padding-top:1rem;overflow:auto}.page-nav .prev a:before{content:"\2190"}.page-nav .next{float:right}.page-nav .next a:after{content:"\2192"}.sidebar ul{padding:0;margin:0;list-style-type:none}.sidebar a{display:inline-block}.sidebar .navbar-items{display:none;border-bottom:1px solid var(--c-border);transition:border-color var(--t-color);padding:.5rem 0 .75rem}.sidebar .navbar-items a{font-weight:600}.sidebar .navbar-items .navbar-item{display:block;line-height:1.25rem;font-size:1.1em;padding:.5rem 0 .5rem 1.5rem}.sidebar .sidebar-items{padding:1.5rem 0}@media (max-width: 719px){.sidebar .navbar-items{display:block}.sidebar .navbar-items .navbar-dropdown-wrapper .navbar-dropdown .navbar-dropdown-item a.router-link-active:after{top:calc(1rem - 2px)}.sidebar .sidebar-items{padding:1rem 0}}.sidebar-item{cursor:default;border-left:.25rem solid transparent;color:var(--c-text)}.sidebar-item:focus-visible{outline-width:1px;outline-offset:-1px}.sidebar-item.active:not(p.sidebar-heading){font-weight:600;color:var(--c-text-accent);border-left-color:var(--c-text-accent)}.sidebar-item.sidebar-heading{transition:color .15s ease;font-size:1.1em;font-weight:700;padding:.35rem 1.5rem .35rem 1.25rem;width:100%;box-sizing:border-box;margin:0}.sidebar-item.sidebar-heading+.sidebar-item-children{transition:height .1s ease-out;overflow:hidden;margin-bottom:.75rem}.sidebar-item.collapsible{cursor:pointer}.sidebar-item.collapsible .arrow{position:relative;top:-.12em;left:.5em}.sidebar-item:not(.sidebar-heading){font-size:1em;font-weight:400;display:inline-block;margin:0;padding:.35rem 1rem .35rem 2rem;line-height:1.4;width:100%;box-sizing:border-box}.sidebar-item:not(.sidebar-heading)+.sidebar-item-children{padding-left:1rem;font-size:.95em}.sidebar-item-children .sidebar-item-children .sidebar-item:not(.sidebar-heading){padding:.25rem 1rem .25rem 1.75rem}.sidebar-item-children .sidebar-item-children .sidebar-item:not(.sidebar-heading).active{font-weight:500;border-left-color:transparent}a.sidebar-heading+.sidebar-item-children .sidebar-item:not(.sidebar-heading).active{border-left-color:transparent}a.sidebar-item{cursor:pointer}a.sidebar-item:hover{color:var(--c-text-accent)}.table-of-contents .badge{vertical-align:middle}.dropdown-enter-from,.dropdown-leave-to{height:0!important}.fade-slide-y-enter-active{transition:all .2s ease}.fade-slide-y-leave-active{transition:all .2s cubic-bezier(1,.5,.8,1)}.fade-slide-y-enter-from,.fade-slide-y-leave-to{transform:translateY(10px);opacity:0} diff --git a/guide/buymeacoffee.html b/guide/buymeacoffee.html new file mode 100644 index 0000000..204c08d --- /dev/null +++ b/guide/buymeacoffee.html @@ -0,0 +1,33 @@ + + + + + + + + +Donation | ChatGPT UI + + + + ++ + + diff --git a/guide/configuration.html b/guide/configuration.html new file mode 100644 index 0000000..8e7855b --- /dev/null +++ b/guide/configuration.html @@ -0,0 +1,45 @@ + + + + + + + + +ChatGPT UI Donation
If this project is helpful to you, it is also helping me.
If you want to support me, Buy me a coffee ❤️ https://www.buymeacoffee.com/WongSaang
Configuration Reference | ChatGPT UI + + + + ++ + + diff --git a/guide/development.html b/guide/development.html new file mode 100644 index 0000000..5973bcc --- /dev/null +++ b/guide/development.html @@ -0,0 +1,40 @@ + + + + + + + + +ChatGPT UI Configuration Reference
Database
By default, the backend uses the built-in Sqlite to store data. If an external database is not connected, the data will be lost after the container is destroyed.
The
chatgpt-ui-wsgi-serverimage provides the environment variableDB_URLto configure the connection to an external database. The following table shows the link format of theDB_URL.
DB LINK PostgreSQL postgres://USER:PASSWORD@HOST:PORT/DATABASE_NAME MySQL mysql://USER:PASSWORD@HOST:PORT/DATABASE_NAME SQLite sqlite:///PATH For example, if I am using PostgreSQL, the configuration is as follows:
backend-wsgi-server: + image: wongsaang/chatgpt-ui-wsgi-server:latest + environment: + - DB_URL=postgres://postgres:postgrespw@localhost:49153/chatgpt +Email verification
If you open the user registration feature and need to send email activation links to users, you need to configure the following environment variables in the
wsgi-serverservice:
Parameters Description Default ACCOUNT_EMAIL_VERIFICATION E-mail authentication method, optional value: none, optional, mandatory optional EMAIL_HOST SMTP server address smtp.mailgun.org EMAIL_PORT SMTP server port 587 EMAIL_HOST_USER User name - EMAIL_HOST_PASSWORD Password - EMAIL_USE_TLS Whether to encrypt True EMAIL_FROM From email webmaster@localhost API Proxy
If you are unable to request the OpenAI API address due to network restrictions, you can configure a proxy in the
wsgi-serverservice. You will need to search for how to set up a proxy server on your own.For example:
backend-wsgi-server: + image: wongsaang/chatgpt-ui-wsgi-server:latest + environment: + - OPENAI_API_PROXY=https://openai.proxy.com/v1 +Backend CSRF whitelist
If you encounter
CSRF verification failedwhile accessing the management background, yourAPP_DOMAINmay not be configured correctly. Under thewsgi-serverservice, there is an environment variablewsgi-server. Its value should be the address and port ofbackend-web-server, default:localhost:9000.Suppose I have resolved the domain name
chagpt.comto the server, and mybackend-web-serverservice is bound to port 9000. The correct configuration is as follows:backend-wsgi-server: + image: wongsaang/chatgpt-ui-wsgi-server:latest + environment: + - APP_DOMAIN=chagpt.com:9000 +Client Configuration
Parameter Description Default Value SERVER_DOMAIN Server Address http://backend-web-server DEFAULT_LOCALE Default Language en NUXT_PUBLIC_APP_NAME Application Name ChatGPT UI NUXT_PUBLIC_TYPEWRITER Enable Typewriter Effect [true/false] true NUXT_PUBLIC_TYPEWRITER_DELAY Typewriter Effect Delay in milliseconds 50 User Registration Control
After deployment, there is an
open_registrationsetting underChat->Settingsin the admin panel to control whether user registration is allowed. The default value isTrue(allowing user registration). If not needed, please change it toFalse.Web Search Function Control
This feature is disabled by default. You can enable it in the admin panel under
Chat->Settings. There is a setting calledopen_web_search, set its value toTrue.Frugal Mode Control
This feature is enabled by default. You can disable it in the
Chat->Settingssection of the management backend. There is a setting calledopen_frugal_mode_controlin Settings. Set its value toFalse.Development Guide | ChatGPT UI + + + + ++ + + diff --git a/guide/problems.html b/guide/problems.html new file mode 100644 index 0000000..dd1253a --- /dev/null +++ b/guide/problems.html @@ -0,0 +1,33 @@ + + + + + + + + +ChatGPT UI Development Guide
Front-end
Project address: https://github.com/WongSaang/chatgpt-ui
Environment Setup
Install the latest stable version of node.js. If you need to package it as a docker image, you also need to install docker.
Install dependencies
yarn install +Start development server
yarn dev +Build
yarn build +Package as a docker image
docker build -t image-name:latest . +Back-end
Required skills: Python, Django
Project address: https://github.com/WongSaang/chatgpt-ui-server
Environment Setup
Install Python, pip/pipenv. If you need to package it as a docker image, you also need to install docker.
Install dependencies
pip install -r requirements.txt +Start development server
python manage.py runserver +Package as a docker image
docker build -t image-name:latest . +Encountering Issues | ChatGPT UI + + + + ++ + + diff --git a/guide/quick-start.html b/guide/quick-start.html new file mode 100644 index 0000000..c1aead0 --- /dev/null +++ b/guide/quick-start.html @@ -0,0 +1,92 @@ + + + + + + + + +ChatGPT UI Encountering Issues
Searching for Issues
If you encounter any issues while using the project, you can search for related keywords on the project's Issues page to see if others have faced similar issues and if there are any solutions available.
Submitting an Issue
If you cannot find a solution, you can communicate with the project maintainers by submitting an issue. Submit an Issue
Note
The title should be clear and concise, and the description should provide as much detail as possible about the issue or suggestion. If possible, it is best to provide reproducible steps and screenshots.
Quick Start | ChatGPT UI + + + + ++ + + diff --git a/images/bmc_qr.png b/images/bmc_qr.png new file mode 100644 index 0000000..61b278a Binary files /dev/null and b/images/bmc_qr.png differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..dbe346e --- /dev/null +++ b/index.html @@ -0,0 +1,33 @@ + + + + + + + + +ChatGPT UI Quick Start
This project provides related docker images for deployment on a VPS or your local computer. Please note that if your network is unable to request the OpenAI API address, you need to configure a proxy. If you want to make it available to other users, it's best to have a domain name and resolve it to the server.
You also need an OpenAI API Key, and there are multiple ways to obtain it online, please search for it yourself.
Deploying
Quickly deploy script
Note: This script has only been verified on Ubuntu Server 22.04 LTS.
bash <(curl -Ls https://raw.githubusercontent.com/WongSaang/chatgpt-ui/main/deployment.sh) +Docker Compose
Prepare docker-compose.yml
The project provides a sample
docker-compose.yml. If you want to customize the configuration, please refer to the configuration reference section.You can download the
docker-compose.ymltemplate to your local machine or server by clicking on the link below:https://raw.githubusercontent.com/WongSaang/chatgpt-ui/main/docker-compose.yml
You can also manually create the
docker-compose.ymlfile and copy the following content into the file:version: '3' +services: + client: + platform: linux/x86_64 + image: wongsaang/chatgpt-ui-client:latest + environment: + - SERVER_DOMAIN=http://backend-web-server + - DEFAULT_LOCALE=en +# - NUXT_PUBLIC_APP_NAME='ChatGPT UI' # The name of the application +# - NUXT_PUBLIC_TYPEWRITER=true # Whether to enable the typewriter effect, default false +# - NUXT_PUBLIC_TYPEWRITER_DELAY=50 # The delay time of the typewriter effect, default 50ms + depends_on: + - backend-web-server + ports: + - '${CLIENT_PORT:-80}:80' + networks: + - chatgpt_ui_network + restart: always + backend-wsgi-server: + platform: linux/x86_64 + image: wongsaang/chatgpt-ui-wsgi-server:latest + environment: + - APP_DOMAIN=${APP_DOMAIN:-localhost:9000} + - SERVER_WORKERS=3 # The number of worker processes for handling requests. + # - DB_URL=postgres://postgres:postgrespw@localhost:49153/chatgpt # If this parameter is not set, the built-in Sqlite will be used by default. It should be noted that if you do not connect to an external database, the data will be lost after the container is destroyed. + - DJANGO_SUPERUSER_USERNAME=admin # default superuser name + - DJANGO_SUPERUSER_PASSWORD=password # default superuser password + - DJANGO_SUPERUSER_EMAIL=admin@example.com # default superuser email + - ACCOUNT_EMAIL_VERIFICATION=${ACCOUNT_EMAIL_VERIFICATION:-none} # Determines the e-mail verification method during signup – choose one of "none", "optional", or "mandatory". Default is "optional". If you don't need to verify the email, you can set it to "none". + # If you want to use the email verification function, you need to configure the following parameters +# - EMAIL_HOST=SMTP server address +# - EMAIL_PORT=SMTP server port +# - EMAIL_HOST_USER= +# - EMAIL_HOST_PASSWORD= +# - EMAIL_USE_TLS=True +# - EMAIL_FROM=no-reply@example.com #Default sender email address + ports: + - '${WSGI_PORT:-8000}:8000' + networks: + - chatgpt_ui_network + restart: always + backend-web-server: + platform: linux/x86_64 + image: wongsaang/chatgpt-ui-web-server:latest + environment: + - BACKEND_URL=http://backend-wsgi-server:8000 + ports: + - '${SERVER_PORT:-9000}:80' + depends_on: + - backend-wsgi-server + networks: + - chatgpt_ui_network + restart: always + +networks: + chatgpt_ui_network: + driver: bridge +Starting the Service
After modifying the configuration as needed, you can start the service by running the following command:
docker-compose up --pull always -d +This command is used to start the services specified in the Docker Compose configuration. The specific meanings of the parameters are as follows:
up: start the services specified in the Docker Compose configuration.--pull always: before starting the service each time, the latest version of the image will be pulled from the Docker image repository. This ensures that the image used is always up to date.-d: run the service in the background. If this parameter is not added, the service will run in the current terminal window until the user manually stops it.After Deployment
Access the management panel at
http(s)://your.domain:9000/adminorhttp(s)://123.123.123.123:9000/adminusing the default superuser account:
- username: admin
- password: password
Before starting a chat, you need to add an OpenAI API key. In the management panel, in the "Settings" section, there is a record namedopenai_api_key. Set the value to your API key.In the latest version, a separate API Key management has been added to the admin panel, located under "Provider/Api keys". You can add multiple API Keys here, and the backend program will track the usage of each key's token and balance the usage based on token usage. To enable this feature, you need to delete the previous "openai_api_key" setting.
Now you can access the client at
http(s)://your.domainorhttp://123.123.123.123to start chatting.🎉🎉🎉 Have fun!
Introduction | ChatGPT UI + + + + ++ + + diff --git a/zh/guide/buymeacoffee.html b/zh/guide/buymeacoffee.html new file mode 100644 index 0000000..5a5af70 --- /dev/null +++ b/zh/guide/buymeacoffee.html @@ -0,0 +1,33 @@ + + + + + + + + +ChatGPT UI Introduction
ChatGPT UI is an unofficial ChatGPT web client. It supports multiple users, multiple languages, and multiple database connections for persistent data storage, such as Mysql, PostgreSQL, and Sqlite.
This project consists of two parts, the client-side and the server-side:
- Client-side, based on Nuxt, project address: https://github.com/WongSaang/chatgpt-ui
- Server-side, based on Django, project address: https://github.com/WongSaang/chatgpt-ui-server
Features
Client-side
- User system, supporting user registration, login, password modification, and more.
- Multi-language user interface, supporting multiple languages.
- Persistent data storage, supporting Mysql, PostgreSQL, and Sqlite databases.
- Asynchronous conversation, supporting multiple conversations simultaneously.
- Management of historical conversations.
- Continuous chat, allowing ChatGPT clients to answer questions based on their historical chat records, resulting in better answers.
- Web search capability, allowing ChatGPT to retrieve the latest information.
- Convenient tools, supporting one-click message and code block copying, as well as message editing.
- Common command management, allowing users to store and edit their own common commands.
- PWA, supporting installation to the desktop.
- User Token Usage Statistics.
- Supports configuring multiple API Keys.
Server-side
- The server-side has an administrative panel.
- User management.
- Conversation and message management.
- Common configurations.
Original Intention
Since using ChatGPT, it has become a good helper in work. Unfortunately, as we all know, it cannot be accessed in some places. But fortunately, OpenAI has opened up its API, so I started to write a user interface for myself.
Nothing is difficult if you put your heart into it.
Later, several friends asked me how to use ChatGPT because they didn't have the technical skills. So I started to develop a multi-user system, which can not only be used by myself but also help my family and friends around me.
After the project was open-sourced, many people raised issues and some even submitted PRs, and the project has developed to its current state. I also learned a lot during this process, as I have always believed that helping others is also helping oneself.
续杯咖啡 | ChatGPT UI + + + + + + + + diff --git a/zh/guide/configuration.html b/zh/guide/configuration.html new file mode 100644 index 0000000..ea038f7 --- /dev/null +++ b/zh/guide/configuration.html @@ -0,0 +1,45 @@ + + + + + + + + +配置参考 | ChatGPT UI + + + + ++ + + diff --git a/zh/guide/development.html b/zh/guide/development.html new file mode 100644 index 0000000..7586833 --- /dev/null +++ b/zh/guide/development.html @@ -0,0 +1,40 @@ + + + + + + + + +ChatGPT UI 配置参考
数据库
后端默认使用内置的 Sqlite 来存储数据,如果不连接外部数据库,数据将在容器销毁后丢失。
chatgpt-ui-wsgi-server镜像提供环境变量DB_URL来配置与外部数据库的连接,以下是DB_URL的链接格式对照表。
数据库 链接 PostgreSQL postgres://USER:PASSWORD@HOST:PORT/DATABASE_NAME MySQL mysql://USER:PASSWORD@HOST:PORT/DATABASE_NAME SQLite sqlite:///PATH 例如我使用 PostgreSQL,则配置如下:
backend-wsgi-server: + image: wongsaang/chatgpt-ui-wsgi-server:latest + environment: + - DB_URL=postgres://postgres:postgrespw@localhost:49153/chatgpt +邮箱验证
如果你开放用户注册功能,并需要向用户发送邮箱激活链接,需要在
wsgi-server服务中配置以下环境变量:
参数 说明 默认值 ACCOUNT_EMAIL_VERIFICATION 邮箱验证方式,可选值: none, optional, mandatory optional EMAIL_HOST SMTP 服务器地址 smtp.mailgun.org EMAIL_PORT SMTP 服务器端口号 587 EMAIL_HOST_USER 用户名 - EMAIL_HOST_PASSWORD 密码 - EMAIL_USE_TLS 是否加密 True EMAIL_FROM 发件邮箱 webmaster@localhost API 代理
如果您的网络无法请求 OpenAI 的 API 地址,您可以在
wsgi-server服务中配置代理,如何搭建代理服务,需要您自行搜索。例如:
backend-wsgi-server: + image: wongsaang/chatgpt-ui-wsgi-server:latest + environment: + - OPENAI_API_PROXY=https://openai.proxy.com/v1 # 注意,域名后面需要带上 v1 +后端 CSRF 白名单
如果你在访问管理后台的时候遇到
CSRF verification failed,可能你的APP_DOMAIN没有配置对。在wsgi-server服务下有个环境变量wsgi-server。 它的值应该是backend-web-server的地址+端口, 默认:localhost:9000。假如我把
chagpt.com这个域名解析到了服务器,并且我的backend-web-server服务绑定了 9000 这个端口。正确的配置如下:backend-wsgi-server: + image: wongsaang/chatgpt-ui-wsgi-server:latest + environment: + - APP_DOMAIN=chagpt.com:9000 +客户端配置
参数 说明 默认值 SERVER_DOMAIN 服务端地址 http://backend-web-server DEFAULT_LOCALE 默认语言 en NUXT_PUBLIC_APP_NAME 应用名称 ChatGPT UI NUXT_PUBLIC_TYPEWRITER 是否开启 打字机 效果[true/false] true NUXT_PUBLIC_TYPEWRITER_DELAY 打字机效果的延迟时间,单位:毫秒 50 用户注册控制
部署完整后,在管理后台的
Chat->Setting下面有open_registration设置项,用于控制是否开放用户注册。默认是True(允许用户注册),如果不需要,请改成False。网页搜索功能控制
该功能默认处于关闭状态,你可以在管理后台的
Chat->Settings中开启它,在 Settings 中有一个open_web_search的设置项,把它的值设置为True。节俭模式控制
该功能默认处于开启状态,你可以在管理后台的
Chat->Settings中关闭它,在 Settings 中有一个open_frugal_mode_control的设置项,把它的值设置为False。开发指南 | ChatGPT UI + + + + ++ + + diff --git a/zh/guide/problems.html b/zh/guide/problems.html new file mode 100644 index 0000000..7f87f4c --- /dev/null +++ b/zh/guide/problems.html @@ -0,0 +1,33 @@ + + + + + + + + +ChatGPT UI 开发指南
前端
项目地址:https://github.com/WongSaang/chatgpt-ui
环境准备
安装最新稳定版 node.js,如果需要打包成 docker 镜像,还需要安装 docker。
安装依赖
yarn install +启动开发服务
yarn dev +构建
yarn build +打包成 docker 镜像
docker build -t image-name:latest . +后端
项目地址:https://github.com/WongSaang/chatgpt-ui-server
环境准备
安装Python、pip/pipenv,如果需要打包成 docker 镜像,还需要安装 docker。
安装依赖
pip install -r requirements.txt +启动开发服务
python manage.py runserver +打包成 docker 镜像
docker build -t image-name:latest . +遇到问题 | ChatGPT UI + + + + + + + + diff --git a/zh/guide/quick-start.html b/zh/guide/quick-start.html new file mode 100644 index 0000000..ba03245 --- /dev/null +++ b/zh/guide/quick-start.html @@ -0,0 +1,87 @@ + + + + + + + + +快速开始 | ChatGPT UI + + + + ++ + + diff --git a/zh/index.html b/zh/index.html new file mode 100644 index 0000000..1ad49d1 --- /dev/null +++ b/zh/index.html @@ -0,0 +1,33 @@ + + + + + + + + +ChatGPT UI 快速开始
本项目提供了相关的 docker 镜像,你需要一个 vps 来部署,当然你也可以在本地的电脑上部署。需要注意的是,如果你的网络无法请求 OpenAI 的 API 地址,您需要配置代理。如果你想开放给其他用户使用,最好还需要一个域名,并将域名解析到服务器。
您还需要一个 OpenAI 的API Key,网上有获取多种方案,请自行搜索。
部署
快速部署脚本
对于技术知识了解不多的选手,如果你看不懂下面的内容,可以看我之前写的博客文章《一行命令部署自己的ChatGPT客户端》
注意:此脚本目前仅在 Ubuntu Server 22.04 LTS 上验证过。
bash <(curl -Ls https://raw.githubusercontent.com/WongSaang/chatgpt-ui/main/deployment.sh) +Docker Compose
准备 docker-compose.yml
项目中提供了一个
docker-compose.yml示例,如果你想自定义配置,请看 配置参考 部分。你可以通过下方链接下载
docker-compose.yml模板到本地或服务器:https://raw.githubusercontent.com/WongSaang/chatgpt-ui/main/docker-compose.yml
也可以手动创建
docker-compose.yml文件,然后复制下面的内容到文件中:version: '3' +services: + client: + image: wongsaang/chatgpt-ui-client:latest + environment: + - SERVER_DOMAIN=http://backend-web-server + - DEFAULT_LOCALE=zh + # - NUXT_PUBLIC_APP_NAME='ChatGPT UI' # APP 名称 + # - NUXT_PUBLIC_TYPEWRITER=true # 是否开启 打字机 效果 + # - NUXT_PUBLIC_TYPEWRITER_DELAY=50 # 打字机效果的延迟时间,单位:毫秒,默认:50 + depends_on: + - backend-web-server + ports: + - '80:80' + networks: + - chatgpt_ui_network + backend-wsgi-server: + image: wongsaang/chatgpt-ui-wsgi-server:latest + environment: + - APP_DOMAIN=${APP_DOMAIN:-localhost:9000} # CSRF 白名单,在这里设置为 chatgpt-ui-web-server 的地址+端口, 默认: localhost:9000 + - SERVER_WORKERS=3 # gunicorn 的工作进程数,默认为 3 + #- DB_URL=postgres://postgres:postgrespw@localhost:49153/chatgpt # 连接外部数据库,如果不设置这个参数,则默认使用内置的 Sqlite。需要注意的是,如果不连接外部数据库,数据将在容器销毁后丢失。链接格式请看下面的 DB_URL 格式对照表 + #- OPENAI_API_PROXY=https://openai.proxy.com/v1 # https://api.openai.com/v1 的代理地址 + - DJANGO_SUPERUSER_USERNAME=admin # 默认超级用户 + - DJANGO_SUPERUSER_PASSWORD=password # 默认超级用户的密码 + - DJANGO_SUPERUSER_EMAIL=admin@example.com # 默认超级用户邮箱 + - ACCOUNT_EMAIL_VERIFICATION=none # 邮箱验证方式,可选值: none, optional, mandatory. 默认为 optional。如果你不需要验证用户的邮箱,可以设置为 none。 + # 如果您想使用电子邮件验证功能,需要配置以下参数: + # - EMAIL_HOST=SMTP server address + # - EMAIL_PORT=SMTP server port + # - EMAIL_HOST_USER= + # - EMAIL_HOST_PASSWORD= + # - EMAIL_USE_TLS=True + # - EMAIL_FROM=no-reply@example.com #默认发件邮箱地址 + ports: + - '8000:8000' + networks: + - chatgpt_ui_network + backend-web-server: + image: wongsaang/chatgpt-ui-web-server:latest + environment: + - BACKEND_URL=http://backend-wsgi-server:8000 + ports: + - '9000:80' + depends_on: + - backend-wsgi-server + networks: + - chatgpt_ui_network + +networks: + chatgpt_ui_network: + driver: bridge +启动服务
你可以自行修改配置后,运行下面的命令来启动服务。
docker-compose up --pull always -d +这个命令用于启动 Docker Compose 配置中的服务。具体的参数含义如下:
up:启动 Docker Compose 配置中的服务。--pull always:每次启动服务前,都会从 Docker 镜像仓库中拉取最新版本的镜像。这样可以确保使用的镜像始终是最新的。-d:在后台运行服务。如果不加这个参数,服务会在当前终端窗口中运行,直到用户手动停止服务。部署完成之后
访问
http(s)://your.domain:9000/admin或 IPhttp(s)://123.123.123.123:9000/admin登录管理面板。默认超级用户: admin
默认密码: password
在可以开始聊天之前,您需要添加一个 OpenAI 的 API 密钥。在管理面板的设置模型中,有一个名称为openai_api_key的记录,将值设置为您的 API 密钥。在最新版本中,管理面板增加了一个独立的 API Key 的管理,位于管理面板的
Provider/ Api keys。你可以在这里添加多个 API Key,后端程序会统计每个 Key 的 token 使用量,并根据 token 使用量来平衡使用 Key。想要这个功能生效,需要删除之前的openai_api_key设置现在可以访问客户端地址
http(s)://your.domain或 IPhttp://123.123.123.123开始聊天。🎉🎉🎉 祝开心!
介绍 | ChatGPT UI + + + + ++ + +ChatGPT UI 介绍
ChatGPT UI 是一个非官方的 ChatGPT Web 客户端。它支持多用户,多语言,多种数据库连接进行数据持久化存储,例如:Mysql、PostgreSQL 和 Sqlite 等。
本项目项目包括客户端和服务端两部分。
- 客户端,基于 Nuxt,项目地址:https://github.com/WongSaang/chatgpt-ui
- 服务端,基于 Django,项目地址:https://github.com/WongSaang/chatgpt-ui-server
功能与特性
客户端
- 用户系统,支持用户注册、登录、修改密码等。
- 用户界面多语言,支持多种语言。
- 数据持久化,支持 Mysql、PostgreSQL 和 Sqlite 等数据库。
- 异步对话,支持多个对话同时进行。
- 历史对话管理。
- 持续聊天,让 ChatGPT 客户历史聊天记录回答问题,得出更好的答案。
- 网页搜索能力,让 ChatGPT 获取最新信息。
- 便捷的工具,支持一键复制消息和代码块,以及重新编辑消息等。
- 常用指令管理,用户可存储和编辑自己的常用指令。
- PWA,支持安装到桌面。
- 用户 Token 使用量统计
- 支持配置多个 API Key
服务端
- 服务端拥有一个管理面板
- 用户管理
- 对话和消息管理
- 常用配置
初衷
自从使用 ChatGPT ,它已经成为工作中的好帮手。可惜的是,就像大家知道的,它在有些地方无法访问。但好在 OpenAI 开放了 API,于是我开始为自己写用户界面。
世上无难事,只怕有心人。
后来,有多位朋友询问我怎么样才能使用 ChatGPT,因为他们没有技术能力。于是我又着手于多用户系统的开发,这样除了自己用,还能帮助到身边的亲朋好友。
项目开源后,有很多人提了 issue,也有人提了 PR,项目就发展到如今的样子。我在这个过程中也学到了很多,正如我一直坚信的,帮助他人也是帮助自己。