import { useEffect, useState, useContext } from 'react'; import Typography from '@mui/material/Typography'; import { useTranslation } from 'react-i18next'; import Icons from '@/components/icons/Icons'; import { AuthForm } from './AuthForm'; import CustomButton from '@/components/customButton/CustomButton'; import { MilvusService } from '@/http'; import Box from '@mui/material/Box'; import type { Theme } from '@mui/material/styles'; import { ColorModeContext } from '@/context'; import { IconButton } from '@mui/material'; import { ATTU_SOURCE_CODE, ATTU_ISSUES, ATTU_DISCORD, ATTU_OFFICE_HOURS, } from '@/consts/link'; const ConnectContainer = () => { const [version, setVersion] = useState('loading'); const { t: commonTrans } = useTranslation(); const { t: btnTrans } = useTranslation('btn'); const { mode, toggleColorMode } = useContext(ColorModeContext); useEffect(() => { MilvusService.getVersion().then((res: any) => { setVersion(res.attu); }); }, []); return ( `1px solid ${theme.palette.divider}`, borderRadius: 2, minHeight: 680, }} > theme.spacing(4, 3), backgroundColor: (theme: Theme) => theme.palette.mode === 'dark' ? theme.palette.background.default : theme.palette.neutral[50], borderRadius: '12px 0 0 12px', position: 'relative', }} > {mode === 'dark' ? : } theme.spacing(2), display: 'block', color: 'primary.main', }} /> theme.palette.mode === 'dark' ? theme.palette.common.white : 'primary.contrastText', marginTop: (theme: Theme) => theme.spacing(2), height: 32, }} > {commonTrans('attu.admin')} {version && ( theme.spacing(1), fontSize: 13, color: (theme: Theme) => theme.palette.mode === 'dark' ? theme.palette.common.white : 'primary.contrastText', opacity: 0.8, height: 16, }} > {commonTrans('attu.version')}: {version} )} theme.spacing(6), display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', width: '100%', gap: (theme: Theme) => theme.spacing(2), '& button': { borderColor: (theme: Theme) => theme.palette.mode === 'dark' ? theme.palette.common.white : 'primary.contrastText', color: (theme: Theme) => theme.palette.mode === 'dark' ? theme.palette.common.white : 'primary.contrastText', height: 40, fontSize: 14, '&:hover': { backgroundColor: 'primary.main', borderColor: 'primary.main', }, }, }} > } fullWidth={true} variant="outlined" onClick={() => window.open(ATTU_SOURCE_CODE, '_blank')} > {btnTrans('star')} } fullWidth={true} variant="outlined" onClick={() => window.open(ATTU_ISSUES, '_blank')} > {commonTrans('attu.fileIssue')} } variant="outlined" onClick={() => window.open(ATTU_DISCORD, '_blank')} fullWidth={true} > {commonTrans('attu.discord')} } variant="outlined" onClick={() => window.open(ATTU_OFFICE_HOURS, '_blank')} fullWidth={true} > {commonTrans('attu.officeHours')} theme.spacing(6, 0), backgroundColor: 'background.paper', }} > ); }; export default ConnectContainer;