Browse Source

style part3

Signed-off-by: ryjiang <jiangruiyi@gmail.com>
ryjiang 10 months ago
parent
commit
5d70b62e40

+ 1 - 1
client/src/App.tsx

@@ -19,7 +19,7 @@ function App() {
   const prefersDarkMode = useMediaQuery('(prefers-color-scheme: dark)');
   const prefersDarkMode = useMediaQuery('(prefers-color-scheme: dark)');
 
 
   const theme = React.useMemo(
   const theme = React.useMemo(
-    () => createTheme(getCommonThemes(prefersDarkMode ? 'dark' : 'dark')),
+    () => createTheme(getCommonThemes(prefersDarkMode ? 'dark' : 'light')),
     [true]
     [true]
   );
   );
 
 

+ 3 - 2
client/src/components/customButton/CustomButton.tsx

@@ -12,11 +12,12 @@ const buttonStyle = makeStyles((theme: Theme) => ({
     padding: theme.spacing(1),
     padding: theme.spacing(1),
 
 
     '&:hover': {
     '&:hover': {
-      backgroundColor: '#f4f4f4',
+      backgroundColor: theme.palette.primary.main,
+      color: theme.palette.background.paper,
     },
     },
   },
   },
   containedBtn: {
   containedBtn: {
-    color: '#fff',
+    color: theme.palette.background.paper,
     backgroundColor: theme.palette.primary.main,
     backgroundColor: theme.palette.primary.main,
     boxShadow: 'initial',
     boxShadow: 'initial',
     fontWeight: 'bold',
     fontWeight: 'bold',

+ 1 - 1
client/src/components/customInput/SearchInput.tsx

@@ -52,7 +52,7 @@ const useSearchStyles = makeStyles((theme: Theme) => ({
     },
     },
   },
   },
   searchIcon: {
   searchIcon: {
-    color: theme.palette.attuGrey.main,
+    color: theme.palette.text.secondary,
     cursor: 'pointer',
     cursor: 'pointer',
     fontSize: '20px',
     fontSize: '20px',
     width: (props: { searched: boolean }) => `${props.searched ? 0 : '20px'}`,
     width: (props: { searched: boolean }) => `${props.searched ? 0 : '20px'}`,

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

@@ -38,7 +38,7 @@ const useStyles = makeStyles((theme: Theme) => ({
     background: '#fff !important',
     background: '#fff !important',
   },
   },
   noIndex: {
   noIndex: {
-    border: `1px solid ${theme.palette.attuGrey.light}`,
+    border: `1px solid ${theme.palette.text.disabled}`,
     backgroundColor: '#fff',
     backgroundColor: '#fff',
   },
   },
 
 

+ 1 - 0
client/src/pages/databases/collections/search/Search.tsx

@@ -410,6 +410,7 @@ const Search = (props: CollectionDataProps) => {
               onClick={genRandomVectors}
               onClick={genRandomVectors}
               size="small"
               size="small"
               disabled={false}
               disabled={false}
+              className={classes.genBtn}
             >
             >
               {btnTrans('example')}
               {btnTrans('example')}
             </CustomButton>
             </CustomButton>

+ 4 - 0
client/src/pages/databases/collections/search/Styles.ts

@@ -187,6 +187,10 @@ export const getQueryStyles = makeStyles((theme: Theme) => ({
     },
     },
   },
   },
 
 
+  genBtn: {
+    marginBottom: 8,
+  },
+
   btn: {
   btn: {
     height: 56,
     height: 56,
     width: 80,
     width: 80,

+ 15 - 9
client/src/pages/home/DatabaseCard.tsx

@@ -31,7 +31,7 @@ const useStyles = makeStyles((theme: Theme) => ({
       boxShadow: '0px 0px 4px 0px #00000029',
       boxShadow: '0px 0px 4px 0px #00000029',
       borderColor: theme.palette.primary.main,
       borderColor: theme.palette.primary.main,
     },
     },
-    '&.active': {
+    '&.current': {
       boxShadow: '0px 0px 4px 0px #00000029',
       boxShadow: '0px 0px 4px 0px #00000029',
       borderColor: theme.palette.primary.main,
       borderColor: theme.palette.primary.main,
     },
     },
@@ -59,17 +59,23 @@ const useStyles = makeStyles((theme: Theme) => ({
     marginBottom: theme.spacing(1),
     marginBottom: theme.spacing(1),
   },
   },
   delIcon: {
   delIcon: {
-    color: theme.palette.text.primary,
+    color: theme.palette.text.secondary,
     cursor: 'pointer',
     cursor: 'pointer',
     position: 'absolute',
     position: 'absolute',
-    right: 4,
-    top: 4,
-    minWidth: 0,
-    minHeight: 0,
-    padding: theme.spacing(0),
+    width: 24,
+    height: 24,
+    lineHeight: 24,
+    display: 'flex',
+    top: 8,
+    right: 8,
+    minWidth: 8,
     '& svg': {
     '& svg': {
-      width: 15,
+      width: 16,
+      height: 16,
+      overflow: 'hidden',
     },
     },
+    padding: theme.spacing(1),
+   
   },
   },
 
 
   // create db
   // create db
@@ -164,7 +170,7 @@ const DatabaseCard: FC<DatabaseCardProps> = ({
   return (
   return (
     <section className={`${wrapperClass}`}>
     <section className={`${wrapperClass}`}>
       <section
       <section
-        className={`${classes.wrapper} ${isActive ? 'active' : ''}`}
+        className={`${classes.wrapper} ${isActive ? 'current' : ''}`}
         onClick={onClick}
         onClick={onClick}
       >
       >
         <>
         <>

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

@@ -26,7 +26,7 @@ const useStyles = makeStyles((theme: Theme) => ({
 
 
     '& .active': {
     '& .active': {
       '& path': {
       '& path': {
-        fill: theme.palette.attuGrey.dark,
+        fill: theme.palette.text.primary,
       },
       },
     },
     },
 
 

+ 8 - 10
client/src/pages/system/DataCard.tsx

@@ -12,6 +12,7 @@ const getStyles = makeStyles((theme: Theme) => ({
     padding: theme.spacing(1.5, 2),
     padding: theme.spacing(1.5, 2),
     boxSizing: 'border-box',
     boxSizing: 'border-box',
     flexGrow: 1,
     flexGrow: 1,
+    height: '100%',
   },
   },
 
 
   title: {
   title: {
@@ -35,20 +36,18 @@ const getStyles = makeStyles((theme: Theme) => ({
 
 
   rootName: {
   rootName: {
     color: theme.palette.text.secondary,
     color: theme.palette.text.secondary,
-    fontSize: '20px',
-    lineHeight: '24px',
+    fontSize: 20,
   },
   },
 
 
   childName: {
   childName: {
     color: theme.palette.primary.main,
     color: theme.palette.primary.main,
-    fontSize: '20px',
-    lineHeight: '24px',
+    fontSize: 20,
   },
   },
 
 
   ip: {
   ip: {
     color: theme.palette.text.primary,
     color: theme.palette.text.primary,
-    fontSize: '11px',
-    lineHeight: '24px',
+    fontSize: 11,
+    lineHeight: 2,
   },
   },
 
 
   sectionRoot: {
   sectionRoot: {
@@ -73,11 +72,11 @@ const getStyles = makeStyles((theme: Theme) => ({
   },
   },
 
 
   sectionCell: {
   sectionCell: {
-    backgroundColor: theme.palette.background.default,
+    backgroundColor: theme.palette.background.paper,
     color: theme.palette.text.primary,
     color: theme.palette.text.primary,
     display: 'table-cell',
     display: 'table-cell',
-    fontSize: '14px',
-    padding: theme.spacing(1, 1),
+    fontSize: 13,
+    padding: theme.spacing(1),
     textTransform: 'capitalize',
     textTransform: 'capitalize',
     verticalAlign: 'middle',
     verticalAlign: 'middle',
     width: '50%',
     width: '50%',
@@ -85,7 +84,6 @@ const getStyles = makeStyles((theme: Theme) => ({
   progressTitle: {
   progressTitle: {
     fontSize: '14px',
     fontSize: '14px',
     color: theme.palette.text.primary,
     color: theme.palette.text.primary,
-    lineHeight: '24px',
     display: 'flex',
     display: 'flex',
     justifyContent: 'space-between',
     justifyContent: 'space-between',
   },
   },

+ 7 - 1
client/src/pages/system/NodeListView.tsx

@@ -29,6 +29,12 @@ const getStyles = makeStyles((theme: Theme) => ({
     width: '100%',
     width: '100%',
     height: '28px',
     height: '28px',
   },
   },
+  childCloseBtn: {
+    border: 0,
+    backgroundColor: theme.palette.background.paper,
+    color: theme.palette.text.primary,
+    width: '100%',
+  },
   gridContainer: {
   gridContainer: {
     height: `calc(100vh - 120px)`,
     height: `calc(100vh - 120px)`,
     display: 'flex',
     display: 'flex',
@@ -194,7 +200,7 @@ const NodeListView: FC<NodeListViewProps> = props => {
         className={classes.childCloseBtnContainer}
         className={classes.childCloseBtnContainer}
         onClick={() => setShowChildView(false)}
         onClick={() => setShowChildView(false)}
       >
       >
-        <KeyboardArrowDown />
+        <KeyboardArrowDown className={classes.childCloseBtn} />
       </button>
       </button>
       <div className={classes.gridContainer}>
       <div className={classes.gridContainer}>
         <div className={classes.leftContainer}>
         <div className={classes.leftContainer}>

+ 1 - 1
client/src/pages/system/Progress.tsx

@@ -36,7 +36,7 @@ const Progress: FC<ProgressProps> = props => {
         y2={15}
         y2={15}
         vectorEffect="non-scaling-stroke"
         vectorEffect="non-scaling-stroke"
         strokeWidth="12"
         strokeWidth="12"
-        stroke={theme.palette.text.primary}
+        stroke={theme.palette.text.disabled}
         strokeLinecap="round"
         strokeLinecap="round"
       />
       />
       <line
       <line

+ 1 - 5
client/src/pages/system/SystemView.tsx

@@ -37,6 +37,7 @@ const getStyles = makeStyles((theme: Theme) => ({
     width: '70%',
     width: '70%',
     background: theme.palette.background.paper,
     background: theme.palette.background.paper,
     borderRadius: 8,
     borderRadius: 8,
+    boxShadow: '0 0 10px 0 rgba(0,0,0,0.1)',
   },
   },
   right: { width: '30%', borderRadius: 8 },
   right: { width: '30%', borderRadius: 8 },
   childView: {
   childView: {
@@ -56,11 +57,6 @@ const getStyles = makeStyles((theme: Theme) => ({
     top: 1600,
     top: 1600,
     opacity: 0,
     opacity: 0,
   },
   },
-  childCloseBtn: {
-    border: 0,
-    backgroundColor: theme.palette.background.paper,
-    width: '100%',
-  },
 }));
 }));
 
 
 const SystemView: any = () => {
 const SystemView: any = () => {

+ 3 - 24
client/src/styles/theme.ts

@@ -1,17 +1,5 @@
 import { PaletteMode } from '@mui/material';
 import { PaletteMode } from '@mui/material';
 
 
-// define types for the common theme
-declare module '@mui/material/styles/createPalette' {
-  interface Palette {
-    attuGrey: Palette['primary'];
-    attuDark: Palette['primary'];
-  }
-  interface PaletteOptions {
-    attuGrey: PaletteOptions['primary'];
-    attuDark: PaletteOptions['primary'];
-  }
-}
-
 const getCommonThemes = (mode: PaletteMode) => ({
 const getCommonThemes = (mode: PaletteMode) => ({
   typography: {
   typography: {
     fontFamily: [
     fontFamily: [
@@ -35,24 +23,15 @@ const getCommonThemes = (mode: PaletteMode) => ({
       dark: mode === 'light' ? '#08a568' : '#078b63',
       dark: mode === 'light' ? '#08a568' : '#078b63',
     },
     },
     secondary: {
     secondary: {
-      light: '#82d3ba',
-      main: '#0ACE82',
-      dark: '#279371',
+      light: mode === 'light' ? '#7EE3D0' : '#4DBB9C',
+      main: '#10C998',
+      dark: mode === 'light' ? '#0BA978' : '#08845B',
     },
     },
     error: {
     error: {
       main: '#ff4605',
       main: '#ff4605',
       light: mode === 'light' ? '#ff8f68' : '#ff6a3a',
       light: mode === 'light' ? '#ff8f68' : '#ff6a3a',
       dark: mode === 'light' ? '#cd3804' : '#b33900',
       dark: mode === 'light' ? '#cd3804' : '#b33900',
     },
     },
-    attuGrey: {
-      main: mode === 'light' ? '#aeaebb' : '#565665',
-      light: mode === 'light' ? '#dcdce3' : '#838394',
-      dark: mode === 'light' ? '#82838e' : '#34343f',
-      contrastText: mode === 'light' ? '#f8f8fc' : '#e0e0e5',
-    },
-    attuDark: {
-      main: mode === 'light' ? '#010e29' : '#0d1b34',
-    },
     background: {
     background: {
       default: mode === 'light' ? '#f5f5f5' : '#121212',
       default: mode === 'light' ? '#f5f5f5' : '#121212',
       paper: mode === 'light' ? '#ffffff' : '#1e1e1e',
       paper: mode === 'light' ? '#ffffff' : '#1e1e1e',