mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-08 16:15:50 +08:00
feat: #1000 ready to support client-side only
This commit is contained in:
@@ -24,6 +24,7 @@ import {
|
||||
import { SideBar } from "./sidebar";
|
||||
import { useAppConfig } from "../store/config";
|
||||
import { AuthPage } from "./auth";
|
||||
import { getClientConfig } from "../config/client";
|
||||
|
||||
export function Loading(props: { noLogo?: boolean }) {
|
||||
return (
|
||||
@@ -147,6 +148,10 @@ function Screen() {
|
||||
export function Home() {
|
||||
useSwitchTheme();
|
||||
|
||||
useEffect(() => {
|
||||
console.log("[Config] got config from build time", getClientConfig());
|
||||
}, []);
|
||||
|
||||
if (!useHasHydrated()) {
|
||||
return <Loading />;
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { useState, useEffect, useMemo, HTMLProps, useRef } from "react";
|
||||
import { useState, useEffect, useMemo } from "react";
|
||||
|
||||
import styles from "./settings.module.scss";
|
||||
|
||||
@@ -45,6 +45,7 @@ import { ErrorBoundary } from "./error";
|
||||
import { InputRange } from "./input-range";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { Avatar, AvatarPicker } from "./emoji";
|
||||
import { getClientConfig } from "../config/client";
|
||||
|
||||
function EditPromptModal(props: { id: number; onClose: () => void }) {
|
||||
const promptStore = usePromptStore();
|
||||
@@ -541,6 +542,21 @@ export function Settings() {
|
||||
/>
|
||||
)}
|
||||
</ListItem>
|
||||
|
||||
{!accessStore.hideUserApiKey ? (
|
||||
<ListItem
|
||||
title={Locale.Settings.Endpoint.Title}
|
||||
subTitle={Locale.Settings.Endpoint.SubTitle}
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
value={accessStore.openaiUrl}
|
||||
onChange={(e) =>
|
||||
accessStore.updateOpenAiUrl(e.currentTarget.value)
|
||||
}
|
||||
></input>
|
||||
</ListItem>
|
||||
) : null}
|
||||
</List>
|
||||
|
||||
<List>
|
||||
|
Reference in New Issue
Block a user