From ad8e8c3c3a763de2eaec488b8b5ce264c7b12ae0 Mon Sep 17 00:00:00 2001 From: pomelo-nwu Date: Tue, 12 Nov 2024 18:51:20 +0800 Subject: [PATCH] feat: update site --- .../graphy/src/pages/dataset/embed/view.tsx | 50 +++++++-------- .../graphy/src/pages/dataset/list/action.tsx | 51 +++++++++++++++ .../graphy/src/pages/dataset/list/index.tsx | 29 +++++---- .../graphy/src/pages/dataset/list/item.tsx | 62 +++++++++++++------ .../graphy/src/pages/dataset/list/steps.tsx | 33 ---------- .../src/pages/explore/services/kuzu.tsx | 1 + 6 files changed, 135 insertions(+), 91 deletions(-) create mode 100644 examples/graphy/src/pages/dataset/list/action.tsx diff --git a/examples/graphy/src/pages/dataset/embed/view.tsx b/examples/graphy/src/pages/dataset/embed/view.tsx index 58eba9823..b1ae1af9b 100644 --- a/examples/graphy/src/pages/dataset/embed/view.tsx +++ b/examples/graphy/src/pages/dataset/embed/view.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import ImportorApp, { useContext } from '@graphscope/studio-importor'; import { Button } from 'antd'; -import { Toolbar, Utils, MultipleInstance } from '@graphscope/studio-components'; +import { Toolbar, Utils } from '@graphscope/studio-components'; import SaveButton from './save'; import { transformDataToSchema } from './transform'; @@ -36,31 +36,29 @@ const Init = ({ data }) => { const EmbedSchemaView: React.FunctionComponent = props => { const { data } = props; return ( - - } - rightSide={} - rightSideStyle={{ - width: '0px', - padding: '0px 12px', - }} - queryPrimitiveTypes={() => { - return ['DT_DOUBLE', 'DT_STRING', 'DT_SIGNED_INT32', 'DT_SIGNED_INT64'].map(item => { - return { label: item, value: item }; - }); - }} - > - - - + } + rightSide={} + rightSideStyle={{ + width: '0px', + padding: '0px 12px', + }} + queryPrimitiveTypes={() => { + return ['DT_DOUBLE', 'DT_STRING', 'DT_SIGNED_INT32', 'DT_SIGNED_INT64'].map(item => { + return { label: item, value: item }; + }); + }} + > + + ); }; diff --git a/examples/graphy/src/pages/dataset/list/action.tsx b/examples/graphy/src/pages/dataset/list/action.tsx new file mode 100644 index 000000000..e21edda88 --- /dev/null +++ b/examples/graphy/src/pages/dataset/list/action.tsx @@ -0,0 +1,51 @@ +import React, { useState } from 'react'; + +import { Space, Button, theme, Tooltip } from 'antd'; + +import type { IDataset } from '../typing'; + +import { downloadDataset, runExtract, deleteDataset, useKuzuGraph } from '../service'; + +import { FileZipOutlined, DeleteOutlined, GlobalOutlined } from '@ant-design/icons'; + +const Action: React.FunctionComponent = props => { + const { id, refreshList } = props; + const [loading, setLoading] = useState(false); + const handleDelete = async () => { + await deleteDataset(id); + refreshList && refreshList(); + }; + + return ( + + + + + + + + + + + + ); +}; + +export default Action; diff --git a/examples/graphy/src/pages/dataset/list/index.tsx b/examples/graphy/src/pages/dataset/list/index.tsx index 8ae0d3504..aa6741108 100644 --- a/examples/graphy/src/pages/dataset/list/index.tsx +++ b/examples/graphy/src/pages/dataset/list/index.tsx @@ -6,6 +6,7 @@ import { useNavigate } from 'react-router-dom'; import { GraphList, GraphSchema } from '../../components'; import { queryDataset } from '../service'; import ListItem from './item'; +import Action from './action'; const { useToken } = theme; import type { IDataset } from '../typing'; @@ -34,7 +35,6 @@ const List: React.FunctionComponent = props => { const { lists } = state; const queryData = async () => { const data = await queryDataset(); - setState(preState => { return { ...preState, @@ -54,18 +54,23 @@ const List: React.FunctionComponent = props => { }, ]} > - - + {!isEmpty && ( + + + + )} + + {lists.map(item => { + return ; + })} - {lists.map(item => { - return ; - })} {isEmpty && ( = { container: { - margin: '24px 0px', - padding: '12px', - background: '#f4f6f8', + margin: '0px', + padding: '1px', + // background: '#f4f6f8', }, card: { borderRadius: '4px', padding: '12px', background: '#fff', + // border: '1px solid #ddd', }, }; const List: React.FunctionComponent any }> = props => { - const { id, schema, entity, status, refreshList } = props; + const { id, schema, entity } = props; console.log(props); let summarized = false; if (entity.length > 0) { @@ -35,24 +43,38 @@ const List: React.FunctionComponent any }> = pro return item.summarized === true; }); } - const navigation = useNavigate(); - const handleDelete = () => { - deleteDataset(id); - refreshList(); - }; return ( - - - - - - - - + + - - - - - - - - ); }; diff --git a/examples/graphy/src/pages/explore/services/kuzu.tsx b/examples/graphy/src/pages/explore/services/kuzu.tsx index ee5577212..63c84f740 100644 --- a/examples/graphy/src/pages/explore/services/kuzu.tsx +++ b/examples/graphy/src/pages/explore/services/kuzu.tsx @@ -29,6 +29,7 @@ export const queryStatistics = async () => { }; export const reload = async () => { const graph_id = (Utils.getSearchParams('graph_id') || '0') as string; + debugger; const driver = await getDriver(); await driver.switchDataset(graph_id); window.KUZU_DRIVER = driver;