Skip to content

Commit

Permalink
4.8.5 test (#1819)
Browse files Browse the repository at this point in the history
  • Loading branch information
c121914yu authored Jun 21, 2024
1 parent 5cc01b8 commit 24596a6
Show file tree
Hide file tree
Showing 40 changed files with 906 additions and 1,056 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build-sandbox-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
build-fastgpt-sandbox-images:
runs-on: ubuntu-20.04
steps:
# install env
- name: Checkout
uses: actions/checkout@v3
with:
Expand All @@ -31,6 +32,7 @@ jobs:
restore-keys: |
${{ runner.os }}-buildx-
# login docker
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
Expand All @@ -49,6 +51,7 @@ jobs:
username: ${{ secrets.DOCKER_HUB_NAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}

# Set tag
- name: Set image name and tag
run: |
if [[ "${{ github.ref_name }}" == "main" ]]; then
Expand All @@ -66,6 +69,7 @@ jobs:
echo "Docker_Hub_Tag=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-sandbox:${{ github.ref_name }}" >> $GITHUB_ENV
echo "Docker_Hub_Latest=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-sandbox:latest" >> $GITHUB_ENV
fi
- name: Build and publish image for main branch or tag push event
env:
Git_Tag: ${{ env.Git_Tag }}
Expand Down
91 changes: 36 additions & 55 deletions .github/workflows/fastgpt-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
build-fastgpt-images:
runs-on: ubuntu-20.04
steps:
# install env
- name: Checkout
uses: actions/checkout@v3
with:
Expand All @@ -31,19 +32,45 @@ jobs:
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
# login docker
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GH_PAT }}
- name: Set DOCKER_REPO_TAGGED based on branch or tag
- name: Login to Ali Hub
uses: docker/login-action@v2
with:
registry: registry.cn-hangzhou.aliyuncs.com
username: ${{ secrets.ALI_HUB_USERNAME }}
password: ${{ secrets.ALI_HUB_PASSWORD }}
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_NAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}

# Set tag
- name: Set image name and tag
run: |
if [[ "${{ github.ref_name }}" == "main" ]]; then
echo "DOCKER_REPO_TAGGED=ghcr.io/${{ github.repository_owner }}/fastgpt:latest" >> $GITHUB_ENV
echo "Git_Tag=ghcr.io/${{ github.repository_owner }}/fastgpt:latest" >> $GITHUB_ENV
echo "Git_Latest=ghcr.io/${{ github.repository_owner }}/fastgpt:latest" >> $GITHUB_ENV
echo "Ali_Tag=${{ secrets.ALI_IMAGE_NAME }}/fastgpt:latest" >> $GITHUB_ENV
echo "Ali_Latest=${{ secrets.ALI_IMAGE_NAME }}/fastgpt:latest" >> $GITHUB_ENV
echo "Docker_Hub_Tag=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt:latest" >> $GITHUB_ENV
echo "Docker_Hub_Latest=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt:latest" >> $GITHUB_ENV
else
echo "DOCKER_REPO_TAGGED=ghcr.io/${{ github.repository_owner }}/fastgpt:${{ github.ref_name }}" >> $GITHUB_ENV
echo "Git_Tag=ghcr.io/${{ github.repository_owner }}/fastgpt:${{ github.ref_name }}" >> $GITHUB_ENV
echo "Git_Latest=ghcr.io/${{ github.repository_owner }}/fastgpt:latest" >> $GITHUB_ENV
echo "Ali_Tag=${{ secrets.ALI_IMAGE_NAME }}/fastgpt:${{ github.ref_name }}" >> $GITHUB_ENV
echo "Ali_Latest=${{ secrets.ALI_IMAGE_NAME }}/fastgpt:latest" >> $GITHUB_ENV
echo "Docker_Hub_Tag=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt:${{ github.ref_name }}" >> $GITHUB_ENV
echo "Docker_Hub_Latest=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt:latest" >> $GITHUB_ENV
fi
- name: Build and publish image for main branch or tag push event
env:
DOCKER_REPO_TAGGED: ${{ env.DOCKER_REPO_TAGGED }}
Expand All @@ -56,56 +83,10 @@ jobs:
--push \
--cache-from=type=local,src=/tmp/.buildx-cache \
--cache-to=type=local,dest=/tmp/.buildx-cache \
-t ${DOCKER_REPO_TAGGED} \
-t ${Git_Tag} \
-t ${Git_Latest} \
-t ${Ali_Tag} \
-t ${Ali_Latest} \
-t ${Docker_Hub_Tag} \
-t ${Docker_Hub_Latest} \
.
push-to-docker-hub:
needs: build-fastgpt-images
runs-on: ubuntu-20.04
if: github.repository == 'labring/FastGPT'
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_NAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Set DOCKER_REPO_TAGGED based on branch or tag
run: |
if [[ "${{ github.ref_name }}" == "main" ]]; then
echo "IMAGE_TAG=latest" >> $GITHUB_ENV
else
echo "IMAGE_TAG=${{ github.ref_name }}" >> $GITHUB_ENV
fi
- name: Pull image from GitHub Container Registry
run: docker pull ghcr.io/${{ github.repository_owner }}/fastgpt:${{env.IMAGE_TAG}}
- name: Tag image with Docker Hub repository name and version tag
run: docker tag ghcr.io/${{ github.repository_owner }}/fastgpt:${{env.IMAGE_TAG}} ${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt:${{env.IMAGE_TAG}}
- name: Push image to Docker Hub
run: docker push ${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt:${{env.IMAGE_TAG}}
push-to-ali-hub:
needs: build-fastgpt-images
if: github.repository == 'labring/FastGPT'
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Login to Ali Hub
uses: docker/login-action@v2
with:
registry: registry.cn-hangzhou.aliyuncs.com
username: ${{ secrets.ALI_HUB_USERNAME }}
password: ${{ secrets.ALI_HUB_PASSWORD }}
- name: Set DOCKER_REPO_TAGGED based on branch or tag
run: |
if [[ "${{ github.ref_name }}" == "main" ]]; then
echo "IMAGE_TAG=latest" >> $GITHUB_ENV
else
echo "IMAGE_TAG=${{ github.ref_name }}" >> $GITHUB_ENV
fi
- name: Pull image from GitHub Container Registry
run: docker pull ghcr.io/${{ github.repository_owner }}/fastgpt:${{env.IMAGE_TAG}}
- name: Tag image with Docker Hub repository name and version tag
run: docker tag ghcr.io/${{ github.repository_owner }}/fastgpt:${{env.IMAGE_TAG}} ${{ secrets.ALI_IMAGE_NAME }}/fastgpt:${{env.IMAGE_TAG}}
- name: Push image to Docker Hub
run: docker push ${{ secrets.ALI_IMAGE_NAME }}/fastgpt:${{env.IMAGE_TAG}}
4 changes: 3 additions & 1 deletion docSite/content/zh-cn/docs/development/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ images: []
### 页面崩溃

1. 关闭翻译
2. 检查配置文件是否正常加载,如果没有正常加载会导致缺失系统信息,在某些操作下会导致空指针。(95%情况是配置文件不对,可以F12打开控制台,看具体的空指针情况)
2. 检查配置文件是否正常加载,如果没有正常加载会导致缺失系统信息,在某些操作下会导致空指针。
* 95%情况是配置文件不对。会提示 xxx undefined
* 提示`URI malformed`,请 Issue 反馈具体操作和页面,这是由于特殊字符串编码解析报错。
3. 某些api不兼容问题(较少)

### 开启内容补全后,响应速度变慢
Expand Down
8 changes: 5 additions & 3 deletions docSite/content/zh-cn/docs/development/upgrading/485.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ curl --location --request POST 'https://{{host}}/api/admin/initv485' \
3. 优化 - 原文件编码存取
4. 优化 - 文件夹读取,支持单个文件夹超出 100 个文件
5. 优化 - 问答拆分/手动录入,当有`a`字段时,自动将`q`作为补充索引。
6. 修复 - SSR渲染
7. 修复 - 定时任务无法实际关闭
8. 修复 - 输入引导特殊字符导致正则报错
6. 优化 - 对话框页面代码
7. 修复 - SSR渲染
8. 修复 - 定时任务无法实际关闭
9. 修复 - 输入引导特殊字符导致正则报错
10. 修复 - 文件包含特殊字符`%`,且为转义时会导致页面崩溃
16 changes: 9 additions & 7 deletions packages/global/core/dataset/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ export function getSourceNameIcon({
sourceName: string;
sourceId?: string;
}) {
const fileIcon = getFileIcon(decodeURIComponent(sourceName), '');
if (fileIcon) {
return fileIcon;
}
if (strIsLink(sourceId)) {
return 'common/linkBlue';
}
try {
const fileIcon = getFileIcon(decodeURIComponent(sourceName.replace(/%/g, '%25')), '');
if (fileIcon) {
return fileIcon;
}
if (strIsLink(sourceId)) {
return 'common/linkBlue';
}
} catch (error) {}

return 'file/fill/manual';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type Props = Omit<BoxProps, 'onChange'> & {
onChange: (e: string) => void;
};

const RowTabs = ({ list, value, onChange, py = '7px', px = '12px', ...props }: Props) => {
const FillRowTabs = ({ list, value, onChange, py = '7px', px = '12px', ...props }: Props) => {
return (
<Box
display={'inline-flex'}
Expand Down Expand Up @@ -55,4 +55,4 @@ const RowTabs = ({ list, value, onChange, py = '7px', px = '12px', ...props }: P
);
};

export default RowTabs;
export default FillRowTabs;
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,24 @@ import React, { useMemo } from 'react';
import { Box, Flex, Grid, Image } from '@chakra-ui/react';
import type { FlexProps, GridProps } from '@chakra-ui/react';
import { useTranslation } from 'next-i18next';
import MyIcon from '@fastgpt/web/components/common/Icon';
import MyIcon from '../Icon';

// @ts-ignore
interface Props extends GridProps {
list: { id: string; icon?: string; label: string | React.ReactNode }[];
activeId: string;
type Props<ValueType = string> = Omit<GridProps, 'onChange'> & {
list: { icon?: string; label: string | React.ReactNode; value: ValueType }[];
value: ValueType;
size?: 'sm' | 'md' | 'lg';
inlineStyles?: FlexProps;
onChange: (id: string) => void;
}
onChange: (value: ValueType) => void;
};

const Tabs = ({ list, size = 'md', activeId, onChange, inlineStyles, ...props }: Props) => {
const LightRowTabs = <ValueType = string,>({
list,
size = 'md',
value,
onChange,
inlineStyles,
...props
}: Props<ValueType>) => {
const { t } = useTranslation();
const sizeMap = useMemo(() => {
switch (size) {
Expand Down Expand Up @@ -49,15 +55,15 @@ const Tabs = ({ list, size = 'md', activeId, onChange, inlineStyles, ...props }:
>
{list.map((item) => (
<Flex
key={item.id}
key={item.value as string}
py={sizeMap.inlineP}
alignItems={'center'}
justifyContent={'center'}
borderBottom={'2px solid transparent'}
px={3}
whiteSpace={'nowrap'}
{...inlineStyles}
{...(activeId === item.id
{...(value === item.value
? {
color: 'primary.600',
cursor: 'default',
Expand All @@ -68,8 +74,8 @@ const Tabs = ({ list, size = 'md', activeId, onChange, inlineStyles, ...props }:
cursor: 'pointer'
})}
onClick={() => {
if (activeId === item.id) return;
onChange(item.id);
if (value === item.value) return;
onChange(item.value);
}}
>
{item.icon && (
Expand All @@ -88,4 +94,4 @@ const Tabs = ({ list, size = 'md', activeId, onChange, inlineStyles, ...props }:
);
};

export default Tabs;
export default LightRowTabs;
3 changes: 2 additions & 1 deletion packages/web/styles/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,8 @@ export const theme = extendTheme({
color: 'myGray.600',
fontWeight: 'normal',
height: '100%',
overflow: 'hidden'
overflow: 'hidden',
fontSize: '16px'
},
a: {
color: 'primary.600'
Expand Down
1 change: 1 addition & 0 deletions projects/app/src/components/ChatBox/Input/ChatInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ const ChatInput = ({
color={'myGray.900'}
isDisabled={isSpeaking}
value={inputValue}
fontSize={['md', 'sm']}
onChange={(e) => {
const textarea = e.target;
textarea.style.height = textareaMinH;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import type { ChatHistoryItemResType } from '@fastgpt/global/core/chat/type.d';
import { useTranslation } from 'next-i18next';
import { moduleTemplatesFlat } from '@fastgpt/global/core/workflow/template/constants';

import Tabs from '../../Tabs';
import LightRowTabs from '@fastgpt/web/components/common/Tabs/LightRowTabs';
import MyModal from '@fastgpt/web/components/common/MyModal';
import MyTooltip from '@fastgpt/web/components/common/MyTooltip';
import Markdown from '../../Markdown';
import { QuoteList } from './QuoteModal';
import { DatasetSearchModeMap } from '@fastgpt/global/core/dataset/constants';
Expand Down Expand Up @@ -142,7 +141,7 @@ export const ResponseBox = React.memo(function ResponseBox({
{t(item.moduleName)}
</Flex>
),
id: `${i}`
value: `${i}`
})),
[response, t]
);
Expand All @@ -155,7 +154,7 @@ export const ResponseBox = React.memo(function ResponseBox({
<>
{!hideTabs && (
<Box>
<Tabs list={list} activeId={currentTab} onChange={setCurrentTab} />
<LightRowTabs list={list} value={currentTab} onChange={setCurrentTab} />
</Box>
)}
<Box py={2} px={4} flex={'1 0 0'} overflow={'auto'}>
Expand Down
2 changes: 1 addition & 1 deletion projects/app/src/components/ChatBox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ const ChatBox = (
</Box>
</Box>
{/* message input */}
{onStartChat && (chatStarted || filterVariableNodes.length === 0) && active && (
{onStartChat && (chatStarted || filterVariableNodes.length === 0) && active && appId && (
<ChatInput
onSendMessage={sendPrompt}
onStop={() => chatController.current?.abort('stop')}
Expand Down
2 changes: 1 addition & 1 deletion projects/app/src/components/Layout/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useMemo } from 'react';
import { Box, BoxProps, Flex, Link, LinkProps } from '@chakra-ui/react';
import { useRouter } from 'next/router';
import { useUserStore } from '@/web/support/user/useUserStore';
import { useChatStore } from '@/web/core/chat/storeChat';
import { useChatStore } from '@/web/core/chat/context/storeChat';
import { HUMAN_ICON } from '@fastgpt/global/common/system/constants';
import NextLink from 'next/link';
import Badge from '../Badge';
Expand Down
2 changes: 1 addition & 1 deletion projects/app/src/components/Layout/navbarPhone.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useMemo } from 'react';
import { useRouter } from 'next/router';
import { Flex, Box } from '@chakra-ui/react';
import { useChatStore } from '@/web/core/chat/storeChat';
import { useChatStore } from '@/web/core/chat/context/storeChat';
import { useTranslation } from 'next-i18next';
import Badge from '../Badge';
import MyIcon from '@fastgpt/web/components/common/Icon';
Expand Down
Loading

0 comments on commit 24596a6

Please sign in to comment.