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
91f8708e
Unverified
Commit
91f8708e
authored
Jul 09, 2024
by
gaoyan
Committed by
GitHub
Jul 09, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Feature] Fix Home Page Link (#3634)
Co-authored-by:
gaoyan1998
<
gaoyan1998@users.noreply.github.com
>
parent
84bb9eb2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
39 deletions
+54
-39
TaskServiceImpl.java
...src/main/java/org/dinky/service/impl/TaskServiceImpl.java
+24
-2
FastLink.tsx
dinky-web/src/pages/Home/components/FastLink/FastLink.tsx
+14
-7
MyWorker.tsx
dinky-web/src/pages/Home/components/MyWorker/MyWorker.tsx
+4
-2
index.tsx
dinky-web/src/pages/Home/index.tsx
+12
-28
No files found.
dinky-admin/src/main/java/org/dinky/service/impl/TaskServiceImpl.java
View file @
91f8708e
...
...
@@ -107,6 +107,7 @@ import java.nio.charset.StandardCharsets;
import
java.util.ArrayList
;
import
java.util.Base64
;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -125,7 +126,6 @@ import org.springframework.web.multipart.MultipartFile;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.databind.JsonNode
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
...
...
@@ -1024,8 +1024,10 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
@Override
public
List
<
TaskDTO
>
getUserTasks
(
Integer
userId
)
{
Map
<
Integer
,
TaskDTO
>
tskMap
=
new
HashMap
<>();
LambdaQueryWrapper
<
Task
>
taskWrapper
=
new
LambdaQueryWrapper
<>();
taskWrapper
.
in
(
Task:
:
getDialect
,
Dialect
.
FLINK_SQL
.
getValue
(),
Dialect
.
FLINK_JAR
.
getValue
());
// 流式获取数据,防止OOM
baseMapper
.
selectList
(
Wrappers
.
emptyWrapper
()
,
resultContext
->
{
baseMapper
.
selectList
(
taskWrapper
,
resultContext
->
{
Task
task
=
resultContext
.
getResultObject
();
if
(
hasTaskOperatePermission
(
task
.
getFirstLevelOwner
(),
task
.
getSecondLevelOwners
()))
{
// 去掉statement,防止OOM
...
...
@@ -1049,6 +1051,26 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
});
List
<
TaskDTO
>
tasks
=
new
ArrayList
<>(
tskMap
.
values
());
// 按照step排序,发布>开发>,相同情况 下按照状态排序
// 失败>重启>运行>完成>未知
Comparator
<
TaskDTO
>
statusComparator
=
Comparator
.
comparingInt
(
task
->
{
String
status
=
task
.
getStatus
()
==
null
?
"UNKNOWN"
:
task
.
getStatus
();
switch
(
JobStatus
.
valueOf
(
status
))
{
case
FAILED:
return
4
;
case
RESTARTING:
return
3
;
case
RUNNING:
return
2
;
case
FINISHED:
return
1
;
default
:
return
0
;
}
});
tasks
.
sort
(
Comparator
.
comparingInt
(
TaskDTO:
:
getStep
)
.
thenComparing
(
statusComparator
)
.
reversed
());
return
tasks
;
}
...
...
dinky-web/src/pages/Home/components/FastLink/FastLink.tsx
View file @
91f8708e
...
...
@@ -25,7 +25,7 @@ import {
DatabaseIcon
}
from
'@/components/Icons/HomeIcon'
;
import
React
from
'react'
;
import
{
AllJobIcons
}
from
'@/components/Icons/DevopsIcons
'
;
import
{
history
}
from
'umi
'
;
import
{
l
}
from
'@/utils/intl'
;
const
FastLink
=
()
=>
{
...
...
@@ -38,27 +38,27 @@ const FastLink = () => {
const
links
=
[
{
title
:
l
(
'menu.datastudio'
),
href
:
''
,
href
:
'
/datastudio
'
,
icon
:
<
ClusterInstanceIcon
style=
{
imgStyle
}
/>
},
{
title
:
l
(
'menu.registration.alert.instance'
),
href
:
''
,
href
:
'
/registration/alert/instance
'
,
icon
:
<
AlertInstanceIcon
style=
{
imgStyle
}
/>
},
{
title
:
l
(
'menu.registration.datasource'
),
href
:
''
,
href
:
'
/registration/datasource/list
'
,
icon
:
<
DatabaseIcon
style=
{
imgStyle
}
/>
},
{
title
:
l
(
'menu.registration.cluster.cluster-config'
),
href
:
''
,
href
:
'
/registration/cluster/instance
'
,
icon
:
<
ClusterInstanceIcon
style=
{
imgStyle
}
/>
},
{
title
:
l
(
'menu.registration.resource'
),
href
:
''
,
href
:
'
/registration/resource
'
,
icon
:
<
ClusterConfigIcon
style=
{
imgStyle
}
/>
}
];
...
...
@@ -67,7 +67,14 @@ const FastLink = () => {
<
Space
size=
{
[
12
,
8
]
}
wrap
>
{
links
.
map
((
link
)
=>
{
return
(
<
Button
key=
{
link
.
title
}
type=
'text'
ghost
size=
{
'large'
}
icon=
{
link
.
icon
}
>
<
Button
key=
{
link
.
title
}
type=
'text'
ghost
size=
{
'large'
}
icon=
{
link
.
icon
}
onClick=
{
()
=>
history
.
push
(
link
.
href
)
}
>
{
link
.
title
}
</
Button
>
);
...
...
dinky-web/src/pages/Home/components/MyWorker/MyWorker.tsx
View file @
91f8708e
...
...
@@ -17,7 +17,7 @@
*
*/
import
{
Card
,
Space
,
Typography
}
from
'antd'
;
import
{
Card
,
Space
,
T
ag
,
T
ypography
}
from
'antd'
;
import
useHookRequest
from
'@/hooks/useHookRequest'
;
import
{
getData
}
from
'@/services/api'
;
import
{
API_CONSTANTS
}
from
'@/services/endpoints'
;
...
...
@@ -28,6 +28,7 @@ import JobLifeCycleTag from '@/components/JobTags/JobLifeCycleTag';
import
StatusTag
from
'@/components/JobTags/StatusTag'
;
import
EllipsisMiddle
from
'@/components/Typography/EllipsisMiddle'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
history
}
from
'umi'
;
const
MyWorker
=
()
=>
{
const
{
loading
,
data
}
=
useHookRequest
<
any
,
any
>
(
getData
,
{
...
...
@@ -60,7 +61,7 @@ const MyWorker = () => {
>
<
Card
style=
{
{
height
:
'
3
0vh'
,
height
:
'
6
0vh'
,
overflowY
:
'auto'
}
}
>
...
...
@@ -74,6 +75,7 @@ const MyWorker = () => {
<
JobLifeCycleTag
animation=
{
false
}
bordered=
{
false
}
status=
{
item
.
step
}
/>
</
Space
>
}
onClick=
{
()
=>
history
.
push
(
'/devops/job-detail?id='
+
item
.
jobInstanceId
)
}
>
<
div
style=
{
{
marginBottom
:
10
}
}
>
{
item
.
note
??
l
(
'home.task.not.desc'
)
}
</
div
>
<
Space
style=
{
{
fontSize
:
10
}
}
>
...
...
dinky-web/src/pages/Home/index.tsx
View file @
91f8708e
...
...
@@ -17,28 +17,16 @@
*
*/
import
{
Radar
}
from
'@ant-design/plots'
;
import
{
PageContainer
,
ProCard
}
from
'@ant-design/pro-components'
;
import
{
Link
,
useRequest
}
from
'@umijs/max'
;
import
{
Avatar
,
Button
,
Card
,
Col
,
List
,
Row
,
Space
,
Statistic
,
Tag
}
from
'antd'
;
import
dayjs
from
'dayjs'
;
import
relativeTime
from
'dayjs/plugin/relativeTime'
;
import
{
Card
,
Col
,
Row
}
from
'antd'
;
import
React
,
{
FC
}
from
'react'
;
import
{
useModel
}
from
'@@/exports'
;
import
{
getRandomGreeting
}
from
'@/pages/Home/util'
;
import
useHookRequest
from
'@/hooks/useHookRequest'
;
import
{
getData
}
from
'@/services/api'
;
import
{
API_CONSTANTS
}
from
'@/services/endpoints'
;
import
{
StatusCountOverView
}
from
'@/types/Home/data'
;
import
StatisticsCard
from
'@/pages/DevOps/JobList/components/Overview/StatisticsCard'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
AllJobIcons
,
ErrorIcons
,
RunningIcons
,
UnknownIcons
}
from
'@/components/Icons/DevopsIcons'
;
import
{
ThunderboltTwoTone
}
from
'@ant-design/icons'
;
import
{
ErrorIcons
,
RunningIcons
,
UnknownIcons
}
from
'@/components/Icons/DevopsIcons'
;
import
OSMetrics
from
'@/pages/Home/components/OSMetrics/OSMetrics'
;
import
MyWorker
from
'@/pages/Home/components/MyWorker/MyWorker'
;
import
FastLink
from
'@/pages/Home/components/FastLink/FastLink'
;
...
...
@@ -46,14 +34,10 @@ import AlertHistoryList from '@/pages/DevOps/JobDetail/AlertHistory/components/A
import
BatchStreamProportion
from
'@/pages/Home/components/BatchStreamProportion'
;
import
WorkHeader
from
'@/pages/Home/components/WorkerHeader/WorkHeader'
;
dayjs
.
extend
(
relativeTime
);
const
Workplace
:
FC
=
()
=>
{
const
{
data
}
=
useHookRequest
(
getData
,
{
defaultParams
:
[
API_CONSTANTS
.
GET_STATUS_COUNT
]
});
const
statusCount
=
data
as
StatusCountOverView
;
const
a
:
any
=
{};
const
ExtraContent
:
FC
<
Record
<
string
,
any
>>
=
()
=>
{
return
(
<
ProCard
layout=
'center'
ghost
>
...
...
@@ -83,16 +67,16 @@ const Workplace: FC = () => {
<
WorkHeader
/>
<
br
/>
<
MyWorker
/>
<
Card
bodyStyle=
{
{
padding
:
0
,
height
:
100
}
}
bordered=
{
false
}
title=
{
l
(
'devops.jobinfo.config.JobAlert'
)
}
>
<
AlertHistoryList
jobDetail=
{
a
}
/>
</
Card
>
{
/*<Card*/
}
{
/* bodyStyle={{*/
}
{
/* padding: 0,*/
}
{
/* height: 100*/
}
{
/* }}*/
}
{
/* bordered={false}*/
}
{
/* title={l('devops.jobinfo.config.JobAlert')}*/
}
{
/*>*/
}
{
/* /!*<AlertHistoryList jobDetail={a} />*!/*/
}
{
/*</Card>*/
}
</
Col
>
<
Col
xl=
{
8
}
lg=
{
24
}
md=
{
24
}
sm=
{
24
}
xs=
{
24
}
>
<
Card
...
...
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