Compare commits

...

6 Commits

Author SHA1 Message Date
Dogtiti
a5ac2386d8 Merge pull request #5470 from ChatGPTNextWeb/add_tip_top
add fanyi add top tip
2024-09-25 15:46:21 +08:00
lyf
e83f61e74d fix 2024-09-25 15:21:17 +08:00
lyf
10d472e79e fix 2024-09-25 14:41:41 +08:00
lyf
a6b920d9af fix 2024-09-25 14:35:09 +08:00
lyf
77f037a3c4 add maidian 2024-09-25 13:08:03 +08:00
lyf
248d27680d fix style 2024-09-25 11:15:00 +08:00
9 changed files with 48 additions and 22 deletions

View File

@@ -13,7 +13,10 @@ import BotIcon from "../icons/bot.svg";
import { getClientConfig } from "../config/client"; import { getClientConfig } from "../config/client";
import LeftIcon from "@/app/icons/left.svg"; import LeftIcon from "@/app/icons/left.svg";
import { safeLocalStorage } from "@/app/utils"; import { safeLocalStorage } from "@/app/utils";
import {
trackSettingsPageGuideToCPaymentClick,
trackAuthorizationPageButtonToCPaymentClick,
} from "../utils/auth-settings-events";
const storage = safeLocalStorage(); const storage = safeLocalStorage();
export function AuthPage() { export function AuthPage() {
@@ -22,6 +25,7 @@ export function AuthPage() {
const goHome = () => navigate(Path.Home); const goHome = () => navigate(Path.Home);
const goChat = () => navigate(Path.Chat); const goChat = () => navigate(Path.Chat);
const goSaas = () => { const goSaas = () => {
trackAuthorizationPageButtonToCPaymentClick();
window.location.href = SAAS_CHAT_URL; window.location.href = SAAS_CHAT_URL;
}; };
@@ -151,11 +155,17 @@ function TopBanner() {
onMouseEnter={handleMouseEnter} onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave} onMouseLeave={handleMouseLeave}
> >
<div className={styles["top-banner-inner"]}> <div className={`${styles["top-banner-inner"]} no-dark`}>
<Logo className={styles["top-banner-logo"]}></Logo> <Logo className={styles["top-banner-logo"]}></Logo>
<span> <span>
{Locale.Auth.TopTips} {Locale.Auth.TopTips}
<a href={SAAS_CHAT_URL} rel="stylesheet"> <a
href={SAAS_CHAT_URL}
rel="stylesheet"
onClick={() => {
trackSettingsPageGuideToCPaymentClick();
}}
>
{Locale.Settings.Access.SaasStart.ChatNow} {Locale.Settings.Access.SaasStart.ChatNow}
<Arrow style={{ marginLeft: "4px" }} /> <Arrow style={{ marginLeft: "4px" }} />
</a> </a>

View File

@@ -21,7 +21,6 @@ import {
} from "./artifacts"; } from "./artifacts";
import { useChatStore } from "../store"; import { useChatStore } from "../store";
import { IconButton } from "./button"; import { IconButton } from "./button";
export function Mermaid(props: { code: string }) { export function Mermaid(props: { code: string }) {
const ref = useRef<HTMLDivElement>(null); const ref = useRef<HTMLDivElement>(null);
const [hasError, setHasError] = useState(false); const [hasError, setHasError] = useState(false);

View File

@@ -0,0 +1,7 @@
.select-compress-model {
width: 60%;
select {
max-width: 100%;
white-space: normal;
}
}

View File

@@ -6,7 +6,7 @@ import { InputRange } from "./input-range";
import { ListItem, Select } from "./ui-lib"; import { ListItem, Select } from "./ui-lib";
import { useAllModels } from "../utils/hooks"; import { useAllModels } from "../utils/hooks";
import { groupBy } from "lodash-es"; import { groupBy } from "lodash-es";
import styles from "./ui-lib.module.scss"; import styles from "./model-config.module.scss";
export function ModelConfigList(props: { export function ModelConfigList(props: {
modelConfig: ModelConfig; modelConfig: ModelConfig;
@@ -243,7 +243,7 @@ export function ModelConfigList(props: {
subTitle={Locale.Settings.CompressModel.SubTitle} subTitle={Locale.Settings.CompressModel.SubTitle}
> >
<Select <Select
className={styles["select-model"]} className={styles["select-compress-model"]}
aria-label={Locale.Settings.CompressModel.Title} aria-label={Locale.Settings.CompressModel.Title}
value={compressModelValue} value={compressModelValue}
onChange={(e) => { onChange={(e) => {

View File

@@ -73,7 +73,7 @@
} }
} }
.SubTitle-button { .subtitle-button {
button { button {
overflow:visible ; overflow:visible ;
} }

View File

@@ -19,7 +19,7 @@ import ConfirmIcon from "../icons/confirm.svg";
import ConnectionIcon from "../icons/connection.svg"; import ConnectionIcon from "../icons/connection.svg";
import CloudSuccessIcon from "../icons/cloud-success.svg"; import CloudSuccessIcon from "../icons/cloud-success.svg";
import CloudFailIcon from "../icons/cloud-fail.svg"; import CloudFailIcon from "../icons/cloud-fail.svg";
import { trackSettingsPageGuideToCPaymentClick } from "../utils/auth-settings-events";
import { import {
Input, Input,
List, List,
@@ -690,7 +690,7 @@ export function Settings() {
const saasStartComponent = ( const saasStartComponent = (
<ListItem <ListItem
className={styles["SubTitle-button"]} className={styles["subtitle-button"]}
title={ title={
Locale.Settings.Access.SaasStart.Title + Locale.Settings.Access.SaasStart.Title +
`${Locale.Settings.Access.SaasStart.Label}` `${Locale.Settings.Access.SaasStart.Label}`
@@ -706,6 +706,7 @@ export function Settings() {
type={"primary"} type={"primary"}
text={Locale.Settings.Access.SaasStart.ChatNow} text={Locale.Settings.Access.SaasStart.ChatNow}
onClick={() => { onClick={() => {
trackSettingsPageGuideToCPaymentClick();
window.location.href = SAAS_CHAT_URL; window.location.href = SAAS_CHAT_URL;
}} }}
/> />

View File

@@ -260,11 +260,9 @@
.select-with-icon-select { .select-with-icon-select {
height: 100%; height: 100%;
max-width: 100%;
border: var(--border-in-light); border: var(--border-in-light);
padding: 10px 35px 10px 10px; padding: 10px 35px 10px 10px;
border-radius: 10px; border-radius: 10px;
white-space: normal;
appearance: none; appearance: none;
cursor: pointer; cursor: pointer;
background-color: var(--white); background-color: var(--white);
@@ -281,15 +279,6 @@
} }
} }
.select-model {
width: 60%;
.select-with-icon-select {
max-width: 100%;
white-space: normal;
}
}
.modal-input { .modal-input {
height: 100%; height: 100%;
width: 100%; width: 100%;

View File

@@ -2,6 +2,7 @@ import { getClientConfig } from "../config/client";
import { SubmitKey } from "../store/config"; import { SubmitKey } from "../store/config";
import { SAAS_CHAT_URL } from "@/app/constant"; import { SAAS_CHAT_URL } from "@/app/constant";
const SAAS_CHAT_URL_WITH_PARAM = `${SAAS_CHAT_URL}?data=title`;
const isApp = !!getClientConfig()?.isApp; const isApp = !!getClientConfig()?.isApp;
const cn = { const cn = {
@@ -9,10 +10,10 @@ const cn = {
Error: { Error: {
Unauthorized: isApp Unauthorized: isApp
? `😆 对话遇到了一些问题,不用慌: ? `😆 对话遇到了一些问题,不用慌:
\\ 1⃣ 想要零配置开箱即用,[点击这里立刻开启对话 🚀](${SAAS_CHAT_URL}) \\ 1⃣ 想要零配置开箱即用,[点击这里立刻开启对话 🚀](${SAAS_CHAT_URL_WITH_PARAM})
\\ 2⃣ 如果你想消耗自己的 OpenAI 资源,点击[这里](/#/settings)修改设置 ⚙️` \\ 2⃣ 如果你想消耗自己的 OpenAI 资源,点击[这里](/#/settings)修改设置 ⚙️`
: `😆 对话遇到了一些问题,不用慌: : `😆 对话遇到了一些问题,不用慌:
\ 1⃣ 想要零配置开箱即用,[点击这里立刻开启对话 🚀](${SAAS_CHAT_URL}) \ 1⃣ 想要零配置开箱即用,[点击这里立刻开启对话 🚀](${SAAS_CHAT_URL_WITH_PARAM})
\ 2⃣ 如果你正在使用私有部署版本,点击[这里](/#/auth)输入访问秘钥 🔑 \ 2⃣ 如果你正在使用私有部署版本,点击[这里](/#/auth)输入访问秘钥 🔑
\ 3⃣ 如果你想消耗自己的 OpenAI 资源,点击[这里](/#/settings)修改设置 ⚙️ \ 3⃣ 如果你想消耗自己的 OpenAI 资源,点击[这里](/#/settings)修改设置 ⚙️
`, `,

View File

@@ -0,0 +1,19 @@
import { sendGAEvent } from "@next/third-parties/google";
export function trackConversationGuideToCPaymentClick() {
sendGAEvent("event", "ConversationGuideToCPaymentClick", { value: 1 });
}
export function trackAuthorizationPageButtonToCPaymentClick() {
sendGAEvent("event", "AuthorizationPageButtonToCPaymentClick", { value: 1 });
}
export function trackAuthorizationPageBannerToCPaymentClick() {
sendGAEvent("event", "AuthorizationPageBannerToCPaymentClick", {
value: 1,
});
}
export function trackSettingsPageGuideToCPaymentClick() {
sendGAEvent("event", "SettingsPageGuideToCPaymentClick", { value: 1 });
}