docs: switch to docs layout and apply black theme (#6533)

* feat: add Gemini 3.1 models

- Add gemini-3.1-pro-preview (released February 19, 2026)
- Add gemini-3.1-flash-lite-preview (released March 3, 2026)

Both models support:
- 1M context window
- 64k max response
- Vision
- Tool choice

* docs: switch to docs layout and apply black theme

- Change layout from notebook to docs
- Update logo to icon + text format
- Apply fumadocs black theme
- Simplify global.css (keep only navbar and TOC styles)
- Fix icon components to properly accept className props
- Add mobile text overflow handling
- Update Node engine requirement to >=20.x

* doc

* doc

* lock

* fix: ts

* doc

* doc

---------

Co-authored-by: archer <archer@archerdeMac-mini.local>
Co-authored-by: archer <545436317@qq.com>
This commit is contained in:
Archer
2026-03-10 11:57:25 +08:00
committed by GitHub
parent 2f183a9936
commit 960c8898cf
17 changed files with 159 additions and 795 deletions
+18 -50
View File
@@ -1,18 +1,17 @@
import { type ReactNode } from 'react';
import { source } from '@/lib/source';
import { DocsLayout } from 'fumadocs-ui/layouts/notebook';
import { DocsLayout } from 'fumadocs-ui/layouts/docs';
import { baseOptions } from '@/app/layout.config';
import { t, getLocalizedPath, i18n } from '@/lib/i18n';
import LogoLight from '@/components/docs/logo';
import LogoDark from '@/components/docs/logoDark';
import '@/app/global.css';
import { CustomSidebarComponents } from '@/components/sideBar';
import { SidebarKeepOpen } from '@/components/sidebarKeepOpen';
import { SidebarScrollFix } from '@/components/sidebarScrollFix';
import FeishuLogoLight from '@/components/docs/feishuLogoLIght';
import FeishuLogoDark from '@/components/docs/feishuLogoDark';
import GithubLogoLight from '@/components/docs/githubLogoLight';
import GithubLogoDark from '@/components/docs/githubLogoDark';
import { BookOpen, Code, Lightbulb, CircleHelp, Scale, History, Server } from 'lucide-react';
import { BookOpen, Code, Lightbulb, CircleHelp, Server } from 'lucide-react';
export default async function Layout({
params,
@@ -57,51 +56,6 @@ export default async function Layout({
return (
<DocsLayout
{...baseOptions(lang)}
nav={{
title: (
<div className="flex flex-row items-center gap-2 h-14 ml-1">
<div className="block dark:hidden">
<LogoLight className="w-48 h-auto" />
</div>
<div className="hidden dark:block">
<LogoDark className="w-48 h-auto" />
</div>
</div>
),
mode: 'top'
}}
links={[
{
type: 'icon',
icon: (
<div className="flex flex-row items-center gap-2">
<div className="block dark:hidden">
<FeishuLogoLight />
</div>
<div className="hidden dark:block">
<FeishuLogoDark />
</div>
</div>
),
url: 'https://oss.laf.run/otnvvf-imgs/fastgpt-feishu1.png',
text: '飞书群'
},
{
type: 'icon',
icon: (
<div className="flex flex-row items-center gap-2">
<div className="block dark:hidden">
<GithubLogoLight />
</div>
<div className="hidden dark:block">
<GithubLogoDark />
</div>
</div>
),
url: 'https://github.com/labring/FastGPT',
text: 'github'
}
]}
tree={source.pageTree[lang] || source.pageTree[i18n.defaultLanguage]}
searchToggle={{
enabled: true
@@ -111,9 +65,23 @@ export default async function Layout({
collapsible: false,
components: CustomSidebarComponents
}}
tabMode="sidebar"
links={[
{
type: 'icon',
icon: <FeishuLogoLight className="block dark:hidden size-5" />,
url: 'https://oss.laf.run/otnvvf-imgs/fastgpt-feishu1.png',
text: '飞书群'
},
{
type: 'icon',
icon: <GithubLogoLight className="block dark:hidden size-5" />,
url: 'https://github.com/labring/FastGPT',
text: 'github'
}
]}
>
<SidebarKeepOpen tabUrls={tabUrls} />
<SidebarScrollFix />
{children}
</DocsLayout>
);
+67 -555
View File
@@ -1,553 +1,8 @@
@import 'tailwindcss';
@import 'fumadocs-ui/css/preset.css';
@import 'fumadocs-ui/css/black.css';
@font-face {
font-family: 'Alef';
src: url('/fonts/Alef-Regular.ttf') format('truetype');
}
/* 在文件开头添加这些基础变量 */
:root {
/* 基础颜色 */
--primary-50-hsl: 210, 40%, 98%;
--primary-hsl: 217, 91%, 60%;
--emerald-50-hsl: 152, 81%, 96%;
--emerald-500-hsl: 152, 76%, 40%;
--cardinal-50-hsl: 0, 86%, 97%;
--cardinal-500-hsl: 0, 74%, 42%;
--yellow-50-hsl: 55, 92%, 95%;
--yellow-500-hsl: 45, 93%, 47%;
--blue-500-hsl: 217, 91%, 60%;
--fd-layout-width: 1400px;
/* 文本颜色 */
--text-default: #374151;
--text-default-inv: #ffffff;
--text-muted: #6b7280;
--content-link-color: #2563eb;
/* 其他变量 */
--font-size-sm: 0.875rem;
--gray-200: #e5e7eb;
--gray-700: #374151;
--gray-800: #1f2937;
--gray-900: #111827;
/* 组件颜色 */
--primary-200: #bfdbfe;
--blue-200: #bfdbfe;
--blue-800: #1e40af;
--emerald-200: #a7f3d0;
--emerald-800: #065f46;
--cardinal-200: #fecaca;
--cardinal-800: #991b1b;
--yellow-200: #fde68a;
--yellow-800: #92400e;
/* Tabs 样式 */
--nav-tabs-border-width: none;
--nav-tabs-link-active-bg: none;
--nav-tabs-link-active-color: var(--text-default);
--nav-tabs-border-color: var(--gray-400);
}
[data-dark-mode] {
/* Tabs 样式 */
--nav-tabs-border-color: var(--gray-800);
--text-muted: #9ca3af;
--content-link-color: #60a5fa;
}
/* 全局代码块样式 */
pre,
code {
border-radius: 16px;
background: #f5f6f7;
font-family: Alef;
font-size: 1rem;
font-weight: 400;
line-height: 16px;
letter-spacing: 0.48px;
}
div[role='tabpanel'] figure:has(+ p) pre,
div[role='tabpanel'] figure:has(+ p) pre code {
background-color: #ececec;
}
.dark div[role='tabpanel'] figure:has(+ p) pre,
.dark div[role='tabpanel'] figure:has(+ p) pre code {
background-color: #3d3d3d;
}
.dark pre,
.dark code {
background: #1e1e1e;
}
pre {
padding: 24px 30px 24px 24px;
}
pre code {
gap: 20px;
}
code span {
padding-left: 0 !important;
}
/* 去除代码块内层边框 */
.bg-fd-secondary.border {
border: none;
}
/* 去除代码块外层边框 */
.shiki {
border: none;
padding: 0;
}
/* 行内代码样式 */
/* 行内代码样式 */
:not(pre) > code {
display: inline-block;
height: 25px;
padding: 0 10px;
margin: 0 0.2em;
color: #272727;
background: #f5f6f7;
font-family: 'PingFang SC';
font-size: 14px;
font-style: normal;
font-weight: 500;
line-height: 180%;
letter-spacing: 0.056px;
border: none;
border-radius: 8px;
}
.dark :not(pre) > code {
color: #e6e6e6 !important;
background: #282828 !important;
}
div[role='tablist'] ~ div:has(figure, p, ul) {
border-radius: 0 !important;
border: solid 1.5px #e5e5e5;
border-radius: 0.75rem !important;
}
.dark div[role='tablist'] ~ div:has(figure, p, ul) {
border: solid 1.5px #535353;
}
.dark div[role='tablist'] {
background-color: #1e1e1e;
}
/* 代码块下方的滚动条样式 */
div.bg-fd-secondary:has(pre) {
padding: 0;
}
.dark div.bg-fd-secondary:has(pre) {
background-color: #1e1e1e;
}
div.bg-fd-secondary:has(pre)::-webkit-scrollbar-track {
background: #e8e8e8;
}
div.bg-fd-secondary:has(pre)::-webkit-scrollbar-thumb {
background: #b0b0b0;
}
div.bg-fd-secondary:has(pre)::-webkit-scrollbar-thumb:hover {
background: #909090;
}
.dark div.bg-fd-secondary:has(pre)::-webkit-scrollbar-track {
background: #1a1a1a;
}
.dark div.bg-fd-secondary:has(pre)::-webkit-scrollbar-thumb {
background: #404040;
}
.dark div.bg-fd-secondary:has(pre)::-webkit-scrollbar-thumb:hover {
background: #606060;
}
/* 代码块中的滚动条样式优化 */
/* 图片居中显示 */
.fumadocs-content img,
.mdx-content img,
.prose img,
img {
display: block !important;
margin-left: auto !important;
margin-right: auto !important;
max-width: 100% !important;
height: auto !important;
border-radius: 8px !important;
box-shadow:
0 4px 6px -1px rgba(0, 0, 0, 0.1),
0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}
/* MDX 表格样式 */
.fumadocs-content table,
.mdx-content table,
.prose table {
width: 100% !important;
border-collapse: separate !important;
margin: 1rem 0 !important;
}
.fumadocs-content table td,
.fumadocs-content table th,
.mdx-content table td,
.mdx-content table th,
.prose table td,
.prose table th {
padding: 0.75rem 1rem !important;
text-align: left !important;
}
/* Tabs 样式 */
.nav-tabs {
display: flex;
gap: 0.5rem;
border-bottom: 1px solid var(--nav-tabs-border-color);
margin-bottom: 0.8rem;
}
.nav-tabs .nav-link {
color: var(--text-muted) !important;
margin-bottom: -1px;
padding: 0.75rem 1.5rem;
border: none;
background: none;
cursor: pointer;
font-size: 1rem;
transition: all 0.2s ease;
}
.nav-tabs .nav-link:hover {
text-decoration: none !important;
}
.nav-tabs .nav-link.active {
border-bottom: 2px solid var(--content-link-color);
color: var(--content-link-color) !important;
}
.tab-content {
margin-bottom: 0.8rem;
padding: 1rem 0;
}
div[data-state='open'].fixed.inset-0.z-50 {
background-color: rgba(255, 255, 255, 0.4) !important;
}
#nd-subnav > div:nth-of-type(1) button:nth-of-type(1) {
box-shadow:
0px 1px 2px 0px rgba(19, 51, 107, 0.05),
0px 0px 1px 0px rgba(19, 51, 107, 0.08) !important;
background-color: none !important;
&:hover {
cursor: pointer;
}
}
/* 复制按钮容器和按钮样式 */
div[class*='bg-fd-card']:has(button[aria-label='Copy Text']),
div[class*='bg-fd-card']:has(button[aria-label='Copied Text']) {
right: 26px;
top: 24px;
display: flex;
align-items: center;
justify-content: center;
background-color: #818181;
color: #818181;
border: none;
border-radius: 4px;
background: rgba(0, 0, 0, 0.01);
-webkit-backdrop-filter: blur(5px);
backdrop-filter: blur(5px);
&:hover {
cursor: pointer;
}
}
/* 按钮内部样式 */
button[aria-label='Copy Text'],
button[aria-label='Copied Text'] {
color: #818181;
background-color: transparent;
border: none;
padding: 0;
&:hover {
cursor: pointer;
}
}
button[aria-label='Copy Text'] svg {
display: none;
}
button[aria-label='Copy Text']::before {
content: '';
background-image: url('../public/icons/copy.svg');
width: 26px;
height: 26px;
transition: filter 0.2s ease;
}
/* 鼠标悬停时使复制图标颜色变深 */
button[aria-label='Copy Text']:hover::before {
filter: brightness(0.7); /* 降低亮度使颜色变深 */
}
button[aria-label='Copied Text'] {
width: 26px;
height: 26px;
/* transition: filter 0.2s ease; */
}
button[aria-label='Copied Text'] svg {
width: 20px;
height: 20px;
transition: filter 0.2s ease;
}
#nd-subnav > div:nth-of-type(1) button {
&:hover {
cursor: pointer;
}
}
#nd-subnav > div:nth-of-type(1) {
border-bottom: 0.1px solid #e8ebf0 !important;
}
#nd-subnav > div:nth-of-type(2) {
border-bottom: 0.1px solid #e8ebf0 !important;
height: 100%;
}
.dark #nd-subnav > div:nth-of-type(1) {
border-bottom: 0.1px solid #363b4a58 !important;
}
.dark #nd-subnav > div:nth-of-type(2) {
border-bottom: 0.1px solid #363b4a58 !important;
}
div[data-rmiz-modal-content] {
background-color: none !important;
}
div[data-rmiz-modal-overlay='visible'] {
background-color: #ffffff00 !important;
backdrop-filter: blur(4px);
}
.dark div[data-rmiz-modal-overlay='visible'] {
background-color: #060c1a00 !important;
backdrop-filter: blur(4px);
}
.dark div[data-rmiz-modal-content] {
background-color: #060c1a00 !important;
}
#nd-tocnav {
border-bottom-color: #e8ebf0 !important;
}
.dark #nd-tocnav {
border-bottom-color: #1d2532 !important;
cursor: pointer !important;
}
#nd-subnav > div:nth-of-type(2) a {
text-decoration: none;
color: #485264;
transition: color 0.2s ease;
background-color: transparent !important;
font-weight: 400;
/* 先清除默认下划线 */
&:hover {
text-decoration: underline;
text-decoration-color: #dfe2ea;
text-decoration-thickness: 3px; /* 下划线粗细 */
text-underline-offset: 17px; /* 下划线与文字距离 */
}
&.text-fd-primary {
text-decoration: underline;
text-decoration-color: #3370ff;
text-decoration-thickness: 3px; /* 下划线粗细 */
text-underline-offset: 17px; /* 下划线与文字距离 */
background-color: transparent !important;
font-weight: 600;
color: #111824;
}
}
.dark #nd-subnav > div:nth-of-type(2) a {
color: #ffffff;
}
@theme {
--color-fd-muted: hsl(0, 0%, 96.1%);
--color-fd-popover: hsl(0, 0%, 100%);
--color-fd-popover-foreground: hsl(0, 0%, 15.1%);
--color-fd-card-foreground: hsl(0, 0%, 3.9%);
--color-fd-border: hsl(0, 0%, 89.8%);
--color-fd-primary-foreground: hsl(0, 0%, 98%);
--color-fd-secondary-foreground: hsl(0, 0%, 9%);
--color-fd-accent: hsl(0, 0%, 94.1%);
--color-fd-ring: hsl(0, 0%, 63.9%);
--color-fd-background: hsl(0, 0%, 100%);
--color-fd-card: hsl(0, 0%, 100%);
--color-fd-foreground: hsl(240, 6%, 25%);
--color-fd-muted-foreground: hsl(240, 6%, 50%);
--color-fd-secondary: hsl(240, 6%, 97%);
--color-fd-accent-foreground: hsl(240, 6%, 25%);
--color-fd-primary: hsl(226, 55%, 45%);
}
.dark {
--color-fd-background: #000000;
--color-fd-foreground: hsl(220, 60%, 94.5%);
--color-fd-muted: hsl(220, 50%, 10%);
--color-fd-muted-foreground: #b0b0b0;
--color-fd-popover: hsl(220, 50%, 10%);
--color-fd-popover-foreground: hsl(220, 60%, 94.5%);
--color-fd-card: hsla(220, 56%, 15%, 0.4);
--color-fd-card-foreground: hsl(220, 60%, 94.5%);
--color-fd-border: hsla(220, 50%, 50%, 0.2);
--color-fd-primary: #c2d3ff; /* 文本高亮色 */
--color-fd-primary-foreground: hsl(0, 0%, 9%);
--color-fd-secondary: hsl(220, 50%, 20%);
--color-fd-secondary-foreground: hsl(220, 80%, 90%);
--color-fd-accent: hsl(220, 40%, 20%);
--color-fd-accent-foreground: hsl(220, 80%, 90%);
--color-fd-ring: hsl(205, 100%, 85%);
}
#nd-sidebar {
border-color: transparent;
}
#nd-page > article,
#nd-toc {
padding-top: 2rem;
}
button[data-search-full] {
background-color: var(--color-fd-background);
}
.dark\:text-blue-400:where(.dark, .dark *) {
color: #c2d3ff;
background-color: #434548;
}
.dark div[role='tabpanel'].bg-fd-background {
background-color: #1e1e1e;
}
div[role='tabpanel'].bg-fd-background {
background-color: #f7f7f8;
}
div[role='tabpanel'].bg-fd-background > div > ul {
margin: 0;
display: flex;
flex-direction: column;
gap: 10px;
}
.dark div[role='tabpanel'].bg-fd-background > div > ul {
margin: 0;
background-color: #1e1e1e;
}
div[role='tabpanel'].bg-fd-background > div > ul > li {
margin: 0;
}
button[role='tab'] {
padding-top: 16px;
padding-bottom: 16px;
}
/* 移动端侧边栏左侧 padding 缩小 */
@media (max-width: 767px) {
#nd-sidebar-mobile [data-radix-scroll-area-viewport] {
padding-left: 8px;
padding-right: 8px;
padding-top: 0;
}
/* SidebarHeader 底部 padding */
#nd-sidebar-mobile > div:first-child {
padding-top: 8px;
padding-bottom: 22px;
}
/* 去掉 viewport 内部的顶部渐变遮罩 */
#nd-sidebar-mobile [data-radix-scroll-area-viewport] > div {
mask-image: linear-gradient(
transparent,
#fff 0px,
#fff calc(100% - 12px),
transparent
) !important;
-webkit-mask-image: linear-gradient(
transparent,
#fff 0px,
#fff calc(100% - 12px),
transparent
) !important;
}
}
/* RootToggle 图标容器:缩小到与图标匹配,修复对齐和间距 */
#nd-sidebar .size-9,
#nd-sidebar .size-5,
#nd-sidebar-mobile .size-9,
#nd-sidebar-mobile .size-5,
[data-radix-popper-content-wrapper] .size-9,
[data-radix-popper-content-wrapper] .size-5 {
width: 20px !important;
height: 20px !important;
flex-shrink: 0;
display: flex !important;
align-items: center;
justify-content: center;
}
/* RootToggle sidebar tab selector: remove bottom margin */
#nd-sidebar .mb-2,
#nd-sidebar-mobile .mb-2 {
margin-bottom: 0 !important;
}
/* RootToggle 下拉菜单:增加两侧 padding + 选中项浅蓝背景 */
[data-radix-popper-content-wrapper] > div {
padding: 6px 8px !important;
}
[data-radix-popper-content-wrapper] a {
padding-left: 12px !important;
padding-right: 12px !important;
border-radius: 8px;
display: flex !important;
align-items: center !important;
gap: 8px;
}
/* 移动端目录下拉框(TOC Popover Trigger):文本溢出省略号 */
/* 移动端目录下拉框:文本溢出省略号 */
@media (max-width: 767px) {
button[class*='tocnav'] {
max-width: 100vw;
@@ -564,12 +19,69 @@ button[role='tab'] {
overflow-wrap: break-word;
word-break: break-word;
}
/* RootToggle 图标容器:缩小尺寸,对齐文字 */
#nd-sidebar-mobile [data-radix-popper-anchor] .size-9,
#nd-sidebar-mobile button .size-9 {
width: 20px !important;
height: 20px !important;
flex-shrink: 0;
}
}
/* RootToggle 图标容器:缩小到与图标匹配,修复对齐和间距 */
#nd-sidebar .size-9,
#nd-sidebar .size-5,
#nd-sidebar-mobile .size-9,
#nd-sidebar-mobile .size-5,
[data-radix-popper-content-wrapper] .size-9,
[data-radix-popper-content-wrapper] .size-5 {
flex-shrink: 0;
display: flex !important;
align-items: center;
justify-content: center;
}
#nd-sidebar > div > div,
#nd-sidebar-mobile > div > div {
padding-top: 6px !important;
}
#nd-sidebar > div > button,
#nd-sidebar-mobile > div > button {
height: 38px;
padding: 6px 8px !important;
}
#nd-sidebar-mobile > div > button {
gap: 0;
}
/* 移除导航栏图标的上边距 - 使用通用选择器匹配所有 radix 弹窗 */
[data-radix-popper-content-wrapper] > div > a {
padding: 8px 6px;
height: 38px;
}
[data-radix-popper-content-wrapper] > div > a > div {
margin-top: 0 !important;
}
/* Image zoom modal overlay */
html [data-rmiz-modal-overlay='visible'] {
--color-fd-background: rgba(255, 255, 255, 0.7);
background-color: rgba(255, 255, 255, 0.7) !important;
}
html.dark [data-rmiz-modal-overlay='visible'] {
--color-fd-background: rgba(0, 0, 0, 0.75);
background-color: rgba(0, 0, 0, 0.75) !important;
}
/* Content */
/* img */
#nd-page article img {
object-fit: contain;
display: block;
margin-left: auto;
margin-right: auto;
max-width: 80%;
max-height: 500px;
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
border-radius: 6px;
}
[data-rmiz-modal-img] {
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
border-radius: 6px;
}
+4 -4
View File
@@ -1,5 +1,6 @@
import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared';
import { i18n } from '@/lib/i18n';
import Image from 'next/image';
/**
* Shared layout configurations
@@ -16,10 +17,9 @@ export const baseOptions = (locale: string): BaseLayoutProps => {
},
nav: {
title: (
<div className="flex flex-col">
<div className="flex flex-row items-center gap-2">
<img src="/FastGPT-full.svg" alt="FastGPT" width={49} height={48} />
</div>
<div className="flex flex-row items-center gap-2">
<Image src="/logo.svg" alt="FastGPT" width={30} height={30} />
<span className="font-semibold text-lg">FastGPT</span>
</div>
)
},
+2 -2
View File
@@ -2,8 +2,8 @@
import React from 'react';
const feishuLogoDark: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (
<svg width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
const feishuLogoDark: React.FC<React.SVGProps<SVGSVGElement>> = ({ className, ...props }) => (
<svg {...props} className={className} viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M17 29C21 29 25 26.9339 28 23.4065C36 14 41.4242 16.8166 44 17.9998C38.5 20.9998 40.5 29.6233 33 35.9998C28.382 39.9259 23.4945 41.014 19 41C12.5231 40.9799 6.86226 37.7637 4 35.4063V16.9998"
stroke="#8b9dc1"
+2 -2
View File
@@ -2,8 +2,8 @@
import React from 'react';
const feishuLogoLight: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (
<svg width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
const feishuLogoLight: React.FC<React.SVGProps<SVGSVGElement>> = ({ className, ...props }) => (
<svg {...props} className={className} viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M17 29C21 29 25 26.9339 28 23.4065C36 14 41.4242 16.8166 44 17.9998C38.5 20.9998 40.5 29.6233 33 35.9998C28.382 39.9259 23.4945 41.014 19 41C12.5231 40.9799 6.86226 37.7637 4 35.4063V16.9998"
stroke="#8a8a8a"
+2 -2
View File
@@ -2,8 +2,8 @@
import React from 'react';
const githubLogoLight: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (
<svg width="98" height="98" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 98 98">
const githubLogoLight: React.FC<React.SVGProps<SVGSVGElement>> = ({ className, ...props }) => (
<svg {...props} className={className} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 98 98">
<path
fillRule="evenodd"
clipRule="evenodd"
+2 -2
View File
@@ -2,8 +2,8 @@
import React from 'react';
const githubLogoLight: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (
<svg width="98" height="98" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 98 98">
const githubLogoLight: React.FC<React.SVGProps<SVGSVGElement>> = ({ className, ...props }) => (
<svg {...props} className={className} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 98 98">
<path
fillRule="evenodd"
clipRule="evenodd"
+46
View File
@@ -0,0 +1,46 @@
'use client';
import { useEffect } from 'react';
/**
* 修复侧边栏滚动焦点问题
* 当鼠标从内容区移动到侧边栏时,确保滚动事件作用于侧边栏而不是内容区
*/
export function SidebarScrollFix() {
useEffect(() => {
const handleMouseEnter = (e: MouseEvent) => {
const target = e.currentTarget as HTMLElement;
// 鼠标进入侧边栏时,聚焦到侧边栏的滚动容器
if (target) {
target.focus({ preventScroll: true });
}
};
// 桌面端侧边栏
const sidebar = document.querySelector('#nd-sidebar');
// 移动端侧边栏
const sidebarMobile = document.querySelector('#nd-sidebar-mobile');
if (sidebar) {
sidebar.addEventListener('mouseenter', handleMouseEnter as EventListener);
// 确保侧边栏可以接收焦点
(sidebar as HTMLElement).setAttribute('tabindex', '-1');
}
if (sidebarMobile) {
sidebarMobile.addEventListener('mouseenter', handleMouseEnter as EventListener);
(sidebarMobile as HTMLElement).setAttribute('tabindex', '-1');
}
return () => {
if (sidebar) {
sidebar.removeEventListener('mouseenter', handleMouseEnter as EventListener);
}
if (sidebarMobile) {
sidebarMobile.removeEventListener('mouseenter', handleMouseEnter as EventListener);
}
};
}, []);
return null;
}
+2 -2
View File
@@ -52,7 +52,7 @@
]
},
"engines": {
"node": "20.x",
"pnpm": "9.x"
"node": ">=20.x",
"pnpm": ">=9.x"
}
}
+2 -2
View File
@@ -2,8 +2,8 @@
"name": "@fastgpt/global",
"version": "1.0.0",
"engines": {
"node": "20.x",
"pnpm": "9.x"
"node": ">=20.x",
"pnpm": ">=9.x"
},
"dependencies": {
"@fastgpt-sdk/plugin": "0.3.8",
+2 -2
View File
@@ -3,8 +3,8 @@
"version": "1.0.0",
"type": "module",
"engines": {
"node": "20.x",
"pnpm": "9.x"
"node": ">=20.x",
"pnpm": ">=9.x"
},
"dependencies": {
"@fastgpt-sdk/storage": "catalog:",
+2 -2
View File
@@ -2,8 +2,8 @@
"name": "@fastgpt/web",
"version": "1.0.0",
"engines": {
"node": "20.x",
"pnpm": "9.x"
"node": ">=20.x",
"pnpm": ">=9.x"
},
"dependencies": {
"@chakra-ui/anatomy": "catalog:",
-162
View File
@@ -1,162 +0,0 @@
// 已使用 json5 进行解析,会自动去掉注释,无需手动去除
{
"feConfigs": {
"lafEnv": "https://laf.dev" // laf环境。 https://laf.run (杭州阿里云) ,或者私有化的laf环境。如果使用 Laf openapi 功能,需要最新版的 laf 。
},
"systemEnv": {
"vectorMaxProcess": 15, // 向量处理线程数量
"qaMaxProcess": 15, // 问答拆分线程数量
"tokenWorkers": 30, // Token 计算线程保持数,会持续占用内存,不能设置太大。
"hnswEfSearch": 100 // 向量搜索参数,仅对 PG 和 OB 生效。越大,搜索越精确,但是速度越慢。设置为100,有99%+精度。
},
"llmModels": [
{
"provider": "OpenAI", // 模型提供商,主要用于分类展示,目前已经内置提供商包括:https://github.com/labring/FastGPT/blob/main/packages/global/core/ai/provider.ts, 可 pr 提供新的提供商,或直接填写 Other
"model": "gpt-5", // 模型名(对应OneAPI中渠道的模型名)
"name": "gpt-5", // 模型别名
"maxContext": 128000, // 最大上下文
"maxResponse": 16000, // 最大回复
"quoteMaxToken": 120000, // 最大引用内容
"maxTemperature": 1.2, // 最大温度
"charsPointsPrice": 0, // n积分/1k token(商业版)
"censor": false, // 是否开启敏感校验(商业版)
"vision": true, // 是否支持图片输入
"datasetProcess": true, // 是否设置为文本理解模型(QA),务必保证至少有一个为true,否则知识库会报错
"usedInClassify": true, // 是否用于问题分类(务必保证至少有一个为true)
"usedInExtractFields": true, // 是否用于内容提取(务必保证至少有一个为true)
"usedInToolCall": true, // 是否用于工具调用(务必保证至少有一个为true)
"toolChoice": true, // 是否支持工具选择(分类,内容提取,工具调用会用到。)
"functionCall": false, // 是否支持函数调用(分类,内容提取,工具调用会用到。会优先使用 toolChoice,如果为false,则使用 functionCall,如果仍为 false,则使用提示词模式) // 自定义文本分类提示词(不支持工具和函数调用的模型 // 自定义内容提取提示词
"defaultSystemChatPrompt": "", // 对话默认携带的系统提示词
"defaultConfig": {}, // 请求API时,挟带一些默认配置(比如 GLM4 的 top_p
"fieldMap": {} // 字段映射(o1 模型需要把 max_tokens 映射为 max_completion_tokens
},
{
"provider": "OpenAI",
"model": "gpt-4o",
"name": "gpt-4o",
"maxContext": 128000,
"maxResponse": 4000,
"quoteMaxToken": 120000,
"maxTemperature": 1.2,
"charsPointsPrice": 0,
"censor": false,
"vision": true,
"datasetProcess": true,
"usedInClassify": true,
"usedInExtractFields": true,
"usedInToolCall": true,
"toolChoice": true,
"functionCall": false,
"defaultSystemChatPrompt": "",
"defaultConfig": {},
"fieldMap": {}
},
{
"provider": "OpenAI",
"model": "o1-mini",
"name": "o1-mini",
"maxContext": 128000,
"maxResponse": 65000,
"quoteMaxToken": 120000,
"maxTemperature": 1.2,
"charsPointsPrice": 0,
"censor": false,
"vision": false,
"datasetProcess": true,
"usedInClassify": true,
"usedInExtractFields": true,
"usedInToolCall": true,
"toolChoice": false,
"functionCall": false,
"defaultSystemChatPrompt": "",
"defaultConfig": {
"temperature": 1,
"max_tokens": null,
"stream": false
}
},
{
"provider": "OpenAI",
"model": "o1-preview",
"name": "o1-preview",
"maxContext": 128000,
"maxResponse": 32000,
"quoteMaxToken": 120000,
"maxTemperature": 1.2,
"charsPointsPrice": 0,
"censor": false,
"vision": false,
"datasetProcess": true,
"usedInClassify": true,
"usedInExtractFields": true,
"usedInToolCall": true,
"toolChoice": false,
"functionCall": false,
"defaultSystemChatPrompt": "",
"defaultConfig": {
"temperature": 1,
"max_tokens": null,
"stream": false
}
}
],
"vectorModels": [
{
"provider": "OpenAI",
"model": "text-embedding-3-small",
"name": "text-embedding-3-small",
"charsPointsPrice": 0,
"defaultToken": 512,
"maxToken": 3000,
"weight": 100
},
{
"provider": "OpenAI",
"model": "text-embedding-3-large",
"name": "text-embedding-3-large",
"charsPointsPrice": 0,
"defaultToken": 512,
"maxToken": 3000,
"weight": 100,
"defaultConfig": {
"dimensions": 1024
}
},
{
"provider": "OpenAI",
"model": "text-embedding-ada-002", // 模型名(与OneAPI对应)
"name": "Embedding-2", // 模型展示名
"charsPointsPrice": 0, // n积分/1k token
"defaultToken": 700, // 默认文本分割时候的 token
"maxToken": 3000, // 最大 token
"weight": 100, // 优先训练权重
"defaultConfig": {}, // 自定义额外参数。例如,如果希望使用 embedding3-large 的话,可以传入 dimensions:1024,来返回1024维度的向量。(目前必须小于1536维度)
"dbConfig": {}, // 存储时的额外参数(非对称向量模型时候需要用到)
"queryConfig": {} // 参训时的额外参数
}
],
"reRankModels": [],
"audioSpeechModels": [
{
"provider": "OpenAI",
"model": "tts-1",
"name": "OpenAI TTS1",
"charsPointsPrice": 0,
"voices": [
{ "label": "Alloy", "value": "alloy", "bufferId": "openai-Alloy" },
{ "label": "Echo", "value": "echo", "bufferId": "openai-Echo" },
{ "label": "Fable", "value": "fable", "bufferId": "openai-Fable" },
{ "label": "Onyx", "value": "onyx", "bufferId": "openai-Onyx" },
{ "label": "Nova", "value": "nova", "bufferId": "openai-Nova" },
{ "label": "Shimmer", "value": "shimmer", "bufferId": "openai-Shimmer" }
]
}
],
"whisperModel": {
"provider": "OpenAI",
"model": "whisper-1",
"name": "Whisper1",
"charsPointsPrice": 0
}
}
+2 -2
View File
@@ -11,8 +11,8 @@
"build:workers:watch": "npx tsx scripts/build-workers.ts --watch"
},
"engines": {
"node": "20.x",
"pnpm": "9.x"
"node": ">=20.x",
"pnpm": ">=9.x"
},
"dependencies": {
"@chakra-ui/anatomy": "catalog:",
+2 -2
View File
@@ -9,8 +9,8 @@
"lint": "next lint"
},
"engines": {
"node": "20.x",
"pnpm": "9.x"
"node": ">=20.x",
"pnpm": ">=9.x"
},
"dependencies": {
"@chakra-ui/anatomy": "catalog:",
+2 -2
View File
@@ -14,8 +14,8 @@
"mcp_test": "npx @modelcontextprotocol/inspector"
},
"engines": {
"node": "20.x",
"pnpm": "9.x"
"node": ">=20.x",
"pnpm": ">=9.x"
},
"dependencies": {
"@fastgpt/global": "workspace:*",
+2 -2
View File
@@ -12,8 +12,8 @@
"test:watch": "vitest"
},
"engines": {
"node": "20.x",
"pnpm": "9.x"
"node": ">=20.x",
"pnpm": ">=9.x"
},
"dependencies": {
"axios": "^1.7.9",