{Locale.Plugin.Item.Info(
FunctionToolService.add(m).length,
)}
@@ -335,7 +336,10 @@ export function PluginPage() {
diff --git a/app/components/sd/sd-panel.tsx b/app/components/sd/sd-panel.tsx
index a71e560dd..15aff0ab6 100644
--- a/app/components/sd/sd-panel.tsx
+++ b/app/components/sd/sd-panel.tsx
@@ -4,6 +4,7 @@ import { Select } from "@/app/components/ui-lib";
import { IconButton } from "@/app/components/button";
import Locale from "@/app/locales";
import { useSdStore } from "@/app/store/sd";
+import clsx from "clsx";
export const params = [
{
@@ -136,7 +137,7 @@ export function ControlParamItem(props: {
className?: string;
}) {
return (
-
+
diff --git a/app/components/sd/sd.tsx b/app/components/sd/sd.tsx
index 0ace62a83..1ccc0647e 100644
--- a/app/components/sd/sd.tsx
+++ b/app/components/sd/sd.tsx
@@ -36,6 +36,7 @@ import { removeImage } from "@/app/utils/chat";
import { SideBar } from "./sd-sidebar";
import { WindowContent } from "@/app/components/home";
import { params } from "./sd-panel";
+import clsx from "clsx";
function getSdTaskStatus(item: any) {
let s: string;
@@ -104,7 +105,7 @@ export function Sd() {
return (
<>
-
+
@@ -121,7 +122,10 @@ export function Sd() {
)}
Stability AI
diff --git a/app/components/settings.tsx b/app/components/settings.tsx
index 9f338718e..e2666b551 100644
--- a/app/components/settings.tsx
+++ b/app/components/settings.tsx
@@ -49,7 +49,7 @@ import Locale, {
changeLang,
getLang,
} from "../locales";
-import { copyToClipboard } from "../utils";
+import { copyToClipboard, clientUpdate, semverCompare } from "../utils";
import Link from "next/link";
import {
Anthropic,
@@ -59,6 +59,7 @@ import {
ByteDance,
Alibaba,
Moonshot,
+ XAI,
Google,
GoogleSafetySettingsThreshold,
OPENAI_BASE_URL,
@@ -71,6 +72,7 @@ import {
Stability,
Iflytek,
SAAS_CHAT_URL,
+ ChatGLM,
} from "../constant";
import { Prompt, SearchService, usePromptStore } from "../store/prompt";
import { ErrorBoundary } from "./error";
@@ -585,7 +587,7 @@ export function Settings() {
const [checkingUpdate, setCheckingUpdate] = useState(false);
const currentVersion = updateStore.formatVersion(updateStore.version);
const remoteId = updateStore.formatVersion(updateStore.remoteVersion);
- const hasNewVersion = currentVersion !== remoteId;
+ const hasNewVersion = semverCompare(currentVersion, remoteId) === -1;
const updateUrl = getClientConfig()?.isApp ? RELEASE_URL : UPDATE_URL;
function checkUpdate(force = false) {
@@ -1194,6 +1196,86 @@ export function Settings() {
>
);
+ const XAIConfigComponent = accessStore.provider === ServiceProvider.XAI && (
+ <>
+
+
+ accessStore.update(
+ (access) => (access.xaiUrl = e.currentTarget.value),
+ )
+ }
+ >
+
+
+ {
+ accessStore.update(
+ (access) => (access.xaiApiKey = e.currentTarget.value),
+ );
+ }}
+ />
+
+ >
+ );
+
+ const chatglmConfigComponent = accessStore.provider ===
+ ServiceProvider.ChatGLM && (
+ <>
+
+
+ accessStore.update(
+ (access) => (access.chatglmUrl = e.currentTarget.value),
+ )
+ }
+ >
+
+
+ {
+ accessStore.update(
+ (access) => (access.chatglmApiKey = e.currentTarget.value),
+ );
+ }}
+ />
+
+ >
+ );
+
const stabilityConfigComponent = accessStore.provider ===
ServiceProvider.Stability && (
<>
@@ -1357,9 +1439,17 @@ export function Settings() {
{checkingUpdate ? (
) : hasNewVersion ? (
-
- {Locale.Settings.Update.GoToUpdate}
-
+ clientConfig?.isApp ? (
+
}
+ text={Locale.Settings.Update.GoToUpdate}
+ onClick={() => clientUpdate()}
+ />
+ ) : (
+
+ {Locale.Settings.Update.GoToUpdate}
+
+ )
) : (
}
@@ -1509,6 +1599,22 @@ export function Settings() {
}
>
+
+
+ updateConfig(
+ (config) => (config.enableCodeFold = e.currentTarget.checked),
+ )
+ }
+ >
+
@@ -1628,6 +1734,8 @@ export function Settings() {
{moonshotConfigComponent}
{stabilityConfigComponent}
{lflytekConfigComponent}
+ {XAIConfigComponent}
+ {chatglmConfigComponent}
>
)}
>
diff --git a/app/components/sidebar.tsx b/app/components/sidebar.tsx
index 493b1103b..a5e33b15e 100644
--- a/app/components/sidebar.tsx
+++ b/app/components/sidebar.tsx
@@ -30,6 +30,7 @@ import { Link, useNavigate } from "react-router-dom";
import { isIOS, useMobileScreen } from "../utils";
import dynamic from "next/dynamic";
import { showConfirm, Selector } from "./ui-lib";
+import clsx from "clsx";
const ChatList = dynamic(async () => (await import("./chat-list")).ChatList, {
loading: () => null,
@@ -141,9 +142,9 @@ export function SideBarContainer(props: {
const { children, className, onDragStart, shouldNarrow } = props;
return (
-
+
{children}
@@ -227,6 +234,7 @@ export function SideBar(props: { className?: string }) {
title="NextChat"
subTitle="Build your own AI assistant."
logo={
}
+ shouldNarrow={shouldNarrow}
>
-
+
}
onClick={async () => {
diff --git a/app/components/ui-lib.tsx b/app/components/ui-lib.tsx
index 4af37dbba..a64265235 100644
--- a/app/components/ui-lib.tsx
+++ b/app/components/ui-lib.tsx
@@ -23,6 +23,7 @@ import React, {
useRef,
} from "react";
import { IconButton } from "./button";
+import clsx from "clsx";
export function Popover(props: {
children: JSX.Element;
@@ -45,7 +46,7 @@ export function Popover(props: {
export function Card(props: { children: JSX.Element[]; className?: string }) {
return (
-
{props.children}
+
{props.children}
);
}
@@ -60,11 +61,13 @@ export function ListItem(props: {
}) {
return (
@@ -135,9 +138,9 @@ export function Modal(props: ModalProps) {
return (
{props.title}
@@ -260,7 +263,7 @@ export function Input(props: InputProps) {
return (
);
}
@@ -301,9 +304,13 @@ export function Select(
const { className, children, align, ...otherProps } = props;
return (