diff --git a/.github/workflows/fastgpt-image.yml b/.github/workflows/fastgpt-image.yml index 2752e86cd..fdf652d00 100644 --- a/.github/workflows/fastgpt-image.yml +++ b/.github/workflows/fastgpt-image.yml @@ -90,3 +90,45 @@ jobs: -t ${Docker_Hub_Tag} \ -t ${Docker_Hub_Latest} \ . + build-fastgpt-images-child-route: + runs-on: ubuntu-20.04 + steps: + # Set tag + - name: Set image name and tag + run: | + if [[ "${{ github.ref_name }}" == "main" ]]; then + echo "Git_Tag=ghcr.io/${{ github.repository_owner }}/fastgpt-child-route:latest" >> $GITHUB_ENV + echo "Git_Latest=ghcr.io/${{ github.repository_owner }}/fastgpt-child-route:latest" >> $GITHUB_ENV + echo "Ali_Tag=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-child-route:latest" >> $GITHUB_ENV + echo "Ali_Latest=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-child-route:latest" >> $GITHUB_ENV + echo "Docker_Hub_Tag=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-child-route:latest" >> $GITHUB_ENV + echo "Docker_Hub_Latest=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-child-route:latest" >> $GITHUB_ENV + else + echo "Git_Tag=ghcr.io/${{ github.repository_owner }}/fastgpt-child-route:${{ github.ref_name }}" >> $GITHUB_ENV + echo "Git_Latest=ghcr.io/${{ github.repository_owner }}/fastgpt-child-route:latest" >> $GITHUB_ENV + echo "Ali_Tag=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-child-route:${{ github.ref_name }}" >> $GITHUB_ENV + echo "Ali_Latest=${{ secrets.ALI_IMAGE_NAME }}/fastgpt-child-route:latest" >> $GITHUB_ENV + echo "Docker_Hub_Tag=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-child-route:${{ github.ref_name }}" >> $GITHUB_ENV + echo "Docker_Hub_Latest=${{ secrets.DOCKER_IMAGE_NAME }}/fastgpt-child-route:latest" >> $GITHUB_ENV + fi + + - name: Build and publish image for main branch or tag push event + env: + DOCKER_REPO_TAGGED: ${{ env.DOCKER_REPO_TAGGED }} + run: | + docker buildx build \ + -f projects/app/Dockerfile \ + --platform linux/amd64,linux/arm64 \ + --build-arg base_url=fastai \ + --label "org.opencontainers.image.source=https://github.com/${{ github.repository_owner }}/FastGPT" \ + --label "org.opencontainers.image.description=fastgpt image" \ + --push \ + --cache-from=type=local,src=/tmp/.buildx-cache \ + --cache-to=type=local,dest=/tmp/.buildx-cache \ + -t ${Git_Tag} \ + -t ${Git_Latest} \ + -t ${Ali_Tag} \ + -t ${Ali_Latest} \ + -t ${Docker_Hub_Tag} \ + -t ${Docker_Hub_Latest} \ + . diff --git a/packages/service/common/file/read/utils.ts b/packages/service/common/file/read/utils.ts index dad2d8c10..08a77eacd 100644 --- a/packages/service/common/file/read/utils.ts +++ b/packages/service/common/file/read/utils.ts @@ -9,6 +9,7 @@ import type { ReadFileResponse } from '../../../worker/readFile/type'; import axios from 'axios'; import { addLog } from '../../system/log'; import { batchRun } from '@fastgpt/global/common/fn/utils'; +import { addHours } from 'date-fns'; export type readRawTextByLocalFileParams = { teamId: string; @@ -111,6 +112,7 @@ export const readRawContentByFileBuffer = async ({ type: MongoImageTypeEnum.collectionImage, base64Img: `data:${item.mime};base64,${item.base64}`, teamId, + expiredTime: addHours(new Date(), 1), metadata: { ...metadata, mime: item.mime diff --git a/projects/app/.env.template b/projects/app/.env.template index 9decedb37..69cd81a85 100644 --- a/projects/app/.env.template +++ b/projects/app/.env.template @@ -35,7 +35,7 @@ SANDBOX_URL=http://localhost:3001 PRO_URL= # 页面的地址,用于自动补全相对路径资源的 domain FE_DOMAIN=http://localhost:3000 -# 二级路由 +# 二级路由,需要打包时候就确定 # NEXT_PUBLIC_BASE_URL=/fastai # 日志等级: debug, info, warn, error diff --git a/projects/app/src/pages/dataset/detail/components/NavBar.tsx b/projects/app/src/pages/dataset/detail/components/NavBar.tsx index ffd1f6c77..8ae91ea19 100644 --- a/projects/app/src/pages/dataset/detail/components/NavBar.tsx +++ b/projects/app/src/pages/dataset/detail/components/NavBar.tsx @@ -89,14 +89,12 @@ const NavBar = ({ currentTab }: { currentTab: TabEnum }) => { } bg={'white'} - size={'smSquare'} + size={'xsSquare'} borderRadius={'50%'} aria-label={''} _hover={'none'}