Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
deploy-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
zhouzihao
deploy-ui
Commits
150f8df5
Commit
150f8df5
authored
Mar 31, 2020
by
zhouzihao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev-添加了项目构建的前端功能
parent
fc8e18c5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
80 additions
and
8 deletions
+80
-8
src/views/BuildLogList.vue
src/views/BuildLogList.vue
+2
-2
src/views/ProjectList.vue
src/views/ProjectList.vue
+78
-6
No files found.
src/views/BuildLogList.vue
View file @
150f8df5
...
...
@@ -62,7 +62,7 @@ export default {
{
title
:
"
项目名称
"
,
key
:
"
project_name
"
,
width
:
1
00
width
:
3
00
},
{
title
:
"
构建环境
"
,
...
...
@@ -125,7 +125,7 @@ export default {
{
title
:
"
镜像名称
"
,
key
:
"
image_name
"
,
width
:
1
00
width
:
4
00
},
{
title
:
"
报错地址
"
,
...
...
src/views/ProjectList.vue
View file @
150f8df5
...
...
@@ -71,7 +71,32 @@
<Button
type=
"primary"
@
click=
"save"
>
保存
</Button>
</div>
</Drawer>
<Drawer
title=
"构建项目"
:closable=
"false"
v-model=
"showBuild"
width=
"720"
>
<div>
<Form
:model=
"buildData"
label-position=
"left"
:label-width=
"100"
>
<FormItem
label=
"构建分支"
>
<Input
v-model=
"buildData.branch"
></Input>
</FormItem>
<FormItem
label=
"构建版本"
>
<Input
v-model=
"buildData.version"
></Input>
</FormItem>
<FormItem
label=
"构建环境类型"
>
<Select
v-model=
"buildData.env_id"
style=
"width:200px"
>
<Option
v-for=
"item in envlist"
:value=
"item.env_id"
:key=
"item.env_id"
>
{{
item
.
name
}}
</Option>
</Select>
</FormItem>
</Form>
</div>
<div
class=
"demo-drawer-footer"
>
<Button
style=
"margin-right: 8px"
@
click=
"showBuild= false"
>
取消
</Button>
<Button
type=
"primary"
@
click=
"build"
>
保存
</Button>
</div>
<Spin
size=
"large"
fix
v-if=
"spinShow"
></Spin>
</Drawer>
</section>
</
template
>
<
script
>
...
...
@@ -160,6 +185,11 @@ export default {
},
style
:
{
marginRight
:
"
5px
"
},
on
:
{
click
:
()
=>
{
this
.
showBuildDraw
(
params
.
index
);
}
}
},
"
build
"
...
...
@@ -191,10 +221,26 @@ export default {
isShow
:
false
,
isAdd
:
false
,
showData
:
{},
typeList
:
[]
typeList
:
[],
showBuild
:
false
,
buildData
:
{},
envlist
:
[],
spinShow
:
false
};
},
methods
:
{
getEnvList
:
function
()
{
axios
.
get
(
config
.
serve_url
+
"
/env/
"
)
.
then
(
rs
=>
{
if
(
rs
.
status
==
200
)
{
this
.
envlist
=
rs
.
data
;
}
})
.
catch
(
err
=>
{
console
.
log
(
JSON
.
stringify
(
err
));
});
},
getList
:
function
()
{
axios
.
get
(
...
...
@@ -222,9 +268,6 @@ export default {
this
.
isShow
=
true
;
this
.
showData
=
this
.
data1
[
index
];
},
build
:
function
()
{
//
},
goConfigs
:
function
(
index
)
{
this
.
$router
.
push
({
path
:
"
/configList
"
,
query
:
this
.
data1
[
index
]
});
},
...
...
@@ -257,13 +300,42 @@ export default {
console
.
log
(
JSON
.
stringify
(
err
));
});
},
getType
(
type_id
)
{
getType
:
function
(
type_id
)
{
return
_
.
find
(
this
.
typeList
,
{
type_id
:
type_id
}).
name
;
},
showBuildDraw
:
function
(
index
)
{
this
.
buildData
[
"
p_id
"
]
=
this
.
data1
[
index
].
p_id
;
this
.
buildData
[
"
branch
"
]
=
"
master
"
;
console
.
log
(
this
.
buildData
);
this
.
showBuild
=
true
;
},
build
:
function
()
{
this
.
spinShow
=
true
;
axios
.
post
(
config
.
serve_url
+
"
/project/build/
"
,
this
.
buildData
)
.
then
(
rs
=>
{
var
rr
=
JSON
.
parse
(
rs
.
data
);
if
(
rr
.
success
)
{
this
.
spinShow
=
false
;
this
.
showBuild
=
false
;
this
.
$Message
.
success
(
"
构建成功!
"
);
}
else
{
this
.
spinShow
=
false
;
// this.showBuild = false;
this
.
$Message
.
error
(
"
构建失败请联系管理员处理
"
);
}
})
.
catch
(
err
=>
{
this
.
spinShow
=
false
;
// this.showBuild = false;
this
.
$Message
.
error
(
err
+
"
构建失败请联系管理员处理
"
);
});
}
},
mounted
:
function
()
{
this
.
getList
();
this
.
getTypeList
();
this
.
getEnvList
();
}
};
</
script
>
\ No newline at end of file
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