Skip to content

Commit

Permalink
finish data explorer
Browse files Browse the repository at this point in the history
Signed-off-by: ryjiang <[email protected]>
  • Loading branch information
shanghaikid committed Oct 17, 2024
1 parent a0c1a56 commit 8ff5e2b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions client/src/i18n/cn/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const searchTrans = {
groupBy: '分组',
outputFields: '输出字段',
consistency: '一致性',
graphNodeHoverTip: '双击以查看更多',
};

export default searchTrans;
1 change: 1 addition & 0 deletions client/src/i18n/en/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const searchTrans = {
groupBy: 'Group By',
outputFields: 'Outputs',
consistency: 'Consistency',
graphNodeHoverTip: 'Double click to explore more',
};

export default searchTrans;
11 changes: 10 additions & 1 deletion client/src/pages/databases/collections/search/DataPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { useTheme } from '@mui/material';
import { Typography, useTheme } from '@mui/material';
import SyntaxHighlighter from 'react-syntax-highlighter';
import { useTranslation } from 'react-i18next';
import { vs2015, github } from 'react-syntax-highlighter/dist/esm/styles/hljs';
import { GraphNode } from '../../types';

const DataPanel = (props: { node: GraphNode; color: any }) => {
// i18n
const { t: searchTrans } = useTranslation('search');

// theme
const theme = useTheme();
// props
Expand Down Expand Up @@ -53,6 +57,11 @@ const DataPanel = (props: { node: GraphNode; color: any }) => {
>
{json}
</SyntaxHighlighter>
{node.nodeY && (
<Typography className="tip">
{searchTrans('graphNodeHoverTip')}
</Typography>
)}
</div>
);
};
Expand Down
5 changes: 5 additions & 0 deletions client/src/pages/databases/collections/search/Styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,11 @@ export const getDataExplorerStyle = makeStyles((theme: Theme) => ({
objectFit: 'contain',
},
},
'& .tip': {
color: theme.palette.text.secondary,
fontSize: 12,
textAlign: 'center',
}
},
},
selectedNodes: {
Expand Down

0 comments on commit 8ff5e2b

Please sign in to comment.