From c9c690db3ccb01e522d0af530fe4f91009da7368 Mon Sep 17 00:00:00 2001 From: ryjiang Date: Mon, 16 Jun 2025 15:46:10 +0800 Subject: [PATCH 1/2] add office hour on the login page Signed-off-by: ryjiang --- client/src/components/icons/Icons.tsx | 17 +++++++++++++++++ client/src/components/icons/Types.ts | 3 ++- client/src/i18n/cn/common.ts | 1 + client/src/i18n/en/common.ts | 1 + client/src/pages/connect/ConnectContainer.tsx | 9 +++++++++ 5 files changed, 30 insertions(+), 1 deletion(-) diff --git a/client/src/components/icons/Icons.tsx b/client/src/components/icons/Icons.tsx index 0c50a97d..eafd6bf6 100644 --- a/client/src/components/icons/Icons.tsx +++ b/client/src/components/icons/Icons.tsx @@ -1027,6 +1027,23 @@ const icons: { > ), + calendar: (props = {}) => ( + + + + ), }; export default icons; diff --git a/client/src/components/icons/Types.ts b/client/src/components/icons/Types.ts index d417ba85..99715a1f 100644 --- a/client/src/components/icons/Types.ts +++ b/client/src/components/icons/Types.ts @@ -62,4 +62,5 @@ export type IconsType = | 'file' | 'eye' | 'newWindow' - | 'caretSort'; + | 'caretSort' + | 'calendar'; diff --git a/client/src/i18n/cn/common.ts b/client/src/i18n/cn/common.ts index 005f5e42..97ad2b95 100644 --- a/client/src/i18n/cn/common.ts +++ b/client/src/i18n/cn/common.ts @@ -20,6 +20,7 @@ const commonTrans = { checkHealth: '检查健康状态', version: '版本', clearHistory: '清空所有历史', + officeHours: 'Office Hours', }, status: { loaded: '已加载', diff --git a/client/src/i18n/en/common.ts b/client/src/i18n/en/common.ts index 09e86eaf..24a9acd1 100644 --- a/client/src/i18n/en/common.ts +++ b/client/src/i18n/en/common.ts @@ -21,6 +21,7 @@ const commonTrans = { checkHealth: 'Check Health', version: 'Version', clearHistory: 'Clear All History', + officeHours: 'Office Hours', }, status: { loaded: 'Loaded', diff --git a/client/src/pages/connect/ConnectContainer.tsx b/client/src/pages/connect/ConnectContainer.tsx index 4232a940..2a789866 100644 --- a/client/src/pages/connect/ConnectContainer.tsx +++ b/client/src/pages/connect/ConnectContainer.tsx @@ -171,6 +171,15 @@ const ConnectContainer = () => { > {commonTrans('attu.discord')} + + } + variant="outlined" + onClick={() => window.open('https://milvus.io/blog/join-milvus-office-hours-to-get-support-from-vectordb-experts.md', '_blank')} + fullWidth={true} + > + {commonTrans('attu.officeHours')} + Date: Mon, 16 Jun 2025 17:03:40 +0800 Subject: [PATCH 2/2] add more Signed-off-by: ryjiang --- client/src/consts/link.ts | 11 + client/src/i18n/cn/common.ts | 3 + client/src/i18n/en/common.ts | 3 + client/src/pages/connect/ConnectContainer.tsx | 21 +- client/src/pages/home/CommunityLinks.tsx | 135 +++++++++ client/src/pages/home/Home.tsx | 278 ++++++++++-------- 6 files changed, 314 insertions(+), 137 deletions(-) create mode 100644 client/src/pages/home/CommunityLinks.tsx diff --git a/client/src/consts/link.ts b/client/src/consts/link.ts index 6229af22..d038f4c1 100644 --- a/client/src/consts/link.ts +++ b/client/src/consts/link.ts @@ -2,3 +2,14 @@ export const MILVUS_BASE_URL = 'https://milvus.io'; export const CLOUD_DOCS_BASE_URL = `https://docs.zilliz.com`; export const MILVUS_RESTFUL_DOC_URL = `${MILVUS_BASE_URL}/api-reference/restful/v2.5.x/About.md`; export const CLOUD_RESTFUL_DOC_URL = `${CLOUD_DOCS_BASE_URL}/reference/restful/data-plane-v2`; + +// Community links +export const MILVUS_SOURCE_CODE = 'https://github.com/milvus-io/milvus'; +export const MILVUS_DOCS = 'https://milvus.io/docs'; +export const MILVUS_DISCORD = 'https://milvus.io/discord'; +export const MILVUS_OFFICE_HOURS = 'https://milvus.io/blog/join-milvus-office-hours-to-get-support-from-vectordb-experts.md'; + +export const ATTU_SOURCE_CODE = 'https://github.com/zilliztech/attu'; +export const ATTU_ISSUES = 'https://github.com/zilliztech/attu/issues'; +export const ATTU_DISCORD = 'https://milvus.io/discord'; +export const ATTU_OFFICE_HOURS = 'https://milvus.io/blog/join-milvus-office-hours-to-get-support-from-vectordb-experts.md'; diff --git a/client/src/i18n/cn/common.ts b/client/src/i18n/cn/common.ts index 97ad2b95..01549d89 100644 --- a/client/src/i18n/cn/common.ts +++ b/client/src/i18n/cn/common.ts @@ -3,6 +3,7 @@ const commonTrans = { admin: 'Attu', address: 'Milvus 地址', fileIssue: '提交问题', + fileMilvusIssue: '提交 Milvus 问题', discord: 'Discord', token: 'Token', authentication: '认证', @@ -21,6 +22,8 @@ const commonTrans = { version: '版本', clearHistory: '清空所有历史', officeHours: 'Office Hours', + docs: 'Docs', + community: '社区', }, status: { loaded: '已加载', diff --git a/client/src/i18n/en/common.ts b/client/src/i18n/en/common.ts index 24a9acd1..89baf6d1 100644 --- a/client/src/i18n/en/common.ts +++ b/client/src/i18n/en/common.ts @@ -3,6 +3,7 @@ const commonTrans = { admin: 'Attu', address: 'Milvus Address', fileIssue: 'Open an Issue', + fileMilvusIssue: 'Open a Milvus Issue', discord: 'Discord', token: 'token', authentication: 'Authentication', @@ -22,6 +23,8 @@ const commonTrans = { version: 'Version', clearHistory: 'Clear All History', officeHours: 'Office Hours', + docs: 'Docs', + community: 'Community', }, status: { loaded: 'Loaded', diff --git a/client/src/pages/connect/ConnectContainer.tsx b/client/src/pages/connect/ConnectContainer.tsx index 2a789866..e38f9b81 100644 --- a/client/src/pages/connect/ConnectContainer.tsx +++ b/client/src/pages/connect/ConnectContainer.tsx @@ -9,6 +9,12 @@ 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'); @@ -142,9 +148,7 @@ const ConnectContainer = () => { startIcon={} fullWidth={true} variant="outlined" - onClick={() => - window.open('https://github.com/zilliztech/attu', '_blank') - } + onClick={() => window.open(ATTU_SOURCE_CODE, '_blank')} > {btnTrans('star')} @@ -153,12 +157,7 @@ const ConnectContainer = () => { startIcon={} fullWidth={true} variant="outlined" - onClick={() => - window.open( - 'https://github.com/zilliztech/attu/issues', - '_blank' - ) - } + onClick={() => window.open(ATTU_ISSUES, '_blank')} > {commonTrans('attu.fileIssue')} @@ -166,7 +165,7 @@ const ConnectContainer = () => { } variant="outlined" - onClick={() => window.open('https://milvus.io/discord', '_blank')} + onClick={() => window.open(ATTU_DISCORD, '_blank')} fullWidth={true} > {commonTrans('attu.discord')} @@ -175,7 +174,7 @@ const ConnectContainer = () => { } variant="outlined" - onClick={() => window.open('https://milvus.io/blog/join-milvus-office-hours-to-get-support-from-vectordb-experts.md', '_blank')} + onClick={() => window.open(ATTU_OFFICE_HOURS, '_blank')} fullWidth={true} > {commonTrans('attu.officeHours')} diff --git a/client/src/pages/home/CommunityLinks.tsx b/client/src/pages/home/CommunityLinks.tsx new file mode 100644 index 00000000..0894f839 --- /dev/null +++ b/client/src/pages/home/CommunityLinks.tsx @@ -0,0 +1,135 @@ +import { Box, Typography, Link } from '@mui/material'; +import { useTranslation } from 'react-i18next'; +import { useContext } from 'react'; +import { + MILVUS_SOURCE_CODE, + MILVUS_DOCS, + MILVUS_DISCORD, + MILVUS_OFFICE_HOURS, +} from '@/consts/link'; +import Icons from '@/components/icons/Icons'; +import { authContext } from '@/context'; + +const CommunityLinks = () => { + const { t } = useTranslation(); + const { isManaged } = useContext(authContext); + + const links = isManaged + ? [ + { + title: t('attu.docs'), + url: 'https://docs.zilliz.com/docs/home', + icon: , + }, + { + title: 'Support', + url: 'https://support.zilliz.com/hc/en-us', + icon: , + }, + { + title: 'Pricing', + url: 'https://zilliz.com/pricing', + icon: , + }, + { + title: t('attu.discord'), + url: MILVUS_DISCORD, + icon: , + }, + ] + : [ + { + title: t('attu.fileMilvusIssue'), + url: MILVUS_SOURCE_CODE, + icon: , + }, + { + title: t('attu.docs'), + url: MILVUS_DOCS, + icon: , + }, + { + title: t('attu.discord'), + url: MILVUS_DISCORD, + icon: , + }, + { + title: t('attu.officeHours'), + url: MILVUS_OFFICE_HOURS, + icon: , + }, + ]; + + return ( + + + {isManaged ? 'Zilliz Cloud' : t('attu.community')} + + + {links.map(link => ( + + + {link.icon} + + + {link.title} + + + ))} + + + ); +}; + +export default CommunityLinks; diff --git a/client/src/pages/home/Home.tsx b/client/src/pages/home/Home.tsx index 98eeb78b..43872c7e 100644 --- a/client/src/pages/home/Home.tsx +++ b/client/src/pages/home/Home.tsx @@ -16,6 +16,7 @@ import CreateDatabaseDialog from '../dialogs/CreateDatabaseDialog'; import icons from '@/components/icons/Icons'; import SysCard from './SysCard'; import StatusIcon, { LoadingType } from '@/components/status/StatusIcon'; +import CommunityLinks from '@/pages/home/CommunityLinks'; const Home = () => { useNavigationHook(ROUTE_PATHS.HOME); @@ -88,147 +89,114 @@ const Home = () => { margin: '12px', position: 'relative', display: 'flex', - flexDirection: 'column', + gap: 2, height: 'calc(100vh - 80px)', + pr: 2, + overflow: 'hidden', })} > + {/* Main content */} - - - + + + theme.palette.text.primary, + }} + > + {databaseTrans('databases')} + + + ({databases.length}) + + + - - - {loadingDatabases ? ( - - ) : ( - - {databases.map(db => { - if (db.name === database) { - db.collections = collections.map(c => c.collection_name); - } - return ( - - ); - })} - - )} - - - {data?.systemInfo && ( - <> - - theme.palette.text.primary }} - > - {homeTrans('sysInfo')} - + {loadingDatabases ? ( + + ) : ( - - - - - - - + {databases.map(db => { + if (db.name === database) { + db.collections = collections.map(c => c.collection_name); + } + return ( + + ); + })} - + )} + - {data?.deployMode === MILVUS_DEPLOY_MODE.DISTRIBUTED && ( + {data?.systemInfo && ( + <> + theme.palette.text.primary }} + > + {homeTrans('sysInfo')} + { }} > + + + + - )} - - )} + + {data?.deployMode === MILVUS_DEPLOY_MODE.DISTRIBUTED && ( + + + + + + + + )} + + )} + + + {/* Right sidebar */} + + + ); };