Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dlink
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
zhaowei
dlink
Commits
84c263bc
Commit
84c263bc
authored
Nov 25, 2021
by
godkaikai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
左侧操作栏拖动与布局调整
parent
d6a4da56
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
82 additions
and
64 deletions
+82
-64
app.tsx
dlink-web/src/app.tsx
+1
-1
index.tsx
...c/components/Studio/StudioConsole/StudioHistory/index.tsx
+1
-1
index.tsx
dlink-web/src/components/Studio/StudioConsole/index.tsx
+2
-2
index.tsx
dlink-web/src/components/Studio/StudioLeftTool/index.tsx
+6
-6
index.tsx
dlink-web/src/components/Studio/StudioRightTool/index.tsx
+1
-1
index.tsx
dlink-web/src/components/Studio/StudioTabs/index.tsx
+2
-3
index.tsx
dlink-web/src/components/Studio/index.tsx
+63
-50
global.less
dlink-web/src/global.less
+6
-0
No files found.
dlink-web/src/app.tsx
View file @
84c263bc
...
@@ -161,7 +161,7 @@ export const layout: RunTimeLayoutConfig = ({ initialState }) => {
...
@@ -161,7 +161,7 @@ export const layout: RunTimeLayoutConfig = ({ initialState }) => {
/*waterMarkProps: {
/*waterMarkProps: {
content: initialState?.currentUser?.name,
content: initialState?.currentUser?.name,
},*/
},*/
footerRender
:
()
=>
<
Footer
/>,
//
footerRender: () => <Footer />,
onPageChange
:
()
=>
{
onPageChange
:
()
=>
{
const
{
location
}
=
history
;
const
{
location
}
=
history
;
// 如果没有登录,重定向到 login
// 如果没有登录,重定向到 login
...
...
dlink-web/src/components/Studio/StudioConsole/StudioHistory/index.tsx
View file @
84c263bc
import
{
StateType
}
from
"@/pages/FlinkSqlStudio/model"
;
import
{
StateType
}
from
"@/pages/FlinkSqlStudio/model"
;
import
{
connect
}
from
"umi"
;
import
{
connect
}
from
"umi"
;
import
{
Button
,
Tag
,
Space
,
Typography
,
Divider
,
Badge
,
Drawer
,
Modal
,
}
from
'antd'
;
import
{
Button
,
Tag
,
Space
,
Typography
,
Divider
,
Badge
,
Drawer
,
Modal
}
from
'antd'
;
import
{
MessageOutlined
,
ClusterOutlined
,
FireOutlined
,
ReloadOutlined
,
RocketOutlined
}
from
"@ant-design/icons"
;
import
{
MessageOutlined
,
ClusterOutlined
,
FireOutlined
,
ReloadOutlined
,
RocketOutlined
}
from
"@ant-design/icons"
;
import
ProList
from
'@ant-design/pro-list'
;
import
ProList
from
'@ant-design/pro-list'
;
import
{
handleRemove
,
queryData
}
from
"@/components/Common/crud"
;
import
{
handleRemove
,
queryData
}
from
"@/components/Common/crud"
;
...
...
dlink-web/src/components/Studio/StudioConsole/index.tsx
View file @
84c263bc
...
@@ -10,7 +10,6 @@ import StudioHistory from "./StudioHistory";
...
@@ -10,7 +10,6 @@ import StudioHistory from "./StudioHistory";
import
StudioFX
from
"./StudioFX"
;
import
StudioFX
from
"./StudioFX"
;
import
StudioCA
from
"./StudioCA"
;
import
StudioCA
from
"./StudioCA"
;
import
StudioProcess
from
"./StudioProcess"
;
import
StudioProcess
from
"./StudioProcess"
;
const
{
TabPane
}
=
Tabs
;
const
{
TabPane
}
=
Tabs
;
...
@@ -18,7 +17,8 @@ const { TabPane } = Tabs;
...
@@ -18,7 +17,8 @@ const { TabPane } = Tabs;
const
StudioConsole
=
(
props
:
any
)
=>
{
const
StudioConsole
=
(
props
:
any
)
=>
{
return
(
return
(
<
Tabs
defaultActiveKey=
"StudioMsg"
size=
"small"
tabPosition=
"top"
style=
{
{
border
:
"1px solid #f0f0f0"
,
margin
:
"0 32px"
}
}
>
<
Tabs
defaultActiveKey=
"StudioMsg"
size=
"small"
tabPosition=
"top"
style=
{
{
border
:
"1px solid #f0f0f0"
,
height
:
"50%"
,
overflow
:
"auto"
,
width
:
"100%"
}
}
>
<
TabPane
<
TabPane
tab=
{
tab=
{
<
span
>
<
span
>
...
...
dlink-web/src/components/Studio/StudioLeftTool/index.tsx
View file @
84c263bc
...
@@ -15,20 +15,20 @@ const { TabPane } = Tabs;
...
@@ -15,20 +15,20 @@ const { TabPane } = Tabs;
const
StudioLeftTool
=
(
props
:
any
)
=>
{
const
StudioLeftTool
=
(
props
:
any
)
=>
{
return
(
return
(
<
Tabs
defaultActiveKey=
"1"
size=
"small"
tabPosition=
"left"
style=
{
{
height
:
"100%"
,
border
:
"1px solid #f0f0f0"
}
}
>
<
Tabs
defaultActiveKey=
"1"
size=
"small"
tabPosition=
"left"
style=
{
{
height
:
"100%"
}
}
>
<
TabPane
tab=
{
<
span
><
BarsOutlined
/>
目录
</
span
>
}
key=
"StudioTree"
>
<
TabPane
tab=
{
<
span
><
BarsOutlined
/>
目录
</
span
>
}
key=
"StudioTree"
>
<
StudioTree
/>
<
StudioTree
/>
</
TabPane
>
</
TabPane
>
<
TabPane
tab=
{
<
span
><
MessageOutlined
/>
会话
</
span
>
}
key=
"Connectors"
>
<
TabPane
tab=
{
<
span
><
MessageOutlined
/>
会话
</
span
>
}
key=
"Connectors"
>
<
StudioConnector
/>
<
StudioConnector
/>
</
TabPane
>
</
TabPane
>
<
TabPane
tab=
{
<
span
><
ClusterOutlined
/>
集群
</
span
>
}
key=
"Cluster"
>
<
TabPane
tab=
{
<
span
><
ClusterOutlined
/>
集群
</
span
>
}
key=
"Cluster"
>
<
StudioCluster
/>
<
StudioCluster
/>
</
TabPane
>
</
TabPane
>
<
TabPane
tab=
{
<
span
><
DatabaseOutlined
/>
数据源
</
span
>
}
key=
"DataSource"
>
<
TabPane
tab=
{
<
span
><
DatabaseOutlined
/>
数据源
</
span
>
}
key=
"DataSource"
>
<
StudioDataBase
/>
<
StudioDataBase
/>
</
TabPane
>
</
TabPane
>
<
TabPane
tab=
{
<
span
><
AppstoreOutlined
/>
元数据
</
span
>
}
key=
"MetaData"
>
<
TabPane
tab=
{
<
span
><
AppstoreOutlined
/>
元数据
</
span
>
}
key=
"MetaData"
>
<
StudioMetaData
/>
<
StudioMetaData
/>
</
TabPane
>
</
TabPane
>
<
TabPane
tab=
{
<
span
><
FunctionOutlined
/>
函数
</
span
>
}
key=
"Function"
>
<
TabPane
tab=
{
<
span
><
FunctionOutlined
/>
函数
</
span
>
}
key=
"Function"
>
...
...
dlink-web/src/components/Studio/StudioRightTool/index.tsx
View file @
84c263bc
...
@@ -16,7 +16,7 @@ const StudioRightTool = (props:any) => {
...
@@ -16,7 +16,7 @@ const StudioRightTool = (props:any) => {
// const [form] = Form.useForm();
// const [form] = Form.useForm();
const
{
form
}
=
props
;
const
{
form
}
=
props
;
return
(
return
(
<
Tabs
defaultActiveKey=
"1"
size=
"small"
tabPosition=
"right"
style=
{
{
height
:
"100%"
,
border
:
"1px solid #f0f0f0"
}
}
>
<
Tabs
defaultActiveKey=
"1"
size=
"small"
tabPosition=
"right"
style=
{
{
height
:
"100%"
,
overflow
:
"auto"
,
border
:
"1px solid #f0f0f0"
}
}
>
<
TabPane
tab=
{
<
span
><
SettingOutlined
/>
作业配置
</
span
>
}
key=
"StudioSetting"
>
<
TabPane
tab=
{
<
span
><
SettingOutlined
/>
作业配置
</
span
>
}
key=
"StudioSetting"
>
<
StudioSetting
form=
{
form
}
/>
<
StudioSetting
form=
{
form
}
/>
</
TabPane
>
</
TabPane
>
...
...
dlink-web/src/components/Studio/StudioTabs/index.tsx
View file @
84c263bc
...
@@ -59,7 +59,6 @@ const EditorTabs = (props: any) => {
...
@@ -59,7 +59,6 @@ const EditorTabs = (props: any) => {
};
};
return
(
return
(
<>
<
Tabs
<
Tabs
hideAdd
hideAdd
type=
"editable-card"
type=
"editable-card"
...
@@ -68,7 +67,7 @@ const EditorTabs = (props: any) => {
...
@@ -68,7 +67,7 @@ const EditorTabs = (props: any) => {
activeKey=
{
tabs
.
activeKey
+
''
}
activeKey=
{
tabs
.
activeKey
+
''
}
onEdit=
{
onEdit
}
onEdit=
{
onEdit
}
className=
{
styles
[
"edit-tabs"
]
}
className=
{
styles
[
"edit-tabs"
]
}
style=
{
{
height
:
"
10
0%"
}
}
style=
{
{
height
:
"
5
0%"
}
}
>
>
{
tabs
.
panes
.
map
(
pane
=>
(
{
tabs
.
panes
.
map
(
pane
=>
(
<
TabPane
tab=
{
pane
.
title
}
key=
{
pane
.
key
}
closable=
{
pane
.
closable
}
>
<
TabPane
tab=
{
pane
.
title
}
key=
{
pane
.
key
}
closable=
{
pane
.
closable
}
>
...
@@ -76,7 +75,7 @@ const EditorTabs = (props: any) => {
...
@@ -76,7 +75,7 @@ const EditorTabs = (props: any) => {
</
TabPane
>
</
TabPane
>
))
}
))
}
</
Tabs
>
</
Tabs
>
</>
)
)
};
};
...
...
dlink-web/src/components/Studio/index.tsx
View file @
84c263bc
import
React
from
"react"
;
import
React
,
{
useEffect
,
useRef
,
useState
,
useCallback
}
from
"react"
;
import
{
connect
}
from
"umi"
;
import
{
connect
}
from
"umi"
;
import
styles
from
'./index.less'
;
import
styles
from
'./index.less'
;
import
{}
from
"@ant-design/icons"
;
import
{}
from
"@ant-design/icons"
;
...
@@ -25,6 +25,41 @@ const Studio: React.FC<StudioProps> = (props) => {
...
@@ -25,6 +25,41 @@ const Studio: React.FC<StudioProps> = (props) => {
const
{
rightClickMenu
,
dispatch
}
=
props
;
const
{
rightClickMenu
,
dispatch
}
=
props
;
const
[
form
]
=
Form
.
useForm
();
const
[
form
]
=
Form
.
useForm
();
const
VIEW
=
{
rightToolWidth
:
300
,
leftToolWidth
:
300
,
marginTop
:
114
,
};
const
[
height
,
setHeight
]
=
useState
<
number
>
();
const
[
size
,
setSize
]
=
useState
({
width
:
document
.
documentElement
.
clientWidth
,
height
:
document
.
documentElement
.
clientHeight
,
});
const
onResize
=
useCallback
(()
=>
{
setSize
({
width
:
document
.
documentElement
.
clientWidth
,
height
:
document
.
documentElement
.
clientHeight
,
})
},
[]);
// const width = document.querySelector('body').offsetWidth;
// const height = document.querySelector('body').offsetHeight*(1/2);
/*const minWidth = document.querySelector('body').offsetWidth*(1/6);
const maxWidth = document.querySelector('body').offsetWidth*(1/2);*/
/* const resize=()=>{
debugger;
setWidth(document.querySelector('body').offsetWidth);
setHeight(document.querySelector('body').offsetHeight);
console.log(width);
console.log(height);
};*/
useEffect
(()
=>
{
window
.
addEventListener
(
'resize'
,
onResize
);
onResize
();
return
()
=>
{
window
.
removeEventListener
(
'resize'
,
onResize
);
};
},
[
onResize
]);
loadSettings
(
dispatch
);
loadSettings
(
dispatch
);
getFillAllByVersion
(
''
,
dispatch
);
getFillAllByVersion
(
''
,
dispatch
);
showCluster
(
dispatch
);
showCluster
(
dispatch
);
...
@@ -34,6 +69,8 @@ const Studio: React.FC<StudioProps> = (props) => {
...
@@ -34,6 +69,8 @@ const Studio: React.FC<StudioProps> = (props) => {
listSession
(
dispatch
);
listSession
(
dispatch
);
showJars
(
dispatch
);
showJars
(
dispatch
);
const
onClick
=
()
=>
{
const
onClick
=
()
=>
{
if
(
rightClickMenu
){
if
(
rightClickMenu
){
dispatch
&&
dispatch
({
dispatch
&&
dispatch
({
...
@@ -44,78 +81,54 @@ const Studio: React.FC<StudioProps> = (props) => {
...
@@ -44,78 +81,54 @@ const Studio: React.FC<StudioProps> = (props) => {
};
};
return
(
return
(
// <div onClick={onClick} style={{'margin':'-24px'}}>
// <StudioMenu form={form}/>
// <Card bordered={false} className={styles.card} size="small" id="studio_card">
// <Row>
// <Col span={4} className={styles["vertical-tabs"]}>
// <StudioLeftTool/>
// </Col>
// <Col span={16}>
// <StudioTabs/>
// </Col>
// <Col span={4} className={styles["vertical-tabs"]}>
// <StudioRightTool form={form}/>
// </Col>
// </Row>
// <Row>
// <Col span={24}>
// <StudioConsole/>
// </Col>
// </Row>
// </Card>
// <BackTop />
// </div>
<
div
onClick=
{
onClick
}
style=
{
{
'margin'
:
'-24px'
}
}
>
<
div
onClick=
{
onClick
}
style=
{
{
'margin'
:
'-24px'
}
}
>
<
StudioMenu
form=
{
form
}
/>
<
StudioMenu
form=
{
form
}
/>
<
Card
bordered=
{
false
}
className=
{
styles
.
card
}
size=
"small"
id=
"studio_card"
>
<
Card
bordered=
{
false
}
className=
{
styles
.
card
}
size=
"small"
id=
"studio_card"
>
<
Row
>
<
Row
>
<
Col
>
<
DraggleLayout
<
DraggleLayout
containerWidth=
{
1100
}
containerWidth=
{
size
.
width
-
VIEW
.
rightToolWidth
}
containerHeight=
{
1220
}
containerHeight=
{
(
size
.
height
-
VIEW
.
marginTop
)
/
2
}
min=
{
50
}
min=
{
VIEW
.
leftToolWidth
}
max=
{
600
}
max=
{
size
.
width
*
(
1
/
2
)
}
initLeftWidth=
{
200
}
initLeftWidth=
{
VIEW
.
leftToolWidth
}
handler=
{
handler=
{
<
div
<
div
style=
{
{
style=
{
{
width
:
4
,
width
:
4
,
height
:
'100%'
,
height
:
'100%'
,
background
:
'rgb(
77, 81, 10
0)'
,
background
:
'rgb(
240, 240, 24
0)'
,
}
}
}
}
/>
/>
}
}
>
>
<
StudioLeftTool
span=
{
4
}
className=
{
styles
[
"vertical-tabs"
]
}
style=
{
{
<
Col
className=
{
styles
[
"vertical-tabs"
]
}
>
backgroundColor
:
`rgb(36, 205, 208)`
,
<
StudioLeftTool
className=
{
styles
[
"vertical-tabs"
]
}
style=
{
{
color
:
`#fff`
,
height
:
(
size
.
height
-
VIEW
.
marginTop
),
height
:
'100%'
,
display
:
'flex'
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
}
}
/>
<
StudioTabs
style=
{
{
backgroundColor
:
`rgb(116, 140, 253)`
,
color
:
`#fff`
,
height
:
'100%'
,
display
:
'flex'
,
display
:
'flex'
,
alignItems
:
'center'
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
justifyContent
:
'center'
,
}
}
/>
</
Col
>
<
Col
style=
{
{
height
:
((
size
.
height
-
VIEW
.
marginTop
)),
}
}
>
<
StudioTabs
style=
{
{
height
:
((
size
.
height
-
VIEW
.
marginTop
)
/
2
),
}
}
/>
<
StudioConsole
style=
{
{
height
:
((
size
.
height
-
VIEW
.
marginTop
)
/
2
),
}
}
}
}
/>
/>
</
Col
>
</
DraggleLayout
>
</
DraggleLayout
>
</
Col
>
<
Col
id=
'StudioRightTool'
style=
{
{
width
:
VIEW
.
rightToolWidth
,
height
:(
size
.
height
-
VIEW
.
marginTop
)}
}
className=
{
styles
[
"vertical-tabs"
]
}
>
<
Col
span=
{
4
}
className=
{
styles
[
"vertical-tabs"
]
}
>
<
StudioRightTool
form=
{
form
}
/>
<
StudioRightTool
form=
{
form
}
/>
</
Col
>
</
Col
>
</
Row
>
</
Row
>
<
Row
>
<
Col
span=
{
24
}
>
<
StudioConsole
/>
</
Col
>
</
Row
>
</
Card
>
</
Card
>
<
BackTop
/>
<
BackTop
/>
</
div
>
</
div
>
...
...
dlink-web/src/global.less
View file @
84c263bc
...
@@ -55,3 +55,9 @@ ol {
...
@@ -55,3 +55,9 @@ ol {
min-height: 100vh;
min-height: 100vh;
}
}
}
}
.ant-pro-basicLayout-content {
position: relative;
margin: 24px;
margin-bottom: 0!important;
}
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