mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-11-17 14:33:41 +08:00
thay doi ui chebichat
This commit is contained in:
@@ -357,6 +357,7 @@
|
||||
font-size: 12px;
|
||||
color: var(--black);
|
||||
margin-left: 6px;
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1330,18 +1330,32 @@ function _Chat() {
|
||||
}
|
||||
}
|
||||
|
||||
// Sử dụng useMemo để tạo mảng context chứa các tin nhắn ngữ cảnh (context messages) của phiên chat hiện tại.
|
||||
// Nếu mask được thiết lập ẩn context (hideContext), trả về mảng rỗng.
|
||||
// Ngược lại, sao chép các tin nhắn context từ session.mask.context.
|
||||
const context: RenderMessage[] = useMemo(() => {
|
||||
return session.mask.hideContext ? [] : session.mask.context.slice();
|
||||
}, [session.mask.context, session.mask.hideContext]);
|
||||
|
||||
// Nếu không có tin nhắn context nào (context.length === 0)
|
||||
// và tin nhắn đầu tiên của session không phải là lời chào mặc định của bot (BOT_HELLO),
|
||||
// thì thêm tin nhắn chào mặc định của bot vào context.
|
||||
// Nếu người dùng chưa đăng nhập (không có quyền truy cập), thay nội dung lời chào bằng thông báo lỗi chưa đăng nhập.
|
||||
if (
|
||||
context.length === 0 &&
|
||||
session.messages.at(0)?.content !== BOT_HELLO.content
|
||||
) {
|
||||
// sao chép lời chào mặc định của bot
|
||||
|
||||
const copiedHello = Object.assign({}, BOT_HELLO);
|
||||
|
||||
// nếu người dùng chưa đăng nhập, thay nội dung lời chào bằng thông báo lỗi chưa đăng nhập
|
||||
if (!accessStore.isAuthorized()) {
|
||||
copiedHello.content = Locale.Error.Unauthorized;
|
||||
}
|
||||
// thêm lời chào vào context
|
||||
// để hiển thị lời chào này trong giao diện chat
|
||||
// như là một phần của ngữ cảnh cuộc trò chuyện
|
||||
context.push(copiedHello);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,8 +6,11 @@ import EmojiPicker, {
|
||||
|
||||
import { ModelType } from "../store";
|
||||
|
||||
import BotIconDefault from "../icons/llm-icons/default.svg";
|
||||
import BotIconOpenAI from "../icons/llm-icons/openai.svg";
|
||||
// import BotIconDefault from "../icons/llm-icons/chebichat.svg";
|
||||
|
||||
import BotIconDefault from "../icons/llm-icons/chebichat.svg";
|
||||
|
||||
import BotIconOpenAI from "../icons/llm-icons/chebichat.svg";
|
||||
import BotIconGemini from "../icons/llm-icons/gemini.svg";
|
||||
import BotIconGemma from "../icons/llm-icons/gemma.svg";
|
||||
import BotIconClaude from "../icons/llm-icons/claude.svg";
|
||||
@@ -15,7 +18,10 @@ import BotIconMeta from "../icons/llm-icons/meta.svg";
|
||||
import BotIconMistral from "../icons/llm-icons/mistral.svg";
|
||||
import BotIconDeepseek from "../icons/llm-icons/deepseek.svg";
|
||||
import BotIconMoonshot from "../icons/llm-icons/moonshot.svg";
|
||||
import BotIconQwen from "../icons/llm-icons/qwen.svg";
|
||||
|
||||
// thay bang chebichat
|
||||
import BotIconQwen from "../icons/llm-icons/chebichat.svg";
|
||||
|
||||
import BotIconWenxin from "../icons/llm-icons/wenxin.svg";
|
||||
import BotIconGrok from "../icons/llm-icons/grok.svg";
|
||||
import BotIconHunyuan from "../icons/llm-icons/hunyuan.svg";
|
||||
@@ -68,7 +74,10 @@ export function Avatar(props: { model?: ModelType; avatar?: string }) {
|
||||
LlmIcon = BotIconClaude;
|
||||
} else if (modelName.includes("llama")) {
|
||||
LlmIcon = BotIconMeta;
|
||||
} else if (modelName.startsWith("mixtral") || modelName.startsWith("codestral")) {
|
||||
} else if (
|
||||
modelName.startsWith("mixtral") ||
|
||||
modelName.startsWith("codestral")
|
||||
) {
|
||||
LlmIcon = BotIconMistral;
|
||||
} else if (modelName.includes("deepseek")) {
|
||||
LlmIcon = BotIconDeepseek;
|
||||
@@ -93,15 +102,15 @@ export function Avatar(props: { model?: ModelType; avatar?: string }) {
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="no-dark">
|
||||
<LlmIcon className="user-avatar" width={30} height={30} />
|
||||
<div className="user-avatar">
|
||||
<LlmIcon className="user-avatar" size={48} width={48} height={48} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="user-avatar">
|
||||
{props.avatar && <EmojiAvatar avatar={props.avatar} />}
|
||||
{props.avatar && <EmojiAvatar avatar={props.avatar} size={48} />}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -523,7 +523,7 @@ export function ImagePreviewer(props: {
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
{/* <div>
|
||||
<div className={styles["main-title"]}>NextChat</div>
|
||||
<div className={styles["sub-title"]}>
|
||||
github.com/ChatGPTNextWeb/ChatGPT-Next-Web
|
||||
@@ -536,7 +536,8 @@ export function ImagePreviewer(props: {
|
||||
model={session.mask.modelConfig.model}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div> */}
|
||||
|
||||
<div>
|
||||
<div className={styles["chat-info-item"]}>
|
||||
{Locale.Exporter.Model}: {mask.modelConfig.model}
|
||||
|
||||
@@ -5,7 +5,9 @@ import styles from "./home.module.scss";
|
||||
import { IconButton } from "./button";
|
||||
import SettingsIcon from "../icons/settings.svg";
|
||||
import GithubIcon from "../icons/github.svg";
|
||||
import ChatGptIcon from "../icons/chatgpt.svg";
|
||||
|
||||
import ChatGptIcon from "../icons/chebichat.svg";
|
||||
|
||||
import AddIcon from "../icons/add.svg";
|
||||
import DeleteIcon from "../icons/delete.svg";
|
||||
import MaskIcon from "../icons/mask.svg";
|
||||
@@ -250,8 +252,8 @@ export function SideBar(props: { className?: string }) {
|
||||
{...props}
|
||||
>
|
||||
<SideBarHeader
|
||||
title="NextChat"
|
||||
subTitle="Build your own AI assistant."
|
||||
title="Chebi Chat"
|
||||
subTitle="Trợ lý AI học tiếng Trung"
|
||||
logo={<ChatGptIcon />}
|
||||
shouldNarrow={shouldNarrow}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user