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
5eb34dc1
Unverified
Commit
5eb34dc1
authored
Sep 25, 2023
by
ZackYoung
Committed by
GitHub
Sep 25, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Fix][Web] Fix DataStudio page bug (#2338)
* optimize_docker_action * optimize_docker_action * optimize_docker_action * fix datastudio develop page bug * fix sse * optimize_action
parent
bb8b272d
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
96 additions
and
87 deletions
+96
-87
backend.yaml
.github/workflows/backend.yaml
+1
-1
docker_build.yaml
.github/workflows/docker_build.yaml
+8
-11
MonitorServiceImpl.java
.../main/java/org/dinky/service/impl/MonitorServiceImpl.java
+0
-3
SseEmitterUTF8.java
dinky-admin/src/main/java/org/dinky/sse/SseEmitterUTF8.java
+15
-0
package.json
dinky-web/package.json
+1
-1
index.tsx
dinky-web/src/components/Sidebar/MovableSidebar/index.tsx
+4
-22
global.less
dinky-web/src/global.less
+3
-0
index.tsx
dinky-web/src/pages/DataStudio/BottomContainer/index.tsx
+29
-22
index.tsx
dinky-web/src/pages/DataStudio/FooterContainer/index.tsx
+5
-1
index.tsx
...web/src/pages/DataStudio/MiddleContainer/Editor/index.tsx
+3
-3
index.tsx
...b/src/pages/DataStudio/MiddleContainer/KeyBoard/index.tsx
+3
-2
index.tsx
...src/pages/DataStudio/MiddleContainer/QuickGuide/index.tsx
+3
-2
index.tsx
dinky-web/src/pages/DataStudio/MiddleContainer/index.tsx
+3
-2
index.tsx
dinky-web/src/pages/DataStudio/RightContainer/index.tsx
+14
-13
index.tsx
dinky-web/src/pages/DataStudio/index.tsx
+2
-2
model.ts
dinky-web/src/pages/DataStudio/model.ts
+2
-2
No files found.
.github/workflows/backend.yaml
View file @
5eb34dc1
...
...
@@ -77,7 +77,7 @@ jobs:
${{ runner.os }}-node-
-
name
:
Install Dependencies
if
:
steps.filter.outputs.frontend == 'true'
run
:
cd dinky-web && npm install --
prefer-offline --
no-audit --progress=false --legacy-peer-deps
run
:
cd dinky-web && npm install --no-audit --progress=false --legacy-peer-deps
-
name
:
Npm Web Build
if
:
steps.filter.outputs.frontend == 'true'
run
:
cd dinky-web && npm run build
...
...
.github/workflows/docker_build.yaml
View file @
5eb34dc1
...
...
@@ -46,9 +46,9 @@ jobs:
key
:
${{ runner.os }}-maven-${{ hashFiles('pom.xml') }}
restore-keys
:
|
${{ runner.os }}-maven-
-
name
:
Check Style
run
:
|
./mvnw -T 4C -B --no-snapshot-updates clean spotless:check
#
- name: Check Style
#
run: |
#
./mvnw -T 4C -B --no-snapshot-updates clean spotless:check
-
name
:
Build and Package
run
:
|
./mvnw -B clean install \
...
...
@@ -75,9 +75,6 @@ jobs:
namespace
:
dinkydocker
steps
:
-
uses
:
actions/checkout@v3
-
name
:
Move Dockerfile
run
:
|
cp ./docker/Dockerfile* ./
-
name
:
Log in to the Container registry,url -> ${{ matrix.url }}
if
:
${{ matrix.url == 'registry.cn-hangzhou.aliyuncs.com'}}
uses
:
docker/login-action@v2
...
...
@@ -95,7 +92,7 @@ jobs:
-
name
:
push docker dinky mysql image
uses
:
docker/build-push-action@v2
with
:
file
:
DockerfileMysql
file
:
docker/
DockerfileMysql
context
:
.
push
:
true
tags
:
${{ matrix.url }}/${{ matrix.namespace }}/dinky-mysql-server:${{ inputs.version }}
...
...
@@ -167,11 +164,11 @@ jobs:
FLINK_BIG_VERSION
:
1.13
-
FLINK_VERSION
:
1.14.6
FLINK_BIG_VERSION
:
1.14
-
FLINK_VERSION
:
1.15.
2
-
FLINK_VERSION
:
1.15.
4
FLINK_BIG_VERSION
:
1.15
-
FLINK_VERSION
:
1.16.
0
-
FLINK_VERSION
:
1.16.
2
FLINK_BIG_VERSION
:
1.16
-
FLINK_VERSION
:
1.17.
0
-
FLINK_VERSION
:
1.17.
1
FLINK_BIG_VERSION
:
1.17
steps
:
-
uses
:
actions/checkout@v3
...
...
@@ -208,7 +205,7 @@ jobs:
FLINK_VERSION=${{ matrix.FLINK_VERSION }}
DINKY_IMAGE=${{ matrix.url }}/${{ matrix.namespace }}/dinky-standalone-server:${{ inputs.version }}
FLINK_BIG_VERSION=${{ matrix.FLINK_BIG_VERSION }}
file
:
DockerfileDinkyFlink
file
:
./docker/
DockerfileDinkyFlink
context
:
.
push
:
true
tags
:
${{ matrix.url }}/${{ matrix.namespace }}/dinky-standalone-server:${{ inputs.version }}-flink-${{matrix.FLINK_BIG_VERSION }}
dinky-admin/src/main/java/org/dinky/service/impl/MonitorServiceImpl.java
View file @
5eb34dc1
...
...
@@ -34,7 +34,6 @@ import org.apache.paimon.data.Timestamp;
import
org.apache.paimon.predicate.Predicate
;
import
org.apache.paimon.predicate.PredicateBuilder
;
import
java.io.IOException
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.Date
;
...
...
@@ -106,8 +105,6 @@ public class MonitorServiceImpl extends ServiceImpl<MetricsMapper, Metrics> impl
sseEmitter
.
send
(
JSONUtil
.
toJsonStr
(
Jvm
.
of
()));
ThreadUtil
.
sleep
(
10000
);
}
}
catch
(
IOException
e
)
{
sseEmitter
.
complete
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
sseEmitter
.
complete
();
...
...
dinky-admin/src/main/java/org/dinky/sse/SseEmitterUTF8.java
View file @
5eb34dc1
...
...
@@ -19,6 +19,7 @@
package
org
.
dinky
.
sse
;
import
java.io.IOException
;
import
java.nio.charset.StandardCharsets
;
import
org.springframework.http.HttpHeaders
;
...
...
@@ -26,6 +27,10 @@ import org.springframework.http.MediaType;
import
org.springframework.http.server.ServerHttpResponse
;
import
org.springframework.web.servlet.mvc.method.annotation.SseEmitter
;
import
cn.hutool.core.util.ReflectUtil
;
import
lombok.extern.slf4j.Slf4j
;
@Slf4j
public
class
SseEmitterUTF8
extends
SseEmitter
{
public
SseEmitterUTF8
(
Long
timeout
)
{
super
(
timeout
);
...
...
@@ -38,4 +43,14 @@ public class SseEmitterUTF8 extends SseEmitter {
HttpHeaders
headers
=
outputMessage
.
getHeaders
();
headers
.
setContentType
(
new
MediaType
(
MediaType
.
TEXT_EVENT_STREAM
,
StandardCharsets
.
UTF_8
));
}
@Override
public
void
send
(
Object
object
,
MediaType
mediaType
)
throws
IOException
{
Boolean
complete
=
(
Boolean
)
ReflectUtil
.
getFieldValue
(
this
,
"complete"
);
if
(
complete
)
{
log
.
warn
(
"SseEmitter is complete, cannot send message: {}"
,
object
);
return
;
}
super
.
send
(
object
,
mediaType
);
}
}
dinky-web/package.json
View file @
5eb34dc1
...
...
@@ -59,7 +59,7 @@
"omit.js"
:
"^2.0.2"
,
"rc-menu"
:
"^9.8.4"
,
"rc-util"
:
"^5.33.0"
,
"re-resizable"
:
"6.9.
9
"
,
"re-resizable"
:
"6.9.
11
"
,
"react"
:
"^18.2.0"
,
"react-countup"
:
"^6.4.2"
,
"react-dom"
:
"^18.0.0"
,
...
...
dinky-web/src/components/Sidebar/MovableSidebar/index.tsx
View file @
5eb34dc1
...
...
@@ -20,6 +20,7 @@ export type MovableSidebarProps = {
handlerMaxsize
?:
()
=>
void
;
btnGroup
?:
React
.
ReactNode
[];
onResize
?:
ResizeCallback
;
onResizeStop
?:
ResizeCallback
;
style
?:
React
.
CSSProperties
;
tagList
?:
TabPaneProps
[];
};
...
...
@@ -32,6 +33,7 @@ const MovableSidebar: React.FC<MovableSidebarProps> = (props) => {
style
,
visible
,
onResize
,
onResizeStop
,
defaultSize
,
minWidth
,
maxWidth
,
...
...
@@ -57,6 +59,7 @@ const MovableSidebar: React.FC<MovableSidebarProps> = (props) => {
borderRadius
:
5
}
}
onResize=
{
onResize
}
onResizeStop=
{
onResizeStop
}
defaultSize=
{
defaultSize
}
minWidth=
{
minWidth
}
maxWidth=
{
maxWidth
}
...
...
@@ -64,27 +67,6 @@ const MovableSidebar: React.FC<MovableSidebarProps> = (props) => {
maxHeight=
{
maxHeight
}
enable=
{
enable
}
>
{
/*<PageContainer*/
}
{
/* title={title}*/
}
{
/* tabProps={{*/
}
{
/* type: "editable-card",*/
}
{
/* hideAdd: true,*/
}
{
/* size: "small",*/
}
{
/* animated: true,*/
}
{
/* tabBarStyle: {margin: 0, padding: 0},*/
}
{
/* }}*/
}
{
/* tabList={tagList}*/
}
{
/* extra={[*/
}
{
/* <Button title={l('global.mini')} key={"minimize"} icon={<MinusOutlined/>} block type={"text"} shape={"circle"}*/
}
{
/* onClick={props.handlerMinimize}/>*/
}
{
/* // <MinusSquareOutlined size={15} title={l('global.mini')} key={"minimize"} onClick={handlerMinimize}/>,*/
}
{
/* // <MinusOutlined size={35} title={l('global.mini')} key={"minimize"} onClick={handlerMinimize}/>,*/
}
{
/* // <PlusSquareOutlined size={15} title={l('global.max')} key={"maximize"} onClick={handlerMaxsize}/>*/
}
{
/* ]}*/
}
{
/* fixedHeader*/
}
{
/*>*/
}
{
/* <div style={{height: contentHeight,marginBlock:-5,marginInline:-10}}>{children}</div>*/
}
{
/*</PageContainer>*/
}
<>
<
div
style=
{
{
...
...
@@ -95,7 +77,7 @@ const MovableSidebar: React.FC<MovableSidebarProps> = (props) => {
>
<
div
>
{
title
}
</
div
>
<
div
className=
{
showBtn
?
'show'
:
'hide'
}
>
<
Space
size=
{
5
}
>
<
Space
size=
{
1
}
>
{
props
.
btnGroup
}
<
CircleBtn
onClick=
{
props
.
handlerMinimize
}
icon=
{
<
MinusOutlined
/>
}
/>
</
Space
>
...
...
dinky-web/src/global.less
View file @
5eb34dc1
...
...
@@ -369,6 +369,9 @@ h5 {
font-weight: 500;
font-size: 15px;
font-family: 'SimHei', serif;
overflow: visible;
white-space: nowrap;
text-overflow: ellipsis;
}
.container-header {
display: flex;
...
...
dinky-web/src/pages/DataStudio/BottomContainer/index.tsx
View file @
5eb34dc1
import
{
CircleBtn
}
from
'@/components/CallBackButton/CircleBtn'
;
import
{
CircleBtn
}
from
'@/components/CallBackButton/CircleBtn'
;
import
Title
from
'@/components/Front/Title'
;
import
ContentScroll
from
'@/components/Scroll/ContentScroll'
;
import
MovableSidebar
from
'@/components/Sidebar/MovableSidebar'
;
import
{
StateType
,
STUDIO_MODEL
,
VIEW
}
from
'@/pages/DataStudio/model'
;
import
{
LeftBottomMoreTabs
,
LeftBottomSide
}
from
'@/pages/DataStudio/route'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
connect
}
from
'@@/exports'
;
import
{
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
ConfigProvider
,
Space
,
Tabs
}
from
'antd'
;
import
{
StateType
,
STUDIO_MODEL
,
VIEW
}
from
'@/pages/DataStudio/model'
;
import
{
LeftBottomMoreTabs
,
LeftBottomSide
}
from
'@/pages/DataStudio/route'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
connect
}
from
'@@/exports'
;
import
{
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
ConfigProvider
,
Space
,
Tabs
}
from
'antd'
;
import
React
from
'react'
;
export
type
BottomContainerProps
=
{
size
:
number
;
};
const
BottomContainer
:
React
.
FC
<
BottomContainerProps
>
=
(
props
:
any
)
=>
{
const
{
dispatch
,
size
,
bottomContainer
}
=
props
;
const
{
dispatch
,
size
,
bottomContainer
}
=
props
;
const
width
=
document
.
documentElement
.
clientWidth
-
VIEW
.
sideWidth
*
2
;
/**
* 侧边栏最小化
...
...
@@ -70,7 +71,7 @@ const BottomContainer: React.FC<BottomContainerProps> = (props: any) => {
return
Object
.
values
(
Object
.
keys
(
LeftBottomMoreTabs
).
map
((
x
)
=>
LeftBottomMoreTabs
[
x
].
map
((
y
)
=>
{
return
{
...
y
,
key
:
x
+
'/'
+
y
.
key
};
return
{...
y
,
key
:
x
+
'/'
+
y
.
key
};
})
)
).
flatMap
((
x
)
=>
x
);
...
...
@@ -82,7 +83,9 @@ const BottomContainer: React.FC<BottomContainerProps> = (props: any) => {
* @param direction
* @param {{offsetHeight: any}} elementRef
*/
const
resizeCallback
=
(
event
:
any
,
direction
:
any
,
elementRef
:
{
offsetHeight
:
any
})
=>
{
const
resizeCallback
=
(
event
:
any
,
direction
:
any
,
elementRef
:
{
offsetHeight
:
any
})
=>
{
updateBottomHeight
(
elementRef
.
offsetHeight
);
const
centerContentHeight
=
document
.
documentElement
.
clientHeight
-
...
...
@@ -92,7 +95,7 @@ const BottomContainer: React.FC<BottomContainerProps> = (props: any) => {
VIEW
.
otherHeight
-
bottomContainer
.
height
;
updateCenterContentHeight
(
centerContentHeight
);
updateToolContentHeight
(
centerContentHeight
-
VIEW
.
mid
Margin
);
updateToolContentHeight
(
centerContentHeight
-
VIEW
.
left
Margin
);
};
const
renderTabPane
=
()
=>
{
...
...
@@ -112,7 +115,7 @@ const BottomContainer: React.FC<BottomContainerProps> = (props: any) => {
});
return
(
<
Tabs
style=
{
{
height
:
'32px'
,
display
:
'-webkit-box'
}
}
style=
{
{
height
:
'32px'
,
display
:
'-webkit-box'
}
}
items=
{
items
}
type=
'card'
onChange=
{
(
key
:
string
)
=>
{
...
...
@@ -133,14 +136,14 @@ const BottomContainer: React.FC<BottomContainerProps> = (props: any) => {
const
renderItems
=
()
=>
{
return
[
...
LeftBottomSide
.
map
((
x
)
=>
{
return
{
...
x
,
key
:
x
.
key
+
'/'
};
return
{...
x
,
key
:
x
.
key
+
'/'
};
}),
...
getSubTabs
()
].
map
((
item
)
=>
{
return
{
...
item
,
children
:
(
<
ContentScroll
height=
{
props
.
bottomContainer
.
height
-
VIEW
.
mid
Margin
}
>
<
ContentScroll
height=
{
props
.
bottomContainer
.
height
-
VIEW
.
left
Margin
}
>
{
item
.
children
}
</
ContentScroll
>
)
...
...
@@ -148,7 +151,6 @@ const BottomContainer: React.FC<BottomContainerProps> = (props: any) => {
});
};
// @ts-ignore
return
(
<
MovableSidebar
title=
{
...
...
@@ -169,14 +171,16 @@ const BottomContainer: React.FC<BottomContainerProps> = (props: any) => {
</
Space
>
</
ConfigProvider
>
}
visible=
{
bottomContainer
.
selectKey
!==
''
}
visible=
{
bottomContainer
.
selectKey
}
style=
{
{
zIndex
:
999
,
height
:
bottomContainer
.
height
,
marginTop
:
0
,
backgroundColor
:
'#fff'
backgroundColor
:
'#fff'
,
position
:
"fixed"
,
bottom
:
VIEW
.
footerHeight
}
}
defaultSize=
{
{
width
:
'100%'
,
height
:
bottomContainer
.
height
}
}
defaultSize=
{
{
width
:
'100%'
,
height
:
bottomContainer
.
height
}
}
minHeight=
{
VIEW
.
midMargin
}
maxHeight=
{
size
.
contentHeight
-
40
}
onResize=
{
(
...
...
@@ -186,9 +190,10 @@ const BottomContainer: React.FC<BottomContainerProps> = (props: any) => {
offsetHeight
:
any
;
}
)
=>
resizeCallback
(
event
,
direction
,
elementRef
)
}
btnGroup=
{
[<
CircleBtn
key=
{
'max'
}
icon=
{
<
PlusOutlined
/>
}
/>]
}
enable=
{
{
top
:
true
}
}
btnGroup=
{
[<
CircleBtn
key=
{
'max'
}
icon=
{
<
PlusOutlined
/>
}
/>]
}
enable=
{
{
top
:
true
}
}
handlerMinimize=
{
handleMinimize
}
maxWidth=
{
width
}
>
<
Tabs
activeKey=
{
...
...
@@ -199,13 +204,15 @@ const BottomContainer: React.FC<BottomContainerProps> = (props: any) => {
:
''
)
}
items=
{
renderItems
()
}
tabBarStyle=
{
{
display
:
'none'
}
}
tabBarStyle=
{
{
display
:
'none'
}
}
/>
</
MovableSidebar
>
);
};
export
default
connect
(({
Studio
}:
{
Studio
:
StateType
})
=>
({
export
default
connect
(({
Studio
}:
{
Studio
:
StateType
})
=>
({
leftContainer
:
Studio
.
leftContainer
,
bottomContainer
:
Studio
.
bottomContainer
,
centerContentHeight
:
Studio
.
centerContentHeight
...
...
dinky-web/src/pages/DataStudio/FooterContainer/index.tsx
View file @
5eb34dc1
...
...
@@ -144,7 +144,11 @@ const FooterContainer: React.FC<FooterContainerProps & StateType> = (props) => {
height
:
VIEW
.
footerHeight
,
width
:
'100%'
,
display
:
'flex'
,
paddingInline
:
10
paddingInline
:
10
,
position
:
'fixed'
,
bottom
:
0
,
right
:
0
,
left
:
0
,
}
}
>
<
Space
style=
{
{
direction
:
'ltr'
,
width
:
'30%%'
}
}
>
...
...
dinky-web/src/pages/DataStudio/MiddleContainer/Editor/index.tsx
View file @
5eb34dc1
...
...
@@ -4,11 +4,11 @@ import { connect } from '@@/exports';
import
{
Editor
}
from
'@monaco-editor/react'
;
import
{
editor
}
from
'monaco-editor'
;
import
React
from
'react'
;
import
{
never
}
from
"@umijs/utils/compiled/zod"
;
export
type
EditorProps
=
{
statement
:
string
;
};
const
{
ScrollType
}
=
editor
;
const
CodeEditor
:
React
.
FC
<
EditorProps
&
any
>
=
(
props
)
=>
{
const
{
...
...
@@ -64,12 +64,12 @@ const CodeEditor: React.FC<EditorProps & any> = (props) => {
});
});
}
}
onChange=
{
(
v
,
d
)
=>
{
onChange=
{
(
v
)
=>
{
if
(
!
current
)
{
return
;
}
current
.
statement
=
v
;
typeof
v
===
"string"
?
current
.
statement
=
v
:
never
;
dispatch
({
type
:
STUDIO_MODEL
.
saveTabs
,
payload
:
{
...
props
.
tabs
}
...
...
dinky-web/src/pages/DataStudio/MiddleContainer/KeyBoard/index.tsx
View file @
5eb34dc1
...
...
@@ -20,6 +20,7 @@
import
{
KEY_BOARD_MIDDLE
}
from
'@/pages/DataStudio/MiddleContainer/KeyBoard/constant'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
Divider
,
Typography
}
from
'antd'
;
import
{
Fragment
}
from
"react"
;
const
{
Title
,
Paragraph
,
Text
}
=
Typography
;
...
...
@@ -27,7 +28,7 @@ const KeyBoard = () => {
const
buildKeyBoard
=
()
=>
{
return
KEY_BOARD_MIDDLE
.
map
((
item
,
index
)
=>
{
return
(
<>
<
Fragment
key=
{
index
}
>
{
index
%
5
===
0
?
(
<>
<
Divider
plain
orientationMargin=
{
0
}
/>
...
...
@@ -42,7 +43,7 @@ const KeyBoard = () => {
<
Divider
type=
'vertical'
/>
</>
)
}
</>
</
Fragment
>
);
});
};
...
...
dinky-web/src/pages/DataStudio/MiddleContainer/QuickGuide/index.tsx
View file @
5eb34dc1
...
...
@@ -21,6 +21,7 @@ import { QUICK_GUIDE } from '@/pages/DataStudio/MiddleContainer/QuickGuide/const
import
{
l
}
from
'@/utils/intl'
;
import
{
Link
}
from
'@umijs/max'
;
import
{
Divider
,
Typography
}
from
'antd'
;
import
{
Fragment
}
from
"react"
;
const
{
Title
,
Paragraph
}
=
Typography
;
...
...
@@ -28,7 +29,7 @@ const QuickGuide = () => {
const
buildQuickGuide
=
()
=>
{
return
QUICK_GUIDE
.
map
((
item
,
index
)
=>
{
return
(
<>
<
Fragment
key=
{
index
}
>
{
index
%
5
===
0
?
(
<>
<
Divider
plain
orientationMargin=
{
0
}
/>
...
...
@@ -44,7 +45,7 @@ const QuickGuide = () => {
</
Link
>
</>
)
}
</>
</
Fragment
>
);
});
};
...
...
dinky-web/src/pages/DataStudio/MiddleContainer/index.tsx
View file @
5eb34dc1
...
...
@@ -267,14 +267,15 @@ const MiddleContainer = (props: any) => {
const
renderMiddleContent
=
()
=>
{
if
(
tabItems
?.
length
===
0
)
{
return
(
<>
// 这里必需设置高度,否则会导致下册内容无法正常拉动
<
div
style=
{
{
height
:
0
}
}
>
<
KeyBoard
/>
<
Divider
/>
<
br
/>
<
br
/>
<
br
/>
<
QuickGuide
/>
</>
</
div
>
);
}
...
...
dinky-web/src/pages/DataStudio/RightContainer/index.tsx
View file @
5eb34dc1
...
...
@@ -20,12 +20,12 @@
import
Title
from
'@/components/Front/Title'
;
import
MovableSidebar
from
'@/components/Sidebar/MovableSidebar'
;
import
useThemeValue
from
'@/hooks/useThemeValue'
;
import
{
mapDispatchToProps
}
from
'@/pages/DataStudio/function'
;
import
{
StateType
,
VIEW
}
from
'@/pages/DataStudio/model'
;
import
{
RightSide
}
from
'@/pages/DataStudio/route'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
connect
}
from
'@@/exports'
;
import
{
Tabs
}
from
'antd'
;
import
{
mapDispatchToProps
}
from
'@/pages/DataStudio/function'
;
import
{
StateType
,
VIEW
}
from
'@/pages/DataStudio/model'
;
import
{
RightSide
}
from
'@/pages/DataStudio/route'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
connect
}
from
'@@/exports'
;
import
{
Tabs
}
from
'antd'
;
import
React
from
'react'
;
export
type
RightContainerProps
=
{
...
...
@@ -38,7 +38,7 @@ const RightContainer: React.FC<RightContainerProps> = (prop: any) => {
size
,
leftContainer
,
rightContainer
,
bottom
Height
,
toolContent
Height
,
updateRightWidth
,
updateSelectRightKey
,
tabs
...
...
@@ -46,7 +46,7 @@ const RightContainer: React.FC<RightContainerProps> = (prop: any) => {
const
maxWidth
=
size
.
width
-
2
*
VIEW
.
leftToolWidth
-
leftContainer
.
width
-
600
;
return
(
<
MovableSidebar
contentHeight=
{
size
.
contentHeight
-
VIEW
.
midMargin
-
bottom
Height
}
contentHeight=
{
toolContent
Height
}
onResize=
{
(
event
:
any
,
direction
:
any
,
...
...
@@ -64,14 +64,14 @@ const RightContainer: React.FC<RightContainerProps> = (prop: any) => {
}
}
minWidth=
{
200
}
maxWidth=
{
maxWidth
}
enable=
{
{
left
:
true
}
}
style=
{
{
borderInlineStart
:
`1px solid ${themeValue.borderColor}`
}
}
enable=
{
{
left
:
true
}
}
style=
{
{
borderInlineStart
:
`1px solid ${themeValue.borderColor}`
}
}
>
{
tabs
.
panes
.
length
>
0
?
(
<
Tabs
activeKey=
{
rightContainer
.
selectKey
}
items=
{
RightSide
}
tabBarStyle=
{
{
display
:
'none'
}
}
tabBarStyle=
{
{
display
:
'none'
}
}
/>
)
:
(
<>
</>
...
...
@@ -81,12 +81,13 @@ const RightContainer: React.FC<RightContainerProps> = (prop: any) => {
};
export
default
connect
(
({
Studio
}:
{
Studio
:
StateType
})
=>
({
({
Studio
}:
{
Studio
:
StateType
})
=>
({
leftContainer
:
Studio
.
leftContainer
,
rightContainer
:
Studio
.
rightContainer
,
bottomContainer
:
Studio
.
bottomContainer
,
activeBreadcrumbTitle
:
Studio
.
tabs
.
activeBreadcrumbTitle
,
tabs
:
Studio
.
tabs
tabs
:
Studio
.
tabs
,
toolContentHeight
:
Studio
.
toolContentHeight
}),
mapDispatchToProps
)(
RightContainer
);
dinky-web/src/pages/DataStudio/index.tsx
View file @
5eb34dc1
...
...
@@ -91,8 +91,8 @@ const DataStudio = (props: any) => {
height
:
document
.
documentElement
.
clientHeight
,
contentHeight
:
document
.
documentElement
.
clientHeight
-
VIEW
.
headerHeight
-
VIEW
.
headerNavHeight
-
VIEW
.
headerHeight
-
VIEW
.
footerHeight
-
VIEW
.
otherHeight
});
...
...
@@ -103,7 +103,7 @@ const DataStudio = (props: any) => {
setSize
(
getClientSize
());
const
centerContentHeight
=
getClientSize
().
contentHeight
-
bottomHeight
;
updateCenterContentHeight
(
centerContentHeight
);
updateToolContentHeight
(
centerContentHeight
-
VIEW
.
mid
Margin
);
updateToolContentHeight
(
centerContentHeight
-
VIEW
.
left
Margin
);
};
useEffect
(()
=>
{
...
...
dinky-web/src/pages/DataStudio/model.ts
View file @
5eb34dc1
...
...
@@ -16,7 +16,7 @@ import ICodeEditor = editor.ICodeEditor;
*/
export
const
VIEW
=
{
headerHeight
:
32
,
headerNavHeight
:
5
5
,
headerNavHeight
:
5
6
,
footerHeight
:
25
,
sideWidth
:
40
,
leftToolWidth
:
180
,
...
...
@@ -26,7 +26,7 @@ export const VIEW = {
rightMargin
:
32
,
leftMargin
:
36
,
midMargin
:
44
,
otherHeight
:
1
,
otherHeight
:
0
,
paddingInline
:
50
};
...
...
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