@lobehub/lobehub 2.0.0-next.332 → 2.0.0-next.334
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +60 -0
- package/apps/desktop/src/main/const/dir.ts +3 -0
- package/apps/desktop/src/main/controllers/SystemCtr.ts +19 -0
- package/apps/desktop/src/main/controllers/__tests__/SystemCtr.test.ts +1 -0
- package/apps/desktop/src/main/menus/impls/macOS.test.ts +1 -0
- package/changelog/v1.json +21 -0
- package/docs/changelog/2023-09-09-plugin-system.mdx +3 -2
- package/docs/changelog/2023-11-14-gpt4-vision.mdx +6 -4
- package/docs/changelog/2023-11-19-tts-stt.mdx +3 -2
- package/docs/changelog/2023-12-22-dalle-3.mdx +5 -2
- package/docs/changelog/2023-12-22-dalle-3.zh-CN.mdx +2 -2
- package/docs/changelog/2024-02-08-sso-oauth.mdx +2 -2
- package/docs/changelog/2024-06-19-lobe-chat-v1.mdx +3 -2
- package/docs/changelog/2024-06-19-lobe-chat-v1.zh-CN.mdx +2 -2
- package/docs/changelog/2024-07-19-gpt-4o-mini.mdx +3 -2
- package/docs/changelog/2024-07-19-gpt-4o-mini.zh-CN.mdx +2 -2
- package/docs/changelog/2024-08-02-lobe-chat-database-docker.mdx +3 -2
- package/docs/changelog/2024-08-21-file-upload-and-knowledge-base.mdx +5 -4
- package/docs/changelog/2024-09-13-openai-o1-models.mdx +2 -2
- package/docs/changelog/2024-09-20-artifacts.mdx +3 -2
- package/docs/changelog/2024-09-20-artifacts.zh-CN.mdx +2 -2
- package/docs/changelog/2024-10-27-pin-assistant.mdx +3 -2
- package/docs/changelog/2024-11-06-share-text-json.mdx +4 -2
- package/docs/changelog/2024-11-06-share-text-json.zh-CN.mdx +2 -2
- package/docs/changelog/2024-11-25-november-providers.mdx +2 -2
- package/docs/changelog/2024-11-27-forkable-chat.mdx +2 -2
- package/docs/changelog/2025-01-03-user-profile.mdx +2 -2
- package/docs/changelog/2025-01-22-new-ai-provider.mdx +2 -2
- package/docs/changelog/2025-02-02-deepseek-r1.mdx +4 -4
- package/docs/development/basic/add-new-authentication-providers.mdx +4 -0
- package/docs/development/basic/add-new-authentication-providers.zh-CN.mdx +4 -0
- package/docs/development/basic/add-new-image-model.mdx +4 -0
- package/docs/development/basic/add-new-image-model.zh-CN.mdx +4 -0
- package/docs/development/basic/architecture.mdx +4 -0
- package/docs/development/basic/architecture.zh-CN.mdx +4 -0
- package/docs/development/basic/chat-api.mdx +4 -0
- package/docs/development/basic/chat-api.zh-CN.mdx +4 -0
- package/docs/development/basic/comfyui-development.mdx +3 -1
- package/docs/development/basic/contributing-guidelines.mdx +4 -0
- package/docs/development/basic/contributing-guidelines.zh-CN.mdx +4 -0
- package/docs/development/basic/feature-development-frontend.mdx +11 -3
- package/docs/development/basic/feature-development-frontend.zh-CN.mdx +11 -3
- package/docs/development/basic/feature-development.mdx +14 -5
- package/docs/development/basic/feature-development.zh-CN.mdx +14 -5
- package/docs/development/basic/folder-structure.mdx +7 -0
- package/docs/development/basic/folder-structure.zh-CN.mdx +7 -0
- package/docs/development/basic/resources.mdx +4 -0
- package/docs/development/basic/resources.zh-CN.mdx +4 -0
- package/docs/development/basic/setup-development.mdx +4 -0
- package/docs/development/basic/setup-development.zh-CN.mdx +4 -0
- package/docs/development/basic/test.mdx +4 -0
- package/docs/development/basic/test.zh-CN.mdx +4 -0
- package/docs/development/basic/work-with-server-side-database.mdx +5 -5
- package/docs/development/basic/work-with-server-side-database.zh-CN.mdx +5 -5
- package/docs/development/internationalization/add-new-locale.mdx +4 -0
- package/docs/development/internationalization/add-new-locale.zh-CN.mdx +4 -0
- package/docs/development/internationalization/internationalization-implementation.mdx +4 -0
- package/docs/development/internationalization/internationalization-implementation.zh-CN.mdx +4 -0
- package/docs/development/others/lighthouse.mdx +4 -0
- package/docs/development/others/lighthouse.zh-CN.mdx +4 -0
- package/docs/development/start.mdx +4 -0
- package/docs/development/start.zh-CN.mdx +4 -0
- package/docs/development/state-management/state-management-intro.mdx +4 -2
- package/docs/development/state-management/state-management-intro.zh-CN.mdx +4 -2
- package/docs/development/state-management/state-management-selectors.mdx +6 -1
- package/docs/development/state-management/state-management-selectors.zh-CN.mdx +6 -1
- package/docs/development/tests/integration-testing.zh-CN.mdx +4 -0
- package/docs/self-hosting/advanced/analytics.mdx +2 -2
- package/docs/self-hosting/advanced/auth/better-auth/apple.mdx +132 -0
- package/docs/self-hosting/advanced/auth/better-auth/apple.zh-CN.mdx +127 -0
- package/docs/self-hosting/advanced/auth/better-auth/auth0.mdx +111 -0
- package/docs/self-hosting/advanced/auth/better-auth/auth0.zh-CN.mdx +107 -0
- package/docs/self-hosting/advanced/auth/better-auth/authelia.mdx +66 -0
- package/docs/self-hosting/advanced/auth/better-auth/authelia.zh-CN.mdx +62 -0
- package/docs/self-hosting/advanced/auth/better-auth/authentik.mdx +67 -0
- package/docs/self-hosting/advanced/auth/better-auth/authentik.zh-CN.mdx +63 -0
- package/docs/self-hosting/advanced/auth/better-auth/casdoor.mdx +62 -0
- package/docs/self-hosting/advanced/auth/better-auth/casdoor.zh-CN.mdx +58 -0
- package/docs/self-hosting/advanced/auth/better-auth/cloudflare-zero-trust.mdx +59 -0
- package/docs/self-hosting/advanced/auth/better-auth/cloudflare-zero-trust.zh-CN.mdx +55 -0
- package/docs/self-hosting/advanced/auth/better-auth/cognito.mdx +88 -0
- package/docs/self-hosting/advanced/auth/better-auth/cognito.zh-CN.mdx +85 -0
- package/docs/self-hosting/advanced/auth/better-auth/feishu.mdx +73 -0
- package/docs/self-hosting/advanced/auth/better-auth/feishu.zh-CN.mdx +69 -0
- package/docs/self-hosting/advanced/auth/better-auth/generic-oidc.mdx +86 -0
- package/docs/self-hosting/advanced/auth/better-auth/generic-oidc.zh-CN.mdx +83 -0
- package/docs/self-hosting/advanced/auth/better-auth/github.mdx +93 -0
- package/docs/self-hosting/advanced/auth/better-auth/github.zh-CN.mdx +90 -0
- package/docs/self-hosting/advanced/auth/better-auth/google.mdx +80 -0
- package/docs/self-hosting/advanced/auth/better-auth/google.zh-CN.mdx +77 -0
- package/docs/self-hosting/advanced/auth/better-auth/keycloak.mdx +77 -0
- package/docs/self-hosting/advanced/auth/better-auth/keycloak.zh-CN.mdx +74 -0
- package/docs/self-hosting/advanced/auth/better-auth/logto.mdx +64 -0
- package/docs/self-hosting/advanced/auth/better-auth/logto.zh-CN.mdx +60 -0
- package/docs/self-hosting/advanced/auth/better-auth/microsoft.mdx +113 -0
- package/docs/self-hosting/advanced/auth/better-auth/microsoft.zh-CN.mdx +109 -0
- package/docs/self-hosting/advanced/auth/better-auth/okta.mdx +67 -0
- package/docs/self-hosting/advanced/auth/better-auth/okta.zh-CN.mdx +63 -0
- package/docs/self-hosting/advanced/auth/better-auth/wechat.mdx +77 -0
- package/docs/self-hosting/advanced/auth/better-auth/wechat.zh-CN.mdx +72 -0
- package/docs/self-hosting/advanced/auth/better-auth/zitadel.mdx +73 -0
- package/docs/self-hosting/advanced/auth/better-auth/zitadel.zh-CN.mdx +69 -0
- package/docs/self-hosting/advanced/auth/clerk.mdx +2 -2
- package/docs/self-hosting/advanced/auth/legacy.mdx +106 -0
- package/docs/self-hosting/advanced/auth/legacy.zh-CN.mdx +101 -0
- package/docs/self-hosting/advanced/auth/next-auth/auth0.mdx +3 -2
- package/docs/self-hosting/advanced/auth/next-auth/authelia.mdx +3 -2
- package/docs/self-hosting/advanced/auth/next-auth/authentik.mdx +3 -2
- package/docs/self-hosting/advanced/auth/next-auth/casdoor.mdx +5 -2
- package/docs/self-hosting/advanced/auth/next-auth/casdoor.zh-CN.mdx +2 -0
- package/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.mdx +3 -2
- package/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.zh-CN.mdx +2 -2
- package/docs/self-hosting/advanced/auth/next-auth/github.mdx +3 -2
- package/docs/self-hosting/advanced/auth/next-auth/google.mdx +10 -12
- package/docs/self-hosting/advanced/auth/next-auth/keycloak.mdx +3 -2
- package/docs/self-hosting/advanced/auth/next-auth/logto.mdx +2 -2
- package/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.mdx +3 -2
- package/docs/self-hosting/advanced/auth/next-auth/okta.mdx +3 -2
- package/docs/self-hosting/advanced/auth/next-auth/okta.zh-CN.mdx +1 -3
- package/docs/self-hosting/advanced/auth/next-auth/wechat.mdx +2 -2
- package/docs/self-hosting/advanced/auth/next-auth/zitadel.mdx +3 -2
- package/docs/self-hosting/advanced/auth.mdx +86 -139
- package/docs/self-hosting/advanced/auth.zh-CN.mdx +84 -135
- package/docs/self-hosting/advanced/desktop.mdx +9 -3
- package/docs/self-hosting/advanced/desktop.zh-CN.mdx +9 -3
- package/docs/self-hosting/advanced/feature-flags.mdx +3 -2
- package/docs/self-hosting/advanced/knowledge-base.mdx +2 -2
- package/docs/self-hosting/advanced/model-list.mdx +2 -2
- package/docs/self-hosting/advanced/observability/grafana.mdx +4 -2
- package/docs/self-hosting/advanced/observability/grafana.zh-CN.mdx +2 -1
- package/docs/self-hosting/advanced/observability/langfuse.mdx +3 -2
- package/docs/self-hosting/advanced/online-search.mdx +4 -6
- package/docs/self-hosting/advanced/s3/tencent-cloud.mdx +2 -2
- package/docs/self-hosting/advanced/settings-url-share.mdx +3 -2
- package/docs/self-hosting/advanced/upstream-sync.mdx +3 -4
- package/docs/self-hosting/advanced/upstream-sync.zh-CN.mdx +0 -2
- package/docs/self-hosting/environment-variables/analytics.mdx +3 -2
- package/docs/self-hosting/environment-variables/auth.mdx +5 -12
- package/docs/self-hosting/environment-variables/auth.zh-CN.mdx +2 -9
- package/docs/self-hosting/environment-variables/basic.mdx +3 -10
- package/docs/self-hosting/environment-variables/basic.zh-CN.mdx +0 -7
- package/docs/self-hosting/environment-variables/model-provider.mdx +3 -4
- package/docs/self-hosting/environment-variables/s3.mdx +2 -2
- package/docs/self-hosting/environment-variables.mdx +2 -3
- package/docs/self-hosting/examples/azure-openai.mdx +2 -3
- package/docs/self-hosting/examples/azure-openai.zh-CN.mdx +0 -1
- package/docs/self-hosting/examples/ollama.mdx +3 -2
- package/docs/self-hosting/faq/no-v1-suffix.mdx +4 -4
- package/docs/self-hosting/faq/proxy-with-unable-to-verify-leaf-signature.mdx +3 -2
- package/docs/self-hosting/faq/vercel-ai-image-timeout.mdx +2 -2
- package/docs/self-hosting/migration/v2/breaking-changes.mdx +73 -0
- package/docs/self-hosting/migration/v2/breaking-changes.zh-CN.mdx +71 -0
- package/docs/self-hosting/platform/alibaba-cloud.mdx +2 -7
- package/docs/self-hosting/platform/alibaba-cloud.zh-CN.mdx +1 -6
- package/docs/self-hosting/platform/btpanel.mdx +4 -2
- package/docs/self-hosting/platform/btpanel.zh-CN.mdx +2 -2
- package/docs/self-hosting/platform/docker-compose.mdx +3 -3
- package/docs/self-hosting/platform/docker-compose.zh-CN.mdx +0 -1
- package/docs/self-hosting/platform/docker.mdx +2 -11
- package/docs/self-hosting/platform/docker.zh-CN.mdx +0 -8
- package/docs/self-hosting/platform/netlify.mdx +5 -17
- package/docs/self-hosting/platform/netlify.zh-CN.mdx +3 -17
- package/docs/self-hosting/platform/railway.mdx +3 -7
- package/docs/self-hosting/platform/railway.zh-CN.mdx +1 -7
- package/docs/self-hosting/platform/repocloud.mdx +3 -7
- package/docs/self-hosting/platform/repocloud.zh-CN.mdx +1 -6
- package/docs/self-hosting/platform/sealos.mdx +2 -7
- package/docs/self-hosting/platform/sealos.zh-CN.mdx +1 -6
- package/docs/self-hosting/platform/tencentcloud-lighthouse.mdx +2 -7
- package/docs/self-hosting/platform/tencentcloud-lighthouse.zh-CN.mdx +1 -6
- package/docs/self-hosting/platform/vercel.mdx +4 -9
- package/docs/self-hosting/platform/vercel.zh-CN.mdx +3 -8
- package/docs/self-hosting/platform/zeabur.mdx +2 -11
- package/docs/self-hosting/platform/zeabur.zh-CN.mdx +1 -10
- package/docs/self-hosting/server-database/docker-compose.mdx +11 -19
- package/docs/self-hosting/server-database/docker-compose.zh-CN.mdx +12 -21
- package/docs/self-hosting/server-database/docker.mdx +9 -24
- package/docs/self-hosting/server-database/docker.zh-CN.mdx +7 -24
- package/docs/self-hosting/server-database/dokploy.mdx +27 -25
- package/docs/self-hosting/server-database/dokploy.zh-CN.mdx +23 -21
- package/docs/self-hosting/server-database/netlify.mdx +2 -2
- package/docs/self-hosting/server-database/netlify.zh-CN.mdx +2 -2
- package/docs/self-hosting/server-database/railway.mdx +2 -2
- package/docs/self-hosting/server-database/repocloud.mdx +2 -2
- package/docs/self-hosting/server-database/sealos.mdx +2 -2
- package/docs/self-hosting/server-database/vercel.mdx +19 -72
- package/docs/self-hosting/server-database/vercel.zh-CN.mdx +17 -68
- package/docs/self-hosting/server-database/zeabur.mdx +2 -2
- package/docs/self-hosting/server-database.mdx +1 -19
- package/docs/self-hosting/server-database.zh-CN.mdx +0 -17
- package/docs/self-hosting/start.mdx +2 -2
- package/docs/self-hosting/start.zh-CN.mdx +2 -2
- package/locales/ar/common.json +1 -0
- package/locales/bg-BG/common.json +1 -0
- package/locales/de-DE/common.json +1 -0
- package/locales/en-US/common.json +1 -0
- package/locales/en-US/desktop-onboarding.json +1 -0
- package/locales/es-ES/common.json +1 -0
- package/locales/fa-IR/common.json +1 -0
- package/locales/fr-FR/common.json +1 -0
- package/locales/it-IT/common.json +1 -0
- package/locales/ja-JP/common.json +1 -0
- package/locales/ko-KR/common.json +1 -0
- package/locales/nl-NL/common.json +1 -0
- package/locales/pl-PL/common.json +1 -0
- package/locales/pt-BR/common.json +1 -0
- package/locales/ru-RU/common.json +1 -0
- package/locales/tr-TR/common.json +1 -0
- package/locales/vi-VN/common.json +1 -0
- package/locales/zh-CN/common.json +1 -0
- package/locales/zh-CN/desktop-onboarding.json +1 -0
- package/locales/zh-TW/common.json +1 -0
- package/package.json +2 -2
- package/packages/builtin-tool-cloud-sandbox/src/systemRole.ts +62 -2
- package/packages/const/src/url.ts +6 -0
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/tasks/index.ts +2 -0
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/tasks/multi-tasks-with-summary.json +234 -0
- package/packages/conversation-flow/src/__tests__/parse.test.ts +25 -0
- package/packages/conversation-flow/src/transformation/ContextTreeBuilder.ts +15 -0
- package/packages/conversation-flow/src/transformation/FlatListBuilder.ts +20 -0
- package/packages/types/src/serverConfig.ts +0 -1
- package/src/app/[variants]/(desktop)/desktop-onboarding/features/LoginStep.tsx +39 -1
- package/src/app/[variants]/(main)/settings/common/features/Common/Common.tsx +34 -14
- package/src/app/[variants]/(mobile)/me/(home)/features/useCategory.tsx +16 -9
- package/src/app/[variants]/layout.tsx +0 -4
- package/src/envs/app.ts +0 -13
- package/src/features/User/UserPanel/useMenu.tsx +18 -9
- package/src/hooks/usePlatform.test.ts +5 -0
- package/src/hooks/usePlatform.ts +1 -0
- package/src/locales/default/common.ts +1 -0
- package/src/locales/default/desktop-onboarding.ts +1 -0
- package/src/server/globalConfig/index.ts +1 -2
- package/src/services/electron/system.ts +4 -0
- package/src/store/serverConfig/selectors.ts +0 -1
package/src/envs/app.ts
CHANGED
|
@@ -2,14 +2,6 @@
|
|
|
2
2
|
import { createEnv } from '@t3-oss/env-nextjs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
|
-
declare global {
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
7
|
-
namespace NodeJS {
|
|
8
|
-
interface ProcessEnv {
|
|
9
|
-
ACCESS_CODE?: string;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
5
|
const isInVercel = process.env.VERCEL === '1';
|
|
14
6
|
|
|
15
7
|
// Vercel URL fallback order (by stability):
|
|
@@ -43,14 +35,11 @@ const ASSISTANT_INDEX_URL = 'https://registry.npmmirror.com/@lobehub/agents-inde
|
|
|
43
35
|
const PLUGINS_INDEX_URL = 'https://registry.npmmirror.com/@lobehub/plugins-index/v1/files/public';
|
|
44
36
|
|
|
45
37
|
export const getAppConfig = () => {
|
|
46
|
-
const ACCESS_CODES = process.env.ACCESS_CODE?.split(',').filter(Boolean) || [];
|
|
47
|
-
|
|
48
38
|
return createEnv({
|
|
49
39
|
client: {
|
|
50
40
|
NEXT_PUBLIC_ENABLE_SENTRY: z.boolean(),
|
|
51
41
|
},
|
|
52
42
|
server: {
|
|
53
|
-
ACCESS_CODES: z.any(z.string()).optional(),
|
|
54
43
|
AGENTS_INDEX_URL: z.string().url(),
|
|
55
44
|
|
|
56
45
|
DEFAULT_AGENT_CONFIG: z.string(),
|
|
@@ -100,8 +89,6 @@ export const getAppConfig = () => {
|
|
|
100
89
|
// Sentry
|
|
101
90
|
NEXT_PUBLIC_ENABLE_SENTRY: !!process.env.NEXT_PUBLIC_SENTRY_DSN,
|
|
102
91
|
|
|
103
|
-
ACCESS_CODES: ACCESS_CODES as any,
|
|
104
|
-
|
|
105
92
|
AGENTS_INDEX_URL: !!process.env.AGENTS_INDEX_URL
|
|
106
93
|
? process.env.AGENTS_INDEX_URL
|
|
107
94
|
: ASSISTANT_INDEX_URL,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { LOBE_CHAT_CLOUD, UTM_SOURCE } from '@lobechat/business-const';
|
|
2
|
-
import { isDesktop } from '@lobechat/const';
|
|
2
|
+
import { DOWNLOAD_URL, isDesktop } from '@lobechat/const';
|
|
3
3
|
import { Flexbox, Hotkey, Icon, Tag } from '@lobehub/ui';
|
|
4
4
|
import { type ItemType } from 'antd/es/menu/interface';
|
|
5
5
|
import { Cloudy, Download, HardDriveDownload, LogOut, Settings2 } from 'lucide-react';
|
|
6
|
-
import { type PropsWithChildren, memo } from 'react';
|
|
6
|
+
import { type PropsWithChildren, memo, useMemo } from 'react';
|
|
7
7
|
import { useTranslation } from 'react-i18next';
|
|
8
8
|
import { Link } from 'react-router-dom';
|
|
9
9
|
|
|
@@ -12,7 +12,7 @@ import type { MenuProps } from '@/components/Menu';
|
|
|
12
12
|
import { DEFAULT_DESKTOP_HOTKEY_CONFIG } from '@/const/desktop';
|
|
13
13
|
import { OFFICIAL_URL } from '@/const/url';
|
|
14
14
|
import DataImporter from '@/features/DataImporter';
|
|
15
|
-
import {
|
|
15
|
+
import { usePlatform } from '@/hooks/usePlatform';
|
|
16
16
|
import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';
|
|
17
17
|
import { useUserStore } from '@/store/user';
|
|
18
18
|
import { authSelectors } from '@/store/user/selectors';
|
|
@@ -44,7 +44,6 @@ const NewVersionBadge = memo(
|
|
|
44
44
|
);
|
|
45
45
|
|
|
46
46
|
export const useMenu = () => {
|
|
47
|
-
const { canInstall, install } = usePWAInstall();
|
|
48
47
|
const hasNewVersion = useNewVersion();
|
|
49
48
|
const { t } = useTranslation(['common', 'setting', 'auth']);
|
|
50
49
|
const { showCloudPromotion, hideDocs } = useServerConfigStore(featureFlagsSelectors);
|
|
@@ -53,6 +52,13 @@ export const useMenu = () => {
|
|
|
53
52
|
authSelectors.isLoginWithAuth(s),
|
|
54
53
|
]);
|
|
55
54
|
const businessMenuItems = useBusinessMenuItems(isLogin);
|
|
55
|
+
const { isIOS, isAndroid } = usePlatform();
|
|
56
|
+
|
|
57
|
+
const downloadUrl = useMemo(() => {
|
|
58
|
+
if (isIOS) return DOWNLOAD_URL.ios;
|
|
59
|
+
if (isAndroid) return DOWNLOAD_URL.android;
|
|
60
|
+
return DOWNLOAD_URL.default;
|
|
61
|
+
}, [isIOS, isAndroid]);
|
|
56
62
|
|
|
57
63
|
const settings: MenuProps['items'] = [
|
|
58
64
|
{
|
|
@@ -71,12 +77,15 @@ export const useMenu = () => {
|
|
|
71
77
|
},
|
|
72
78
|
];
|
|
73
79
|
|
|
74
|
-
const
|
|
80
|
+
const downloadClient: MenuProps['items'] = [
|
|
75
81
|
{
|
|
76
82
|
icon: <Icon icon={Download} />,
|
|
77
|
-
key: '
|
|
78
|
-
label:
|
|
79
|
-
|
|
83
|
+
key: 'download-client',
|
|
84
|
+
label: (
|
|
85
|
+
<a href={downloadUrl} rel="noopener noreferrer" target="_blank">
|
|
86
|
+
{t('downloadClient')}
|
|
87
|
+
</a>
|
|
88
|
+
),
|
|
80
89
|
},
|
|
81
90
|
{
|
|
82
91
|
type: 'divider',
|
|
@@ -119,7 +128,7 @@ export const useMenu = () => {
|
|
|
119
128
|
|
|
120
129
|
...(isLogin ? settings : []),
|
|
121
130
|
...businessMenuItems,
|
|
122
|
-
...(
|
|
131
|
+
...(!isDesktop ? downloadClient : []),
|
|
123
132
|
...data,
|
|
124
133
|
...(!hideDocs ? helps : []),
|
|
125
134
|
].filter(Boolean) as MenuProps['items'];
|
|
@@ -25,6 +25,7 @@ describe('usePlatform', () => {
|
|
|
25
25
|
const { result } = renderHook(() => usePlatform());
|
|
26
26
|
|
|
27
27
|
expect(result.current).toEqual({
|
|
28
|
+
isAndroid: false,
|
|
28
29
|
isApple: true,
|
|
29
30
|
isChrome: true,
|
|
30
31
|
isChromium: true,
|
|
@@ -50,6 +51,7 @@ describe('usePlatform', () => {
|
|
|
50
51
|
const { result } = renderHook(() => usePlatform());
|
|
51
52
|
|
|
52
53
|
expect(result.current).toEqual({
|
|
54
|
+
isAndroid: false,
|
|
53
55
|
isApple: true,
|
|
54
56
|
isChrome: false,
|
|
55
57
|
isChromium: false,
|
|
@@ -75,6 +77,7 @@ describe('usePlatform', () => {
|
|
|
75
77
|
const { result } = renderHook(() => usePlatform());
|
|
76
78
|
|
|
77
79
|
expect(result.current).toEqual({
|
|
80
|
+
isAndroid: false,
|
|
78
81
|
isApple: false,
|
|
79
82
|
isChrome: false,
|
|
80
83
|
isChromium: true,
|
|
@@ -100,6 +103,7 @@ describe('usePlatform', () => {
|
|
|
100
103
|
const { result } = renderHook(() => usePlatform());
|
|
101
104
|
|
|
102
105
|
expect(result.current).toEqual({
|
|
106
|
+
isAndroid: false,
|
|
103
107
|
isApple: false,
|
|
104
108
|
isChrome: false,
|
|
105
109
|
isChromium: false,
|
|
@@ -125,6 +129,7 @@ describe('usePlatform', () => {
|
|
|
125
129
|
const { result } = renderHook(() => usePlatform());
|
|
126
130
|
|
|
127
131
|
expect(result.current).toEqual({
|
|
132
|
+
isAndroid: false,
|
|
128
133
|
isApple: true,
|
|
129
134
|
isChrome: true,
|
|
130
135
|
isChromium: true,
|
package/src/hooks/usePlatform.ts
CHANGED
|
@@ -13,6 +13,7 @@ export const usePlatform = () => {
|
|
|
13
13
|
const browser = useRef(getBrowser());
|
|
14
14
|
|
|
15
15
|
const platformInfo = {
|
|
16
|
+
isAndroid: platform.current?.toLowerCase() === 'android',
|
|
16
17
|
isApple: platform.current && ['mac os', 'ios'].includes(platform.current?.toLowerCase()),
|
|
17
18
|
isArc: isArc(),
|
|
18
19
|
isChrome: browser.current?.toLowerCase() === 'chrome',
|
|
@@ -90,6 +90,7 @@ export default {
|
|
|
90
90
|
'Sign in to sync Agents, Groups, settings, and Context across all devices.',
|
|
91
91
|
'screen5.errors.desktopOnlyOidc':
|
|
92
92
|
'OIDC authorization is only available in the desktop app runtime.',
|
|
93
|
+
'screen5.legacyLocalDb.link': 'Migrate legacy local database',
|
|
93
94
|
'screen5.methods.cloud.description':
|
|
94
95
|
'Sign in with your LobeHub Cloud account to sync everything seamlessly',
|
|
95
96
|
'screen5.methods.cloud.name': 'LobeHub Cloud',
|
|
@@ -27,7 +27,7 @@ const getBetterAuthSSOProviders = () => {
|
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
export const getServerGlobalConfig = async () => {
|
|
30
|
-
const {
|
|
30
|
+
const { DEFAULT_AGENT_CONFIG } = getAppConfig();
|
|
31
31
|
|
|
32
32
|
const config: GlobalServerConfig = {
|
|
33
33
|
aiProvider: await genServerAiProvidersConfig({
|
|
@@ -83,7 +83,6 @@ export const getServerGlobalConfig = async () => {
|
|
|
83
83
|
appEnv.MARKET_TRUSTED_CLIENT_SECRET && appEnv.MARKET_TRUSTED_CLIENT_ID
|
|
84
84
|
),
|
|
85
85
|
enableUploadFileToServer: !!fileEnv.S3_SECRET_ACCESS_KEY,
|
|
86
|
-
enabledAccessCode: ACCESS_CODES?.length > 0,
|
|
87
86
|
|
|
88
87
|
image: cleanObject({
|
|
89
88
|
defaultImageNum: imageEnv.AI_IMAGE_DEFAULT_IMAGE_NUM,
|
|
@@ -48,6 +48,10 @@ class ElectronSystemService {
|
|
|
48
48
|
return this.ipc.system.openExternalLink(url);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
async hasLegacyLocalDb(): Promise<boolean> {
|
|
52
|
+
return this.ipc.system.hasLegacyLocalDb();
|
|
53
|
+
}
|
|
54
|
+
|
|
51
55
|
showContextMenu = async (type: string, data?: any) => {
|
|
52
56
|
return this.ipc.menu.showContextMenu({ data, type });
|
|
53
57
|
};
|
|
@@ -12,7 +12,6 @@ export const serverConfigSelectors = {
|
|
|
12
12
|
enableMarketTrustedClient: (s: ServerConfigStore) =>
|
|
13
13
|
s.serverConfig.enableMarketTrustedClient || false,
|
|
14
14
|
enableUploadFileToServer: (s: ServerConfigStore) => s.serverConfig.enableUploadFileToServer,
|
|
15
|
-
enabledAccessCode: (s: ServerConfigStore) => !!s.serverConfig?.enabledAccessCode,
|
|
16
15
|
enabledTelemetryChat: (s: ServerConfigStore) => s.serverConfig.telemetry.langfuse || false,
|
|
17
16
|
isMobile: (s: ServerConfigStore) => s.isMobile || false,
|
|
18
17
|
oAuthSSOProviders: (s: ServerConfigStore) => s.serverConfig.oAuthSSOProviders,
|