Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
bkunyun
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
Administrator
bkunyun
Commits
1002e59b
Commit
1002e59b
authored
Jun 29, 2022
by
chenshouchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 任务详情下载功能
parent
5edcaf48
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
5 deletions
+34
-5
index.module.css
src/views/Project/ProjectJobDetail/index.module.css
+4
-0
index.tsx
src/views/Project/ProjectJobDetail/index.tsx
+30
-5
No files found.
src/views/Project/ProjectJobDetail/index.module.css
View file @
1002e59b
...
@@ -93,6 +93,10 @@
...
@@ -93,6 +93,10 @@
position
:
relative
;
position
:
relative
;
align-items
:
center
;
align-items
:
center
;
}
}
.taskInfoDownload
{
color
:
rgba
(
19
,
112
,
255
,
1
);
cursor
:
pointer
;
}
.taskInfoValueShowAll
{
.taskInfoValueShowAll
{
white-space
:
normal
;
white-space
:
normal
;
}
}
...
...
src/views/Project/ProjectJobDetail/index.tsx
View file @
1002e59b
...
@@ -17,13 +17,16 @@ import { IResponse } from "@/api/http";
...
@@ -17,13 +17,16 @@ import { IResponse } from "@/api/http";
import
jobSue
from
"@/assets/project/jobSue.svg"
;
import
jobSue
from
"@/assets/project/jobSue.svg"
;
import
jobStop
from
"@/assets/project/jobStop.svg"
;
import
jobStop
from
"@/assets/project/jobStop.svg"
;
import
jobRun
from
"@/assets/project/jobRun.svg"
;
import
jobRun
from
"@/assets/project/jobRun.svg"
;
import
CloudEController
from
"@/api/fileserver/CloudEController"
;
import
jobFail
from
"@/assets/project/jobFail.svg"
;
import
jobFail
from
"@/assets/project/jobFail.svg"
;
import
classNames
from
"classnames"
;
import
{
useStores
}
from
"@/store"
;
import
{
toJS
}
from
"mobx"
;
import
{
observer
}
from
"mobx-react-lite"
;
import
classNames
from
"classnames"
;
import
styles
from
"./index.module.css"
;
import
styles
from
"./index.module.css"
;
import
{
ITaskInfo
}
from
"../ProjectSubmitWork/interface"
;
import
{
ITaskInfo
}
from
"../ProjectSubmitWork/interface"
;
import
Flow
from
"../components/Flow"
;
import
Flow
from
"../components/Flow"
;
import
{
style
}
from
"@mui/system"
;
const
stateMap
=
{
const
stateMap
=
{
RUNNING
:
"正在运行"
,
RUNNING
:
"正在运行"
,
...
@@ -41,7 +44,10 @@ const statusMap = {
...
@@ -41,7 +44,10 @@ const statusMap = {
type
IStatus
=
"Done"
|
"Running"
|
"Failed"
|
"Pending"
;
type
IStatus
=
"Done"
|
"Running"
|
"Failed"
|
"Pending"
;
const
ProjectSubmitWork
=
()
=>
{
const
ProjectSubmitWork
=
observer
(()
=>
{
const
{
currentProjectStore
}
=
useStores
();
const
fileToken
=
toJS
(
currentProjectStore
.
currentProjectInfo
.
filetoken
);
const
projectId
=
toJS
(
currentProjectStore
.
currentProjectInfo
.
id
);
const
[
workFlowJobInfo
,
setWorkFlowJobInfo
]
=
useState
<
ITaskInfo
>
();
const
[
workFlowJobInfo
,
setWorkFlowJobInfo
]
=
useState
<
ITaskInfo
>
();
const
[
patchInfo
,
setPatchInfo
]
=
useState
<
any
>
();
const
[
patchInfo
,
setPatchInfo
]
=
useState
<
any
>
();
const
[
activePatchId
,
setActivePatchId
]
=
useState
<
string
>
(
""
);
const
[
activePatchId
,
setActivePatchId
]
=
useState
<
string
>
(
""
);
...
@@ -101,6 +107,17 @@ const ProjectSubmitWork = () => {
...
@@ -101,6 +107,17 @@ const ProjectSubmitWork = () => {
setShowOptions
(
!
showOptions
);
setShowOptions
(
!
showOptions
);
};
};
const
handleDownLoad
=
(
path
:
string
)
=>
{
if
(
path
.
indexOf
(
"/home/cloudam"
)
!==
-
1
)
{
path
=
path
.
slice
(
13
);
}
CloudEController
.
JobFileDownload
(
path
,
fileToken
as
string
,
projectId
as
string
);
};
return
(
return
(
<
div
className=
{
styles
.
swBox
}
>
<
div
className=
{
styles
.
swBox
}
>
<
div
className=
{
styles
.
swHeader
}
>
<
div
className=
{
styles
.
swHeader
}
>
...
@@ -238,7 +255,15 @@ const ProjectSubmitWork = () => {
...
@@ -238,7 +255,15 @@ const ProjectSubmitWork = () => {
<
div
className=
{
styles
.
taskInfoLi
}
>
<
div
className=
{
styles
.
taskInfoLi
}
>
<
div
className=
{
styles
.
taskInfoParams
}
>
日志文件
</
div
>
<
div
className=
{
styles
.
taskInfoParams
}
>
日志文件
</
div
>
<
div
className=
{
styles
.
taskInfoValue
}
>
<
div
className=
{
styles
.
taskInfoValue
}
>
{
workFlowJobInfo
?.
logPath
}
{
workFlowJobInfo
?.
logPath
&&
(
<
span
className=
{
styles
.
taskInfoDownload
}
onClick=
{
()
=>
handleDownLoad
(
workFlowJobInfo
?.
logPath
)
}
>
下载
</
span
>
)
}
{
!
workFlowJobInfo
?.
logPath
&&
"-"
}
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
...
@@ -357,6 +382,6 @@ const ProjectSubmitWork = () => {
...
@@ -357,6 +382,6 @@ const ProjectSubmitWork = () => {
</
div
>
</
div
>
</
div
>
</
div
>
);
);
};
}
)
;
export
default
ProjectSubmitWork
;
export
default
ProjectSubmitWork
;
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