diff --git a/app/components/chat.module.scss b/app/components/chat.module.scss index e7619e92b..3b5c143b9 100644 --- a/app/components/chat.module.scss +++ b/app/components/chat.module.scss @@ -346,6 +346,12 @@ flex-wrap: nowrap; } } + + .chat-model-name { + font-size: 12px; + color: var(--black); + margin-left: 6px; + } } .chat-message-container { diff --git a/app/components/chat.tsx b/app/components/chat.tsx index 52befde13..ed5b06799 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -1524,6 +1524,11 @@ function _Chat() { > )} + {!isUser && ( +
+ {props.children}
+ {showToggle && collapsed && (
+
+
+
+ )}
+
+ >
+ );
+}
+
function escapeDollarNumber(text: string) {
let escapedText = "";
@@ -211,6 +251,7 @@ function _MarkDownContent(props: { content: string }) {
]}
components={{
pre: PreCode,
+ code: CustomCode,
p: (pProps) => ,
a: (aProps) => {
const href = aProps.href || "";
diff --git a/app/config/server.ts b/app/config/server.ts
index 5bfa2c2df..e953af369 100644
--- a/app/config/server.ts
+++ b/app/config/server.ts
@@ -1,5 +1,5 @@
import md5 from "spark-md5";
-import { DEFAULT_MODELS } from "../constant";
+import { DEFAULT_MODELS, DEFAULT_GA_ID } from "../constant";
declare global {
namespace NodeJS {
@@ -211,6 +211,7 @@ export const getServerSideConfig = () => {
cloudflareKVTTL: process.env.CLOUDFLARE_KV_TTL,
gtmId: process.env.GTM_ID,
+ gaId: process.env.GA_ID || DEFAULT_GA_ID,
needCode: ACCESS_CODES.size > 0,
code: process.env.CODE,
diff --git a/app/constant.ts b/app/constant.ts
index a2da01867..69ec8d868 100644
--- a/app/constant.ts
+++ b/app/constant.ts
@@ -475,4 +475,5 @@ export const internalAllowedWebDavEndpoints = [
"https://app.koofr.net/dav/Koofr",
];
+export const DEFAULT_GA_ID = "G-89WN60ZK2E";
export const PLUGINS = [{ name: "Stable Diffusion", path: Path.Sd }];
diff --git a/app/layout.tsx b/app/layout.tsx
index eda5f43dd..abefd69c1 100644
--- a/app/layout.tsx
+++ b/app/layout.tsx
@@ -6,7 +6,7 @@ import { getClientConfig } from "./config/client";
import type { Metadata, Viewport } from "next";
import { SpeedInsights } from "@vercel/speed-insights/next";
import { getServerSideConfig } from "./config/server";
-import { GoogleTagManager } from "@next/third-parties/google";
+import { GoogleTagManager, GoogleAnalytics } from "@next/third-parties/google";
const serverConfig = getServerSideConfig();
export const metadata: Metadata = {
@@ -56,6 +56,11 @@ export default function RootLayout({