From d88cc575e5b5157c5e87c52c6cbe38a0d848ab6b Mon Sep 17 00:00:00 2001 From: DDMeaqua Date: Fri, 16 Aug 2024 16:10:31 +0800 Subject: [PATCH] chore: update --- app/config/server.ts | 3 ++- app/constant.ts | 3 +++ app/layout.tsx | 12 ++++++++++-- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/app/config/server.ts b/app/config/server.ts index d3ff9651d..575300920 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 { @@ -159,6 +159,7 @@ export const getServerSideConfig = () => { alibabaApiKey: getApiKey(process.env.ALIBABA_API_KEY), 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 2f4acb104..6be72973e 100644 --- a/app/constant.ts +++ b/app/constant.ts @@ -351,3 +351,6 @@ export const internalAllowedWebDavEndpoints = [ "https://webdav.yandex.com", "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 637b4556b..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 = { @@ -37,7 +37,10 @@ export default function RootLayout({ - + @@ -53,6 +56,11 @@ export default function RootLayout({ )} + {serverConfig?.gaId && ( + <> + + + )} );