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
d149ef25
Commit
d149ef25
authored
Oct 26, 2022
by
chenshouchao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat-20221012-environment' into 'release'
cn-feat: 新增流式环境增加字段script、样式调整 See merge request
!154
parents
68012927
ff63dd42
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
91 additions
and
26 deletions
+91
-26
resourceCenter.ts
src/api/resourceCenter.ts
+2
-1
index.tsx
src/views/CustomOperator/components/SaveOperator/index.tsx
+1
-1
index.tsx
src/views/Project/ProjectSetting/BaseInfo/index.tsx
+1
-1
index.tsx
src/views/Project/components/AddProject/index.tsx
+1
-1
index.module.css
.../UserResourcesEnvironment/AddEnvironment/index.module.css
+19
-1
index.tsx
...sources/UserResourcesEnvironment/AddEnvironment/index.tsx
+64
-20
index.tsx
...ourceCenter/UserResources/UserResourcesTemplate/index.tsx
+2
-0
index.tsx
...iews/WorkFlowEdit/components/SaveCustomTemplate/index.tsx
+1
-1
No files found.
src/api/resourceCenter.ts
View file @
d149ef25
...
...
@@ -15,7 +15,8 @@ type addActorenvBuildenvParams = {
baseEnvId
:
string
,
type
:
"BATCH"
|
"FLOW"
,
filePaths
:
Array
<
string
>
,
bashScript
:
string
,
bashScript
?:
string
,
script
?:
string
,
computeType
:
string
,
publicProjectId
:
string
,
}
...
...
src/views/CustomOperator/components/SaveOperator/index.tsx
View file @
d149ef25
...
...
@@ -203,7 +203,7 @@ const SaveOperator = (props: IProps) => {
style=
{
{
position
:
"absolute"
,
fontSize
:
"14px"
,
bottom
:
"7
px"
,
top
:
"96
px"
,
right
:
"12px"
,
color
:
description
.
length
>=
300
?
"#d32f2f"
:
"#C2C6CC"
,
}
}
...
...
src/views/Project/ProjectSetting/BaseInfo/index.tsx
View file @
d149ef25
...
...
@@ -358,7 +358,7 @@ const BaseInfo = observer(() => {
style=
{
{
fontSize
:
"14px"
,
position
:
"absolute"
,
bottom
:
"7
px"
,
top
:
"96
px"
,
right
:
"12px"
,
color
:
projectInfo
.
desc
.
length
>=
100
?
"#d32f2f"
:
"#C2C6CC"
,
}
}
...
...
src/views/Project/components/AddProject/index.tsx
View file @
d149ef25
...
...
@@ -224,7 +224,7 @@ const AddProject = observer((props: IAddProjectProps) => {
style=
{
{
position
:
"absolute"
,
fontSize
:
"14px"
,
bottom
:
"7
px"
,
top
:
"96
px"
,
right
:
"12px"
,
color
:
desc
.
length
>=
300
?
"#d32f2f"
:
"#C2C6CC"
,
}
}
...
...
src/views/ResourceCenter/UserResources/UserResourcesEnvironment/AddEnvironment/index.module.css
View file @
d149ef25
...
...
@@ -31,7 +31,6 @@
.content
{
display
:
flex
;
border-radius
:
4px
;
margin-bottom
:
24px
;
height
:
580px
;
}
.form
{
...
...
@@ -51,6 +50,22 @@
border-top-right-radius
:
4px
;
border-bottom-right-radius
:
4px
;
}
.codeBox2
{
flex
:
1
;
display
:
flex
;
flex-direction
:
column
;
border-radius
:
4px
;
margin-top
:
20px
;
}
.codeBox2
.codeTitle
{
border-top-right-radius
:
4px
;
border-top-left-radius
:
4px
;
}
.codeBox2
.code
{
border-bottom-right-radius
:
4px
;
border-bottom-left-radius
:
4px
;
overflow
:
hidden
;
}
.codeTitle
{
background-color
:
rgba
(
230
,
233
,
237
,
1
);
padding
:
11px
20px
;
...
...
@@ -143,3 +158,6 @@
line-height
:
20px
;
margin-top
:
12px
;
}
.button
{
margin-top
:
24px
;
}
src/views/ResourceCenter/UserResources/UserResourcesEnvironment/AddEnvironment/index.tsx
View file @
d149ef25
...
...
@@ -48,6 +48,7 @@ const AddEnvironment = (props: IAddEnvironmentProps) => {
const
[
envList
,
setEnvList
]
=
useState
<
Array
<
any
>>
([]);
// 基础环境列表 和taskType环境类型有关
const
[
progress
,
setProgress
]
=
useState
(
"0%"
);
// 上传压缩包进度
const
[
code
,
setCode
]
=
useState
(
""
);
// 脚本内容
const
[
flowCode
,
setFlowCode
]
=
useState
(
""
);
// 脚本内容
const
[
codeWidth
,
setCodeWidth
]
=
useState
(
0
);
const
[
upload
,
setUpload
]
=
useState
<
any
>
(()
=>
{});
// 上传压缩包实例 用于暂停(取消上传)upload.abort(true);
const
[
nameHelper
,
setNameHelper
]
=
useState
({
...
...
@@ -270,25 +271,49 @@ const AddEnvironment = (props: IAddEnvironmentProps) => {
};
const
handleSubmit
=
()
=>
{
if
(
!
checkName
(
name
)
&&
!
checkDesc
(
desc
)
&&
!
checkFile
(
filePaths
)
&&
baseEnvId
&&
code
)
{
addActorenvBuildenvFn
({
title
:
name
,
desc
,
baseEnvId
,
type
:
taskType
,
filePaths
,
bashScript
:
Base64
.
encode
(
code
),
publicProjectId
,
computeType
,
});
if
(
taskType
===
"BATCH"
)
{
if
(
!
checkName
(
name
)
&&
!
checkDesc
(
desc
)
&&
!
checkFile
(
filePaths
)
&&
baseEnvId
&&
code
)
{
addActorenvBuildenvFn
({
title
:
name
,
desc
,
baseEnvId
,
type
:
taskType
,
filePaths
,
bashScript
:
Base64
.
encode
(
code
),
publicProjectId
,
computeType
,
});
}
else
{
Message
.
error
(
"请完善环境信息"
);
}
}
else
{
Message
.
error
(
"请完善环境信息"
);
if
(
!
checkName
(
name
)
&&
!
checkDesc
(
desc
)
&&
!
checkFile
(
filePaths
)
&&
baseEnvId
&&
flowCode
)
{
addActorenvBuildenvFn
({
title
:
name
,
desc
,
baseEnvId
,
type
:
taskType
,
filePaths
,
bashScript
:
Base64
.
encode
(
code
),
script
:
Base64
.
encode
(
flowCode
),
publicProjectId
,
computeType
,
});
}
else
{
Message
.
error
(
"请完善环境信息"
);
}
}
};
...
...
@@ -358,7 +383,7 @@ const AddEnvironment = (props: IAddEnvironmentProps) => {
style=
{
{
position
:
"absolute"
,
fontSize
:
"14px"
,
bottom
:
"7
px"
,
top
:
"96
px"
,
right
:
"12px"
,
color
:
desc
.
length
>=
300
?
"#d32f2f"
:
"#C2C6CC"
,
}
}
...
...
@@ -462,7 +487,10 @@ const AddEnvironment = (props: IAddEnvironmentProps) => {
</
div
>
<
div
className=
{
style
.
codeBox
}
>
<
div
className=
{
style
.
codeTitle
}
>
{
taskType
===
"BATCH"
?
"Shell脚本"
:
"Python脚本"
}
Shell脚本
{
taskType
===
"BATCH"
&&
(
<
span
className=
{
style
.
required
}
>
*
</
span
>
)
}
</
div
>
<
div
className=
{
style
.
code
}
id=
"addEnvironmentCode"
>
<
Code
...
...
@@ -474,6 +502,22 @@ const AddEnvironment = (props: IAddEnvironmentProps) => {
</
div
>
</
div
>
</
div
>
{
taskType
===
"FLOW"
&&
(
<
div
className=
{
style
.
codeBox2
}
>
<
div
className=
{
style
.
codeTitle
}
>
Python脚本
<
span
className=
{
style
.
required
}
>
*
</
span
>
</
div
>
<
div
className=
{
style
.
code
}
id=
"addEnvironmentCode"
>
<
Code
value=
{
flowCode
}
onChange=
{
(
e
:
string
)
=>
setFlowCode
(
e
)
}
height=
"535px"
width=
{
`${codeWidth + 368}px`
}
/>
</
div
>
</
div
>
)
}
<
div
className=
{
style
.
button
}
>
<
MyButton
text=
"开始构建"
...
...
src/views/ResourceCenter/UserResources/UserResourcesTemplate/index.tsx
View file @
d149ef25
...
...
@@ -16,6 +16,7 @@ import WorkFlowEdit from "@/views/WorkFlowEdit";
import
{
useMessage
}
from
"@/components/MySnackbar"
;
import
TemplateDetail
from
"./TemplateDetail"
;
import
style
from
"./index.module.css"
;
import
NoData
from
"@/components/BusinessComponents/NoData"
;
const
UserResourcesTemplate
=
observer
(()
=>
{
const
[
title
,
setTitle
]
=
useState
(
""
);
...
...
@@ -162,6 +163,7 @@ const UserResourcesTemplate = observer(() => {
</
div
>
</
div
>
<
div
className=
{
style
.
tableBox
}
>
{
list
.
length
===
0
&&
<
NoData
text=
"暂无相关模板"
></
NoData
>
}
<
CardTable
data=
{
list
}
renderItem=
{
renderItem
}
...
...
src/views/WorkFlowEdit/components/SaveCustomTemplate/index.tsx
View file @
d149ef25
...
...
@@ -253,7 +253,7 @@ const SaveCustomTemplate = (props: IProps) => {
style=
{
{
position
:
"absolute"
,
fontSize
:
"14px"
,
bottom
:
"7
px"
,
top
:
"96
px"
,
right
:
"12px"
,
color
:
description
.
length
>=
300
?
"#d32f2f"
:
"#C2C6CC"
,
}
}
...
...
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