From 6531af6c3a63c078ebf93bd8e8da8fba624dcfd5 Mon Sep 17 00:00:00 2001
From: archer <545436317@qq.com>
Date: Tue, 8 Aug 2023 13:44:20 +0800
Subject: [PATCH] docs icon
---
client/public/locales/en/common.json | 1 +
.../components/Icon/icons/light/course.svg | 1 +
client/src/components/Icon/index.tsx | 3 +-
client/src/components/Layout/navbar.tsx | 16 +++++
client/src/pages/tools/index.tsx | 59 +++++++++++--------
5 files changed, 53 insertions(+), 27 deletions(-)
create mode 100644 client/src/components/Icon/icons/light/course.svg
diff --git a/client/public/locales/en/common.json b/client/public/locales/en/common.json
index 1bddb9bc9..204f340ec 100644
--- a/client/public/locales/en/common.json
+++ b/client/public/locales/en/common.json
@@ -27,6 +27,7 @@
"Cancel": "Cancel",
"Collect": "Collect",
"Copy": "Copy",
+ "Course": "",
"Delete": "Delete",
"Filed is repeat": "Filed is repeated",
"Filed is repeated": "",
diff --git a/client/src/components/Icon/icons/light/course.svg b/client/src/components/Icon/icons/light/course.svg
new file mode 100644
index 000000000..d8da2e2cb
--- /dev/null
+++ b/client/src/components/Icon/icons/light/course.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/client/src/components/Icon/index.tsx b/client/src/components/Icon/index.tsx
index 7b970174a..f3abe9da9 100644
--- a/client/src/components/Icon/index.tsx
+++ b/client/src/components/Icon/index.tsx
@@ -74,7 +74,8 @@ const map = {
outlink_share: require('./icons/outlink/share.svg').default,
outlink_iframe: require('./icons/outlink/iframe.svg').default,
addCircle: require('./icons/circle/add.svg').default,
- playFill: require('./icons/fill/play.svg').default
+ playFill: require('./icons/fill/play.svg').default,
+ courseLight: require('./icons/light/course.svg').default
};
export type IconName = keyof typeof map;
diff --git a/client/src/components/Layout/navbar.tsx b/client/src/components/Layout/navbar.tsx
index 4f561e9a9..33741dbad 100644
--- a/client/src/components/Layout/navbar.tsx
+++ b/client/src/components/Layout/navbar.tsx
@@ -98,6 +98,7 @@ const Navbar = ({ unread }: { unread: number }) => {
>
{/* logo */}
{
))}
+
{unread > 0 && (
{
)}
+
+ {
+ window.open(`https://doc.fastgpt.run/docs/intro`);
+ }}
+ >
+
+
+
+
+
{feConfigs?.show_git && (
diff --git a/client/src/pages/tools/index.tsx b/client/src/pages/tools/index.tsx
index 7ddb50682..5dd41ac68 100644
--- a/client/src/pages/tools/index.tsx
+++ b/client/src/pages/tools/index.tsx
@@ -5,35 +5,42 @@ import MyIcon from '@/components/Icon';
import { useRouter } from 'next/router';
import { feConfigs } from '@/store/static';
import { serviceSideProps } from '@/utils/i18n';
-
-const list = [
- {
- icon: 'dbLight',
- label: '我的知识库',
- link: '/kb/list'
- },
- ...(feConfigs?.show_appStore
- ? [
- {
- icon: 'appStoreLight',
- label: 'AI应用市场',
- link: '/appStore'
- }
- ]
- : []),
- ...(feConfigs?.show_git
- ? [
- {
- icon: 'git',
- label: 'GitHub 地址',
- link: 'https://github.com/labring/FastGPT'
- }
- ]
- : [])
-];
+import { useTranslation } from 'react-i18next';
const Tools = () => {
+ const { t } = useTranslation();
const router = useRouter();
+ const list = [
+ {
+ icon: 'dbLight',
+ label: '我的知识库',
+ link: '/kb/list'
+ },
+ ...(feConfigs?.show_appStore
+ ? [
+ {
+ icon: 'appStoreLight',
+ label: 'AI应用市场',
+ link: '/appStore'
+ }
+ ]
+ : []),
+ ...(feConfigs?.show_git
+ ? [
+ {
+ icon: 'git',
+ label: 'GitHub 地址',
+ link: 'https://github.com/labring/FastGPT'
+ }
+ ]
+ : []),
+ {
+ icon: 'courseLight',
+ label: '使用文档',
+ link: 'https://doc.fastgpt.run/docs/intro'
+ }
+ ];
+
return (
{list.map((item) => (