Merge remote-tracking branch 'origin/main'

main
liushujing 3 months ago
commit c08448b09d

@ -1 +0,0 @@
module.exports = require('@lobehub/lint').changelog;

@ -1 +0,0 @@
module.exports = require('@lobehub/lint').commitlint;

@ -1,31 +0,0 @@
# Eslintignore for LobeHub
################################################################
# dependencies
node_modules
# ci
coverage
.coverage
# test
jest*
*.test.ts
*.test.tsx
# umi
.umi
.umi-production
.umi-test
.dumi/tmp*
!.dumirc.ts
# production
dist
es
lib
logs
# misc
# add other ignore file below
.next

@ -1,37 +0,0 @@
const config = require('@lobehub/lint').eslint;
config.extends.push('plugin:@next/next/recommended');
config.rules['unicorn/no-negated-condition'] = 0;
config.rules['unicorn/prefer-type-error'] = 0;
config.rules['unicorn/prefer-logical-operator-over-ternary'] = 0;
config.rules['unicorn/no-null'] = 0;
config.rules['unicorn/no-typeof-undefined'] = 0;
config.rules['unicorn/explicit-length-check'] = 0;
config.rules['unicorn/prefer-code-point'] = 0;
config.rules['no-extra-boolean-cast'] = 0;
config.rules['unicorn/no-useless-undefined'] = 0;
config.rules['react/no-unknown-property'] = 0;
config.rules['unicorn/prefer-ternary'] = 0;
config.rules['unicorn/prefer-spread'] = 0;
config.rules['unicorn/catch-error-name'] = 0;
config.rules['unicorn/no-array-for-each'] = 0;
config.rules['unicorn/prefer-number-properties'] = 0;
config.overrides = [
{
extends: ['plugin:mdx/recommended'],
files: ['*.mdx'],
rules: {
'@typescript-eslint/no-unused-vars': 1,
'no-undef': 0,
'react/jsx-no-undef': 0,
'react/no-unescaped-entities': 0,
},
settings: {
'mdx/code-blocks': false,
},
},
];
module.exports = config;

@ -1 +0,0 @@
module.exports = require('@lobehub/lint').prettier;

@ -1 +0,0 @@
module.exports = require('@lobehub/lint').semanticRelease;

@ -1 +0,0 @@
module.exports = require('@lobehub/lint').remarklint;

@ -1,9 +0,0 @@
const config = require('@lobehub/lint').stylelint;
module.exports = {
...config,
rules: {
'selector-id-pattern': null,
...config.rules,
},
};

@ -1,5 +1,5 @@
## Base image for all the stages ## Base image for all the stages
FROM node:20-slim AS base FROM node:22-slim AS base
ARG USE_CN_MIRROR ARG USE_CN_MIRROR
@ -67,7 +67,7 @@ RUN \
# Enable corepack # Enable corepack
&& corepack enable \ && corepack enable \
# Use pnpm for corepack # Use pnpm for corepack
&& corepack use pnpm \ && corepack use $(sed -n 's/.*"packageManager": "\(.*\)".*/\1/p' package.json) \
# Install the dependencies # Install the dependencies
&& pnpm i \ && pnpm i \
# Add sharp dependencies # Add sharp dependencies

@ -1,5 +1,5 @@
## Base image for all the stages ## Base image for all the stages
FROM node:20-slim AS base FROM node:22-slim AS base
ARG USE_CN_MIRROR ARG USE_CN_MIRROR
@ -32,10 +32,10 @@ FROM base AS builder
ARG USE_CN_MIRROR ARG USE_CN_MIRROR
ENV NEXT_PUBLIC_SERVICE_MODE="server" \ ENV NEXT_PUBLIC_SERVICE_MODE="server" \
APP_URL="http://app.com" \ APP_URL="http://192.168.15.199:3210" \
DATABASE_DRIVER="node" \ DATABASE_DRIVER="node" \
DATABASE_URL="postgres://postgres:password@localhost:5432/postgres" \ DATABASE_URL="postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/lobechat" \
KEY_VAULTS_SECRET="use-for-build" KEY_VAULTS_SECRET="Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ="
# Sentry # Sentry
ENV NEXT_PUBLIC_SENTRY_DSN="" \ ENV NEXT_PUBLIC_SENTRY_DSN="" \
@ -113,12 +113,12 @@ ENV NODE_ENV="production" \
NODE_TLS_REJECT_UNAUTHORIZED="" NODE_TLS_REJECT_UNAUTHORIZED=""
# set hostname to localhost # set hostname to localhost
ENV HOSTNAME="0.0.0.0" \ ENV HOSTNAME="192.168.15.199" \
PORT="3210" PORT="3210"
# General Variables # General Variables
ENV ACCESS_CODE="" \ ENV ACCESS_CODE="" \
APP_URL="" \ APP_URL="http://192.168.15.199:3210" \
API_KEY_SELECT_MODE="" \ API_KEY_SELECT_MODE="" \
DEFAULT_AGENT_CONFIG="" \ DEFAULT_AGENT_CONFIG="" \
SYSTEM_AGENT="" \ SYSTEM_AGENT="" \
@ -126,22 +126,22 @@ ENV ACCESS_CODE="" \
PROXY_URL="" PROXY_URL=""
# Database # Database
ENV KEY_VAULTS_SECRET="" \ ENV KEY_VAULTS_SECRET="Kix2wcUONd4CX51E/ZPAd36BqM4wzJgKjPtz2sGztqQ=" \
DATABASE_DRIVER="node" \ DATABASE_DRIVER="node" \
DATABASE_URL="" DATABASE_URL="postgresql://postgres:uWNZugjBqixf8dxC@postgresql:5432/lobechat"
# Next Auth # Next Auth
ENV NEXT_AUTH_SECRET="" \ ENV NEXT_AUTH_SECRET="NX2kaPE923dt6BL2U8e9oSre5RfoT7hg" \
NEXT_AUTH_SSO_PROVIDERS="" \ NEXT_AUTH_SSO_PROVIDERS="casdoor" \
NEXTAUTH_URL="" NEXTAUTH_URL="http://192.168.15.199:3210/api/auth"
# S3 # S3
ENV NEXT_PUBLIC_S3_DOMAIN="" \ ENV NEXT_PUBLIC_S3_DOMAIN="" \
S3_PUBLIC_DOMAIN="" \ S3_PUBLIC_DOMAIN="http://192.168.15.199:9000" \
S3_ACCESS_KEY_ID="" \ S3_ACCESS_KEY_ID="soaucnP8Bip0TDdUjxng" \
S3_BUCKET="" \ S3_BUCKET="casdoor" \
S3_ENDPOINT="" \ S3_ENDPOINT="http://192.168.15.199:9000" \
S3_SECRET_ACCESS_KEY="" S3_SECRET_ACCESS_KEY="ZPUzvY34umfcfxvWKSv0P00vczVMB6YmgJS5J9eO"
# Model Variables # Model Variables
ENV \ ENV \

@ -123,7 +123,7 @@
"@lobehub/chat-plugins-gateway": "^1.9.0", "@lobehub/chat-plugins-gateway": "^1.9.0",
"@lobehub/icons": "^1.33.7", "@lobehub/icons": "^1.33.7",
"@lobehub/tts": "^1.24.3", "@lobehub/tts": "^1.24.3",
"@lobehub/ui": "^1.150.3", "@lobehub/ui": "1.150.3",
"@neondatabase/serverless": "^0.9.4", "@neondatabase/serverless": "^0.9.4",
"@next/third-parties": "^14.2.6", "@next/third-parties": "^14.2.6",
"@react-spring/web": "^9.7.3", "@react-spring/web": "^9.7.3",

@ -93,12 +93,12 @@ const TopActions = memo<TopActionProps>(() => {
<div className={value === '/plugins' ? cx(styles.iconText, styles.iconSelectText) : cx(styles.iconText) }></div> <div className={value === '/plugins' ? cx(styles.iconText, styles.iconSelectText) : cx(styles.iconText) }></div>
</Link> </Link>
)} )}
{showMarket && ( {/*{showMarket && (
<Link aria-label={t('tab.power')} className={value === '/power' ? cx(styles.linkUrl, styles.linkclic) : cx(styles.linkUrl)} href={'/power'} onClick={() => {setValue("/power"); window.localStorage.setItem("nowChat", "")}}> <Link aria-label={t('tab.power')} className={value === '/power' ? cx(styles.linkUrl, styles.linkclic) : cx(styles.linkUrl)} href={'/power'} onClick={() => {setValue("/power"); window.localStorage.setItem("nowChat", "")}}>
<Image alt={"power"} className={cx(styles.iconImg)} preview={false} src="/images/sl.png" /> <Image alt={"power"} className={cx(styles.iconImg)} preview={false} src="/images/sl.png" />
<div className={value === '/power' ? cx(styles.iconText, styles.iconSelectText) : cx(styles.iconText) }></div> <div className={value === '/power' ? cx(styles.iconText, styles.iconSelectText) : cx(styles.iconText) }></div>
</Link> </Link>
)} )}*/}
{showMarket && ( {showMarket && (
<Link aria-label={t('tab.knowledge')} className={value === '/knowledge' ? cx(styles.linkUrl, styles.linkclic) : cx(styles.linkUrl)} href={'/knowledge'} onClick={() => {setValue("/knowledge")}}> <Link aria-label={t('tab.knowledge')} className={value === '/knowledge' ? cx(styles.linkUrl, styles.linkclic) : cx(styles.linkUrl)} href={'/knowledge'} onClick={() => {setValue("/knowledge")}}>
<Image className={cx(styles.iconImg)} preview={false} src="/images/zsk.png" /> <Image className={cx(styles.iconImg)} preview={false} src="/images/zsk.png" />

@ -71,9 +71,9 @@ const Layout = memo<LayoutProps>(({ children, nav }) => {
const { isPWA } = usePlatform(); const { isPWA } = usePlatform();
const theme = useTheme(); const theme = useTheme();
const { styles, cx } = useStyles() const { styles, cx } = useStyles()
console.log(window?.location?.pathname,'3837373666router--------------------------------------------') console.log(window, window.location, window?.location?.pathname,'3837373666router--------------------------------------------')
const { showCloudPromotion } = useServerConfigStore(featureFlagsSelectors); const { showCloudPromotion } = useServerConfigStore(featureFlagsSelectors);
const pathName = window?.location?.pathname const pathName = window?.location?.pathname ?? '/welcome'
return ( return (
<> <>
{showCloudPromotion && <CloudBanner />} {showCloudPromotion && <CloudBanner />}

@ -728,7 +728,7 @@ const ApplicationSet = memo(() => {
url: "/flxai/api/robot/apptoolsset/getAllAiTools", url: "/flxai/api/robot/apptoolsset/getAllAiTools",
}).then((response) => { }).then((response) => {
if (response.code === 0) { if (response.code === 0) {
console.log(response,"2222") // console.log(response,"2222")
setStData(response.data); setStData(response.data);
} }
}).catch(error => { }).catch(error => {

@ -20,7 +20,7 @@ const Layout = ({ children }: PropsWithChildren) => {
> >
<Flexbox <Flexbox
gap={16} gap={16}
style={{ maxWidth: MAX_WIDTH, position: 'relative' }} style={{ position: 'relative' }}
width={'100%'} width={'100%'}
> >
{children} {children}

@ -12,14 +12,16 @@ const Layout = async ({ children }: PropsWithChildren) => {
const categoryList = await discoverService.getProviderList(DEFAULT_LANG); const categoryList = await discoverService.getProviderList(DEFAULT_LANG);
return ( return (
<Flexbox gap={24} horizontal style={{ position: 'relative' }} width={'100%'}> <div>
<CategoryContainer> <Flexbox gap={24} horizontal style={{ position: 'relative' }} width={'100%'}>
<Category data={categoryList} /> <CategoryContainer>
</CategoryContainer> <Category data={categoryList} />
<Flexbox flex={1} gap={16}> </CategoryContainer>
{children} <Flexbox flex={1} gap={16}>
{children}
</Flexbox>
</Flexbox> </Flexbox>
</Flexbox> </div>
); );
}; };

@ -74,7 +74,7 @@ const List = memo<ListProps>(async ({ category, searchKeywords, items = [] }) =>
}; };
fetchData(); fetchData();
}, []); // 空数组[]意味着仅在组件挂载时调用一次 }, []); // 空数组[]意味着仅在组件挂载时调用一次
const handleClickCard = (item) => { const handleClickCard = (item) => {
console.log(item) console.log(item)
router.push(urlJoin('/discover/model/', item.identifier)) router.push(urlJoin('/discover/model/', item.identifier))
@ -108,7 +108,7 @@ const List = memo<ListProps>(async ({ category, searchKeywords, items = [] }) =>
<Grid maxItemWidth={280} rows={4}> <Grid maxItemWidth={280} rows={4}>
{stData.map((item) => ( {stData.map((item) => (
// <Link href={urlJoin('/discover/assistant/', item.identifier)} key={item.identifier}> // <Link href={urlJoin('/discover/assistant/', item.identifier)} key={item.identifier}>
<Card key={item.identifier} onClick={() => handleClickCard(item)} showCategory={!category} {...item} /> <Card style={{boxShadow: "1px 0px 12px 0px rgba(42, 77, 255, 0.19)"}} key={item.identifier} onClick={() => handleClickCard(item)} showCategory={!category} {...item} />
// </Link> // </Link>
))} ))}
</Grid> </Grid>
@ -121,7 +121,7 @@ const List = memo<ListProps>(async ({ category, searchKeywords, items = [] }) =>
initialItemCount={24} initialItemCount={24}
itemContent={(_, item) => ( itemContent={(_, item) => (
// <Link href={urlJoin('/discover/model/', item.identifier)} key={item.identifier}> // <Link href={urlJoin('/discover/model/', item.identifier)} key={item.identifier}>
<Card key={item.identifier} onClick={() => handleClickCard(item)} showCategory={!category} {...item} /> <Card style={{boxShadow: "1px 0px 12px 0px rgba(42, 77, 255, 0.19)"}} key={item.identifier} onClick={() => handleClickCard(item)} showCategory={!category} {...item} />
// </Link> // </Link>
)} )}
style={{ style={{

@ -76,7 +76,7 @@ const useStyles = createStyles(({ css }) => ({
box-shadow: 1px 0px 12px 0px rgba(42, 77, 255, 0.19); box-shadow: 1px 0px 12px 0px rgba(42, 77, 255, 0.19);
border: none; border: none;
border-radius: 8px; border-radius: 8px;
padding: 10px 0; padding: 0px;
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: auto; overflow: auto;
@ -123,6 +123,10 @@ const useStyles = createStyles(({ css }) => ({
box-sizing: border-box; box-sizing: border-box;
border: 1px solid #0044FF; border: 1px solid #0044FF;
`, `,
iconRobotImg: css`
width: 48px;
height: 195px !important;
`,
iconImg: css` iconImg: css`
width: 48px; width: 48px;
height: 48px; height: 48px;
@ -172,7 +176,7 @@ const useStyles = createStyles(({ css }) => ({
border-radius: 8px; border-radius: 8px;
`, `,
robotImg: css` robotImg: css`
margin: 30px 0; margin: 20px 0;
width: 100%; width: 100%;
.ant-image { .ant-image {
width: 100%; width: 100%;
@ -520,8 +524,8 @@ const RobotList = memo<{ mobile?: boolean }>(() => {
renderItem={() => ( renderItem={() => (
<List.Item className={styles.listStyle}> <List.Item className={styles.listStyle}>
<Card className={styles.cardStyle} style={{padding: '0 !important'}}> <Card className={styles.cardStyle} style={{padding: '0 !important'}}>
<div style={{background: '#EFEFEF', padding: '40px 0', textAlign: 'center'}}> <div style={{background: '#EFEFEF', padding: '20px 0', textAlign: 'center'}}>
<Image className={cx(styles.iconImg)} preview={false} src="/images/robot.png" /> <Image className={cx(styles.iconRobotImg)} preview={false} src="/images/robot.png" />
</div> </div>
<div style={{marginTop: '30px'}}> <div style={{marginTop: '30px'}}>
<Flex justify='space-between' style={{height: '100%'}}> <Flex justify='space-between' style={{height: '100%'}}>
@ -541,7 +545,7 @@ const RobotList = memo<{ mobile?: boolean }>(() => {
</Card> </Card>
</List.Item> </List.Item>
)} )}
style={{marginTop: '10px', padding: '0 50px'}} style={{marginTop: '10px', padding: '0 50px', height: 'calc(100vh - 150px)', overflowY: 'scroll'}}
/> />
</div> </div>
</div> </div>
@ -554,9 +558,9 @@ const RobotList = memo<{ mobile?: boolean }>(() => {
</Button> </Button>
</Flex> </Flex>
<div style={{height: '100%', padding: '0 150px 0 50px'}}> <div style={{padding: '0 150px 0 50px', height: 'calc(100vh - 160px)', overflowY: 'scroll'}} >
<Flex gap={30} justify='space-between' style={{height: '100%'}}> <Flex gap={30} justify='space-between' style={{height: '100%'}}>
<div style={{height: '85%', width: '6%'}}> <div style={{height: 'calc(100vh - 160px)', width: '6%'}}>
<Card className={styles.cardStyle} style={{padding: '0', textAlign: 'center'}}> <Card className={styles.cardStyle} style={{padding: '0', textAlign: 'center'}}>
<div className={styles.robotAvatarLeftContainer}> <div className={styles.robotAvatarLeftContainer}>
<div className={styles.robotAvatarLeft}> <div className={styles.robotAvatarLeft}>
@ -608,13 +612,13 @@ const RobotList = memo<{ mobile?: boolean }>(() => {
</div> </div>
</Card> </Card>
</div> </div>
<div style={{height: '85%', width: '52%'}}> <div style={{height: 'calc(100vh - 160px)', width: '52%'}}>
<Card className={styles.cardRobotStyle} style={{height: '120px', padding: '0 !important'}}> <Card className={styles.cardRobotStyle} style={{height: '120px', padding: '0 !important'}}>
<Carousel infinite={false} <Carousel infinite={false}
// afterChange={afterChange} // afterChange={afterChange}
ref={carouselRef}> ref={carouselRef}>
<div> <div>
<Flex gap={50}> <Flex gap={25}>
<div> <div>
<div className={styles.soundCardAvatar}> <div className={styles.soundCardAvatar}>
<Image className={cx(styles.iconImg)} preview={false} src="/images/robot2.png" style={{marginBotom: '5px', marginTop: '12px'}} /> <Image className={cx(styles.iconImg)} preview={false} src="/images/robot2.png" style={{marginBotom: '5px', marginTop: '12px'}} />
@ -666,7 +670,7 @@ const RobotList = memo<{ mobile?: boolean }>(() => {
</Flex> </Flex>
</div> </div>
<div> <div>
<Flex gap={50}> <Flex gap={25}>
<div> <div>
<div className={styles.soundCardAvatar}> <div className={styles.soundCardAvatar}>
<Image className={cx(styles.iconImg)} preview={false} src="/images/robot2.png" style={{marginBotom: '5px', marginTop: '12px'}} /> <Image className={cx(styles.iconImg)} preview={false} src="/images/robot2.png" style={{marginBotom: '5px', marginTop: '12px'}} />
@ -726,17 +730,14 @@ const RobotList = memo<{ mobile?: boolean }>(() => {
</div> </div>
</Card> </Card>
<div className={styles.robotImg}> <div className={styles.robotImg}>
<Image preview={false} src="/images/robot_img.png" style={{height: '600px', width: '100%'}}/> <Image preview={false} src="/images/robot_img.png" style={{height: 'calc(100vh - 440px)', width: '100%'}}/>
</div> </div>
<Card className={styles.cardRobotStyle} style={{height: '120px', padding: '0 !important'}}> <Card className={styles.cardRobotStyle} style={{height: '120px', padding: '0 !important'}}>
<Carousel infinite={false} <Carousel infinite={false}
// afterChange={afterChange} // afterChange={afterChange}
ref={carouselBgRef}> ref={carouselBgRef}>
<div> <div>
<Flex gap={30}> <Flex gap={25}>
<div>
<Image className={styles.robotBg} preview={false} src="/images/robot_bg.png" />
</div>
<div> <div>
<Image className={styles.robotBg} preview={false} src="/images/robot_bg.png" /> <Image className={styles.robotBg} preview={false} src="/images/robot_bg.png" />
</div> </div>
@ -758,10 +759,7 @@ const RobotList = memo<{ mobile?: boolean }>(() => {
</Flex> </Flex>
</div> </div>
<div> <div>
<Flex gap={30}> <Flex gap={25}>
<div>
<Image className={styles.robotBg} preview={false} src="/images/robot_bg.png" />
</div>
<div> <div>
<Image className={styles.robotBg} preview={false} src="/images/robot_bg.png" /> <Image className={styles.robotBg} preview={false} src="/images/robot_bg.png" />
</div> </div>
@ -791,7 +789,7 @@ const RobotList = memo<{ mobile?: boolean }>(() => {
</div> </div>
</Card> </Card>
</div> </div>
<div style={{height: '85%',width: '42%'}}> <div style={{height: 'calc(100vh - 160px)',width: '42%'}}>
<Card className={styles.cardStyle} style={{ padding: '0' }}> <Card className={styles.cardStyle} style={{ padding: '0' }}>
<div className={styles.robotSetHead}> <div className={styles.robotSetHead}>

@ -5,7 +5,7 @@
"lib": ["dom", "dom.iterable", "esnext", "webworker"], "lib": ["dom", "dom.iterable", "esnext", "webworker"],
"allowJs": true, "allowJs": true,
"skipLibCheck": true, "skipLibCheck": true,
"strict": true, "strict": false,
"forceConsistentCasingInFileNames": true, "forceConsistentCasingInFileNames": true,
"noEmit": true, "noEmit": true,
"esModuleInterop": true, "esModuleInterop": true,

Loading…
Cancel
Save