Skip to content

Commit

Permalink
Merge branch 'main' into testgru-src-utils-server-geo.ts-1739055523439
Browse files Browse the repository at this point in the history
  • Loading branch information
gru-agent[bot] authored Feb 13, 2025
1 parent 621cc12 commit 4342b53
Show file tree
Hide file tree
Showing 15 changed files with 274 additions and 241 deletions.
25 changes: 0 additions & 25 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,6 @@

# Changelog

### [Version 1.53.6](https://github.com/lobehub/lobe-chat/compare/v1.53.5...v1.53.6)

<sup>Released on **2025-02-13**</sup>

#### 🐛 Bug Fixes

- **misc**: Fix not enable models correctly.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's fixed

- **misc**: Fix not enable models correctly, closes [#6071](https://github.com/lobehub/lobe-chat/issues/6071) ([b78328e](https://github.com/lobehub/lobe-chat/commit/b78328e))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>

### [Version 1.53.5](https://github.com/lobehub/lobe-chat/compare/v1.53.4...v1.53.5)

<sup>Released on **2025-02-13**</sup>
Expand Down
8 changes: 7 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ ENV NODE_ENV="production" \
NODE_TLS_REJECT_UNAUTHORIZED="" \
SSL_CERT_DIR="/etc/ssl/certs/ca-certificates.crt"

# Make the middleware rewrite through local as default
# refs: https://github.com/lobehub/lobe-chat/issues/5876
ENV MIDDLEWARE_REWRITE_THROUGH_LOCAL="1"

# set hostname to localhost
ENV HOSTNAME="0.0.0.0" \
PORT="3210"
Expand Down Expand Up @@ -222,7 +226,9 @@ ENV \
# 01.AI
ZEROONE_API_KEY="" ZEROONE_MODEL_LIST="" \
# Zhipu
ZHIPU_API_KEY="" ZHIPU_MODEL_LIST=""
ZHIPU_API_KEY="" ZHIPU_MODEL_LIST="" \
# Tencent Cloud
TENCENT_CLOUD_API_KEY="" TENCENT_CLOUD_MODEL_LIST=""

USER nextjs

Expand Down
8 changes: 7 additions & 1 deletion Dockerfile.database
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ ENV NODE_ENV="production" \
NODE_TLS_REJECT_UNAUTHORIZED="" \
SSL_CERT_DIR="/etc/ssl/certs/ca-certificates.crt"

# Make the middleware rewrite through local as default
# refs: https://github.com/lobehub/lobe-chat/issues/5876
ENV MIDDLEWARE_REWRITE_THROUGH_LOCAL="1"

# set hostname to localhost
ENV HOSTNAME="0.0.0.0" \
PORT="3210"
Expand Down Expand Up @@ -259,7 +263,9 @@ ENV \
# 01.AI
ZEROONE_API_KEY="" ZEROONE_MODEL_LIST="" \
# Zhipu
ZHIPU_API_KEY="" ZHIPU_MODEL_LIST=""
ZHIPU_API_KEY="" ZHIPU_MODEL_LIST="" \
# Tencent Cloud
TENCENT_CLOUD_API_KEY="" TENCENT_CLOUD_MODEL_LIST=""

USER nextjs

Expand Down
7 changes: 0 additions & 7 deletions changelog/v1.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
[
{
"children": {
"fixes": ["Fix not enable models correctly."]
},
"date": "2025-02-13",
"version": "1.53.6"
},
{
"children": {
"fixes": ["Fix latex in thinking tag render."]
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lobehub/chat",
"version": "1.52.4",
"version": "1.53.5",
"description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
"keywords": [
"framework",
Expand Down Expand Up @@ -126,7 +126,7 @@
"@lobehub/charts": "^1.12.0",
"@lobehub/chat-plugin-sdk": "^1.32.4",
"@lobehub/chat-plugins-gateway": "^1.9.0",
"@lobehub/icons": "^1.61.1",
"@lobehub/icons": "^1.69.0",
"@lobehub/tts": "^1.28.0",
"@lobehub/ui": "^1.164.10",
"@neondatabase/serverless": "^0.10.4",
Expand Down Expand Up @@ -291,7 +291,7 @@
"fs-extra": "^11.2.0",
"glob": "^11.0.0",
"gray-matter": "^4.0.3",
"happy-dom": "^16.5.2",
"happy-dom": "^17.0.0",
"husky": "^9.1.7",
"just-diff": "^6.0.2",
"lint-staged": "^15.3.0",
Expand Down Expand Up @@ -319,7 +319,7 @@
"vitest": "~1.2.2",
"vitest-canvas-mock": "^0.3.3"
},
"packageManager": "[email protected].4",
"packageManager": "[email protected].5",
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org"
Expand Down
23 changes: 23 additions & 0 deletions src/app/[variants]/(main)/chat/settings/modal/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
'use client';

import { useLayoutEffect } from 'react';

import { useQueryRoute } from '@/hooks/useQueryRoute';

/**
* @description: Chat Settings Modal (intercepting routes fallback when hard refresh)
* @example: /chat/settings/modal?tab=prompt => /chat/settings
* @refs: https://github.com/lobehub/lobe-chat/discussions/2295#discussioncomment-9290942
*/

const ChatSettingsModalFallback = () => {
const router = useQueryRoute();

useLayoutEffect(() => {
router.replace('/chat/settings', { query: { tab: '' } });
}, []);

return null;
};

export default ChatSettingsModalFallback;
61 changes: 61 additions & 0 deletions src/app/[variants]/@modal/chat/(.)settings/modal/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
'use client';

import { Skeleton } from 'antd';
import isEqual from 'fast-deep-equal';
import dynamic from 'next/dynamic';
import { PropsWithChildren, memo } from 'react';
import { useTranslation } from 'react-i18next';

import ModalLayout from '@/app/[variants]/@modal/_layout/ModalLayout';
import StoreUpdater from '@/features/AgentSetting/StoreUpdater';
import { Provider, createStore } from '@/features/AgentSetting/store';
import { useChatSettingsTab } from '@/hooks/useChatSettingsTab';
import { useAgentStore } from '@/store/agent';
import { agentSelectors } from '@/store/agent/slices/chat';
import { ChatSettingsTabs } from '@/store/global/initialState';
import { useSessionStore } from '@/store/session';
import { sessionMetaSelectors } from '@/store/session/selectors';

import SettingModalLayout from '../../../_layout/SettingModalLayout';

const CategoryContent = dynamic(() => import('./features/CategoryContent'), {
loading: () => <Skeleton paragraph={{ rows: 6 }} title={false} />,
ssr: false,
});

const Layout = memo<PropsWithChildren>(({ children }) => {
const tab = useChatSettingsTab();
const { t } = useTranslation('setting');
const id = useSessionStore((s) => s.activeId);
const config = useAgentStore(agentSelectors.currentAgentConfig, isEqual);
const meta = useSessionStore(sessionMetaSelectors.currentAgentMeta, isEqual);
const [updateAgentConfig] = useAgentStore((s) => [s.updateAgentConfig]);
const [updateAgentMeta] = useSessionStore((s) => [
s.updateSessionMeta,
sessionMetaSelectors.currentAgentTitle(s),
]);

return (
<ModalLayout>
<SettingModalLayout
activeTitle={t(`agentTab.${tab as ChatSettingsTabs}`)}
category={<CategoryContent />}
desc={t('header.sessionDesc')}
title={t('header.session')}
>
<Provider createStore={createStore}>
<StoreUpdater
config={config}
id={id}
meta={meta}
onConfigChange={updateAgentConfig}
onMetaChange={updateAgentMeta}
/>
{children}
</Provider>
</SettingModalLayout>
</ModalLayout>
);
});

export default Layout;
5 changes: 5 additions & 0 deletions src/app/[variants]/@modal/chat/(.)settings/modal/loading.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Skeleton } from 'antd';

export default () => {
return <Skeleton paragraph={{ rows: 6 }} style={{ paddingBlock: 16 }} />;
};
56 changes: 56 additions & 0 deletions src/app/[variants]/@modal/chat/(.)settings/modal/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
'use client';

import dynamic from 'next/dynamic';

import { useChatSettingsTab } from '@/hooks/useChatSettingsTab';
import { ChatSettingsTabs } from '@/store/global/initialState';

import Skeleton from './loading';

const loading = () => <Skeleton />;

const AgentMeta = dynamic(() => import('@/features/AgentSetting/AgentMeta'), {
loading,
ssr: false,
});
const AgentChat = dynamic(() => import('@/features/AgentSetting/AgentChat'), {
loading,
ssr: false,
});
const AgentPrompt = dynamic(() => import('@/features/AgentSetting/AgentPrompt'), {
loading,
ssr: false,
});
const AgentPlugin = dynamic(() => import('@/features/AgentSetting/AgentPlugin'), {
loading,
ssr: false,
});
const AgentModal = dynamic(() => import('@/features/AgentSetting/AgentModal'), {
loading,
ssr: false,
});
const AgentTTS = dynamic(() => import('@/features/AgentSetting/AgentTTS'), { loading, ssr: false });

/**
* @description: Agent Settings Modal (intercepting route: /chat/settings/modal )
* @refs: https://github.com/lobehub/lobe-chat/discussions/2295#discussioncomment-9290942
*/

const Page = () => {
const tab = useChatSettingsTab();

return (
<>
{tab === ChatSettingsTabs.Meta && <AgentMeta />}
{tab === ChatSettingsTabs.Prompt && <AgentPrompt modal />}
{tab === ChatSettingsTabs.Chat && <AgentChat />}
{tab === ChatSettingsTabs.Modal && <AgentModal />}
{tab === ChatSettingsTabs.TTS && <AgentTTS />}
{tab === ChatSettingsTabs.Plugin && <AgentPlugin />}
</>
);
};

Page.displayName = 'AgentSettingModal';

export default Page;
Loading

0 comments on commit 4342b53

Please sign in to comment.