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
218f03e7
Commit
218f03e7
authored
Mar 26, 2020
by
zhouzihao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev-添加配置和环境列表OC
parent
485ce0f5
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
495 additions
and
20 deletions
+495
-20
src/components/Layout.vue
src/components/Layout.vue
+16
-16
src/router.js
src/router.js
+10
-0
src/views/ConfigList.vue
src/views/ConfigList.vue
+235
-0
src/views/EnvList.vue
src/views/EnvList.vue
+207
-0
src/views/ProjectList.vue
src/views/ProjectList.vue
+27
-4
No files found.
src/components/Layout.vue
View file @
218f03e7
...
...
@@ -491,22 +491,22 @@ export default {
},
]
},
{
title
:
'
配置管理
'
,
name
:
'
configMange
'
,
icon
:
'
ios-cash
'
,
children
:[
{
title
:
'
配置列表
'
,
name
:
'
configList
'
,
href
:
'
/configList
'
,
closable
:
true
,
showInTags
:
false
,
showInMenus
:
true
,
choosed
:
false
},
]
},
//
{
//
title:'配置管理',
//
name:'configMange',
//
icon:'ios-cash',
//
children:[
//
{
//
title:'配置列表',
//
name:'configList',
//
href:'/configList',
//
closable:true,
//
showInTags:false,
//
showInMenus:true,
//
choosed:false
//
},
//
]
//
},
{
title
:
'
构建管理
'
,
name
:
'
buildManage
'
,
...
...
src/router.js
View file @
218f03e7
...
...
@@ -29,7 +29,17 @@ export default new Router({
component
:
()
=>
import
(
'
@/views/ProjectList
'
)
},
// 环境列表
{
path
:
'
envlist
'
,
name
:
'
envlist
'
,
component
:
()
=>
import
(
'
@/views/EnvList
'
)
},
// 配置列表
{
path
:
'
configList
'
,
name
:
'
configList
'
,
component
:
()
=>
import
(
'
@/views/ConfigList
'
)
},
// 构建日志列表
// 源数据
]
...
...
src/views/ConfigList.vue
0 → 100644
View file @
218f03e7
<
style
lang=
"postcss"
scoped
>
.home-container {
}
.demo-drawer-footer {
width: 100%;
position: absolute;
bottom: 0;
left: 0;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
background: #fff;
}
</
style
>
<
template
>
<section
class=
"home-container"
>
<MasterPage
:title=
"project_name"
>
<div
slot=
"title-icon"
>
<Icon
type=
"md-settings"
/>
</div>
<div
slot=
"title-toolbar"
>
<!-- title工具栏 -->
</div>
<div
slot=
"searchContent"
class=
"search-content-slot"
>
<Select
v-model=
"env_id"
style=
"width:200px"
>
<Option
v-for=
"item in envlist"
:value=
"item.env_id"
:key=
"item.env_id"
>
{{
item
.
name
}}
</Option>
</Select>
</div>
<div
slot=
"search"
>
<Button
type=
"info"
icon=
"ios-search"
@
click=
"getList"
>
查询
</Button>
</div>
<div
slot=
"btns"
>
<Button
type=
"primary"
icon=
"md-add"
@
click=
"addShow"
>
添加
</Button>
</div>
<div
slot=
"paddingContent"
>
<Table
:columns=
"columns1"
:data=
"data1"
></Table>
</div>
<div
slot=
"pager"
></div>
</MasterPage>
<Drawer
title=
"配置详情"
:closable=
"false"
v-model=
"isShow"
width=
"720"
>
<div>
<Form
:model=
"showData"
label-position=
"left"
:label-width=
"100"
>
<h1>
{{
project_name
}}
在环境
{{
env_name
}}
(
{{
env_id
}}
)内的配置
</h1>
<FormItem
label=
"配置类型"
>
<Select
v-model=
"showData.type"
style=
"width:200px"
>
<Option
v-for=
"item in typeList"
:value=
"item.value"
:key=
"item.value"
>
{{
item
.
label
}}
</Option>
</Select>
</FormItem>
<FormItem
label=
"配置文件地址"
>
<Input
v-model=
"showData.path"
></Input>
</FormItem>
<FormItem
label=
"配置内容"
>
<Input
v-model=
"showData.content"
type=
"textarea"
:autosize=
"true"
></Input>
</FormItem>
</Form>
</div>
<div
class=
"demo-drawer-footer"
>
<Button
style=
"margin-right: 8px"
@
click=
"isShow= false"
>
取消
</Button>
<Button
type=
"primary"
@
click=
"save"
>
保存
</Button>
</div>
</Drawer>
</section>
</
template
>
<
script
>
import
MasterPage
from
"
@/components/Master
"
;
import
axios
from
"
axios
"
;
import
config
from
"
@/config/configs
"
;
export
default
{
components
:
{
MasterPage
},
data
()
{
return
{
typeList
:
[
{
value
:
1
,
label
:
"
替换
"
},
{
value
:
2
,
label
:
"
覆盖
"
}
],
columns1
:
[
{
title
:
"
配置id
"
,
key
:
"
config_id
"
,
width
:
100
,
fixed
:
"
left
"
},
{
title
:
"
环境名
"
,
key
:
"
env_id
"
,
width
:
100
,
fixed
:
"
left
"
},
{
title
:
"
项目id
"
,
key
:
"
p_id
"
,
width
:
100
},
{
title
:
"
配置地址
"
,
key
:
"
path
"
,
width
:
200
},
{
title
:
"
配置内容
"
,
key
:
"
content
"
,
// width: 300
},
{
title
:
"
配置方式
"
,
key
:
"
type
"
,
width
:
100
},
{
title
:
"
操作
"
,
key
:
"
action
"
,
fixed
:
"
right
"
,
width
:
150
,
render
:
(
h
,
params
)
=>
{
return
h
(
"
div
"
,
[
h
(
"
Button
"
,
{
props
:
{
type
:
"
primary
"
,
size
:
"
small
"
},
style
:
{
marginRight
:
"
5px
"
},
on
:
{
click
:
()
=>
{
this
.
show
(
params
.
index
);
}
}
},
"
显示/修改
"
)
]);
}
}
],
data1
:
[],
isShow
:
false
,
isAdd
:
false
,
showData
:
{},
env_id
:
1
,
env_name
:
""
,
p_id
:
1
,
envlist
:
[],
project_name
:
""
};
},
methods
:
{
getList
:
function
()
{
// todo 添加选项
axios
.
get
(
config
.
serve_url
+
"
/config/?p_id=
"
+
this
.
p_id
+
"
&env_id=
"
+
this
.
env_id
)
.
then
(
rs
=>
{
if
(
rs
.
status
==
200
)
{
console
.
log
(
JSON
.
stringify
(
rs
.
data
));
this
.
data1
=
rs
.
data
;
}
})
.
catch
(
err
=>
{
console
.
log
(
JSON
.
stringify
(
err
));
});
},
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
));
});
},
addShow
:
function
()
{
this
.
isShow
=
true
;
// 这里正好名字可以对上
this
.
showData
=
{
p_id
:
this
.
p_id
,
env_id
:
this
.
env_id
};
},
show
:
function
(
index
)
{
this
.
isShow
=
true
;
this
.
showData
=
this
.
data1
[
index
];
},
build
:
function
()
{
//
},
save
:
function
()
{
//保存或者新建
this
.
isShow
=
false
;
axios
.
post
(
config
.
serve_url
+
"
/config/
"
,
this
.
showData
)
.
then
(
res
=>
{
console
.
info
(
JSON
.
stringify
(
this
.
showData
));
console
.
info
(
JSON
.
stringify
(
res
));
this
.
$Message
.
success
(
"
操作成功
"
);
this
.
getList
();
})
.
catch
(
err
=>
{
this
.
$Message
.
error
(
err
);
});
}
},
mounted
:
function
()
{
this
.
getEnvList
();
// console.log(JSON.stringify(this.$route.query.p_id));
this
.
p_id
=
this
.
$route
.
query
.
p_id
;
this
.
project_name
=
this
.
$route
.
query
.
name
;
this
.
getList
();
// this.search.project_name = this.$route.query.name;
}
};
</
script
>
\ No newline at end of file
src/views/EnvList.vue
0 → 100644
View file @
218f03e7
<
style
lang=
"postcss"
scoped
>
.home-container {
}
.demo-drawer-footer {
width: 100%;
position: absolute;
bottom: 0;
left: 0;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
background: #fff;
}
</
style
>
<
template
>
<section
class=
"home-container"
>
<MasterPage
title=
"环境列表"
>
<div
slot=
"title-icon"
>
<Icon
type=
"ios-albums"
/>
</div>
<div
slot=
"title-toolbar"
>
<!-- title工具栏 -->
</div>
<div
slot=
"searchContent"
class=
"search-content-slot"
>
<!-- 表单位置 -->
</div>
<div
slot=
"search"
>
<Button
type=
"info"
icon=
"ios-search"
@
click=
"getList"
>
查询
</Button>
</div>
<div
slot=
"btns"
>
<Button
type=
"primary"
icon=
"md-add"
@
click=
"addShow"
>
添加
</Button>
</div>
<div
slot=
"paddingContent"
>
<Table
:columns=
"columns1"
:data=
"data1"
></Table>
</div>
<div
slot=
"pager"
></div>
</MasterPage>
<Drawer
title=
"项目详情"
:closable=
"false"
v-model=
"isShow"
width=
"720"
>
<div>
<Form
:model=
"showData"
label-position=
"left"
:label-width=
"100"
>
<FormItem
label=
"环境名称"
>
<Input
v-model=
"showData.name"
></Input>
</FormItem>
<FormItem
label=
"目标geilab地址"
>
<Input
v-model=
"showData.target_git_url"
></Input>
</FormItem>
<FormItem
label=
"gitlab令牌"
>
<Input
v-model=
"showData.target_git_token"
></Input>
</FormItem>
<FormItem
label=
"Docker仓库地址"
>
<Input
v-model=
"showData.registry_url"
></Input>
</FormItem>
<FormItem
label=
"Docker仓库组群"
>
<Input
v-model=
"showData.registry_group"
></Input>
</FormItem>
<FormItem
label=
"docker仓库账号"
>
<Input
v-model=
"showData.registry_username"
></Input>
</FormItem>
<FormItem
label=
"docker仓库密码"
>
<Input
v-model=
"showData.registry_password"
></Input>
</FormItem>
</Form>
</div>
<div
class=
"demo-drawer-footer"
>
<Button
style=
"margin-right: 8px"
@
click=
"isShow= false"
>
取消
</Button>
<Button
type=
"primary"
@
click=
"save"
>
保存
</Button>
</div>
</Drawer>
</section>
</
template
>
<
script
>
import
MasterPage
from
"
@/components/Master
"
;
import
axios
from
"
axios
"
;
import
config
from
"
@/config/configs
"
;
export
default
{
components
:
{
MasterPage
},
data
()
{
return
{
columns1
:
[
{
title
:
"
环境id
"
,
key
:
"
env_id
"
,
width
:
100
,
fixed
:
"
left
"
},
{
title
:
"
环境名
"
,
key
:
"
name
"
,
width
:
300
,
fixed
:
"
left
"
},
{
title
:
"
目标gitlab地址
"
,
key
:
"
target_git_url
"
,
width
:
300
},
{
title
:
"
目标gitlab令牌
"
,
key
:
"
target_git_token
"
,
width
:
100
},
{
title
:
"
目标docker仓库地址
"
,
key
:
"
registry_url
"
,
width
:
200
},
{
title
:
"
目标镜像组群
"
,
key
:
"
registry_group
"
,
width
:
100
},
{
title
:
"
镜像仓库账号
"
,
key
:
"
registry_username
"
,
width
:
100
},
{
title
:
"
镜像仓库密码
"
,
key
:
"
registry_password
"
,
width
:
100
},
{
title
:
"
操作
"
,
key
:
"
action
"
,
fixed
:
"
right
"
,
width
:
150
,
render
:
(
h
,
params
)
=>
{
return
h
(
"
div
"
,
[
h
(
"
Button
"
,
{
props
:
{
type
:
"
primary
"
,
size
:
"
small
"
},
style
:
{
marginRight
:
"
5px
"
},
on
:
{
click
:
()
=>
{
this
.
show
(
params
.
index
);
}
}
},
"
显示/修改
"
)
]);
}
}
],
data1
:
[],
isShow
:
false
,
isAdd
:
false
,
showData
:
{}
};
},
methods
:
{
getList
:
function
()
{
axios
.
get
(
config
.
serve_url
+
"
/env/
"
)
.
then
(
rs
=>
{
if
(
rs
.
status
==
200
)
{
this
.
data1
=
rs
.
data
;
// this.total = rs.data.paged.total;
}
})
.
catch
(
err
=>
{
console
.
log
(
JSON
.
stringify
(
err
));
});
},
addShow
:
function
()
{
this
.
isShow
=
true
;
this
.
showData
=
{};
},
show
:
function
(
index
)
{
this
.
isShow
=
true
;
this
.
showData
=
this
.
data1
[
index
];
},
build
:
function
()
{
//
},
save
:
function
()
{
//保存或者新建
this
.
isShow
=
false
;
axios
.
post
(
config
.
serve_url
+
"
/env/
"
,
this
.
showData
)
.
then
(
res
=>
{
this
.
$Message
.
success
(
"
操作成功
"
);
this
.
getList
();
})
.
catch
(
err
=>
{
this
.
$Message
.
error
(
err
);
});
},
pageChange
:
function
(
i
)
{
this
.
page
=
i
;
this
.
getList
();
}
},
mounted
:
function
()
{
this
.
getList
();
}
};
</
script
>
\ No newline at end of file
src/views/ProjectList.vue
View file @
218f03e7
...
...
@@ -70,7 +70,7 @@
<
script
>
import
MasterPage
from
"
@/components/Master
"
;
import
axios
from
"
axios
"
;
import
config
from
"
@/config/configs
"
import
config
from
"
@/config/configs
"
;
export
default
{
components
:
{
...
...
@@ -119,7 +119,7 @@ export default {
title
:
"
操作
"
,
key
:
"
action
"
,
fixed
:
"
right
"
,
width
:
15
0
,
width
:
20
0
,
render
:
(
h
,
params
)
=>
{
return
h
(
"
div
"
,
[
h
(
...
...
@@ -146,9 +146,28 @@ export default {
props
:
{
type
:
"
primary
"
,
size
:
"
small
"
},
style
:
{
marginRight
:
"
5px
"
}
},
"
build
"
),
h
(
"
Button
"
,
{
props
:
{
type
:
"
primary
"
,
size
:
"
small
"
,
icon
:
"
md-settings
"
},
on
:
{
click
:
()
=>
{
this
.
goConfigs
(
params
.
index
);
}
}
},
""
)
]);
}
...
...
@@ -167,7 +186,8 @@ export default {
getList
:
function
()
{
axios
.
get
(
config
.
serve_url
+
"
/project/page?page=
"
+
config
.
serve_url
+
"
/project/page?page=
"
+
this
.
page
+
"
&pageSize=
"
+
this
.
pageSize
...
...
@@ -193,11 +213,14 @@ export default {
build
:
function
()
{
//
},
goConfigs
:
function
(
index
)
{
this
.
$router
.
push
({
path
:
"
/configList
"
,
query
:
this
.
data1
[
index
]
});
},
save
:
function
()
{
//保存或者新建
this
.
isShow
=
false
;
axios
.
post
(
config
.
serve_url
+
"
/project/
"
,
this
.
showData
)
.
post
(
config
.
serve_url
+
"
/project/
"
,
this
.
showData
)
.
then
(
res
=>
{
this
.
$Message
.
success
(
"
操作成功
"
);
this
.
getList
();
...
...
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