Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dinky
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangpeng
dinky
Commits
f8438c78
Unverified
Commit
f8438c78
authored
May 19, 2023
by
zhu-mingye
Committed by
GitHub
May 19, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimize layout && added gen sql page (#1978)
parent
5c7529cc
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
271 additions
and
57 deletions
+271
-57
global.less
dinky-web/src/global.less
+7
-12
pages.ts
dinky-web/src/locales/en-US/pages.ts
+1
-1
pages.ts
dinky-web/src/locales/zh-CN/pages.ts
+1
-1
index.tsx
...ponents/DataSourceDetail/RightTagsRouter/GenSQL/index.tsx
+81
-0
index.tsx
...nts/DataSourceDetail/RightTagsRouter/SQLConsole/index.tsx
+54
-0
index.tsx
...nents/DataSourceDetail/RightTagsRouter/SQLQuery/index.tsx
+30
-0
index.tsx
...rce/components/DataSourceDetail/RightTagsRouter/index.tsx
+37
-18
index.tsx
...egCenter/DataSource/components/DataSourceDetail/index.tsx
+50
-25
constants.tsx
dinky-web/src/services/constants.tsx
+1
-0
data.d.ts
dinky-web/src/types/RegCenter/data.d.ts
+9
-0
No files found.
dinky-web/src/global.less
View file @
f8438c78
...
@@ -98,14 +98,13 @@ body,
...
@@ -98,14 +98,13 @@ body,
// scrollbar style --- start ----
// scrollbar style --- start ----
::-webkit-scrollbar {
::-webkit-scrollbar {
width: 0.5vw;
width: 0.2vw;
height: 1vh;
height: 0.5vh;
background-color: #f5f5f5;
}
}
::-webkit-scrollbar-thumb {
::-webkit-scrollbar-thumb {
background-color: #ccc;
background-color: #ccc;
border-radius:
6
px;
border-radius:
10
px;
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
}
}
...
@@ -232,14 +231,10 @@ ol {
...
@@ -232,14 +231,10 @@ ol {
}
}
}
}
.schemaTree {
.schemaTree{
height: 75vh;
max-height: 78vh;
max-height: 75vh;
min-height: 78vh;
background-color: white;
margin-top: 1.5vh;
}
.columnTable{
max-height: 60vh;
overflow: auto;
}
}
.code-content-empty {
.code-content-empty {
...
...
dinky-web/src/locales/en-US/pages.ts
View file @
f8438c78
...
@@ -156,7 +156,7 @@ export default {
...
@@ -156,7 +156,7 @@ export default {
'rc.ds.detail.tag.console'
:
'Console'
,
'rc.ds.detail.tag.console'
:
'Console'
,
// tips
// tips
'rc.ds.detail.tips'
:
'Click on the table on the left to get
the description information of the table
'
,
'rc.ds.detail.tips'
:
'Click on the table on the left to get
relevant information
'
,
// columns info
// columns info
'rc.ds.no'
:
'No.'
,
'rc.ds.no'
:
'No.'
,
...
...
dinky-web/src/locales/zh-CN/pages.ts
View file @
f8438c78
...
@@ -153,7 +153,7 @@ export default {
...
@@ -153,7 +153,7 @@ export default {
'rc.ds.detail.tag.console'
:
'控制台'
,
'rc.ds.detail.tag.console'
:
'控制台'
,
// tips
// tips
'rc.ds.detail.tips'
:
'点击左侧的表,获取
表的描述
信息'
,
'rc.ds.detail.tips'
:
'点击左侧的表,获取
相关
信息'
,
// columns info
// columns info
'rc.ds.no'
:
'序号'
,
'rc.ds.no'
:
'序号'
,
...
...
dinky-web/src/pages/RegCenter/DataSource/components/DataSourceDetail/RightTagsRouter/GenSQL/index.tsx
0 → 100644
View file @
f8438c78
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
{
DataSources
}
from
'@/types/RegCenter/data'
;
import
React
from
'react'
;
import
CodeShow
from
'@/components/CustomEditor/CodeShow'
;
import
{
ProCard
}
from
'@ant-design/pro-components'
;
import
{
Empty
}
from
'antd'
;
import
{
l
}
from
'@/utils/intl'
;
type
GenSQLProps
=
{
sql
:
Partial
<
DataSources
.
SqlGeneration
>
;
}
/**
* props for CodeShow
*/
const
CodeShowProps
=
{
height
:
'60vh'
,
width
:
'100%'
,
lineNumbers
:
'on'
,
language
:
'sql'
,
showFloatButton
:
true
,
};
const
GenSQL
:
React
.
FC
<
GenSQLProps
>
=
(
props
)
=>
{
const
{
sql
}
=
props
;
const
[
activeKey
,
setActiveKey
]
=
React
.
useState
<
string
>
(
'flinkddl'
);
// tab list
const
tabList
=
[
{
key
:
'flinkddl'
,
label
:
'Flink DDL'
,
children
:
<
CodeShow
{
...
CodeShowProps
}
code=
{
sql
.
flinkSqlCreate
||
''
}
/>
},
{
key
:
'select'
,
label
:
'Select'
,
children
:
<
CodeShow
{
...
CodeShowProps
}
code=
{
sql
.
sqlSelect
||
''
}
/>
},
{
key
:
'sqlddl'
,
label
:
'SQL DDL'
,
children
:
<
CodeShow
{
...
CodeShowProps
}
code=
{
sql
.
sqlCreate
||
''
}
/>
}
]
// tab props
const
restTabProps
=
{
activeKey
,
onChange
:
(
key
:
string
)
=>
setActiveKey
(
key
),
tabPosition
:
'left'
,
items
:
tabList
}
return
<>
{
(
sql
.
flinkSqlCreate
||
sql
.
sqlSelect
||
sql
.
sqlCreate
)
?
<
ProCard
tabs=
{
{...
restTabProps
}
}
/>
:
<
Empty
className=
{
'code-content-empty'
}
description=
{
l
(
'rc.ds.detail.tips'
)
}
/>
}
</>;
};
export
default
GenSQL
;
dinky-web/src/pages/RegCenter/DataSource/components/DataSourceDetail/RightTagsRouter/SQLConsole/index.tsx
0 → 100644
View file @
f8438c78
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
CodeEdit
from
'@/components/CustomEditor/CodeEdit'
;
import
React
,
{
useState
}
from
'react'
;
const
CodeEditProps
=
{
height
:
'35vh'
,
width
:
'100%'
,
lineNumbers
:
'on'
,
language
:
'sql'
,
// autoRange: true, // todo: 使用此配置项,后续可以自动识别光标位置,根据;分割,得到 sql 片段区间, 在左侧自动添加 执行按钮 和 区间选中效果, 规划内,暂未实现
};
type
SQLConsoleProps
=
{
querySQL
:
string
,
}
const
SQLConsole
:
React
.
FC
<
SQLConsoleProps
>
=
(
props
)
=>
{
const
{
querySQL
}
=
props
;
const
[
inputValue
,
setInputValue
]
=
useState
(
''
);
const
[
loading
,
setLoading
]
=
useState
<
boolean
>
(
false
);
const
handleInputChange
=
(
value
:
string
)
=>
{
setInputValue
(
value
);
}
const
execSql
=
async
()
=>
{
setLoading
(
true
);
// todo: exec sql callback
setLoading
(
false
);
}
return
<>
<
CodeEdit
{
...
CodeEditProps
}
onChange=
{
handleInputChange
}
code=
{
inputValue
}
/>
</>
}
export
default
SQLConsole
;
dinky-web/src/pages/RegCenter/DataSource/components/DataSourceDetail/RightTagsRouter/SQLQuery/index.tsx
0 → 100644
View file @
f8438c78
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
React
from
'react'
;
type
SQLQueryProps
=
{
query
:
string
,
}
//todo: SQLQuery component
const
SQLQuery
:
React
.
FC
<
SQLQueryProps
>
=
(
props
)
=>
{
const
{
query
}
=
props
;
return
<
div
>
SQLQuery
</
div
>;
};
export
default
SQLQuery
;
dinky-web/src/pages/RegCenter/DataSource/components/DataSourceDetail/RightTagsRouter/index.tsx
View file @
f8438c78
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
import
{
Space
,
Tabs
}
from
'antd'
;
import
{
Space
}
from
'antd'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
import
{
BookOutlined
,
BookOutlined
,
...
@@ -23,29 +23,31 @@ import {
...
@@ -23,29 +23,31 @@ import {
import
React
from
'react'
;
import
React
from
'react'
;
import
{
DataSources
}
from
'@/types/RegCenter/data'
;
import
{
DataSources
}
from
'@/types/RegCenter/data'
;
import
SchemaDesc
from
'@/pages/RegCenter/DataSource/components/DataSourceDetail/RightTagsRouter/SchemaDesc'
;
import
SchemaDesc
from
'@/pages/RegCenter/DataSource/components/DataSourceDetail/RightTagsRouter/SchemaDesc'
;
import
GenSQL
from
'@/pages/RegCenter/DataSource/components/DataSourceDetail/RightTagsRouter/GenSQL'
;
import
{
ProCard
}
from
'@ant-design/pro-components'
;
import
SQLQuery
from
'@/pages/RegCenter/DataSource/components/DataSourceDetail/RightTagsRouter/SQLQuery'
;
import
SQLConsole
from
'@/pages/RegCenter/DataSource/components/DataSourceDetail/RightTagsRouter/SQLConsole'
;
/**
* props
*/
type
RightTagsRouterProps
=
{
type
RightTagsRouterProps
=
{
tableInfo
:
Partial
<
DataSources
.
Table
>
;
tableInfo
:
Partial
<
DataSources
.
Table
>
,
tableColumns
:
Partial
<
DataSources
.
Column
[]
>
;
tableColumns
:
Partial
<
DataSources
.
Column
[]
>
,
genSQL
:
Partial
<
DataSources
.
SqlGeneration
>
,
rightButtons
:
React
.
ReactNode
,
}
}
const
RightTagsRouter
:
React
.
FC
<
RightTagsRouterProps
>
=
(
props
)
=>
{
const
RightTagsRouter
:
React
.
FC
<
RightTagsRouterProps
>
=
(
props
)
=>
{
const
{
tableColumns
,
tableInfo
}
=
props
;
const
{
tableColumns
,
tableInfo
,
genSQL
,
rightButtons
}
=
props
;
// state
const
[
activeKey
,
setActiveKey
]
=
React
.
useState
(
'desc'
);
const
[
activeKey
,
setActiveKey
]
=
React
.
useState
(
'desc'
);
return
<>
// tab list
<
Tabs
const
tabList
=
[
activeKey=
{
activeKey
}
onChange=
{
(
key
)
=>
setActiveKey
(
key
)
}
size=
"small"
animated
destroyInactiveTabPane
style=
{
{
height
:
'100%'
}
}
items=
{
[
{
{
key
:
'desc'
,
key
:
'desc'
,
label
:
<
Space
><
BookOutlined
/>
{
l
(
'rc.ds.detail.tag.desc'
)
}
</
Space
>,
label
:
<
Space
><
BookOutlined
/>
{
l
(
'rc.ds.detail.tag.desc'
)
}
</
Space
>,
...
@@ -54,19 +56,36 @@ const RightTagsRouter: React.FC<RightTagsRouterProps> = (props) => {
...
@@ -54,19 +56,36 @@ const RightTagsRouter: React.FC<RightTagsRouterProps> = (props) => {
{
{
key
:
'query'
,
key
:
'query'
,
label
:
<
Space
><
BookOutlined
/>
{
l
(
'rc.ds.detail.tag.query'
)
}
</
Space
>,
label
:
<
Space
><
BookOutlined
/>
{
l
(
'rc.ds.detail.tag.query'
)
}
</
Space
>,
children
:
<
SchemaDesc
tableInfo=
{
tableInfo
}
tableColumns=
{
tableColumns
}
/>
children
:
<
SQLQuery
query=
{
'111'
}
/>
},
},
{
{
key
:
'gensql'
,
key
:
'gensql'
,
label
:
<
Space
><
BookOutlined
/>
{
l
(
'rc.ds.detail.tag.gensql'
)
}
</
Space
>,
label
:
<
Space
><
BookOutlined
/>
{
l
(
'rc.ds.detail.tag.gensql'
)
}
</
Space
>,
children
:
<
SchemaDesc
tableInfo=
{
tableInfo
}
tableColumns=
{
tableColumns
}
/>
children
:
<
GenSQL
sql=
{
genSQL
}
/>
},
},
{
{
key
:
'console'
,
key
:
'console'
,
label
:
<
Space
><
BookOutlined
/>
{
l
(
'rc.ds.detail.tag.console'
)
}
</
Space
>,
label
:
<
Space
><
BookOutlined
/>
{
l
(
'rc.ds.detail.tag.console'
)
}
</
Space
>,
children
:
<
SchemaDesc
tableInfo=
{
tableInfo
}
tableColumns=
{
tableColumns
}
/>
children
:
<
SQLConsole
querySQL=
{
''
}
/>
},
},
]
}
];
// tab props
const
restTabProps
=
{
activeKey
:
activeKey
,
type
:
'card'
,
tabBarExtraContent
:
rightButtons
,
animated
:
true
,
onChange
:
(
key
:
string
)
=>
setActiveKey
(
key
),
items
:
tabList
,
};
/**
* render
*/
return
<>
<
ProCard
size=
"small"
bordered
tabs=
{
{...
restTabProps
}
}
/>
/>
</>;
</>;
};
};
...
...
dinky-web/src/pages/RegCenter/DataSource/components/DataSourceDetail/index.tsx
View file @
f8438c78
...
@@ -17,8 +17,7 @@
...
@@ -17,8 +17,7 @@
import
React
,
{
useCallback
,
useEffect
,
useState
}
from
'react'
;
import
React
,
{
useCallback
,
useEffect
,
useState
}
from
'react'
;
import
{
DataSources
}
from
'@/types/RegCenter/data'
;
import
{
DataSources
}
from
'@/types/RegCenter/data'
;
import
{
Loading
}
from
'@/pages/Other/Loading'
;
import
{
Button
,
Space
}
from
'antd'
;
import
{
Button
,
Col
,
Row
,
Space
}
from
'antd'
;
import
{
BackwardOutlined
,
ReloadOutlined
}
from
'@ant-design/icons'
;
import
{
BackwardOutlined
,
ReloadOutlined
}
from
'@ant-design/icons'
;
import
{
DataSourceDetailBackButton
}
from
'@/components/StyledComponents'
;
import
{
DataSourceDetailBackButton
}
from
'@/components/StyledComponents'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
l
}
from
'@/utils/intl'
;
...
@@ -27,6 +26,7 @@ import RightTagsRouter from '@/pages/RegCenter/DataSource/components/DataSourceD
...
@@ -27,6 +26,7 @@ import RightTagsRouter from '@/pages/RegCenter/DataSource/components/DataSourceD
import
{
useNavigate
}
from
'@umijs/max'
;
import
{
useNavigate
}
from
'@umijs/max'
;
import
{
API_CONSTANTS
,
RESPONSE_CODE
}
from
'@/services/constants'
;
import
{
API_CONSTANTS
,
RESPONSE_CODE
}
from
'@/services/constants'
;
import
{
getDataByIdReturnResult
,
queryDataByParams
}
from
'@/services/BusinessCrud'
;
import
{
getDataByIdReturnResult
,
queryDataByParams
}
from
'@/services/BusinessCrud'
;
import
{
ProCard
}
from
'@ant-design/pro-components'
;
type
DataSourceDetailProps
=
{
type
DataSourceDetailProps
=
{
dataSource
:
Partial
<
DataSources
.
DataSource
>
;
dataSource
:
Partial
<
DataSources
.
DataSource
>
;
...
@@ -40,6 +40,7 @@ const DataSourceDetail: React.FC<DataSourceDetailProps> = (props) => {
...
@@ -40,6 +40,7 @@ const DataSourceDetail: React.FC<DataSourceDetailProps> = (props) => {
const
[
loading
,
setLoading
]
=
useState
<
boolean
>
(
false
);
const
[
loading
,
setLoading
]
=
useState
<
boolean
>
(
false
);
const
[
treeData
,
setTreeData
]
=
useState
<
Partial
<
any
>
[]
>
([]);
const
[
treeData
,
setTreeData
]
=
useState
<
Partial
<
any
>
[]
>
([]);
const
[
tableColumns
,
setTableColumns
]
=
useState
<
Partial
<
DataSources
.
Column
[]
>>
([]);
const
[
tableColumns
,
setTableColumns
]
=
useState
<
Partial
<
DataSources
.
Column
[]
>>
([]);
const
[
genSQL
,
setGenSQL
]
=
useState
<
Partial
<
DataSources
.
SqlGeneration
>>
({});
const
[
tableInfo
,
setTableInfo
]
=
useState
<
Partial
<
DataSources
.
Table
>>
({});
const
[
tableInfo
,
setTableInfo
]
=
useState
<
Partial
<
DataSources
.
Table
>>
({});
const
handleBackClick
=
()
=>
{
const
handleBackClick
=
()
=>
{
...
@@ -49,10 +50,15 @@ const DataSourceDetail: React.FC<DataSourceDetailProps> = (props) => {
...
@@ -49,10 +50,15 @@ const DataSourceDetail: React.FC<DataSourceDetailProps> = (props) => {
backClick
();
backClick
();
};
};
const
clearState
=
()
=>
{
const
querySchemaTree
=
useCallback
(
async
()
=>
{
setTableColumns
([]);
setTableColumns
([]);
setTableInfo
({});
setTableInfo
({});
setGenSQL
({});
};
const
querySchemaTree
=
useCallback
(
async
()
=>
{
clearState
();
setLoading
(
true
);
setLoading
(
true
);
await
getDataByIdReturnResult
(
API_CONSTANTS
.
DATASOURCE_GET_SCHEMA_TABLES
,
dataSource
.
id
).
then
((
res
)
=>
{
await
getDataByIdReturnResult
(
API_CONSTANTS
.
DATASOURCE_GET_SCHEMA_TABLES
,
dataSource
.
id
).
then
((
res
)
=>
{
if
(
res
.
code
===
RESPONSE_CODE
.
SUCCESS
)
{
if
(
res
.
code
===
RESPONSE_CODE
.
SUCCESS
)
{
...
@@ -67,53 +73,72 @@ const DataSourceDetail: React.FC<DataSourceDetailProps> = (props) => {
...
@@ -67,53 +73,72 @@ const DataSourceDetail: React.FC<DataSourceDetailProps> = (props) => {
querySchemaTree
();
querySchemaTree
();
},
[]);
},
[]);
/**
* tree node click
*/
const
onSchemaTreeNodeClick
=
useCallback
(
async
(
info
:
any
)
=>
{
const
onSchemaTreeNodeClick
=
useCallback
(
async
(
info
:
any
)
=>
{
const
{
node
:
nodeInfo
,
node
:
{
isLeaf
,
parentId
,
name
,
fullInfo
}}
=
info
;
const
{
node
:
{
isLeaf
,
parentId
,
name
,
fullInfo
}}
=
info
;
if
(
isLeaf
)
{
if
(
isLeaf
)
{
console
.
log
(
nodeInfo
,
'nodeInfo'
);
/**
const
data
=
await
queryDataByParams
(
API_CONSTANTS
.
DATASOURCE_GET_COLUMNS_BY_TABLE
,
{
* get table columns
*/
const
columnsData
=
await
queryDataByParams
(
API_CONSTANTS
.
DATASOURCE_GET_COLUMNS_BY_TABLE
,
{
id
:
dataSource
.
id
,
id
:
dataSource
.
id
,
schemaName
:
parentId
,
schemaName
:
parentId
,
tableName
:
name
tableName
:
name
});
});
setTableColumns
(
data
);
/**
* get gen sql
*/
const
genSQLData
=
await
queryDataByParams
(
API_CONSTANTS
.
DATASOURCE_GET_GEN_SQL
,
{
id
:
dataSource
.
id
,
schemaName
:
parentId
,
tableName
:
name
});
setTableColumns
(
columnsData
);
setGenSQL
(
genSQLData
);
setTableInfo
(
fullInfo
);
setTableInfo
(
fullInfo
);
}
else
{
}
else
{
setTableColumns
([]);
clearState
();
setTableInfo
({});
}
}
},
[]);
},
[]);
/**
* render back button and refresh button
* @return {JSX.Element}
*/
const
renderBackButton
=
()
=>
{
return
<>
return
<>
<
DataSourceDetailBackButton
>
<
DataSourceDetailBackButton
>
<
Space
size=
{
'larg
e'
}
>
<
Space
size=
{
'middl
e'
}
>
<
Button
size=
{
'middle'
}
icon=
{
<
ReloadOutlined
spin=
{
loading
}
/>
}
type=
"primary"
<
Button
size=
{
'middle'
}
icon=
{
<
ReloadOutlined
spin=
{
loading
}
/>
}
type=
"primary"
onClick=
{
()
=>
querySchemaTree
()
}
>
{
l
(
'button.refresh'
)
}
</
Button
>
onClick=
{
()
=>
querySchemaTree
()
}
>
{
l
(
'button.refresh'
)
}
</
Button
>
<
Button
size=
{
'middle'
}
icon=
{
<
BackwardOutlined
/>
}
type=
"primary"
<
Button
size=
{
'middle'
}
icon=
{
<
BackwardOutlined
/>
}
type=
"primary"
onClick=
{
handleBackClick
}
>
{
l
(
'button.back'
)
}
</
Button
>
onClick=
{
handleBackClick
}
>
{
l
(
'button.back'
)
}
</
Button
>
</
Space
>
</
Space
>
</
DataSourceDetailBackButton
>
</
DataSourceDetailBackButton
>
{
</>;
loading
?
};
<
Loading
loading=
{
loading
}
/>
:
/**
<>
* render
<
Row
>
*/
<
Col
span=
{
4
}
className=
{
'siderTree schemaTree'
}
>
return
<>
<
ProCard
loading=
{
loading
}
ghost
split=
"vertical"
>
<
ProCard
bordered
className=
{
'siderTree schemaTree'
}
colSpan=
"20%"
>
{
/* tree */
}
{
/* tree */
}
<
SchemaTree
onNodeClick=
{
(
info
:
any
)
=>
onSchemaTreeNodeClick
(
info
)
}
treeData=
{
treeData
}
/>
<
SchemaTree
onNodeClick=
{
(
info
:
any
)
=>
onSchemaTreeNodeClick
(
info
)
}
treeData=
{
treeData
}
/>
</
Col
>
</
ProCard
>
<
Col
span=
{
20
}
>
<
ProCard
headerBordered
>
{
/* tags */
}
{
/* tags */
}
<
RightTagsRouter
<
RightTagsRouter
tableInfo=
{
tableInfo
}
tableInfo=
{
tableInfo
}
tableColumns=
{
tableColumns
}
tableColumns=
{
tableColumns
}
genSQL=
{
genSQL
}
rightButtons=
{
renderBackButton
()
}
/>
/>
</
Col
>
</
ProCard
>
</
Row
>
</
ProCard
>
</>
}
</>;
</>;
};
};
...
...
dinky-web/src/services/constants.tsx
View file @
f8438c78
...
@@ -94,6 +94,7 @@ export const API_CONSTANTS = {
...
@@ -94,6 +94,7 @@ export const API_CONSTANTS = {
// get schema by datasource id
// get schema by datasource id
DATASOURCE_GET_SCHEMA_TABLES
:
"/api/database/getSchemasAndTables"
,
DATASOURCE_GET_SCHEMA_TABLES
:
"/api/database/getSchemasAndTables"
,
DATASOURCE_GET_COLUMNS_BY_TABLE
:
"/api/database/listColumns"
,
DATASOURCE_GET_COLUMNS_BY_TABLE
:
"/api/database/listColumns"
,
DATASOURCE_GET_GEN_SQL
:
"/api/database/getSqlGeneration"
,
// document list
// document list
...
...
dinky-web/src/types/RegCenter/data.d.ts
View file @
f8438c78
...
@@ -155,6 +155,15 @@ declare namespace DataSources {
...
@@ -155,6 +155,15 @@ declare namespace DataSources {
collation
:
string
,
collation
:
string
,
};
};
/**
* table columns info
*/
export
type
SqlGeneration
=
{
flinkSqlCreate
:
string
,
sqlSelect
:
string
,
sqlCreate
:
string
,
};
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment