Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/lobehub/lobe-chat
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Feb 10, 2025
2 parents e53b14f + 5af600a commit 2b880bc
Show file tree
Hide file tree
Showing 21 changed files with 277 additions and 196 deletions.
58 changes: 58 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,64 @@

# Changelog

### [Version 1.52.15](https://github.com/lobehub/lobe-chat/compare/v1.52.14...v1.52.15)

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

#### 🐛 Bug Fixes

- **misc**: Fix lmstudio baseURL.

#### 💄 Styles

- **misc**: Optimized MaxToken Slider.

<br/>

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

#### What's fixed

- **misc**: Fix lmstudio baseURL, closes [#5988](https://github.com/lobehub/lobe-chat/issues/5988) ([1d19aa6](https://github.com/lobehub/lobe-chat/commit/1d19aa6))

#### Styles

- **misc**: Optimized MaxToken Slider, closes [#5952](https://github.com/lobehub/lobe-chat/issues/5952) ([3cdcb95](https://github.com/lobehub/lobe-chat/commit/3cdcb95))

</details>

<div align="right">

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

</div>

### [Version 1.52.14](https://github.com/lobehub/lobe-chat/compare/v1.52.13...v1.52.14)

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

#### 💄 Styles

- **misc**: Refactor agent settings modal.

<br/>

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

#### Styles

- **misc**: Refactor agent settings modal, closes [#5987](https://github.com/lobehub/lobe-chat/issues/5987) ([6482f8a](https://github.com/lobehub/lobe-chat/commit/6482f8a))

</details>

<div align="right">

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

</div>

### [Version 1.52.13](https://github.com/lobehub/lobe-chat/compare/v1.52.12...v1.52.13)

<sup>Released on **2025-02-10**</sup>
Expand Down
15 changes: 15 additions & 0 deletions changelog/v1.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
[
{
"children": {
"fixes": ["Fix lmstudio baseURL."],
"improvements": ["Optimized MaxToken Slider."]
},
"date": "2025-02-10",
"version": "1.52.15"
},
{
"children": {
"improvements": ["Refactor agent settings modal."]
},
"date": "2025-02-10",
"version": "1.52.14"
},
{
"children": {
"fixes": [
Expand Down
24 changes: 24 additions & 0 deletions docker-compose/local/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,30 @@ services:
env_file:
- .env
restart: always
entrypoint: >
/bin/sh -c "
/bin/node /app/startServer.js &
LOBE_PID=\$!
sleep 3
if [ $(wget --timeout=5 --spider --server-response ${AUTH_CASDOOR_ISSUER}/.well-known/openid-configuration 2>&1 | grep -c 'HTTP/1.1 200 OK') -eq 0 ]; then
echo '⚠️Warining: Unable to fetch OIDC configuration from Casdoor'
echo 'Request URL: ${AUTH_CASDOOR_ISSUER}/.well-known/openid-configuration'
echo 'Read more at: https://lobehub.com/docs/self-hosting/server-database/docker-compose#necessary-configuration'
else
if ! wget -O - --timeout=5 ${AUTH_CASDOOR_ISSUER}/.well-known/openid-configuration 2>&1 | grep 'issuer' | grep ${AUTH_CASDOOR_ISSUER}; then
printf '❌Error: The Auth issuer is conflict, Issuer in OIDC configuration is: %s' \$(wget -O - --timeout=5 ${AUTH_CASDOOR_ISSUER}/.well-known/openid-configuration 2>&1 | grep -E 'issuer.*' | awk -F '\"' '{print \$4}')
echo ' , but the issuer in .env file is: ${AUTH_CASDOOR_ISSUER} '
echo 'Request URL: ${AUTH_CASDOOR_ISSUER}/.well-known/openid-configuration'
echo 'Read more at: https://lobehub.com/docs/self-hosting/server-database/docker-compose#necessary-configuration'
fi
fi
if [ $(wget --timeout=5 --spider --server-response ${S3_ENDPOINT}/minio/health/live 2>&1 | grep -c 'HTTP/1.1 200 OK') -eq 0 ]; then
echo '⚠️Warining: Unable to fetch MinIO health status'
echo 'Request URL: ${S3_ENDPOINT}/minio/health/live'
echo 'Read more at: https://lobehub.com/docs/self-hosting/server-database/docker-compose#necessary-configuration'
fi
wait \$LOBE_PID
"
volumes:
data:
Expand Down
4 changes: 2 additions & 2 deletions docs/self-hosting/advanced/auth/next-auth/casdoor.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ If you are deploying using a public network, the following assumptions apply:

Configure the Casdoor webhook so that LobeChat can receive notifications when user information is updated.

Go to `Admin ` -> `Webhooks`, add a webhook, and fill in the following fields:
Go to `Admin` -> `Webhooks`, add a webhook, and fill in the following fields:

- URL: `https://lobe.example.com/api/auth/webhooks/casdoor`
- Method: `POST`
- Content Type: `application/json`
- Headers: `casdoor-secret`: `Your Webhook Secret`
> The webhook is generated by yourself, you can visit https://generate-secret.vercel.app/10 to generate a 10 bit secret.
> The secret is generated by yourself, you can visit https://generate-secret.vercel.app/10 to generate a 10 bit secret.
- Event: `update-user`
- Is user extented: `true`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lobehub/chat",
"version": "1.52.13",
"version": "1.52.15",
"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
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,23 @@ import { Flexbox } from 'react-layout-kit';

import HeaderContent from '@/app/[variants]/(main)/chat/settings/features/HeaderContent';
import Menu from '@/components/Menu';
import { useChatSettingsTab } from '@/hooks/useChatSettingsTab';
import { useQueryRoute } from '@/hooks/useQueryRoute';
import { ChatSettingsTabs } from '@/store/global/initialState';

import { useCategory } from './useCategory';

const CategoryContent = memo(() => {
interface CategoryContentProps {
setTab: (tab: ChatSettingsTabs) => void;
tab: string;
}
const CategoryContent = memo<CategoryContentProps>(({ setTab, tab }) => {
const cateItems = useCategory();
const tab = useChatSettingsTab();
const router = useQueryRoute();

return (
<>
<Menu
items={cateItems}
onClick={({ key }) => {
router.replace('/chat/settings/modal', { query: { tab: key } });
setTab(key as ChatSettingsTabs);
}}
selectable
selectedKeys={[tab as any]}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
'use client';

import { Drawer } from 'antd';
import { useResponsive, useTheme } from 'antd-style';
import isEqual from 'fast-deep-equal';
import { memo, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { Flexbox } from 'react-layout-kit';

import Header from '@/app/[variants]/(main)/settings/_layout/Desktop/Header';
import AgentChat from '@/features/AgentSetting/AgentChat';
import AgentMeta from '@/features/AgentSetting/AgentMeta';
import AgentModal from '@/features/AgentSetting/AgentModal';
import AgentPlugin from '@/features/AgentSetting/AgentPlugin';
import AgentPrompt from '@/features/AgentSetting/AgentPrompt';
import AgentTTS from '@/features/AgentSetting/AgentTTS';
import StoreUpdater from '@/features/AgentSetting/StoreUpdater';
import { Provider, createStore } from '@/features/AgentSetting/store';
import Footer from '@/features/Setting/Footer';
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 CategoryContent from './CategoryContent';

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

const [tab, setTab] = useState(ChatSettingsTabs.Meta);

const ref = useRef<any>(null);
const theme = useTheme();
const { md = true, mobile = false } = useResponsive();

const category = <CategoryContent setTab={setTab} tab={tab} />;
return (
<Provider createStore={createStore}>
<StoreUpdater
config={config}
id={id}
meta={meta}
onConfigChange={updateAgentConfig}
onMetaChange={updateAgentMeta}
/>
<Drawer
height={'100vh'}
onClose={() => {
useAgentStore.setState({ showAgentSetting: false });
}}
open={showAgentSetting}
placement={'bottom'}
styles={{
body: { padding: 0 },
content: {
background: theme.colorBgContainer,
},
}}
title={t('header.session')}
>
<Flexbox height={'100%'} horizontal={md} ref={ref} width={'100%'}>
{md ? (
<Flexbox padding={16}>{category}</Flexbox>
) : (
<Header
getContainer={() => ref.current}
title={t(`agentTab.${tab as ChatSettingsTabs}`)}
>
{category}
</Header>
)}
<Flexbox
align={'center'}
gap={mobile ? 0 : 64}
paddingInline={mobile ? 0 : 56}
style={{
background: mobile
? theme.colorBgContainer
: theme.isDarkMode
? theme.colorFillQuaternary
: theme.colorBgElevated,
minHeight: '100%',
overflowX: 'hidden',
overflowY: 'auto',
paddingTop: mobile ? 0 : 16,
}}
width={'100%'}
>
{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 />} <Footer />
</Flexbox>
</Flexbox>
</Drawer>
</Provider>
);
});

export default AgentSettings;
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,31 @@

import { ActionIcon } from '@lobehub/ui';
import { AlignJustify } from 'lucide-react';
import dynamic from 'next/dynamic';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';

import { DESKTOP_HEADER_ICON_SIZE, MOBILE_HEADER_ICON_SIZE } from '@/const/layoutTokens';
import { useOpenChatSettings } from '@/hooks/useInterceptingRoutes';

const AgentSettings = dynamic(() => import('./AgentSettings'), {
ssr: false,
});

const SettingButton = memo<{ mobile?: boolean }>(({ mobile }) => {
const { t } = useTranslation('common');
const openChatSettings = useOpenChatSettings();

return (
<ActionIcon
icon={AlignJustify}
onClick={() => openChatSettings()}
size={mobile ? MOBILE_HEADER_ICON_SIZE : DESKTOP_HEADER_ICON_SIZE}
title={t('header.session', { ns: 'setting' })}
/>
<>
<ActionIcon
icon={AlignJustify}
onClick={() => openChatSettings()}
size={mobile ? MOBILE_HEADER_ICON_SIZE : DESKTOP_HEADER_ICON_SIZE}
title={t('header.session', { ns: 'setting' })}
/>
<AgentSettings />
</>
);
});

Expand Down
23 changes: 0 additions & 23 deletions src/app/[variants]/(main)/chat/settings/modal/page.tsx

This file was deleted.

Loading

0 comments on commit 2b880bc

Please sign in to comment.