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
b04111bc
Commit
b04111bc
authored
Jul 08, 2022
by
chenshouchao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat-20220705-customTemplate' into 'release'
cn-fix: 新增模板勾选、文件路径修改 See merge request
sunyihao/bkunyun!94
parents
f69316a2
d4fb15ff
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
49 additions
and
20 deletions
+49
-20
tusUpload.ts
src/utils/Upload/tusUpload.ts
+1
-1
index.tsx
src/views/ConsoleLayout/index.tsx
+1
-1
index.tsx
src/views/Project/ProjectJobDetail/index.tsx
+6
-6
index.tsx
src/views/Project/ProjectSubmitWork/index.tsx
+2
-9
index.tsx
...kbench/workbenchTemplate/components/AddTemplate/index.tsx
+35
-2
index.tsx
...iews/Project/ProjectWorkbench/workbenchTemplate/index.tsx
+4
-1
No files found.
src/utils/Upload/tusUpload.ts
View file @
b04111bc
...
...
@@ -78,7 +78,7 @@ const UseTusUpload = (uploadInfoStore: any) => {
id
:
timeId
,
statusMsg
:
"正在上传"
,
upload
,
dir
:
"/
home/cloudam
/"
,
dir
:
"/
ProjectData
/"
,
};
uploadInfoStore
?.
setUploadInfo
(
item
.
id
,
{
...
item
,
...
...
src/views/ConsoleLayout/index.tsx
View file @
b04111bc
...
...
@@ -64,7 +64,7 @@ const ConsoleLayout = observer(() => {
currentProjectStore
.
changeProductInfo
({
id
:
item
.
id
,
name
:
item
.
name
});
setCurrentProduct
(
item
);
runGetProjectList
({
product
:
item
.
name
,
product
:
item
.
id
,
});
};
...
...
src/views/Project/ProjectJobDetail/index.tsx
View file @
b04111bc
...
...
@@ -98,7 +98,7 @@ const ProjectSubmitWork = observer(() => {
// 前往数据管理页面
const
goToProjectData
=
(
path
:
string
)
=>
{
path
=
path
.
slice
(
1
3
);
path
=
path
.
slice
(
1
2
);
if
(
path
)
{
navigate
(
`/product/cadd/projectData`
,
{
state
:
{
pathName
:
path
},
...
...
@@ -110,7 +110,7 @@ const ProjectSubmitWork = observer(() => {
}
};
// 通过文件路径获取文件所在文件夹路径 如 输入 /
home/cloudam/task_a.out 输出/home/cloudam
/
// 通过文件路径获取文件所在文件夹路径 如 输入 /
ProjectData/task_a.out 输出/ProjectData
/
const
getFolderPath
=
(
path
:
string
)
=>
{
const
lastIndex
=
path
.
lastIndexOf
(
"/"
);
if
(
lastIndex
!==
-
1
)
{
...
...
@@ -127,8 +127,8 @@ const ProjectSubmitWork = observer(() => {
},
[
navigate
]);
const
outputPathTransform
=
(
path
:
string
)
=>
{
path
=
path
.
slice
(
1
3
);
return
`ProjectData
${
path
}
`
;
path
=
path
.
slice
(
1
);
return
path
;
};
const
getOutouts
=
(
outputs
:
any
)
=>
{
...
...
@@ -259,8 +259,8 @@ const ProjectSubmitWork = observer(() => {
};
const
handleDownLoad
=
(
path
:
string
)
=>
{
if
(
path
.
indexOf
(
"/
home/cloudam
"
)
!==
-
1
)
{
path
=
path
.
slice
(
1
3
);
if
(
path
.
indexOf
(
"/
ProjectData
"
)
!==
-
1
)
{
path
=
path
.
slice
(
1
2
);
}
CloudEController
.
JobFileDownload
(
path
,
...
...
src/views/Project/ProjectSubmitWork/index.tsx
View file @
b04111bc
...
...
@@ -182,11 +182,7 @@ const ProjectSubmitWork = () => {
parameter
.
domType
.
toLowerCase
()
===
"dataset"
||
parameter
.
domType
.
toLowerCase
()
===
"file"
)
{
if
(
value
===
"ProjectData"
)
{
value
=
"/home/cloudam"
;
}
else
{
value
=
`/home/cloudam
${
value
.
slice
(
11
)}
`
;
}
value
=
`/
${
value
}
`
;
}
promotedParameters
[
parameter
.
name
]
=
{
[
parameter
.
classTypeName
]:
value
,
...
...
@@ -195,10 +191,7 @@ const ProjectSubmitWork = () => {
});
submitWorkFlowRun
({
name
,
outputPath
:
outputPath
===
"ProjectData"
?
"/home/cloudam"
:
`/home/cloudam
${
outputPath
.
slice
(
11
)}
`
,
outputPath
:
`/
${
outputPath
}
`
,
projectId
:
projectId
as
string
,
specId
:
templateConfigInfo
?.
id
as
string
,
promotedParameters
,
...
...
src/views/Project/ProjectWorkbench/workbenchTemplate/components/AddTemplate/index.tsx
View file @
b04111bc
...
...
@@ -16,11 +16,15 @@ import _ from "lodash";
import
{
observer
}
from
"mobx-react-lite"
;
import
noData
from
"../../../../../../assets/project/noTemplate.svg"
;
import
{
ICustomTemplate
}
from
"../../interface"
;
import
{
getAddWorkbenchTemplate
}
from
"@/api/workbench_api"
;
import
{
getAddWorkbenchTemplate
,
addWorkbenchTemplate
,
}
from
"@/api/workbench_api"
;
import
{
toJS
}
from
"mobx"
;
type
IAddTemplateProps
=
{
setShowAddTemplate
:
any
;
getTemplateInfo
:
any
;
};
const
radioOptions
=
[
...
...
@@ -38,7 +42,7 @@ const AddTemplate = observer((props: IAddTemplateProps) => {
const
{
currentProjectStore
}
=
useStores
();
const
projectId
=
toJS
(
currentProjectStore
.
currentProjectInfo
.
id
);
const
productId
=
toJS
(
currentProjectStore
.
currentProductInfo
.
id
);
const
{
setShowAddTemplate
}
=
props
;
const
{
setShowAddTemplate
,
getTemplateInfo
}
=
props
;
const
handleSearch
=
(
value
:
string
)
=>
{
console
.
log
(
value
);
...
...
@@ -56,8 +60,34 @@ const AddTemplate = observer((props: IAddTemplateProps) => {
setTemplateType
(
value
);
};
const
handleSelectTemplate
=
(
id
:
string
)
=>
{
let
list
:
string
[]
=
[...
selectTemplateData
];
if
(
selectTemplateData
.
filter
((
e
)
=>
e
===
id
).
length
>
0
)
{
list
=
list
.
filter
((
e
)
=>
e
!==
id
);
setSelectTemplateData
(
list
);
}
else
{
list
.
push
(
id
);
setSelectTemplateData
(
list
);
}
};
// 项目管理员-添加工作流模板-提交
const
{
run
:
addTemplate
}
=
useMyRequest
(
addWorkbenchTemplate
,
{
onSuccess
:
(
result
:
any
)
=>
{
setSelectTemplateData
([]);
setShowAddTemplate
(
false
);
getTemplateInfo
({
projectId
:
projectId
as
string
,
});
},
});
const
handleAddTemplate
=
()
=>
{
console
.
log
(
"handleAddTemplate"
);
addTemplate
({
projectId
:
projectId
as
string
,
workflowSpecIds
:
selectTemplateData
,
});
};
// 添加工作流模板-获取模板列表
...
...
@@ -205,6 +235,9 @@ const AddTemplate = observer((props: IAddTemplateProps) => {
[
style
.
templateLiCustom
]:
templateType
!==
"public"
,
})
}
key=
{
index
}
onClick=
{
()
=>
{
handleSelectTemplate
(
item
.
id
);
}
}
>
<
div
className=
{
style
.
templateLiTop
}
>
<
span
className=
{
style
.
templateTitle
}
>
{
item
.
title
}
</
span
>
...
...
src/views/Project/ProjectWorkbench/workbenchTemplate/index.tsx
View file @
b04111bc
...
...
@@ -267,7 +267,10 @@ const ProjectMembers = observer(() => {
/> */
}
{
showAddTemplate
&&
(
<
AddTemplate
setShowAddTemplate=
{
setShowAddTemplate
}
/>
<
AddTemplate
setShowAddTemplate=
{
setShowAddTemplate
}
getTemplateInfo=
{
getTemplateInfo
}
/>
)
}
<
SimpleDialog
...
...
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