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
55033d05
Commit
55033d05
authored
Sep 05, 2022
by
jiangzijing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:查看日志
parent
23558f9e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
55 deletions
+59
-55
index.module.css
src/views/Project/ProjectJobDetail/LogView/index.module.css
+18
-17
index.tsx
src/views/Project/ProjectJobDetail/LogView/index.tsx
+36
-32
index.tsx
src/views/Project/ProjectJobDetail/index.tsx
+5
-6
No files found.
src/views/Project/ProjectJobDetail/LogView/index.module.css
View file @
55033d05
...
...
@@ -8,15 +8,7 @@
}
.logViewBox
{
position
:
absolute
;
top
:
50%
;
left
:
50%
;
transform
:
translate
(
-50%
,
-50%
);
width
:
900px
;
height
:
600px
;
background
:
#282c34
;
box-shadow
:
2px
4px
20px
0px
rgba
(
0
,
15
,
45
,
0.12
);
border-radius
:
8px
;
}
.close
{
...
...
@@ -29,12 +21,13 @@
.logViewTop
{
/* height: 30px; */
width
:
100vw
;
background-color
:
#1d2126
;
border-radius
:
8px
8px
0
0
;
/* border-radius: 8px 8px 0 0; */
display
:
flex
;
font-size
:
12px
;
color
:
#8a9099
;
overflow
:
overlay
;
/* overflow: overlay; */
}
.logViewTop
::-webkit-scrollbar-track
{
...
...
@@ -43,11 +36,18 @@
.logTitle
{
display
:
flex
;
width
:
0
;
max-width
:
200px
;
overflow
:
hidden
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
flex
:
1
;
align-items
:
center
;
height
:
30px
;
line-height
:
20px
;
padding
:
0
24px
;
cursor
:
pointer
;
border-right
:
1px
solid
#10141A
;
}
.logTitleSelected
{
...
...
@@ -63,8 +63,8 @@
.logViewContent
{
position
:
relative
;
box-sizing
:
border-box
;
height
:
510px
;
padding
:
16px
24
px
0
;
height
:
calc
(
100vh
-
148px
)
;
padding
:
24px
32
px
0
;
color
:
#d1d6de
;
white-space
:
pre-wrap
;
word-break
:
break-word
;
...
...
@@ -74,12 +74,12 @@
}
.logViewContentMask
{
height
:
16
px
;
width
:
852px
;
height
:
24
px
;
width
:
calc
(
100vw
-
64px
)
;
background-color
:
#282c34
;
position
:
absolute
;
top
:
30px
;
left
:
24
px
;
left
:
32
px
;
z-index
:
1005
;
}
...
...
@@ -91,6 +91,6 @@
display
:
flex
;
align-items
:
center
;
justify-content
:
end
;
height
:
60
px
;
height
:
76
px
;
padding-right
:
24px
;
}
}
\ No newline at end of file
src/views/Project/ProjectJobDetail/LogView/index.tsx
View file @
55033d05
...
...
@@ -7,16 +7,18 @@ import InsertDriveFileOutlinedIcon from "@mui/icons-material/InsertDriveFileOutl
import
CloudEController
from
"@/api/fileserver/CloudEController"
;
import
{
useStores
}
from
"@/store"
;
import
{
toJS
}
from
"mobx"
;
import
FullScreenDrawer
from
"@/components/CommonComponents/FullScreenDrawer"
;
type
LogViewProps
=
{
isshow
:
boolean
;
handleClose
:
()
=>
void
;
logs
:
any
[];
setShowAddTemplate
:
any
;
};
const
LogView
=
(
props
:
LogViewProps
)
=>
{
const
{
isshow
,
handleClose
,
logs
}
=
props
;
const
{
isshow
,
handleClose
,
logs
,
setShowAddTemplate
}
=
props
;
const
{
currentProjectStore
}
=
useStores
();
const
fileToken
=
toJS
(
currentProjectStore
.
currentProjectInfo
.
filetoken
);
const
projectId
=
toJS
(
currentProjectStore
.
currentProjectInfo
.
id
);
...
...
@@ -42,7 +44,7 @@ const LogView = (props: LogViewProps) => {
)?.
then
((
res
)
=>
{
setLogText
(
res
.
data
)
})
}
else
{
}
else
{
setLogText
(
""
)
}
},
[
logPath
]);
...
...
@@ -53,41 +55,42 @@ const LogView = (props: LogViewProps) => {
},
[
logCurrent
]);
// 下载当前日志
const
handleDownLoad
=
()
=>
{
const
handleDownLoad
=
()
=>
{
const
path
=
logPath
.
slice
(
12
)
CloudEController
.
JobFileDownload
(
path
,
fileToken
as
string
,
projectId
as
string
);
path
,
fileToken
as
string
,
projectId
as
string
);
}
return
<
div
className=
{
style
.
logView
}
style=
{
isshow
?
{}
:
{
display
:
"none"
}
}
>
<
div
className=
{
style
.
logViewBox
}
>
<
CloseIcon
onClick=
{
handleClose
}
className=
{
style
.
close
}
/>
<
div
className=
{
style
.
logViewContentMask
}
></
div
>
<
div
className=
{
style
.
logViewTop
}
>
{
logs
.
map
((
item
:
any
,
index
:
number
)
=>
{
return
<
div
key=
{
index
}
onClick=
{
()
=>
{
setLogCurrent
(
index
)
}
}
className=
{
classnames
({
[
style
.
logTitle
]:
true
,
[
style
.
logTitleSelected
]:
index
===
logCurrent
,
})
}
>
<
InsertDriveFileOutlinedIcon
className=
{
style
.
fileIcon
}
/>
<
span
>
{
item
.
logName
}
</
span
>
</
div
>
})
}
return
(
<
FullScreenDrawer
handleClose=
{
setShowAddTemplate
}
zIndex=
{
1002
}
>
<
div
className=
{
style
.
logViewBox
}
>
<
div
className=
{
style
.
logViewContentMask
}
></
div
>
<
div
className=
{
style
.
logViewTop
}
>
{
logs
.
map
((
item
:
any
,
index
:
number
)
=>
{
return
<
div
key=
{
index
}
onClick=
{
()
=>
{
setLogCurrent
(
index
)
}
}
className=
{
classnames
({
[
style
.
logTitle
]:
true
,
[
style
.
logTitleSelected
]:
index
===
logCurrent
,
})
}
>
<
InsertDriveFileOutlinedIcon
className=
{
style
.
fileIcon
}
/>
<
span
>
{
item
.
logName
}
</
span
>
</
div
>
})
}
</
div
>
<
div
className=
{
style
.
logViewContent
}
>
{
logText
}
</
div
>
<
div
className=
{
style
.
logViewBottom
}
>
<
MyButton
text=
'下载当前日志'
onClick=
{
handleDownLoad
}
/>
</
div
>
</
div
>
<
div
className=
{
style
.
logViewContent
}
>
{
logText
}
</
div
>
<
div
className=
{
style
.
logViewBottom
}
>
<
MyButton
text=
'下载当前日志'
onClick=
{
handleDownLoad
}
/>
</
div
>
</
div
>
</
div
>
</
FullScreenDrawer
>
)
}
export
default
LogView
\ No newline at end of file
src/views/Project/ProjectJobDetail/index.tsx
View file @
55033d05
...
...
@@ -306,9 +306,8 @@ const ProjectSubmitWork = observer(() => {
if
(
Array
.
isArray
(
res
.
data
))
{
res
.
data
.
forEach
((
item1
)
=>
{
if
(
item1
.
name
===
item
.
path
.
slice
(
item
.
path
.
lastIndexOf
(
"/"
)
+
1
))
{
randerOutputs
[
index
].
size
=
`
${
item1
.
size
?
storageUnitFromB
(
Number
(
item1
.
size
))
:
"-"
}
`
;
randerOutputs
[
index
].
size
=
`
${
item1
.
size
?
storageUnitFromB
(
Number
(
item1
.
size
))
:
"-"
}
`
;
setRanderOutputs
([...
randerOutputs
]);
}
});
...
...
@@ -494,8 +493,8 @@ const ProjectSubmitWork = observer(() => {
)
}
{
(
!
workFlowJobInfo
?.
outputs
||
Object
.
keys
(
workFlowJobInfo
?.
outputs
).
length
===
0
)
&&
(
<
div
className=
{
styles
.
notResults
}
>
暂无结果文件
</
div
>
)
}
<
div
className=
{
styles
.
notResults
}
>
暂无结果文件
</
div
>
)
}
<
div
className=
{
styles
.
title
}
>
任务信息
</
div
>
<
div
className=
{
styles
.
taskInfoLi
}
>
<
div
className=
{
styles
.
taskInfoParams
}
>
任务名称
</
div
>
...
...
@@ -767,7 +766,7 @@ const ProjectSubmitWork = observer(() => {
projectId=
{
projectId
as
string
}
></
SeeDataset
>
)
}
<
LogView
isshow=
{
showLogView
}
handleClose=
{
handleClose
}
logs=
{
logs
}
/>
{
showLogView
&&
<
LogView
isshow=
{
showLogView
}
handleClose=
{
handleClose
}
logs=
{
logs
}
setShowAddTemplate=
{
handleClose
}
/>
}
</
div
>
);
});
...
...
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