Skip to content

Commit

Permalink
fix: per;fix: invite user un refresh;perf: loginout (#3566)
Browse files Browse the repository at this point in the history
* perf: loginout

* fix: invite user un refresh

* fix: per

* fix: dockerfile

* perf: docker file
  • Loading branch information
c121914yu authored Jan 11, 2025
1 parent 10d8c56 commit f1f0ae2
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 36 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/preview-fastgpt-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,23 @@ jobs:
--cache-to=type=local,dest=/tmp/.buildx-cache \
-t ${DOCKER_REPO_TAGGED} \
.
# Add write md step after build
- name: Write md
run: |
echo "# 🤖 Generated by deploy action" > report.md
echo "📦 Preview Image: \`${DOCKER_REPO_TAGGED}\`" >> report.md
cat report.md
- name: Gh Rebot for Sealos
uses: labring/[email protected]
if: ${{ (github.event_name == 'pull_request_target') }}
with:
version: v0.0.6
env:
GH_TOKEN: '${{ secrets.GH_PAT }}'
SEALOS_TYPE: 'pr_comment'
SEALOS_FILENAME: 'report.md'
SEALOS_REPLACE_TAG: 'DEFAULT_REPLACE_DEPLOY'

helm-check:
runs-on: ubuntu-20.04
Expand Down
1 change: 0 additions & 1 deletion projects/app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ COPY ./projects/app/data /app/data
RUN chown -R nextjs:nodejs /app/data

# Add tmp directory permission control
RUN mkdir -p /tmp && chmod 666 /tmp

ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,53 +1,50 @@
import React, { useEffect } from 'react';
import React from 'react';
import { useTranslation } from 'next-i18next';
import MyModal from '@fastgpt/web/components/common/MyModal';
import {
Button,
ModalFooter,
useDisclosure,
ModalBody,
Flex,
Box,
useTheme
} from '@chakra-ui/react';
import { useQuery } from '@tanstack/react-query';
import { Button, ModalFooter, ModalBody, Flex, Box, useTheme } from '@chakra-ui/react';
import { getTeamList, updateInviteResult } from '@/web/support/user/team/api';
import { TeamMemberStatusEnum } from '@fastgpt/global/support/user/team/constant';
import Avatar from '@fastgpt/web/components/common/Avatar';
import { useRequest } from '@fastgpt/web/hooks/useRequest';
import { useToast } from '@fastgpt/web/hooks/useToast';
import { useConfirm } from '@fastgpt/web/hooks/useConfirm';
import { useSystemStore } from '@/web/common/system/useSystemStore';
import { useRequest2 } from '@fastgpt/web/hooks/useRequest';
import { useUserStore } from '@/web/support/user/useUserStore';

const UpdateInviteModal = () => {
const { t } = useTranslation();
const theme = useTheme();
const { toast } = useToast();
const { ConfirmModal, openConfirm } = useConfirm({});
const { feConfigs } = useSystemStore();
const { initUserInfo } = useUserStore();

const { ConfirmModal, openConfirm } = useConfirm({});

const { data: inviteList = [], refetch } = useQuery(['getInviteList'], () =>
feConfigs.isPlus ? getTeamList(TeamMemberStatusEnum.waiting) : []
const { data: inviteList = [], run: fetchInviteList } = useRequest2(
async () => (feConfigs.isPlus ? getTeamList(TeamMemberStatusEnum.waiting) : []),
{
manual: false
}
);

const { mutate: onAccept, isLoading: isLoadingAccept } = useRequest({
mutationFn: updateInviteResult,
const { runAsync: onAccept, loading: isLoadingAccept } = useRequest2(updateInviteResult, {
onSuccess() {
toast({
status: 'success',
title: t('common:user.team.invite.Accepted')
});
refetch();
fetchInviteList();
initUserInfo();
}
});
const { mutate: onReject, isLoading: isLoadingReject } = useRequest({
mutationFn: updateInviteResult,
const { runAsync: onReject, loading: isLoadingReject } = useRequest2(updateInviteResult, {
onSuccess() {
toast({
status: 'success',
title: t('common:user.team.invite.Reject')
});
refetch();
fetchInviteList();
initUserInfo();
}
});

Expand All @@ -59,7 +56,7 @@ const UpdateInviteModal = () => {
<Box>
<Box>{t('common:user.team.Processing invitations')}</Box>
<Box fontWeight={'normal'} fontSize={'sm'} color={'myGray.500'}>
{t('user.team.Processing invitations Tips', { amount: inviteList?.length })}
{t('common:user.team.Processing invitations Tips', { amount: inviteList?.length })}
</Box>
</Box>
}
Expand Down
2 changes: 0 additions & 2 deletions projects/app/src/pages/account/team/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import { useContextSelector } from 'use-context-selector';
import { useRouter } from 'next/router';
import FillRowTabs from '@fastgpt/web/components/common/Tabs/FillRowTabs';
import MyIcon from '@fastgpt/web/components/common/Icon';
import { useToast } from '@fastgpt/web/hooks/useToast';
import { useSystemStore } from '@/web/common/system/useSystemStore';
import { TeamMemberRoleEnum } from '@fastgpt/global/support/user/team/constant';
import { TeamContext, TeamModalContextProvider } from './components/context';
import dynamic from 'next/dynamic';
Expand Down
16 changes: 5 additions & 11 deletions projects/app/src/pages/api/support/user/account/loginout.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
import type { NextApiRequest, NextApiResponse } from 'next';
import { jsonRes } from '@fastgpt/service/common/response';
import { clearCookie } from '@fastgpt/service/support/permission/controller';
import { NextAPI } from '@/service/middleware/entry';

export default async function handler(req: NextApiRequest, res: NextApiResponse<any>) {
try {
clearCookie(res);
jsonRes(res);
} catch (err) {
jsonRes(res, {
code: 500,
error: err
});
}
async function handler(req: NextApiRequest, res: NextApiResponse<any>) {
clearCookie(res);
}

export default NextAPI(handler);

0 comments on commit f1f0ae2

Please sign in to comment.