Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

合并请求 #3

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ yarn-error.log*

# local env files
.env*.local
yarn.lock

# vercel
.vercel
Expand All @@ -38,6 +39,7 @@ dev

.vscode
.idea
.history

# docker-compose env files
.env
Expand Down
3 changes: 1 addition & 2 deletions app/client/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ export class ClientApi {
.concat([
{
from: "human",
value:
"Share from [Gemini Next Web]: https://github.com/blacksev/Gemini-Next-Web",
value: "Share from [Gemini Next Web]: https://gemini.finai.fun",
},
]);
// 敬告二开开发者们,为了开源大模型的发展,请不要修改上述消息,此消息用于后续数据清洗使用
Expand Down
5 changes: 5 additions & 0 deletions app/command.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useEffect } from "react";
import { useSearchParams } from "react-router-dom";
import Locale from "./locales";
import TagManager from "react-gtm-module";

type Command = (param: string) => void;
interface Commands {
Expand Down Expand Up @@ -30,6 +31,10 @@ export function useCommand(commands: Commands = {}) {
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [searchParams, commands]);

useEffect(() => {
TagManager.initialize({ gtmId: "GTM-WST5PCMK" });
}, []);
}

interface ChatCommands {
Expand Down
4 changes: 1 addition & 3 deletions app/components/exporter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -531,9 +531,7 @@ export function ImagePreviewer(props: {

<div>
<div className={styles["main-title"]}>Gemini Chat Pro</div>
<div className={styles["sub-title"]}>
github.com/blacksev/Gemini-Next-Web
</div>
<div className={styles["sub-title"]}>gemini.finai.fun</div>
<div className={styles["icons"]}>
<ExportAvatar avatar={config.avatar} />
<span className={styles["icon-space"]}>&</span>
Expand Down
9 changes: 9 additions & 0 deletions app/components/footer.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.footer-content {
font-size: 12px;
text-align: center;
color: #888;
width: 100%;
a {
color: inherit;
}
}
12 changes: 12 additions & 0 deletions app/components/footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import styles from "./footer.module.scss";

export default function Footer(props: { noLogo?: boolean }) {
return (
<div className={styles["footer-content"] + " no-dark"}>
&copy; {new Date().getFullYear()}{" "}
<a href="https://gemini.finai.fun">gemini.finai.fun</a> Powered by{" "}
<a href="https://finai.fun">finai.fun</a> &{" "}
<a href="https://emoji.6mzy.com">🧐</a>
</div>
);
}
4 changes: 2 additions & 2 deletions app/components/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ export function Settings() {
</Popover>
</ListItem>

<ListItem
{/* <ListItem
title={Locale.Settings.Update.Version(currentVersion ?? "unknown")}
subTitle={
checkingUpdate
Expand All @@ -717,7 +717,7 @@ export function Settings() {
onClick={() => checkUpdate(true)}
/>
)}
</ListItem>
</ListItem> */}

<ListItem title={Locale.Settings.SendKey}>
<Select
Expand Down
4 changes: 2 additions & 2 deletions app/components/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,11 @@ export function SideBar(props: { className?: string }) {
<IconButton icon={<SettingsIcon />} shadow />
</Link>
</div>
<div className={styles["sidebar-action"]}>
{/* <div className={styles["sidebar-action"]}>
<a href={REPO_URL} target="_blank" rel="noopener noreferrer">
<IconButton icon={<GithubIcon />} shadow />
</a>
</div>
</div> */}
</div>
<div>
<IconButton
Expand Down
1 change: 1 addition & 0 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { type Metadata } from "next";

export const metadata: Metadata = {
title: "Gemini Chat Pro - Your personal Gemini Pro Chat Bot",
keywords: "gemini, chat, bot, pro, chatbot",
description:
"Gemini-Next-Web is the best open source and free chat bot powered by Google Gemini Pro and Gemini Pro Vision models. You can use it to chat with texts and images. All the data are stored in local and there is no need to register an account.",
viewport: {
Expand Down
2 changes: 2 additions & 0 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ import { Analytics } from "@vercel/analytics/react";
import { Home } from "./components/home";

import { getServerSideConfig } from "./config/server";
import Footer from "./components/footer";

const serverConfig = getServerSideConfig();

export default async function App() {
return (
<>
<Home />
<Footer />
{serverConfig?.isVercel && <Analytics />}
</>
);
Expand Down
3 changes: 1 addition & 2 deletions app/store/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ export enum Theme {

export const DEFAULT_CONFIG = {
lastUpdate: Date.now(), // timestamp, to merge state

submitKey: isMacOS() ? SubmitKey.MetaEnter : SubmitKey.CtrlEnter,
submitKey: SubmitKey.Enter,
avatar: "1f603",
fontSize: 14,
theme: Theme.Auto as Theme,
Expand Down
1 change: 1 addition & 0 deletions app/styles/globals.scss
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ body {
user-select: none;
touch-action: pan-x pan-y;
overflow: hidden;
flex-wrap: wrap;

@media only screen and (max-width: 600px) {
background-color: var(--second);
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"@types/node": "^20.9.0",
"@types/react": "^18.2.14",
"@types/react-dom": "^18.2.7",
"@types/react-gtm-module": "^2.0.3",
"@types/react-katex": "^3.0.0",
"@types/spark-md5": "^3.0.4",
"cross-env": "^7.0.3",
Expand All @@ -56,6 +57,7 @@
"husky": "^8.0.0",
"lint-staged": "^13.2.2",
"prettier": "^3.0.2",
"react-gtm-module": "^2.0.11",
"typescript": "5.2.2",
"webpack": "^5.88.1"
},
Expand Down
10 changes: 10 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1618,6 +1618,11 @@
dependencies:
"@types/react" "*"

"@types/react-gtm-module@^2.0.3":
version "2.0.3"
resolved "https://registry.npmmirror.com/@types/react-gtm-module/-/react-gtm-module-2.0.3.tgz#bc4b68abc7112a658100266948e24e88330d2600"
integrity sha512-fL2zKdDFN5LckSsVBXEhhm9M4tFTM9oHJfGcfZJzktQkzpOTGtDM8oXIP9d9UBDxO4xLNZhS22dlgRVv6wgK9w==

"@types/react-katex@^3.0.0":
version "3.0.0"
resolved "https://registry.yarnpkg.com/@types/react-katex/-/react-katex-3.0.0.tgz#119a902bff10eb52f449fac744aaed8c4909391f"
Expand Down Expand Up @@ -5129,6 +5134,11 @@ react-dom@^18.2.0:
loose-envify "^1.1.0"
scheduler "^0.23.0"

react-gtm-module@^2.0.11:
version "2.0.11"
resolved "https://registry.npmmirror.com/react-gtm-module/-/react-gtm-module-2.0.11.tgz#14484dac8257acd93614e347c32da9c5ac524206"
integrity sha512-8gyj4TTxeP7eEyc2QKawEuQoAZdjKvMY4pgWfycGmqGByhs17fR+zEBs0JUDq4US/l+vbTl+6zvUIx27iDo/Vw==

react-is@^16.13.1, react-is@^16.7.0:
version "16.13.1"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
Expand Down