Browse Source

ui: fix schema page ui

Signed-off-by: ryjiang <jiangruiyi@gmail.com>
ryjiang 3 weeks ago
parent
commit
eb1ae7f83a

+ 4 - 4
client/src/pages/databases/collections/schema/Schema.tsx

@@ -460,7 +460,7 @@ const Overview = () => {
             <InfoRow>
             <InfoRow>
               <InfoLabel>{collectionTrans('description')}</InfoLabel>
               <InfoLabel>{collectionTrans('description')}</InfoLabel>
               <InfoValue>
               <InfoValue>
-                <Typography variant="body1">
+                <Typography variant="body2">
                   {collection?.description || '--'}
                   {collection?.description || '--'}
                 </Typography>
                 </Typography>
               </InfoValue>
               </InfoValue>
@@ -469,7 +469,7 @@ const Overview = () => {
             <InfoRow>
             <InfoRow>
               <InfoLabel>{collectionTrans('createdTime')}</InfoLabel>
               <InfoLabel>{collectionTrans('createdTime')}</InfoLabel>
               <InfoValue>
               <InfoValue>
-                <Typography variant="body1">
+                <Typography variant="body2">
                   {new Date(collection.createdTime).toLocaleString()}
                   {new Date(collection.createdTime).toLocaleString()}
                 </Typography>
                 </Typography>
               </InfoValue>
               </InfoValue>
@@ -507,7 +507,7 @@ const Overview = () => {
                 </CustomToolTip>
                 </CustomToolTip>
               </InfoLabel>
               </InfoLabel>
               <InfoValue>
               <InfoValue>
-                <Typography variant="body1">
+                <Typography variant="body2">
                   {collection.loaded ? collection.replicas?.length : '...'}
                   {collection.loaded ? collection.replicas?.length : '...'}
                 </Typography>
                 </Typography>
                 {collection.loaded && enableModifyReplica && (
                 {collection.loaded && enableModifyReplica && (
@@ -561,7 +561,7 @@ const Overview = () => {
                 )}
                 )}
               </InfoLabel>
               </InfoLabel>
               <InfoValue>
               <InfoValue>
-                <Typography variant="body1">
+                <Typography variant="body2">
                   {formatNumber(Number(collection?.rowCount || '0'))}
                   {formatNumber(Number(collection?.rowCount || '0'))}
                 </Typography>
                 </Typography>
               </InfoValue>
               </InfoValue>

+ 9 - 5
client/src/pages/databases/collections/schema/StyledComponents.tsx

@@ -40,7 +40,7 @@ export const Card = styled(Box)(({ theme }) => ({
 
 
 export const InfoRow = styled(Box)(({ theme }) => ({
 export const InfoRow = styled(Box)(({ theme }) => ({
   display: 'flex',
   display: 'flex',
-  alignItems: 'center',
+  alignItems: 'flex-start',
   gap: theme.spacing(1.5),
   gap: theme.spacing(1.5),
   '&:not(:last-child)': {
   '&:not(:last-child)': {
     padding: theme.spacing(0.5, 0),
     padding: theme.spacing(0.5, 0),
@@ -61,9 +61,11 @@ export const InfoLabel = styled(Box)(({ theme }) => ({
   flexShrink: 0,
   flexShrink: 0,
   display: 'flex',
   display: 'flex',
   alignItems: 'center',
   alignItems: 'center',
+  height: '24px',
   [theme.breakpoints.down('md')]: {
   [theme.breakpoints.down('md')]: {
     minWidth: 70,
     minWidth: 70,
     fontSize: 12,
     fontSize: 12,
+    height: '20px',
   },
   },
 }));
 }));
 
 
@@ -77,9 +79,11 @@ export const InfoValue = styled(Box)(({ theme }) => ({
   flex: 1,
   flex: 1,
   minWidth: 0,
   minWidth: 0,
   flexWrap: 'nowrap',
   flexWrap: 'nowrap',
+  minHeight: '24px',
   [theme.breakpoints.down('md')]: {
   [theme.breakpoints.down('md')]: {
     fontSize: 13,
     fontSize: 13,
     gap: theme.spacing(0.5),
     gap: theme.spacing(0.5),
+    minHeight: '20px',
   },
   },
   '& .truncate': {
   '& .truncate': {
     overflow: 'hidden',
     overflow: 'hidden',
@@ -97,6 +101,9 @@ export const InfoValue = styled(Box)(({ theme }) => ({
       gap: theme.spacing(0.5),
       gap: theme.spacing(0.5),
     },
     },
   },
   },
+  '& .MuiTypography-root': {
+    lineHeight: 1.5,
+  },
 }));
 }));
 
 
 export const ActionWrapper = styled(Box)(({ theme }) => ({
 export const ActionWrapper = styled(Box)(({ theme }) => ({
@@ -166,7 +173,4 @@ export const ParamWrapper = styled(Box)(({ theme }) => ({
   },
   },
 }));
 }));
 
 
-export const GridWrapper = styled(Box)(({ theme }) => ({
-  flex: 1,
-  minHeight: 0,
-}));
+export const GridWrapper = styled(Box)(({ theme }) => ({}));