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
65ea93a7
Unverified
Commit
65ea93a7
authored
Aug 09, 2023
by
zhu-mingye
Committed by
GitHub
Aug 09, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix] fix some bug #2182
parent
6b4dd627
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
242 additions
and
134 deletions
+242
-134
db-h2.sql
dinky-admin/src/main/resources/db/db-h2.sql
+2
-2
index.tsx
...ages/DataStudio/FooterContainer/JobRunningModal/index.tsx
+61
-0
index.tsx
dinky-web/src/pages/DataStudio/FooterContainer/index.tsx
+110
-84
index.tsx
dinky-web/src/pages/DataStudio/HeaderContainer/index.tsx
+0
-0
index.tsx
dinky-web/src/pages/DataStudio/MiddleContainer/index.tsx
+11
-7
function.ts
dinky-web/src/pages/DataStudio/function.ts
+12
-8
model.ts
dinky-web/src/pages/DataStudio/model.ts
+41
-28
dinky-mysql.sql
script/sql/dinky-mysql.sql
+3
-3
dinky-pg.sql
script/sql/dinky-pg.sql
+2
-2
No files found.
dinky-admin/src/main/resources/db/db-h2.sql
View file @
65ea93a7
...
@@ -1522,7 +1522,7 @@ CREATE TABLE `dinky_user` (
...
@@ -1522,7 +1522,7 @@ CREATE TABLE `dinky_user` (
)
ENGINE
=
InnoDB
ROW_FORMAT
=
Dynamic
;
)
ENGINE
=
InnoDB
ROW_FORMAT
=
Dynamic
;
INSERT
INTO
`dinky_user`
INSERT
INTO
`dinky_user`
VALUES
(
1
,
'admin'
,
'21232f297a57a5a743894a0e4a801fc3'
,
'Admin'
,
NULL
,
0
VALUES
(
1
,
'admin'
,
'21232f297a57a5a743894a0e4a801fc3'
,
'Admin'
,
NULL
,
0
,
NULL
,
NULL
,
1
,
0
,
'2022-12-13 05:27:19'
,
NULL
,
NULL
,
1
,
1
,
0
,
'2022-12-13 05:27:19'
,
'2022-12-13 05:27:19'
);
,
'2022-12-13 05:27:19'
);
DROP
TABLE
IF
EXISTS
`dinky_user_role`
;
DROP
TABLE
IF
EXISTS
`dinky_user_role`
;
CREATE
TABLE
`dinky_user_role`
(
CREATE
TABLE
`dinky_user_role`
(
...
@@ -1544,7 +1544,7 @@ CREATE TABLE `dinky_user_tenant` (
...
@@ -1544,7 +1544,7 @@ CREATE TABLE `dinky_user_tenant` (
`update_time`
datetime
(
0
)
NULL
DEFAULT
NULL
COMMENT
'update time'
`update_time`
datetime
(
0
)
NULL
DEFAULT
NULL
COMMENT
'update time'
)
ENGINE
=
InnoDB
ROW_FORMAT
=
Dynamic
;
)
ENGINE
=
InnoDB
ROW_FORMAT
=
Dynamic
;
INSERT
INTO
`dinky_user_tenant`
(
`id`
,
`user_id`
,
`tenant_id`
,
`create_time`
,
`update_time`
)
INSERT
INTO
`dinky_user_tenant`
(
`id`
,
`user_id`
,
`tenant_id`
,
`create_time`
,
`update_time`
)
VALUES
(
1
,
1
,
1
,
current_time
,
current_time
);
VALUES
(
1
,
1
,
1
,
1
,
current_time
,
current_time
);
DROP
TABLE
IF
EXISTS
`metadata_column`
;
DROP
TABLE
IF
EXISTS
`metadata_column`
;
CREATE
TABLE
`metadata_column`
(
CREATE
TABLE
`metadata_column`
(
`column_name`
varchar
(
255
)
NOT
NULL
COMMENT
'column name'
,
`column_name`
varchar
(
255
)
NOT
NULL
COMMENT
'column name'
,
...
...
dinky-web/src/pages/DataStudio/FooterContainer/JobRunningModal/index.tsx
0 → 100644
View file @
65ea93a7
/*
*
* 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
{
Col
,
Modal
,
Progress
,
Row
,
Space
}
from
"antd"
;
import
React
from
"react"
;
import
{
JobRunningMsgType
}
from
"@/pages/DataStudio/model"
;
import
{
StopTwoTone
}
from
"@ant-design/icons"
;
type
JobRunningModalProps
=
{
visible
:
boolean
;
onCancel
:
()
=>
void
;
onOk
:
()
=>
void
;
value
:
JobRunningMsgType
;
}
const
JobRunningModal
:
React
.
FC
<
JobRunningModalProps
>
=
(
props
)
=>
{
const
{
visible
,
onCancel
,
onOk
,
value
}
=
props
;
return
<>
<
Modal
title=
{
`Job ${value?.jobName} is running`
}
open=
{
visible
}
onOk=
{
onOk
}
width=
{
'50%'
}
centered
onCancel=
{
onCancel
}
footer=
{
null
}
>
<
Space
direction=
"vertical"
style=
{
{
width
:
'100%'
}
}
>
<
Row
gutter=
{
[
12
,
12
]
}
>
<
Col
span=
{
23
}
>
<
Progress
showInfo
strokeLinecap=
{
'round'
}
percent=
{
100
}
status=
"active"
strokeColor=
{
{
from
:
'#108ee9'
,
to
:
'#87d068'
}
}
/>
</
Col
>
<
Col
span=
{
1
}
>
<
StopTwoTone
/>
</
Col
>
</
Row
>
</
Space
>
</
Modal
>
</>
}
export
default
JobRunningModal
;
\ No newline at end of file
dinky-web/src/pages/DataStudio/FooterContainer/index.tsx
View file @
65ea93a7
...
@@ -4,101 +4,127 @@ import {Button, GlobalToken, Space} from "antd";
...
@@ -4,101 +4,127 @@ import {Button, GlobalToken, Space} from "antd";
import
{
connect
}
from
"@@/exports"
;
import
{
connect
}
from
"@@/exports"
;
import
{
getCurrentTab
}
from
"@/pages/DataStudio/function"
;
import
{
getCurrentTab
}
from
"@/pages/DataStudio/function"
;
import
{
getSseData
}
from
"@/services/api"
;
import
{
getSseData
}
from
"@/services/api"
;
import
{
API_CONSTANTS
}
from
"@/services/constants"
;
import
{
l
}
from
"@/utils/intl"
;
import
{
l
}
from
"@/utils/intl"
;
import
JobRunningModal
from
"@/pages/DataStudio/FooterContainer/JobRunningModal"
;
export
type
FooterContainerProps
=
{
export
type
FooterContainerProps
=
{
token
:
GlobalToken
token
:
GlobalToken
}
}
type
ButtonRoute
=
{
type
ButtonRoute
=
{
text
:
React
.
ReactNode
,
text
:
React
.
ReactNode
,
title
:
string
,
title
:
string
,
onClick
?:
()
=>
void
,
onClick
?:
()
=>
void
,
isShow
?:
(
type
?:
TabsPageType
,
subType
?:
string
,
data
?:
any
)
=>
boolean
;
isShow
?:
(
type
?:
TabsPageType
,
subType
?:
string
,
data
?:
any
)
=>
boolean
;
}
}
const
FooterContainer
:
React
.
FC
<
FooterContainerProps
&
StateType
>
=
(
props
)
=>
{
const
FooterContainer
:
React
.
FC
<
FooterContainerProps
&
StateType
>
=
(
props
)
=>
{
const
{
footContainer
,
token
,
tabs
}
=
props
;
const
{
footContainer
:
{
const
eventSource
=
getSseData
(
"/api/sse/getJvmInfo"
);
memDetails
,
const
[
memDetails
,
setMemDetails
]
=
useState
(
footContainer
.
memDetails
);
codeType
,
useEffect
(()
=>
{
lineSeparator
,
eventSource
.
onmessage
=
(
event
)
=>
{
codeEncoding
,
const
data
=
JSON
.
parse
(
event
.
data
);
space
,
setMemDetails
(
Number
(
data
[
"heapUsed"
]
/
1024
/
1024
).
toFixed
(
0
)
+
"/"
+
Number
(
data
[
"total"
]
/
1024
/
1024
).
toFixed
(
0
)
+
"M"
)
codePosition
,
}
jobRunningMsg
,
return
()
=>
{
},
token
,
tabs
}
=
props
;
eventSource
.
close
()
}
const
[
viewJobRunning
,
setViewJobRunning
]
=
useState
(
false
);
},
[])
const
eventSource
=
getSseData
(
"/api/sse/getJvmInfo"
);
const
[
memDetailInfo
,
setMemDetailInfo
]
=
useState
(
memDetails
);
useEffect
(()
=>
{
eventSource
.
onmessage
=
(
event
)
=>
{
const
data
=
JSON
.
parse
(
event
.
data
);
setMemDetailInfo
(
Number
(
data
[
"heapUsed"
]
/
1024
/
1024
).
toFixed
(
0
)
+
"/"
+
Number
(
data
[
"total"
]
/
1024
/
1024
).
toFixed
(
0
)
+
"M"
)
}
return
()
=>
{
eventSource
.
close
()
}
},
[]);
const
currentTab
=
getCurrentTab
(
tabs
.
panes
,
tabs
.
activeKey
);
const
route
:
ButtonRoute
[]
=
[
const
currentTab
=
getCurrentTab
(
tabs
.
panes
,
tabs
.
activeKey
);
{
const
route
:
ButtonRoute
[]
=
[
text
:
<
span
{
style=
{
{
backgroundColor
:
token
.
colorBgBase
}
}
>
{
memDetails
}
</
span
>,
text
:
<
span
style=
{
{
backgroundColor
:
token
.
colorBgBase
}
}
>
{
memDetailInfo
}
</
span
>,
title
:
l
(
"pages.datastudio.footer.memDetails"
,
""
,
{
title
:
l
(
"pages.datastudio.footer.memDetails"
,
""
,
{
max
:
memDetails
.
split
(
"/"
)[
1
],
max
:
memDetailInfo
.
split
(
"/"
)[
1
],
used
:
memDetails
.
split
(
"/"
)[
0
]
used
:
memDetailInfo
.
split
(
"/"
)[
0
]
}),
}),
isShow
:
()
=>
true
isShow
:
()
=>
true
},
},
{
{
text
:
footContainer
.
codeType
,
text
:
codeType
,
title
:
l
(
"pages.datastudio.footer.codeType"
)
+
footContainer
.
codeType
,
title
:
l
(
"pages.datastudio.footer.codeType"
)
+
codeType
,
isShow
:
(
type
)
=>
TabsPageType
.
project
===
type
isShow
:
(
type
)
=>
TabsPageType
.
project
===
type
},
},
{
{
text
:
footContainer
.
lineSeparator
,
text
:
lineSeparator
,
title
:
l
(
"pages.datastudio.footer.lineSeparator"
)
+
footContainer
.
lineSeparator
,
title
:
l
(
"pages.datastudio.footer.lineSeparator"
)
+
lineSeparator
,
isShow
:
(
type
)
=>
TabsPageType
.
project
===
type
isShow
:
(
type
)
=>
TabsPageType
.
project
===
type
},
},
{
{
text
:
footContainer
.
codeEncoding
,
text
:
codeEncoding
,
title
:
l
(
"pages.datastudio.footer.codeEncoding"
)
+
footContainer
.
codeEncoding
,
title
:
l
(
"pages.datastudio.footer.codeEncoding"
)
+
codeEncoding
,
isShow
:
(
type
)
=>
TabsPageType
.
project
===
type
isShow
:
(
type
)
=>
TabsPageType
.
project
===
type
},
},
{
{
text
:
"Space: "
+
footContainer
.
space
,
text
:
"Space: "
+
space
,
title
:
"Space: "
+
footContainer
.
space
,
title
:
"Space: "
+
space
,
isShow
:
(
type
)
=>
TabsPageType
.
project
===
type
isShow
:
(
type
)
=>
TabsPageType
.
project
===
type
},
},
{
{
text
:
footContainer
.
codePosition
[
0
]
+
":"
+
footContainer
.
codePosition
[
1
],
text
:
codePosition
[
0
]
+
":"
+
codePosition
[
1
],
title
:
l
(
"pages.datastudio.footer.codePosition"
,
""
,
{
title
:
l
(
"pages.datastudio.footer.codePosition"
,
""
,
{
Ln
:
footContainer
.
codePosition
[
0
],
Ln
:
codePosition
[
0
],
Col
:
footContainer
.
codePosition
[
1
]
Col
:
codePosition
[
1
]
}),
}),
isShow
:
(
type
)
=>
TabsPageType
.
project
===
type
isShow
:
(
type
)
=>
TabsPageType
.
project
===
type
},
},
]
];
return
(
<
div
style=
{
{
backgroundColor
:
token
.
colorFill
,
/**
height
:
VIEW
.
footerHeight
,
* render footer right info
width
:
"100%"
,
* @param {ButtonRoute[]} routes
display
:
"flex"
,
* @returns {JSX.Element[]}
paddingInline
:
10
*/
}
}
>
const
renderFooterRightInfo
=
(
routes
:
ButtonRoute
[])
=>
{
<
Space
style=
{
{
direction
:
"ltr"
,
width
:
"50%"
}
}
>
return
routes
.
filter
(
x
=>
{
<
Button
size=
{
"small"
}
type=
{
"text"
}
block
style=
{
{
paddingInline
:
4
}
}
>
Welcome to Dinky !
</
Button
>
if
(
x
.
isShow
)
{
</
Space
>
return
x
.
isShow
(
currentTab
?.
type
,
currentTab
?.
subType
,
currentTab
?.
params
);
<
Space
style=
{
{
direction
:
"rtl"
,
width
:
"50%"
}
}
size=
{
4
}
direction=
{
"horizontal"
}
>
}
{
route
.
filter
(
x
=>
{
return
false
if
(
x
.
isShow
)
{
return
x
.
isShow
(
currentTab
?.
type
,
currentTab
?.
subType
,
currentTab
?.
params
);
}
return
false
})
})
.
map
((
item
,
index
)
=>
{
.
map
((
item
,
index
)
=>
(
return
<
Button
size=
{
"small"
}
type=
{
"text"
}
block
style=
{
{
paddingInline
:
4
}
}
key=
{
index
}
<
Button
size=
{
"small"
}
type=
{
"text"
}
block
style=
{
{
paddingInline
:
4
}
}
key=
{
index
}
onClick=
{
item
.
onClick
}
title=
{
item
.
title
}
>
{
item
.
text
}
</
Button
>
onClick=
{
item
.
onClick
}
title=
{
item
.
title
}
>
{
item
.
text
}
</
Button
>
})
}
))
</
Space
>
}
</
div
>
)
return
<>
<
div
style=
{
{
backgroundColor
:
token
.
colorFill
,
height
:
VIEW
.
footerHeight
,
width
:
"100%"
,
display
:
"flex"
,
paddingInline
:
10
}
}
>
<
Space
style=
{
{
direction
:
"ltr"
,
width
:
"30%%"
}
}
>
<
Button
size=
{
"small"
}
type=
{
"text"
}
block
style=
{
{
paddingInline
:
4
}
}
>
Welcome to Dinky !
</
Button
>
</
Space
>
<
Space
onClick=
{
()
=>
setViewJobRunning
(
true
)
}
style=
{
{
direction
:
'rtl'
,
width
:
"30%"
}
}
>
{
jobRunningMsg
.
jobName
}
-
{
jobRunningMsg
.
runningLog
}
</
Space
>
<
Space
style=
{
{
direction
:
"rtl"
,
width
:
"70%"
}
}
size=
{
4
}
direction=
{
"horizontal"
}
>
{
renderFooterRightInfo
(
route
)
}
</
Space
>
</
div
>
<
JobRunningModal
value=
{
jobRunningMsg
}
visible=
{
viewJobRunning
}
onCancel=
{
()
=>
setViewJobRunning
(
false
)
}
onOk=
{
()
=>
setViewJobRunning
(
false
)
}
/>
</>
}
}
export
default
connect
(({
Studio
}:
{
Studio
:
StateType
})
=>
({
export
default
connect
(({
Studio
}:
{
Studio
:
StateType
})
=>
({
footContainer
:
Studio
.
footContainer
,
footContainer
:
Studio
.
footContainer
,
tabs
:
Studio
.
tabs
tabs
:
Studio
.
tabs
}))(
FooterContainer
);
}))(
FooterContainer
);
dinky-web/src/pages/DataStudio/HeaderContainer/index.tsx
View file @
65ea93a7
This diff is collapsed.
Click to expand it.
dinky-web/src/pages/DataStudio/MiddleContainer/index.tsx
View file @
65ea93a7
...
@@ -20,7 +20,6 @@ import React, {useState} from "react";
...
@@ -20,7 +20,6 @@ import React, {useState} from "react";
import
{
connect
}
from
"@@/exports"
;
import
{
connect
}
from
"@@/exports"
;
import
{
DataStudioParams
,
MetadataParams
,
StateType
,
TabsItemType
,
TabsPageType
}
from
"@/pages/DataStudio/model"
;
import
{
DataStudioParams
,
MetadataParams
,
StateType
,
TabsItemType
,
TabsPageType
}
from
"@/pages/DataStudio/model"
;
import
RightTagsRouter
from
"@/pages/RegCenter/DataSource/components/DataSourceDetail/RightTagsRouter"
;
import
RightTagsRouter
from
"@/pages/RegCenter/DataSource/components/DataSourceDetail/RightTagsRouter"
;
import
{
renderDBIcon
}
from
"@/pages/RegCenter/DataSource/components/function"
;
import
KeyBoard
from
"@/pages/DataStudio/MiddleContainer/KeyBoard"
;
import
KeyBoard
from
"@/pages/DataStudio/MiddleContainer/KeyBoard"
;
import
{
MenuInfo
}
from
"rc-menu/es/interface"
;
import
{
MenuInfo
}
from
"rc-menu/es/interface"
;
import
{
STUDIO_TAG_RIGHT_CONTEXT_MENU
}
from
"@/pages/DataStudio/constants"
;
import
{
STUDIO_TAG_RIGHT_CONTEXT_MENU
}
from
"@/pages/DataStudio/constants"
;
...
@@ -29,8 +28,7 @@ import ContentScroll from "@/components/Scroll/ContentScroll";
...
@@ -29,8 +28,7 @@ import ContentScroll from "@/components/Scroll/ContentScroll";
import
useThemeValue
from
"@/hooks/useThemeValue"
;
import
useThemeValue
from
"@/hooks/useThemeValue"
;
import
Editor
from
"@/pages/DataStudio/MiddleContainer/Editor"
;
import
Editor
from
"@/pages/DataStudio/MiddleContainer/Editor"
;
import
{
getTabIcon
}
from
"@/pages/DataStudio/MiddleContainer/function"
;
import
{
getTabIcon
}
from
"@/pages/DataStudio/MiddleContainer/function"
;
import
{
getCurrentData
,
getCurrentTab
}
from
"@/pages/DataStudio/function"
;
import
{
RightSide
}
from
"@/pages/DataStudio/route"
;
import
{
RightSide
,
TabProp
}
from
"@/pages/DataStudio/route"
;
type
TargetKey
=
React
.
MouseEvent
|
React
.
KeyboardEvent
|
string
;
type
TargetKey
=
React
.
MouseEvent
|
React
.
KeyboardEvent
|
string
;
...
@@ -211,7 +209,8 @@ const MiddleContainer = (props: any) => {
...
@@ -211,7 +209,8 @@ const MiddleContainer = (props: any) => {
const
renderContent
=
()
=>
{
const
renderContent
=
()
=>
{
switch
(
item
.
type
)
{
switch
(
item
.
type
)
{
case
TabsPageType
.
metadata
:
case
TabsPageType
.
metadata
:
const
params
=
item
.
params
as
MetadataParams
let
params
:
MetadataParams
;
params
=
item
.
params
as
MetadataParams
;
return
<
RightTagsRouter
tableInfo=
{
params
.
tableInfo
}
queryParams=
{
params
.
queryParams
}
/>
return
<
RightTagsRouter
tableInfo=
{
params
.
tableInfo
}
queryParams=
{
params
.
queryParams
}
/>
case
TabsPageType
.
project
:
case
TabsPageType
.
project
:
if
(
parseInt
(
activeKey
)
<
0
)
{
if
(
parseInt
(
activeKey
)
<
0
)
{
...
@@ -225,12 +224,17 @@ const MiddleContainer = (props: any) => {
...
@@ -225,12 +224,17 @@ const MiddleContainer = (props: any) => {
}
}
return
{
return
{
key
:
item
.
key
,
key
:
item
.
key
,
label
:
<
Space
size=
{
0
}
onContextMenu=
{
(
e
)
=>
handleRightClick
(
e
,
item
)
}
label
:
<>
key=
{
item
.
key
}
>
{
getTabIcon
(
item
.
icon
,
16
)
}{
item
.
label
}
</
Space
>,
<
Space
children
:
onClick=
{
()
=>
updateActiveKey
(
item
.
key
,
{
target
:
{
innerText
:
item
.
label
}})
}
size=
{
0
}
onContextMenu=
{
(
e
)
=>
handleRightClick
(
e
,
item
)
}
key=
{
item
.
key
}
>
{
getTabIcon
(
item
.
icon
,
16
)
}{
item
.
label
}
</
Space
>
</>,
children
:<>
<
ContentScroll
height=
{
activeKey
===
item
.
key
?
props
.
centerContentHeight
-
35
:
0
}
>
<
ContentScroll
height=
{
activeKey
===
item
.
key
?
props
.
centerContentHeight
-
35
:
0
}
>
{
renderContent
()
}
{
renderContent
()
}
</
ContentScroll
>
</
ContentScroll
>
</>
}
}
})
})
...
...
dinky-web/src/pages/DataStudio/function.ts
View file @
65ea93a7
...
@@ -19,9 +19,8 @@
...
@@ -19,9 +19,8 @@
import
{
Dispatch
}
from
"@@/plugin-dva/types"
;
import
{
Dispatch
}
from
"@@/plugin-dva/types"
;
import
{
DataSources
}
from
"@/types/RegCenter/data"
;
import
{
Cluster
,
DataSources
}
from
"@/types/RegCenter/data"
;
import
{
ClusterConfigurationType
,
ClusterType
,
DataStudioParams
,
EnvType
,
TabsItemType
}
from
"@/pages/DataStudio/model"
;
import
{
DataStudioParams
,
EnvType
,
JobRunningMsgType
,
TabsItemType
}
from
"@/pages/DataStudio/model"
;
import
{
RightSide
}
from
"@/pages/DataStudio/route"
;
export
const
mapDispatchToProps
=
(
dispatch
:
Dispatch
)
=>
({
export
const
mapDispatchToProps
=
(
dispatch
:
Dispatch
)
=>
({
updateToolContentHeight
:
(
key
:
number
)
=>
dispatch
({
updateToolContentHeight
:
(
key
:
number
)
=>
dispatch
({
...
@@ -69,7 +68,7 @@ export const mapDispatchToProps = (dispatch: Dispatch) => ({
...
@@ -69,7 +68,7 @@ export const mapDispatchToProps = (dispatch: Dispatch) => ({
type
:
"Studio/updateBottomConsole"
,
type
:
"Studio/updateBottomConsole"
,
payload
:
data
,
payload
:
data
,
}),
}),
saveSession
:
(
data
:
Cluster
Typ
e
[])
=>
dispatch
({
saveSession
:
(
data
:
Cluster
.
Instanc
e
[])
=>
dispatch
({
type
:
"Studio/saveSession"
,
type
:
"Studio/saveSession"
,
payload
:
data
,
payload
:
data
,
}),
}),
...
@@ -81,20 +80,25 @@ export const mapDispatchToProps = (dispatch: Dispatch) => ({
...
@@ -81,20 +80,25 @@ export const mapDispatchToProps = (dispatch: Dispatch) => ({
type
:
"Studio/saveTabs"
,
type
:
"Studio/saveTabs"
,
payload
:
data
,
payload
:
data
,
}),
}),
saveClusterConfiguration
:
(
data
:
Cluster
ConfigurationType
[])
=>
dispatch
({
saveClusterConfiguration
:
(
data
:
Cluster
.
Config
[])
=>
dispatch
({
type
:
"Studio/saveClusterConfiguration"
,
type
:
"Studio/saveClusterConfiguration"
,
payload
:
data
,
payload
:
data
,
}),
}),
updateJobRunningMsg
:
(
data
:
JobRunningMsgType
)
=>
dispatch
({
type
:
"Studio/updateJobRunningMsg"
,
payload
:
data
,
}),
});
});
export
const
getCurrentTab
=
(
panes
:
any
,
activeKey
:
string
)
=>
{
return
(
panes
as
TabsItemType
[]).
find
(
item
=>
item
.
key
===
activeKey
)
}
export
const
getCurrentData
=
(
panes
:
any
,
activeKey
:
string
)
=>
{
export
const
getCurrentData
=
(
panes
:
any
,
activeKey
:
string
)
=>
{
return
(
getCurrentTab
(
panes
,
activeKey
)?.
params
as
DataStudioParams
)?.
taskData
return
(
getCurrentTab
(
panes
,
activeKey
)?.
params
as
DataStudioParams
)?.
taskData
}
}
export
const
getCurrentTab
=
(
panes
:
any
,
activeKey
:
string
)
=>
{
return
(
panes
as
TabsItemType
[]).
find
(
item
=>
item
.
key
===
activeKey
)
}
export
const
getFooterValue
=
(
panes
:
any
,
activeKey
:
string
)
=>
{
export
const
getFooterValue
=
(
panes
:
any
,
activeKey
:
string
)
=>
{
...
...
dinky-web/src/pages/DataStudio/model.ts
View file @
65ea93a7
import
{
Reducer
}
from
"@@/plugin-dva/types"
;
import
{
Reducer
}
from
"@@/plugin-dva/types"
;
import
React
from
"react"
;
import
React
from
"react"
;
import
{
DataSources
}
from
"@/types/RegCenter/data"
;
import
{
Cluster
,
DataSources
}
from
"@/types/RegCenter/data"
;
import
{
QueryParams
}
from
"@/pages/RegCenter/DataSource/components/DataSourceDetail/RightTagsRouter/data"
;
import
{
QueryParams
}
from
"@/pages/RegCenter/DataSource/components/DataSourceDetail/RightTagsRouter/data"
;
import
{
l
}
from
"@/utils/intl"
;
import
{
l
}
from
"@/utils/intl"
;
import
{
get
CurrentTab
,
get
FooterValue
}
from
"@/pages/DataStudio/function"
;
import
{
getFooterValue
}
from
"@/pages/DataStudio/function"
;
/**
/**
* 初始化布局宽高度
* 初始化布局宽高度
...
@@ -154,17 +154,7 @@ export type MetaStoreColumnType = {
...
@@ -154,17 +154,7 @@ export type MetaStoreColumnType = {
name
:
string
;
name
:
string
;
type
:
string
;
type
:
string
;
}
}
export
type
ClusterConfigurationType
=
{
id
:
number
,
name
:
string
,
type
:
string
,
config
:
any
,
available
:
boolean
,
note
:
string
,
enabled
:
boolean
,
createTime
:
Date
,
updateTime
:
Date
,
}
export
type
Container
=
{
export
type
Container
=
{
selectKey
:
string
;
selectKey
:
string
;
selectSubKey
:
{
[
c
:
string
]:
string
};
selectSubKey
:
{
[
c
:
string
]:
string
};
...
@@ -187,18 +177,20 @@ export type SessionType = {
...
@@ -187,18 +177,20 @@ export type SessionType = {
createTime
?:
string
;
createTime
?:
string
;
connectors
:
ConnectorType
[];
connectors
:
ConnectorType
[];
}
}
export
type
ClusterType
=
{
id
:
number
,
/**
name
:
string
,
* job running type msg
type
:
string
,
*/
hosts
:
string
,
export
type
JobRunningMsgType
=
{
jobManagerHost
:
string
,
taskId
:
number
|
null
,
status
:
number
,
jobName
:
string
,
note
:
string
,
jobState
:
string
,
enabled
:
boolean
,
runningLog
:
string
,
createTime
:
Date
,
};
updateTime
:
Date
,
}
/**
* footer
*/
type
FooterType
=
{
type
FooterType
=
{
codePosition
:
[
number
,
number
],
codePosition
:
[
number
,
number
],
space
:
number
,
space
:
number
,
...
@@ -206,7 +198,12 @@ type FooterType = {
...
@@ -206,7 +198,12 @@ type FooterType = {
lineSeparator
:
string
,
lineSeparator
:
string
,
codeType
:
string
,
codeType
:
string
,
memDetails
:
string
,
memDetails
:
string
,
jobRunningMsg
:
JobRunningMsgType
,
}
}
/**
* state type overview
*/
export
type
StateType
=
{
export
type
StateType
=
{
isFullScreen
:
boolean
;
isFullScreen
:
boolean
;
toolContentHeight
:
number
;
toolContentHeight
:
number
;
...
@@ -226,8 +223,8 @@ export type StateType = {
...
@@ -226,8 +223,8 @@ export type StateType = {
expandKeys
:
[];
expandKeys
:
[];
selectKey
:
[];
selectKey
:
[];
};
};
sessionCluster
:
Cluster
Typ
e
[];
sessionCluster
:
Cluster
.
Instanc
e
[];
clusterConfiguration
:
Cluster
ConfigurationType
[];
clusterConfiguration
:
Cluster
.
Config
[];
env
:
EnvType
[];
env
:
EnvType
[];
tabs
:
TabsType
;
tabs
:
TabsType
;
bottomContainerContent
:
BottomContainerContent
;
bottomContainerContent
:
BottomContainerContent
;
...
@@ -263,6 +260,7 @@ export type ModelType = {
...
@@ -263,6 +260,7 @@ export type ModelType = {
saveClusterConfiguration
:
Reducer
<
StateType
>
;
saveClusterConfiguration
:
Reducer
<
StateType
>
;
saveEnv
:
Reducer
<
StateType
>
;
saveEnv
:
Reducer
<
StateType
>
;
saveFooterValue
:
Reducer
<
StateType
>
;
saveFooterValue
:
Reducer
<
StateType
>
;
updateJobRunningMsg
:
Reducer
<
StateType
>
;
};
};
};
};
const
Model
:
ModelType
=
{
const
Model
:
ModelType
=
{
...
@@ -319,6 +317,12 @@ const Model: ModelType = {
...
@@ -319,6 +317,12 @@ const Model: ModelType = {
lineSeparator
:
"LF"
,
lineSeparator
:
"LF"
,
codeType
:
""
,
codeType
:
""
,
memDetails
:
"100/500M"
,
memDetails
:
"100/500M"
,
jobRunningMsg
:
{
taskId
:
null
,
jobName
:
''
,
jobState
:
''
,
runningLog
:
''
,
},
}
}
},
},
effects
:
{},
effects
:
{},
...
@@ -712,7 +716,16 @@ const Model: ModelType = {
...
@@ -712,7 +716,16 @@ const Model: ModelType = {
...
state
,
...
state
,
footContainer
:
payload
,
footContainer
:
payload
,
}
}
}
},
updateJobRunningMsg
(
state
,
{
payload
})
{
return
{
...
state
,
footContainer
:
{
...
state
.
footContainer
,
jobRunningMsg
:
payload
},
}
},
}
}
}
}
...
...
script/sql/dinky-mysql.sql
View file @
65ea93a7
...
@@ -882,7 +882,7 @@ CREATE TABLE `dinky_user` (
...
@@ -882,7 +882,7 @@ CREATE TABLE `dinky_user` (
-- ----------------------------
-- ----------------------------
-- Records of dinky_user
-- Records of dinky_user
-- ----------------------------
-- ----------------------------
INSERT
INTO
`dinky_user`
VALUES
(
1
,
'admin'
,
'21232f297a57a5a743894a0e4a801fc3'
,
'Admin'
,
NULL
,
0
,
NULL
,
NULL
,
1
,
0
,
'2022-12-13 05:27:19'
,
'2022-12-13 05:27:19'
);
INSERT
INTO
`dinky_user`
VALUES
(
1
,
'admin'
,
'21232f297a57a5a743894a0e4a801fc3'
,
'Admin'
,
NULL
,
0
,
NULL
,
NULL
,
1
,
1
,
0
,
'2022-12-13 05:27:19'
,
'2022-12-13 05:27:19'
);
-- ----------------------------
-- ----------------------------
-- Table structure for dinky_user_role
-- Table structure for dinky_user_role
...
@@ -911,7 +911,7 @@ CREATE TABLE `dinky_user_tenant` (
...
@@ -911,7 +911,7 @@ CREATE TABLE `dinky_user_tenant` (
`id`
int
(
11
)
NOT
NULL
AUTO_INCREMENT
COMMENT
'ID'
,
`id`
int
(
11
)
NOT
NULL
AUTO_INCREMENT
COMMENT
'ID'
,
`user_id`
int
(
11
)
NOT
NULL
COMMENT
'user id'
,
`user_id`
int
(
11
)
NOT
NULL
COMMENT
'user id'
,
`tenant_id`
int
(
11
)
NOT
NULL
COMMENT
'tenant id'
,
`tenant_id`
int
(
11
)
NOT
NULL
COMMENT
'tenant id'
,
`tenant_admin_flag`
tinyint
DEFAULT
'0'
COMMENT
'tenant admin flag(0:false,1:true)'
,
`tenant_admin_flag`
tinyint
DEFAULT
'0'
COMMENT
'tenant admin flag(0:false,1:true)'
,
`create_time`
datetime
(
0
)
NULL
DEFAULT
NULL
COMMENT
'create time'
,
`create_time`
datetime
(
0
)
NULL
DEFAULT
NULL
COMMENT
'create time'
,
`update_time`
datetime
(
0
)
NULL
DEFAULT
NULL
COMMENT
'update time'
,
`update_time`
datetime
(
0
)
NULL
DEFAULT
NULL
COMMENT
'update time'
,
PRIMARY
KEY
(
`id`
)
USING
BTREE
,
PRIMARY
KEY
(
`id`
)
USING
BTREE
,
...
@@ -921,7 +921,7 @@ CREATE TABLE `dinky_user_tenant` (
...
@@ -921,7 +921,7 @@ CREATE TABLE `dinky_user_tenant` (
-- ----------------------------
-- ----------------------------
-- Records of dinky_user_tenant
-- Records of dinky_user_tenant
-- ----------------------------
-- ----------------------------
INSERT
INTO
`dinky_user_tenant`
(
`id`
,
`user_id`
,
`tenant_id`
,
`create_time`
,
`update_time`
)
VALUES
(
1
,
1
,
1
,
current_time
,
current_time
);
INSERT
INTO
`dinky_user_tenant`
(
`id`
,
`user_id`
,
`tenant_id`
,
`create_time`
,
`update_time`
)
VALUES
(
1
,
1
,
1
,
1
,
current_time
,
current_time
);
-- ----------------------------
-- ----------------------------
-- Table structure for metadata_column
-- Table structure for metadata_column
...
...
script/sql/dinky-pg.sql
View file @
65ea93a7
...
@@ -1500,7 +1500,7 @@ COMMENT ON TABLE "public"."dinky_user" IS 'user';
...
@@ -1500,7 +1500,7 @@ COMMENT ON TABLE "public"."dinky_user" IS 'user';
-- ----------------------------
-- ----------------------------
-- Records of dinky_user
-- Records of dinky_user
-- ----------------------------
-- ----------------------------
INSERT
INTO
"public"
.
"dinky_user"
VALUES
(
1
,
'admin'
,
'21232f297a57a5a743894a0e4a801fc3'
,
'Admin'
,
NULL
,
0
,
NULL
,
NULL
,
1
,
0
,
'2022-12-13 05:27:19'
,
'2022-12-13 05:27:19'
);
INSERT
INTO
"public"
.
"dinky_user"
VALUES
(
1
,
'admin'
,
'21232f297a57a5a743894a0e4a801fc3'
,
'Admin'
,
NULL
,
0
,
NULL
,
NULL
,
1
,
1
,
0
,
'2022-12-13 05:27:19'
,
'2022-12-13 05:27:19'
);
-- ----------------------------
-- ----------------------------
-- Table structure for dinky_user_role
-- Table structure for dinky_user_role
...
@@ -1550,7 +1550,7 @@ COMMENT ON TABLE "public"."dinky_user_tenant" IS 'Relationship between users and
...
@@ -1550,7 +1550,7 @@ COMMENT ON TABLE "public"."dinky_user_tenant" IS 'Relationship between users and
-- ----------------------------
-- ----------------------------
-- Records of dinky_user_tenant
-- Records of dinky_user_tenant
-- ----------------------------
-- ----------------------------
INSERT
INTO
"public"
.
"dinky_user_tenant"
VALUES
(
1
,
1
,
1
,
'2023-05-29 21:25:42'
,
'2023-05-29 21:25:42'
);
INSERT
INTO
"public"
.
"dinky_user_tenant"
VALUES
(
1
,
1
,
1
,
1
,
'2023-05-29 21:25:42'
,
'2023-05-29 21:25:42'
);
-- ----------------------------
-- ----------------------------
-- Table structure for metadata_column
-- Table structure for metadata_column
...
...
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