Browse Source

fix some UI issues

Signed-off-by: ruiyi.jiang <ruiyi.jiang@zilliz.com>
ruiyi.jiang 1 year ago
parent
commit
660dd4c1dd

+ 0 - 1
client/src/components/customTabList/RouteTabList.tsx

@@ -19,7 +19,6 @@ const useStyles = makeStyles((theme: Theme) => ({
     padding: theme.spacing(0, 1),
     padding: theme.spacing(0, 1),
   },
   },
   tab: {
   tab: {
-    height: theme.spacing(0.5),
     backgroundColor: theme.palette.primary.main,
     backgroundColor: theme.palette.primary.main,
   },
   },
   tabContainer: {
   tabContainer: {

+ 3 - 3
client/src/components/grid/Grid.tsx

@@ -182,13 +182,13 @@ const AttuGrid: FC<AttuGridType> = props => {
     if (tableRef.current && rowHeight > 0) {
     if (tableRef.current && rowHeight > 0) {
       const containerHeight: number = tableRef.current.offsetHeight;
       const containerHeight: number = tableRef.current.offsetHeight;
       const hasToolbar = toolbarConfigs.length > 0;
       const hasToolbar = toolbarConfigs.length > 0;
-      const totleHeight =
+      const totalHeight =
         containerHeight -
         containerHeight -
         tableHeaderHeight -
         tableHeaderHeight -
         (showPagination ? pagerHeight : 0) -
         (showPagination ? pagerHeight : 0) -
-        (hasToolbar ? 34 : 0);
+        (hasToolbar ? 47 : 0);
 
 
-      const rowCount = Math.floor(totleHeight / rowHeight);
+      const rowCount = Math.floor(totalHeight / rowHeight);
 
 
       // fix loading mask
       // fix loading mask
       setLoadingRowCount(rowCount);
       setLoadingRowCount(rowCount);

+ 10 - 10
client/src/components/icons/Icons.tsx

@@ -72,8 +72,8 @@ const icons: { [x in IconsType]: (props?: any) => React.ReactElement } = {
   ),
   ),
   navPerson: (props = {}) => (
   navPerson: (props = {}) => (
     <SvgIcon
     <SvgIcon
-      width="24"
-      height="24"
+      width="15"
+      height="15"
       viewBox="0 0 15 15"
       viewBox="0 0 15 15"
       fill="none"
       fill="none"
       xmlns="http://www.w3.org/2000/svg"
       xmlns="http://www.w3.org/2000/svg"
@@ -88,8 +88,8 @@ const icons: { [x in IconsType]: (props?: any) => React.ReactElement } = {
   ),
   ),
   navOverview: (props = {}) => (
   navOverview: (props = {}) => (
     <SvgIcon
     <SvgIcon
-      width="24"
-      height="24"
+      width="15"
+      height="15"
       viewBox="0 0 15 15"
       viewBox="0 0 15 15"
       fill="none"
       fill="none"
       xmlns="http://www.w3.org/2000/svg"
       xmlns="http://www.w3.org/2000/svg"
@@ -123,8 +123,8 @@ const icons: { [x in IconsType]: (props?: any) => React.ReactElement } = {
   ),
   ),
   navSearch: (props = {}) => (
   navSearch: (props = {}) => (
     <SvgIcon
     <SvgIcon
-      width="24"
-      height="24"
+      width="15"
+      height="15"
       viewBox="0 0 15 15"
       viewBox="0 0 15 15"
       fill="none"
       fill="none"
       xmlns="http://www.w3.org/2000/svg"
       xmlns="http://www.w3.org/2000/svg"
@@ -139,8 +139,8 @@ const icons: { [x in IconsType]: (props?: any) => React.ReactElement } = {
   ),
   ),
   navSystem: (props = {}) => (
   navSystem: (props = {}) => (
     <SvgIcon
     <SvgIcon
-      width="24"
-      height="24"
+      width="15"
+      height="15"
       viewBox="0 0 15 15"
       viewBox="0 0 15 15"
       fill="none"
       fill="none"
       xmlns="http://www.w3.org/2000/svg"
       xmlns="http://www.w3.org/2000/svg"
@@ -155,8 +155,8 @@ const icons: { [x in IconsType]: (props?: any) => React.ReactElement } = {
   ),
   ),
   settings: (props = {}) => (
   settings: (props = {}) => (
     <SvgIcon
     <SvgIcon
-      width="24"
-      height="24"
+      width="15"
+      height="15"
       viewBox="0 0 15 15"
       viewBox="0 0 15 15"
       fill="none"
       fill="none"
       xmlns="http://www.w3.org/2000/svg"
       xmlns="http://www.w3.org/2000/svg"

+ 9 - 11
client/src/components/menu/NavMenu.tsx

@@ -12,7 +12,6 @@ import icons from '../icons/Icons';
 import { useTranslation } from 'react-i18next';
 import { useTranslation } from 'react-i18next';
 import Typography from '@material-ui/core/Typography';
 import Typography from '@material-ui/core/Typography';
 import ChevronRightIcon from '@material-ui/icons/ChevronRight';
 import ChevronRightIcon from '@material-ui/icons/ChevronRight';
-import CommunityBtn from './CommunityBtn';
 
 
 const timeout = 150;
 const timeout = 150;
 const duration = `${timeout}ms`;
 const duration = `${timeout}ms`;
@@ -32,17 +31,16 @@ const useStyles = makeStyles((theme: Theme) =>
       }),
       }),
     },
     },
     rootCollapse: {
     rootCollapse: {
-      width: theme.spacing(9),
+      width: '56px',
     },
     },
     rootExpand: {
     rootExpand: {
       width: (props: any) => props.width || '100%',
       width: (props: any) => props.width || '100%',
     },
     },
     nested: {
     nested: {
-      paddingLeft: theme.spacing(4),
+      paddingLeft: '12px',
     },
     },
     item: {
     item: {
-      marginBottom: theme.spacing(0.5),
-      paddingLeft: theme.spacing(3),
+      paddingLeft: '16px',
       boxSizing: 'content-box',
       boxSizing: 'content-box',
       height: theme.spacing(3),
       height: theme.spacing(3),
       width: 'initial',
       width: 'initial',
@@ -87,8 +85,8 @@ const useStyles = makeStyles((theme: Theme) =>
       display: 'flex',
       display: 'flex',
       alignItems: 'center',
       alignItems: 'center',
       height: '86px',
       height: '86px',
-      marginBottom: theme.spacing(2),
-      paddingLeft: theme.spacing(3),
+      marginBottom: theme.spacing(1),
+      paddingLeft: '16px',
 
 
       '& .title': {
       '& .title': {
         margin: 0,
         margin: 0,
@@ -137,12 +135,13 @@ const useStyles = makeStyles((theme: Theme) =>
       transform: 'rotateZ(180deg)',
       transform: 'rotateZ(180deg)',
     },
     },
     collapseIcon: {
     collapseIcon: {
-      left: 58,
+      left: 44,
     },
     },
     version: {
     version: {
       position: 'absolute',
       position: 'absolute',
-      left: 16,
-      bottom: (props: any) => (props.expanded ? '20px' : '70px'),
+      fontSize: '10px',
+      bottom: 10,
+      left: 12,
     },
     },
   })
   })
 );
 );
@@ -248,7 +247,6 @@ const NavMenu: FC<NavMenuType> = props => {
         >
         >
           v {versionInfo.attu}
           v {versionInfo.attu}
         </Typography>
         </Typography>
-        <CommunityBtn />
       </div>
       </div>
     </List>
     </List>
   );
   );

+ 1 - 1
client/src/i18n/en/nav.ts

@@ -5,7 +5,7 @@ const navTrans = {
   search: 'Vector Search',
   search: 'Vector Search',
   system: 'System View',
   system: 'System View',
   user: 'User',
   user: 'User',
-  dbAdmin: 'Database Management',
+  dbAdmin: 'DB Management',
   database: 'Database',
   database: 'Database',
 };
 };
 
 

+ 2 - 1
client/src/pages/collections/Collections.tsx

@@ -483,7 +483,7 @@ const Collections = () => {
               </Tooltip>
               </Tooltip>
             ) : null}
             ) : null}
             <Tooltip
             <Tooltip
-              title={consistencyTooltipsMap[v.consistency_level]}
+              title={consistencyTooltipsMap[v.consistency_level] || ''}
               placement="top"
               placement="top"
               arrow
               arrow
             >
             >
@@ -619,6 +619,7 @@ const Collections = () => {
           page={currentPage}
           page={currentPage}
           onPageChange={handlePageChange}
           onPageChange={handlePageChange}
           rowsPerPage={pageSize}
           rowsPerPage={pageSize}
+          tableHeaderHeight={49}
           rowHeight={49}
           rowHeight={49}
           setRowsPerPage={handlePageSize}
           setRowsPerPage={handlePageSize}
           isLoading={loading}
           isLoading={loading}

+ 0 - 1
client/src/pages/collections/StatusAction.tsx

@@ -80,7 +80,6 @@ const StatusAction: FC<StatusActionType> = props => {
     collectionName,
     collectionName,
     field,
     field,
     action = () => {},
     action = () => {},
-    onIndexCreate,
   } = props;
   } = props;
   const { t: commonTrans } = useTranslation();
   const { t: commonTrans } = useTranslation();
   const { t: collectionTrans } = useTranslation('collection');
   const { t: collectionTrans } = useTranslation('collection');

+ 4 - 4
client/src/pages/index.tsx

@@ -58,10 +58,10 @@ function Index() {
   const isIndex = location.pathname === '/';
   const isIndex = location.pathname === '/';
   const defaultActive = useMemo(() => {
   const defaultActive = useMemo(() => {
     if (location.pathname.includes('databases')) {
     if (location.pathname.includes('databases')) {
-      return navTrans('databases');
+      return navTrans('database');
     }
     }
     if (location.pathname.includes('db-admin')) {
     if (location.pathname.includes('db-admin')) {
-      return navTrans('db-admin');
+      return navTrans('dbAdmin');
     }
     }
 
 
     if (location.pathname.includes('search')) {
     if (location.pathname.includes('search')) {
@@ -87,7 +87,7 @@ function Index() {
     },
     },
     {
     {
       icon: icons.database,
       icon: icons.database,
-      label: navTrans('databases'),
+      label: navTrans('database'),
       onClick: () => navigate(`/databases/${database}`),
       onClick: () => navigate(`/databases/${database}`),
     },
     },
     {
     {
@@ -116,7 +116,7 @@ function Index() {
       },
       },
       {
       {
         icon: icons.settings,
         icon: icons.settings,
-        label: navTrans('db-admin'),
+        label: navTrans('dbAdmin'),
         onClick: () => navigate('/db-admin'),
         onClick: () => navigate('/db-admin'),
       }
       }
     );
     );

+ 1 - 0
client/src/pages/query/Query.tsx

@@ -398,6 +398,7 @@ const Query = () => {
             isLoading={tableLoading}
             isLoading={tableLoading}
             rows={queryResult.data}
             rows={queryResult.data}
             rowCount={total}
             rowCount={total}
+            tableHeaderHeight={46}
             rowHeight={43}
             rowHeight={43}
             selected={selectedData}
             selected={selectedData}
             setSelected={onSelectChange}
             setSelected={onSelectChange}

+ 1 - 1
client/src/pages/query/Styles.ts

@@ -16,7 +16,7 @@ export const getQueryStyles = makeStyles((theme: Theme) => ({
     justifyContent: 'space-between',
     justifyContent: 'space-between',
     alignItems: 'center',
     alignItems: 'center',
     backgroundColor: 'white',
     backgroundColor: 'white',
-    padding: theme.spacing(1, 0),
+    padding: theme.spacing(0, 0, 1),
     gap: theme.spacing(2),
     gap: theme.spacing(2),
     borderRadius: theme.spacing(0.5, 0.5, 0, 0),
     borderRadius: theme.spacing(0.5, 0.5, 0, 0),