Browse Source

UI update

Signed-off-by: ryjiang <jiangruiyi@gmail.com>
ryjiang 1 year ago
parent
commit
a7371dae3a

+ 3 - 1
client/src/pages/databases/collections/data/CollectionData.tsx

@@ -383,6 +383,7 @@ const CollectionData = (props: CollectionDataProps) => {
 
 
             <div className="right">
             <div className="right">
               <CustomMultiSelector
               <CustomMultiSelector
+                className={classes.outputs}
                 options={fields.map(f => {
                 options={fields.map(f => {
                   return {
                   return {
                     label:
                     label:
@@ -430,7 +431,7 @@ const CollectionData = (props: CollectionDataProps) => {
                 }}
                 }}
               />
               />
               <CustomButton
               <CustomButton
-                className="btn"
+                className={classes.btn}
                 onClick={handleFilterReset}
                 onClick={handleFilterReset}
                 disabled={!collection.loaded}
                 disabled={!collection.loaded}
                 startIcon={<ResetIcon classes={{ root: 'icon' }} />}
                 startIcon={<ResetIcon classes={{ root: 'icon' }} />}
@@ -438,6 +439,7 @@ const CollectionData = (props: CollectionDataProps) => {
                 {btnTrans('reset')}
                 {btnTrans('reset')}
               </CustomButton>
               </CustomButton>
               <CustomButton
               <CustomButton
+                className={classes.btn}
                 variant="contained"
                 variant="contained"
                 onClick={() => {
                 onClick={() => {
                   setCurrentPage(0);
                   setCurrentPage(0);

+ 11 - 13
client/src/pages/databases/collections/data/Styles.ts

@@ -16,25 +16,15 @@ export const getQueryStyles = makeStyles((theme: Theme) => ({
     alignItems: 'center',
     alignItems: 'center',
     backgroundColor: 'white',
     backgroundColor: 'white',
     padding: theme.spacing(0, 0, 1),
     padding: theme.spacing(0, 0, 1),
-    gap: theme.spacing(2),
+    gap: theme.spacing(1),
 
 
     '& .left': {
     '& .left': {
       display: 'flex',
       display: 'flex',
       justifyContent: 'space-between',
       justifyContent: 'space-between',
       alignItems: 'center',
       alignItems: 'center',
+      gap: theme.spacing(1),
       flex: 1,
       flex: 1,
-      padding: theme.spacing(0, 0, 0, 0),
-      fontSize: theme.spacing(2),
-      backgroundColor: '#f4f4f4',
 
 
-      '& .expression': {
-        display: 'flex',
-        justifyContent: 'space-between',
-        flex: 1,
-        alignItems: 'center',
-        padding: theme.spacing(0, 1.5),
-        backgroundColor: '#f4f4f4',
-      },
       '& .textarea': {
       '& .textarea': {
         width: '100%',
         width: '100%',
         '& .MuiFormHelperText-root': {
         '& .MuiFormHelperText-root': {
@@ -51,6 +41,14 @@ export const getQueryStyles = makeStyles((theme: Theme) => ({
     },
     },
   },
   },
   selector: {
   selector: {
-    width: 180,
+    width: 160,
+  },
+  outputs: {
+    height: 56,
+    width: 140,
+  },
+  btn: {
+    height: 56,
+    width: 80,
   },
   },
 }));
 }));

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

@@ -447,7 +447,7 @@ const Search = (props: CollectionDataProps) => {
                   textConfig={{
                   textConfig={{
                     label: searchTrans('filterExpr'),
                     label: searchTrans('filterExpr'),
                     key: 'advFilter',
                     key: 'advFilter',
-                    className: classes.filterInput,
+                    className: 'textarea',
                     onChange: onFilterChange,
                     onChange: onFilterChange,
                     value: searchParams.globalParams.filter,
                     value: searchParams.globalParams.filter,
                     disabled: false,
                     disabled: false,
@@ -480,7 +480,7 @@ const Search = (props: CollectionDataProps) => {
               </div>
               </div>
               <div className="right">
               <div className="right">
                 <CustomButton
                 <CustomButton
-                  className="btn"
+                  className={classes.btn}
                   disabled={disableSearch}
                   disabled={disableSearch}
                   onClick={() => {
                   onClick={() => {
                     // open code dialog
                     // open code dialog
@@ -502,7 +502,7 @@ const Search = (props: CollectionDataProps) => {
                 </CustomButton>
                 </CustomButton>
 
 
                 <CustomButton
                 <CustomButton
-                  className="btn"
+                  className={classes.btn}
                   disabled={result.length === 0}
                   disabled={result.length === 0}
                   onClick={() => {
                   onClick={() => {
                     saveCsvAs(
                     saveCsvAs(
@@ -515,7 +515,7 @@ const Search = (props: CollectionDataProps) => {
                   {btnTrans('export')}
                   {btnTrans('export')}
                 </CustomButton>
                 </CustomButton>
                 <CustomButton
                 <CustomButton
-                  className="btn"
+                  className={classes.btn}
                   onClick={onResetClicked}
                   onClick={onResetClicked}
                   startIcon={<Icons.clear classes={{ root: 'icon' }} />}
                   startIcon={<Icons.clear classes={{ root: 'icon' }} />}
                 >
                 >

+ 22 - 14
client/src/pages/databases/collections/search/Styles.ts

@@ -1,5 +1,4 @@
 import { makeStyles, Theme } from '@material-ui/core';
 import { makeStyles, Theme } from '@material-ui/core';
-import { Height } from '@material-ui/icons';
 
 
 export const getQueryStyles = makeStyles((theme: Theme) => ({
 export const getQueryStyles = makeStyles((theme: Theme) => ({
   root: {
   root: {
@@ -166,26 +165,35 @@ export const getQueryStyles = makeStyles((theme: Theme) => ({
     display: 'flex',
     display: 'flex',
     justifyContent: 'space-between',
     justifyContent: 'space-between',
     alignItems: 'center',
     alignItems: 'center',
-    background: '#fff',
-    marginBottom: theme.spacing(1),
+    backgroundColor: 'white',
+    padding: theme.spacing(0, 0, 1),
+    gap: theme.spacing(1),
 
 
     '& .left': {
     '& .left': {
       display: 'flex',
       display: 'flex',
+      justifyContent: 'space-between',
+      alignItems: 'center',
       gap: theme.spacing(1),
       gap: theme.spacing(1),
-      '& .MuiFilledInput-adornedEnd': {
-        paddingRight: 0,
-      },
-      '& span button': {
-        height: '100%',
+      flex: 1,
+
+      '& .textarea': {
+        width: '100%',
+        '& .MuiFormHelperText-root': {
+          display: 'none',
+        },
       },
       },
     },
     },
-    '& .right': {},
-  },
 
 
-  filterInput: {
-    width: '280px',
-    '& .MuiFormHelperText-root': {
-      display: 'none',
+    '& .right': {
+      display: 'flex',
+      justifyContent: 'space-between',
+      alignItems: 'center',
+      gap: theme.spacing(1),
     },
     },
   },
   },
+
+  btn: {
+    height: 56,
+    width: 80,
+  },
 }));
 }));