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
7246b1f5
Unverified
Commit
7246b1f5
authored
Jun 23, 2022
by
aiwenmo
Committed by
GitHub
Jun 23, 2022
Browse files
Options
Browse Files
Download
Plain Diff
[Feature-635][admin] Add job instance info api
[Feature-635][admin] Add job instance info api
parents
67900115
63d8bcaf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
0 deletions
+33
-0
APIController.java
...min/src/main/java/com/dlink/controller/APIController.java
+22
-0
index.tsx
dlink-web/src/pages/API/TaskAPI/index.tsx
+11
-0
No files found.
dlink-admin/src/main/java/com/dlink/controller/APIController.java
View file @
7246b1f5
package
com
.
dlink
.
controller
;
package
com
.
dlink
.
controller
;
import
com.dlink.assertion.Asserts
;
import
com.dlink.model.JobInstance
;
import
com.dlink.model.Task
;
import
com.dlink.service.JobInstanceService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
@@ -38,6 +42,8 @@ public class APIController {
...
@@ -38,6 +42,8 @@ public class APIController {
private
StudioService
studioService
;
private
StudioService
studioService
;
@Autowired
@Autowired
private
TaskService
taskService
;
private
TaskService
taskService
;
@Autowired
private
JobInstanceService
jobInstanceService
;
@GetMapping
(
"/submitTask"
)
@GetMapping
(
"/submitTask"
)
public
Result
submitTask
(
@RequestParam
Integer
id
)
{
public
Result
submitTask
(
@RequestParam
Integer
id
)
{
...
@@ -120,4 +126,20 @@ public class APIController {
...
@@ -120,4 +126,20 @@ public class APIController {
public
Result
reOnLineTask
(
@RequestParam
Integer
id
)
{
public
Result
reOnLineTask
(
@RequestParam
Integer
id
)
{
return
taskService
.
reOnLineTask
(
id
);
return
taskService
.
reOnLineTask
(
id
);
}
}
/**
* 获取Job实例的所有信息
*/
@GetMapping
(
"/getJobInfoDetail"
)
public
Result
getJobInfoDetail
(
@RequestParam
Integer
id
)
{
return
Result
.
succeed
(
jobInstanceService
.
getJobInfoDetail
(
id
),
"获取成功"
);
}
/**
* 通过 taskId 获取 Task 对应的 Job 实例的所有信息
*/
@GetMapping
(
"/getJobInfoDetailByTaskId"
)
public
Result
getJobInfoDetailByTaskId
(
@RequestParam
Integer
id
)
{
return
Result
.
succeed
(
jobInstanceService
.
getJobInstanceByTaskId
(
id
),
"获取成功"
);
}
}
}
dlink-web/src/pages/API/TaskAPI/index.tsx
View file @
7246b1f5
...
@@ -64,6 +64,17 @@ const TaskAPI = (props: any) => {
...
@@ -64,6 +64,17 @@ const TaskAPI = (props: any) => {
<
CodeShow
code=
{
`curl http://${address}/openapi/restartTask?id=${(task ? task.id : '1')}`
}
language=
'shell'
<
CodeShow
code=
{
`curl http://${address}/openapi/restartTask?id=${(task ? task.id : '1')}`
}
language=
'shell'
height=
'500px'
theme=
"vs-dark"
/>
height=
'500px'
theme=
"vs-dark"
/>
</
TabPane
>
</
TabPane
>
<
TabPane
tab=
{
<
span
>
作业实例
</
span
>
}
key=
"taskInstance"
>
<
CodeShow
code=
{
`curl http://${address}/openapi/getJobInfoDetailByTaskId?id=${(task ? task.id : '1')}`
}
language=
'shell'
height=
'500px'
theme=
"vs-dark"
/>
</
TabPane
>
<
TabPane
<
TabPane
tab=
{
tab=
{
<
span
>
<
span
>
...
...
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