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
b01e3c0b
Unverified
Commit
b01e3c0b
authored
Aug 29, 2023
by
zhu-mingye
Committed by
GitHub
Aug 29, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify some logical (#2271)
* modify some logical * Spotless Apply * fix --------- Co-authored-by:
zhu-mingye
<
zhu-mingye@users.noreply.github.com
>
parent
09ea7775
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
61 additions
and
32 deletions
+61
-32
TaskServiceImpl.java
...src/main/java/org/dinky/service/impl/TaskServiceImpl.java
+1
-1
JobConfig.java
dinky-core/src/main/java/org/dinky/job/JobConfig.java
+1
-1
JobManager.java
dinky-core/src/main/java/org/dinky/job/JobManager.java
+3
-2
GatewayType.java
...ay/src/main/java/org/dinky/gateway/enums/GatewayType.java
+17
-0
AvatarDropdown.tsx
dinky-web/src/components/RightContent/AvatarDropdown.tsx
+18
-22
pages.ts
dinky-web/src/locales/en-US/pages.ts
+2
-0
pages.ts
dinky-web/src/locales/zh-CN/pages.ts
+1
-0
service.tsx
dinky-web/src/pages/DataStudio/HeaderContainer/service.tsx
+0
-2
index.tsx
.../pages/DataStudio/LeftContainer/Project/JobTree/index.tsx
+7
-3
index.tsx
dinky-web/src/pages/Other/PersonCenter/index.tsx
+11
-1
No files found.
dinky-admin/src/main/java/org/dinky/service/impl/TaskServiceImpl.java
View file @
b01e3c0b
...
@@ -947,7 +947,7 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
...
@@ -947,7 +947,7 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
Savepoints
savepoints
=
buildSavepoint
(
config
);
Savepoints
savepoints
=
buildSavepoint
(
config
);
if
(
Asserts
.
isNotNull
(
savepoints
))
{
if
(
Asserts
.
isNotNull
(
savepoints
))
{
config
.
setSavePointPath
(
savepoints
.
getPath
());
config
.
setSavePointPath
(
savepoints
.
getPath
());
config
.
getConfigJson
().
put
(
"execution.savepoint.path"
,
savepoints
.
getPath
());
config
.
getConfigJson
().
put
(
"execution.savepoint.path"
,
savepoints
.
getPath
());
// todo: 写工具类处理相关配置
}
}
if
(!
GatewayType
.
get
(
task
.
getType
()).
isDeployCluster
())
{
if
(!
GatewayType
.
get
(
task
.
getType
()).
isDeployCluster
())
{
...
...
dinky-core/src/main/java/org/dinky/job/JobConfig.java
View file @
b01e3c0b
...
@@ -275,7 +275,7 @@ public class JobConfig {
...
@@ -275,7 +275,7 @@ public class JobConfig {
.
getFlinkConfig
()
.
getFlinkConfig
()
.
getConfiguration
()
.
getConfiguration
()
.
put
(
CoreOptions
.
DEFAULT_PARALLELISM
.
key
(),
String
.
valueOf
(
parallelism
));
.
put
(
CoreOptions
.
DEFAULT_PARALLELISM
.
key
(),
String
.
valueOf
(
parallelism
));
setUseRemote
(
false
);
setUseRemote
(
false
);
// todo: remove
}
}
public
void
addGatewayConfig
(
Map
<
String
,
Object
>
config
)
{
public
void
addGatewayConfig
(
Map
<
String
,
Object
>
config
)
{
...
...
dinky-core/src/main/java/org/dinky/job/JobManager.java
View file @
b01e3c0b
...
@@ -186,9 +186,10 @@ public class JobManager {
...
@@ -186,9 +186,10 @@ public class JobManager {
private
Executor
createExecutor
()
{
private
Executor
createExecutor
()
{
initEnvironmentSetting
();
initEnvironmentSetting
();
if
(!
runMode
.
equals
(
GatewayType
.
LOCAL
)
&&
!
useGateway
&&
config
.
isUseRemo
te
())
{
if
(!
runMode
.
isLocalExecu
te
())
{
executor
=
Executor
.
buildRemoteExecutor
(
environmentSetting
,
config
.
getExecutorSetting
());
executor
=
Executor
.
buildRemoteExecutor
(
environmentSetting
,
config
.
getExecutorSetting
());
// 构建远端执行器
}
else
{
}
else
{
// 构建本地执行器
if
(
ArrayUtil
.
isNotEmpty
(
config
.
getJarFiles
()))
{
if
(
ArrayUtil
.
isNotEmpty
(
config
.
getJarFiles
()))
{
config
.
getExecutorSetting
()
config
.
getExecutorSetting
()
.
getConfig
()
.
getConfig
()
...
...
dinky-gateway/src/main/java/org/dinky/gateway/enums/GatewayType.java
View file @
b01e3c0b
...
@@ -76,6 +76,23 @@ public enum GatewayType {
...
@@ -76,6 +76,23 @@ public enum GatewayType {
return
get
(
type
).
isDeployCluster
();
return
get
(
type
).
isDeployCluster
();
}
}
/**
* 是否在本地构建 job graph , 用于校验是否提交到集群
* @return true: 本地构建 jobgraph
*/
public
boolean
isLocalExecute
()
{
switch
(
value
)
{
case
"l"
:
case
"ya"
:
case
"ypj"
:
case
"ka"
:
case
"kao"
:
return
true
;
default
:
return
false
;
}
}
public
boolean
isDeployCluster
()
{
public
boolean
isDeployCluster
()
{
switch
(
value
)
{
switch
(
value
)
{
case
"ya"
:
case
"ya"
:
...
...
dinky-web/src/components/RightContent/AvatarDropdown.tsx
View file @
b01e3c0b
...
@@ -31,6 +31,23 @@ import { useCallback } from 'react';
...
@@ -31,6 +31,23 @@ import { useCallback } from 'react';
import
{
flushSync
}
from
'react-dom'
;
import
{
flushSync
}
from
'react-dom'
;
import
HeaderDropdown
from
'../HeaderDropdown'
;
import
HeaderDropdown
from
'../HeaderDropdown'
;
export
const
loginOut
=
async
()
=>
{
await
outLogin
();
const
{
search
,
pathname
}
=
window
.
location
;
const
urlParams
=
new
URL
(
window
.
location
.
href
).
searchParams
;
/** 此方法会跳转到 redirect 参数所在的位置 */
const
redirect
=
urlParams
.
get
(
'redirect'
);
// Note: There may be security issues, please note
if
(
window
.
location
.
pathname
!==
'/user/login'
&&
!
redirect
)
{
history
.
replace
({
pathname
:
'/user/login'
,
search
:
stringify
({
redirect
:
pathname
+
search
})
});
}
};
const
Name
=
()
=>
{
const
Name
=
()
=>
{
const
{
initialState
}
=
useModel
(
'@@initialState'
);
const
{
initialState
}
=
useModel
(
'@@initialState'
);
const
{
currentUser
}
=
initialState
||
{};
const
{
currentUser
}
=
initialState
||
{};
...
@@ -77,22 +94,6 @@ const AvatarDropdown = () => {
...
@@ -77,22 +94,6 @@ const AvatarDropdown = () => {
/**
/**
* 退出登录,并且将当前的 url 保存
* 退出登录,并且将当前的 url 保存
*/
*/
const
loginOut
=
async
()
=>
{
await
outLogin
();
const
{
search
,
pathname
}
=
window
.
location
;
const
urlParams
=
new
URL
(
window
.
location
.
href
).
searchParams
;
/** 此方法会跳转到 redirect 参数所在的位置 */
const
redirect
=
urlParams
.
get
(
'redirect'
);
// Note: There may be security issues, please note
if
(
window
.
location
.
pathname
!==
'/user/login'
&&
!
redirect
)
{
history
.
replace
({
pathname
:
'/user/login'
,
search
:
stringify
({
redirect
:
pathname
+
search
})
});
}
};
const
actionClassName
=
useEmotionCss
(({
token
})
=>
{
const
actionClassName
=
useEmotionCss
(({
token
})
=>
{
return
{
return
{
...
@@ -220,12 +221,7 @@ const AvatarDropdown = () => {
...
@@ -220,12 +221,7 @@ const AvatarDropdown = () => {
];
];
return
(
return
(
<
HeaderDropdown
<
HeaderDropdown
menu=
{
{
selectedKeys
:
[],
items
:
menuItems
}
}
>
menu=
{
{
selectedKeys
:
[],
items
:
menuItems
}
}
>
<
span
className=
{
actionClassName
}
>
<
span
className=
{
actionClassName
}
>
<
AvatarLogo
/>
<
AvatarLogo
/>
<
Name
/>
<
Name
/>
...
...
dinky-web/src/locales/en-US/pages.ts
View file @
b01e3c0b
...
@@ -203,6 +203,8 @@ export default {
...
@@ -203,6 +203,8 @@ export default {
'user.newpwdPlaceholder'
:
'Please enter new password'
,
'user.newpwdPlaceholder'
:
'Please enter new password'
,
'user.repeatpwdPlaceholder'
:
'Please enter repeat new password'
,
'user.repeatpwdPlaceholder'
:
'Please enter repeat new password'
,
'user.oldNewPwdNoMatch'
:
'The new passwords do not match'
,
'user.oldNewPwdNoMatch'
:
'The new passwords do not match'
,
'user.changePasswordSuccess'
:
'Password changed successfully, will jump to the login page to re-login!'
,
'user.login.status.code'
:
'Code'
,
'user.login.status.code'
:
'Code'
,
'user.login.status.msg'
:
'Message'
,
'user.login.status.msg'
:
'Message'
,
'user.login.accesstime'
:
'Login Time'
,
'user.login.accesstime'
:
'Login Time'
,
...
...
dinky-web/src/locales/zh-CN/pages.ts
View file @
b01e3c0b
...
@@ -190,6 +190,7 @@ export default {
...
@@ -190,6 +190,7 @@ export default {
'user.isdelete'
:
'该用户已被删除,无法重置密码,请先恢复该用户!'
,
'user.isdelete'
:
'该用户已被删除,无法重置密码,请先恢复该用户!'
,
'user.reset'
:
'您确定要重置此用户密码吗?'
,
'user.reset'
:
'您确定要重置此用户密码吗?'
,
'user.resetPassword'
:
'重置密码'
,
'user.resetPassword'
:
'重置密码'
,
'user.changePasswordSuccess'
:
'密码修改成功, 即将跳转至登录页重新登录!'
,
'user.resetPasswordSuccess'
:
'用户: {username} 密码重置成功! 新密码为: {password}'
,
'user.resetPasswordSuccess'
:
'用户: {username} 密码重置成功! 新密码为: {password}'
,
'user.usernamePlaceholder'
:
'请输入用户名'
,
'user.usernamePlaceholder'
:
'请输入用户名'
,
'user.jobnumberPlaceholder'
:
'请输入工号'
,
'user.jobnumberPlaceholder'
:
'请输入工号'
,
...
...
dinky-web/src/pages/DataStudio/HeaderContainer/service.tsx
View file @
b01e3c0b
...
@@ -10,8 +10,6 @@ export async function getJobPlan(title: string, params: any) {
...
@@ -10,8 +10,6 @@ export async function getJobPlan(title: string, params: any) {
return
handleOption
(
'/api/studio/getJobPlan'
,
title
,
params
);
return
handleOption
(
'/api/studio/getJobPlan'
,
title
,
params
);
}
}
export
async
function
executeSql
(
title
:
string
,
params
:
TaskDataType
)
{
export
async
function
executeSql
(
title
:
string
,
params
:
TaskDataType
)
{
// TODO: temp process
params
.
configJson
=
params
.
configJson
[
0
];
return
handleOption
(
'/api/studio/executeSql'
,
title
,
params
);
return
handleOption
(
'/api/studio/executeSql'
,
title
,
params
);
}
}
export
function
offLineTask
(
title
:
string
,
id
:
number
,
type
:
string
)
{
export
function
offLineTask
(
title
:
string
,
id
:
number
,
type
:
string
)
{
...
...
dinky-web/src/pages/DataStudio/LeftContainer/Project/JobTree/index.tsx
View file @
b01e3c0b
...
@@ -30,7 +30,7 @@ import { connect } from '@@/exports';
...
@@ -30,7 +30,7 @@ import { connect } from '@@/exports';
import
{
Key
}
from
'@ant-design/pro-components'
;
import
{
Key
}
from
'@ant-design/pro-components'
;
import
{
Empty
,
Tree
}
from
'antd'
;
import
{
Empty
,
Tree
}
from
'antd'
;
import
Search
from
'antd/es/input/Search'
;
import
Search
from
'antd/es/input/Search'
;
import
React
,
{
useState
}
from
'react'
;
import
React
,
{
use
Effect
,
use
State
}
from
'react'
;
const
{
DirectoryTree
}
=
Tree
;
const
{
DirectoryTree
}
=
Tree
;
...
@@ -48,7 +48,11 @@ type TreeProps = {
...
@@ -48,7 +48,11 @@ type TreeProps = {
const
JobTree
:
React
.
FC
<
TreeProps
&
connect
>
=
(
props
)
=>
{
const
JobTree
:
React
.
FC
<
TreeProps
&
connect
>
=
(
props
)
=>
{
const
{
treeData
,
onNodeClick
,
style
,
height
,
onRightClick
,
selectedKeys
}
=
props
;
const
{
treeData
,
onNodeClick
,
style
,
height
,
onRightClick
,
selectedKeys
}
=
props
;
const
[
searchValue
,
setSearchValueValue
]
=
useState
(
''
);
const
[
searchValue
,
setSearchValueValue
]
=
useState
(
''
);
const
data
=
buildProjectTree
(
treeData
,
searchValue
);
const
[
data
,
setData
]
=
useState
<
any
[]
>
([]);
useEffect
(()
=>
{
setData
(
buildProjectTree
(
treeData
,
searchValue
));
},
[
searchValue
]);
const
[
expandedKeys
,
setExpandedKeys
]
=
useState
<
Key
[]
>
();
const
[
expandedKeys
,
setExpandedKeys
]
=
useState
<
Key
[]
>
();
const
[
autoExpandParent
,
setAutoExpandParent
]
=
useState
(
true
);
const
[
autoExpandParent
,
setAutoExpandParent
]
=
useState
(
true
);
...
@@ -97,7 +101,7 @@ const JobTree: React.FC<TreeProps & connect> = (props) => {
...
@@ -97,7 +101,7 @@ const JobTree: React.FC<TreeProps & connect> = (props) => {
allowClear=
{
true
}
allowClear=
{
true
}
/>
/>
{
treeData
.
length
>
0
?
(
{
data
.
length
?
(
<
DirectoryTree
<
DirectoryTree
style=
{
{
...
style
,
height
:
height
-
40
-
16
,
overflowY
:
'auto'
}
}
style=
{
{
...
style
,
height
:
height
-
40
-
16
,
overflowY
:
'auto'
}
}
className=
{
'treeList'
}
className=
{
'treeList'
}
...
...
dinky-web/src/pages/Other/PersonCenter/index.tsx
View file @
b01e3c0b
...
@@ -19,14 +19,17 @@
...
@@ -19,14 +19,17 @@
import
Pop
from
'@/components/Animation/Pop'
;
import
Pop
from
'@/components/Animation/Pop'
;
import
{
LogSvg
}
from
'@/components/Icons/CodeLanguageIcon'
;
import
{
LogSvg
}
from
'@/components/Icons/CodeLanguageIcon'
;
import
{
loginOut
}
from
'@/components/RightContent/AvatarDropdown'
;
import
PasswordForm
from
'@/pages/AuthCenter/User/components/PasswordModal/PasswordForm'
;
import
PasswordForm
from
'@/pages/AuthCenter/User/components/PasswordModal/PasswordForm'
;
import
BaseInfo
from
'@/pages/Other/PersonCenter/BaseInfo'
;
import
BaseInfo
from
'@/pages/Other/PersonCenter/BaseInfo'
;
import
LoginLogRecord
from
'@/pages/Other/PersonCenter/LoginLogRecord'
;
import
LoginLogRecord
from
'@/pages/Other/PersonCenter/LoginLogRecord'
;
import
OperationLogRecord
from
'@/pages/Other/PersonCenter/OperationLogRecord'
;
import
OperationLogRecord
from
'@/pages/Other/PersonCenter/OperationLogRecord'
;
import
{
handleOption
}
from
'@/services/BusinessCrud'
;
import
{
handleOption
}
from
'@/services/BusinessCrud'
;
import
{
RESPONSE_CODE
}
from
'@/services/constants'
;
import
{
API_CONSTANTS
}
from
'@/services/endpoints'
;
import
{
API_CONSTANTS
}
from
'@/services/endpoints'
;
import
{
UserBaseInfo
}
from
'@/types/AuthCenter/data'
;
import
{
UserBaseInfo
}
from
'@/types/AuthCenter/data'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
SuccessMessage
}
from
'@/utils/messages'
;
import
{
useModel
}
from
'@@/exports'
;
import
{
useModel
}
from
'@@/exports'
;
import
{
SecurityScanTwoTone
}
from
'@ant-design/icons'
;
import
{
SecurityScanTwoTone
}
from
'@ant-design/icons'
;
import
{
PageContainer
,
PageLoading
,
ProCard
}
from
'@ant-design/pro-components'
;
import
{
PageContainer
,
PageLoading
,
ProCard
}
from
'@ant-design/pro-components'
;
...
@@ -107,8 +110,15 @@ const PersonCenter = () => {
...
@@ -107,8 +110,15 @@ const PersonCenter = () => {
* @returns {Promise<void>}
* @returns {Promise<void>}
*/
*/
const
handleSubmitPassWord
=
async
(
value
:
UserBaseInfo
.
ChangePasswordParams
)
=>
{
const
handleSubmitPassWord
=
async
(
value
:
UserBaseInfo
.
ChangePasswordParams
)
=>
{
await
handleOption
(
API_CONSTANTS
.
USER_MODIFY_PASSWORD
,
l
(
'button.changePassword'
),
value
);
const
result
=
await
handleOption
(
API_CONSTANTS
.
USER_MODIFY_PASSWORD
,
l
(
'button.changePassword'
),
value
);
if
(
result
&&
result
.
code
===
RESPONSE_CODE
.
SUCCESS
)
{
form
.
resetFields
();
form
.
resetFields
();
(
await
SuccessMessage
(
l
(
'user.changePasswordSuccess'
)))
&&
(
await
loginOut
());
}
};
};
/**
/**
...
...
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