Skip to content
Closed

error #5385

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
173 changes: 173 additions & 0 deletions change.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
diff --git a/web/classic/src/hooks/common/useNavigation.js b/web/classic/src/hooks/common/useNavigation.js
index f7e61a20..c2a64b01 100644
--- a/web/classic/src/hooks/common/useNavigation.js
+++ b/web/classic/src/hooks/common/useNavigation.js
@@ -49,16 +49,16 @@ export const useNavigation = (t, docsLink, headerNavModules) => {
itemKey: 'pricing',
to: '/pricing',
},
- ...(docsLink
- ? [
- {
- text: t('文档'),
- itemKey: 'docs',
- isExternal: true,
- externalLink: docsLink,
- },
- ]
- : []),
+ // ...(docsLink
+ // ? [
+ // {
+ // text: t('文档'),
+ // itemKey: 'docs',
+ // isExternal: true,
+ // externalLink: docsLink,
+ // },
+ // ]
+ // : []),
{
text: t('关于'),
itemKey: 'about',
diff --git a/web/classic/src/pages/Home/index.jsx b/web/classic/src/pages/Home/index.jsx
index c153c1b3..0aa93b11 100644
--- a/web/classic/src/pages/Home/index.jsx
+++ b/web/classic/src/pages/Home/index.jsx
@@ -239,16 +239,17 @@ const Home = () => {
{statusState.status.version}
</Button>
) : (
- docsLink && (
- <Button
- size={isMobile ? 'default' : 'large'}
- className='flex items-center !rounded-3xl px-6 py-2'
- icon={<IconFile />}
- onClick={() => window.open(docsLink, '_blank')}
- >
- {t('文档')}
- </Button>
- )
+ // docsLink && (
+ // <Button
+ // size={isMobile ? 'default' : 'large'}
+ // className='flex items-center !rounded-3xl px-6 py-2'
+ // icon={<IconFile />}
+ // onClick={() => window.open(docsLink, '_blank')}
+ // >
+ // {t('文档')}
+ // </Button>
+ null
+ // )
)}
</div>

diff --git a/web/classic/src/pages/Setting/Operation/SettingsHeaderNavModules.jsx b/web/classic/src/pages/Setting/Operation/SettingsHeaderNavModules.jsx
index 19943c1a..5c061ef2 100644
--- a/web/classic/src/pages/Setting/Operation/SettingsHeaderNavModules.jsx
+++ b/web/classic/src/pages/Setting/Operation/SettingsHeaderNavModules.jsx
@@ -178,11 +178,11 @@ export default function SettingsHeaderNavModules(props) {
description: t('模型定价,需要登录访问'),
hasSubConfig: true, // 标识该模块有子配置
},
- {
- key: 'docs',
- title: t('文档'),
- description: t('系统文档和帮助信息'),
- },
+ // {
+ // key: 'docs',
+ // title: t('文档'),
+ // description: t('系统文档和帮助信息'),
+ // },
{
key: 'about',
title: t('关于'),
diff --git a/web/default/src/components/layout/components/public-header.tsx b/web/default/src/components/layout/components/public-header.tsx
index 476cddbd..f82b01ac 100644
--- a/web/default/src/components/layout/components/public-header.tsx
+++ b/web/default/src/components/layout/components/public-header.tsx
@@ -123,7 +123,7 @@ export function PublicHeader(props: PublicHeaderProps) {

{/* Desktop nav */}
<div className='hidden items-center gap-0.5 sm:flex'>
- {links.map((link, i) => {
+ {links.filter(link => t(link.title) !== '文档').map((link, i) => {
const isActive = pathname === link.href
if (link.external) {
return (
diff --git a/web/default/src/features/home/components/sections/stats.tsx b/web/default/src/features/home/components/sections/stats.tsx
index 33e1b9d4..5bcd086d 100644
--- a/web/default/src/features/home/components/sections/stats.tsx
+++ b/web/default/src/features/home/components/sections/stats.tsx
@@ -79,25 +79,27 @@ export function Stats(_props: StatsProps) {
{ end: 10, suffix: 'K+', label: t('active routes') },
]

- return (
- <div className='border-border/50 bg-background/60 relative z-10 border-y backdrop-blur'>
- <div className='mx-auto max-w-6xl px-6 py-10 md:py-12'>
- <div className='grid grid-cols-2 gap-8 md:grid-cols-4 md:gap-12'>
- {stats.map((s) => (
- <div
- key={s.label}
- className='flex flex-col items-center rounded-lg px-3 py-2 text-center'
- >
- <span className='text-primary text-2xl font-bold tracking-tight md:text-3xl'>
- <Counter end={s.end} suffix={s.suffix} decimals={s.decimals} />
- </span>
- <span className='text-muted-foreground mt-1.5 text-xs'>
- {s.label}
- </span>
- </div>
- ))}
- </div>
- </div>
- </div>
- )
+ // return (
+ // <div className='border-border/50 bg-background/60 relative z-10 border-y backdrop-blur'>
+ // <div className='mx-auto max-w-6xl px-6 py-10 md:py-12'>
+ // <div className='grid grid-cols-2 gap-8 md:grid-cols-4 md:gap-12'>
+ // {stats.map((s) => (
+ // <div
+ // key={s.label}
+ // className='flex flex-col items-center rounded-lg px-3 py-2 text-center'
+ // >
+ // <span className='text-primary text-2xl font-bold tracking-tight md:text-3xl'>
+ // <Counter end={s.end} suffix={s.suffix} decimals={s.decimals} />
+ // </span>
+ // <span className='text-muted-foreground mt-1.5 text-xs'>
+ // {s.label}
+ // </span>
+ // </div>
+ // ))}
+ // </div>
+ // </div>
+ // </div>
+ // )
+
+ return '';
}
diff --git a/web/default/src/hooks/use-top-nav-links.ts b/web/default/src/hooks/use-top-nav-links.ts
index dfbd8844..2db4b0c0 100644
--- a/web/default/src/hooks/use-top-nav-links.ts
+++ b/web/default/src/hooks/use-top-nav-links.ts
@@ -77,15 +77,15 @@ export function useTopNavLinks(): TopNavLink[] {
// Docs (supports external links)
if (modules?.docs !== false) {
if (docsLink) {
- links.push({ title: t('Docs'), href: docsLink, external: true })
+ // links.push({ title: t('Docs'), href: docsLink, external: true })
} else {
- links.push({ title: t('Docs'), href: '/docs' })
+ // links.push({ title: t('Docs'), href: '/docs' })
}
}

// About
if (modules?.about !== false) {
- links.push({ title: t('About'), href: '/about' })
+ // links.push({ title: t('About'), href: '/about' })
}

return links
2 changes: 1 addition & 1 deletion controller/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func GetStatus(c *gin.Context) {
"turnstile_check": common.TurnstileCheckEnabled,
"turnstile_site_key": common.TurnstileSiteKey,
"top_up_link": common.TopUpLink,
"docs_link": operation_setting.GetGeneralSetting().DocsLink,
// "docs_link": operation_setting.GetGeneralSetting().DocsLink,
"quota_per_unit": common.QuotaPerUnit,
// 兼容旧前端:保留 display_in_currency,同时提供新的 quota_display_type
"display_in_currency": operation_setting.IsCurrencyDisplay(),
Expand Down
4 changes: 2 additions & 2 deletions setting/operation_setting/general_setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const (
)

type GeneralSetting struct {
DocsLink string `json:"docs_link"`
// DocsLink string `json:"docs_link"`
PingIntervalEnabled bool `json:"ping_interval_enabled"`
PingIntervalSeconds int `json:"ping_interval_seconds"`
// 当前站点额度展示类型:USD / CNY / TOKENS
Expand All @@ -24,7 +24,7 @@ type GeneralSetting struct {

// 默认配置
var generalSetting = GeneralSetting{
DocsLink: "https://docs.newapi.pro",
// DocsLink: "https://docs.newapi.pro",
PingIntervalEnabled: false,
PingIntervalSeconds: 60,
QuotaDisplayType: QuotaDisplayTypeUSD,
Expand Down
1 change: 1 addition & 0 deletions web/classic/bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions web/classic/src/components/common/DocumentRenderer/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ const sanitizeHtml = (html) => {
* @param {string} emptyMessage - 空内容时的提示消息
*/
const DocumentRenderer = ({ apiEndpoint, title, cacheKey, emptyMessage }) => {
return null;
/* eslint-disable no-unreachable */
const { t } = useTranslation();
const [content, setContent] = useState('');
const [loading, setLoading] = useState(true);
Expand Down
4 changes: 2 additions & 2 deletions web/classic/src/components/layout/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const FooterBar = () => {
</div>
</div>

<div className='text-left'>
{/* <div className='text-left'>
<p className='!text-semi-color-text-0 font-semibold mb-5'>
{t('文档')}
</p>
Expand Down Expand Up @@ -119,7 +119,7 @@ const FooterBar = () => {
{t('API 文档')}
</a>
</div>
</div>
</div> */}

<div className='text-left'>
<p className='!text-semi-color-text-0 font-semibold mb-5'>
Expand Down
2 changes: 1 addition & 1 deletion web/classic/src/components/settings/OperationSetting.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const OperationSetting = () => {

/* 通用设置 */
TopUpLink: '',
'general_setting.docs_link': '',
// 'general_setting.docs_link': '',
QuotaPerUnit: 0,
USDExchangeRate: 0,
RetryTimes: 0,
Expand Down
10 changes: 5 additions & 5 deletions web/classic/src/helpers/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ export function setStatusData(data) {
} else {
localStorage.removeItem('chat_link2');
}
if (data.docs_link) {
localStorage.setItem('docs_link', data.docs_link);
} else {
localStorage.removeItem('docs_link');
}
// if (data.docs_link) {
// localStorage.setItem('docs_link', data.docs_link);
// } else {
// localStorage.removeItem('docs_link');
// }
}

export function setUserData(data) {
Expand Down
3 changes: 2 additions & 1 deletion web/classic/src/hooks/common/useHeaderBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ export const useHeaderBar = ({ onMobileMenuToggle, drawerOpen }) => {
const isNewYear = currentDate.getMonth() === 0 && currentDate.getDate() === 1;

const isSelfUseMode = statusState?.status?.self_use_mode_enabled || false;
const docsLink = statusState?.status?.docs_link || '';
// const docsLink = statusState?.status?.docs_link || '';
const docsLink = '';
const isDemoSiteMode = statusState?.status?.demo_site_enabled || false;

// 获取顶栏模块配置
Expand Down
28 changes: 14 additions & 14 deletions web/classic/src/hooks/common/useNavigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const useNavigation = (t, docsLink, headerNavModules) => {
home: true,
console: true,
pricing: true,
docs: true,
// docs: true,
about: true,
};

Expand All @@ -49,16 +49,16 @@ export const useNavigation = (t, docsLink, headerNavModules) => {
itemKey: 'pricing',
to: '/pricing',
},
...(docsLink
? [
{
text: t('文档'),
itemKey: 'docs',
isExternal: true,
externalLink: docsLink,
},
]
: []),
// ...(docsLink
// ? [
// {
// text: t('文档'),
// itemKey: 'docs',
// isExternal: true,
// externalLink: docsLink,
// },
// ]
// : []),
{
text: t('关于'),
itemKey: 'about',
Expand All @@ -68,9 +68,9 @@ export const useNavigation = (t, docsLink, headerNavModules) => {

// 根据配置过滤导航链接
return allLinks.filter((link) => {
if (link.itemKey === 'docs') {
return docsLink && modules.docs;
}
// if (link.itemKey === 'docs') {
// return docsLink && modules.docs;
// }
if (link.itemKey === 'pricing') {
// 支持新的pricing配置格式
return typeof modules.pricing === 'object'
Expand Down
23 changes: 12 additions & 11 deletions web/classic/src/pages/Home/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const Home = () => {
const [noticeVisible, setNoticeVisible] = useState(false);
const isMobile = useIsMobile();
const isDemoSiteMode = statusState?.status?.demo_site_enabled || false;
const docsLink = statusState?.status?.docs_link || '';
// const docsLink = statusState?.status?.docs_link || '';
const serverAddress =
statusState?.status?.server_address || `${window.location.origin}`;
const endpointItems = API_ENDPOINTS.map((e) => ({ value: e }));
Expand Down Expand Up @@ -239,16 +239,17 @@ const Home = () => {
{statusState.status.version}
</Button>
) : (
docsLink && (
<Button
size={isMobile ? 'default' : 'large'}
className='flex items-center !rounded-3xl px-6 py-2'
icon={<IconFile />}
onClick={() => window.open(docsLink, '_blank')}
>
{t('文档')}
</Button>
)
// docsLink && (
// <Button
// size={isMobile ? 'default' : 'large'}
// className='flex items-center !rounded-3xl px-6 py-2'
// icon={<IconFile />}
// onClick={() => window.open(docsLink, '_blank')}
// >
// {t('文档')}
// </Button>
null
// )
)}
</div>

Expand Down
25 changes: 13 additions & 12 deletions web/classic/src/pages/PrivacyPolicy/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,21 @@ For commercial licensing, please contact support@quantumnous.com
*/

import React from 'react';
import { useTranslation } from 'react-i18next';
import DocumentRenderer from '../../components/common/DocumentRenderer';
// import { useTranslation } from 'react-i18next';
// import DocumentRenderer from '../../components/common/DocumentRenderer';

const PrivacyPolicy = () => {
const { t } = useTranslation();

return (
<DocumentRenderer
apiEndpoint='/api/privacy-policy'
title={t('隐私政策')}
cacheKey='privacy_policy'
emptyMessage={t('加载隐私政策内容失败...')}
/>
);
// const { t } = useTranslation();

return null;
// return (
// <DocumentRenderer
// apiEndpoint='/api/privacy-policy'
// title={t('隐私政策')}
// cacheKey='privacy_policy'
// emptyMessage={t('加载隐私政策内容失败...')}
// />
// );
};

export default PrivacyPolicy;
Loading
Loading