Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qahome-diamond
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
QA
qahome-diamond
Commits
12bbb7ea
Commit
12bbb7ea
authored
Oct 28, 2019
by
智勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加k8s conf
parent
e88bd005
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
115 additions
and
101 deletions
+115
-101
manager.vue
src/views/dbconfig/manager.vue
+17
-4
index.vue
src/views/proconfig/index.vue
+98
-97
No files found.
src/views/dbconfig/manager.vue
View file @
12bbb7ea
...
...
@@ -32,17 +32,22 @@
<!-- <pagination v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" /> -->
<el-dialog
:title=
"dialogStatus"
:visible.sync=
"dialogFormVisible"
>
<el-alert
v-show=
"dialogStatus==='新建'"
style=
"margin-bottom:20px"
title=
"新建需要管理员权限"
type=
"warning"
/>
<el-form
ref=
"dataForm"
:rules=
"rules"
:model=
"temp"
label-position=
"left"
label-width=
"90px"
style=
"width: 90%; margin-left:40px;"
>
<el-form-item
label=
"Database"
prop=
"dbname"
>
<el-input
v-model=
"temp.dbname"
style=
"width:100%"
/>
<el-input
v-model=
"temp.dbname"
:disabled=
"disabled"
style=
"width:100%"
/>
</el-form-item>
<el-form
:inline=
"true"
:rules=
"rules"
:model=
"temp"
class=
"demo-form-inline"
label-width=
"90px"
>
<el-form-item
label=
"Host"
prop=
"ip"
>
<el-input
v-model=
"temp.ip"
placeholder=
"数据库同步环境IP"
class=
"input-width"
/>
<el-input
v-model=
"temp.ip"
:disabled=
"disabled"
placeholder=
"数据库同步环境IP"
class=
"input-width"
/>
</el-form-item>
<el-form-item
label=
"Port"
prop=
"port"
>
<el-input
v-model=
"temp.port"
placeholder=
"数据库同步环境端口"
class=
"input-width"
/>
<el-input
v-model=
"temp.port"
:disabled=
"disabled"
placeholder=
"数据库同步环境端口"
class=
"input-width"
/>
</el-form-item>
</el-form>
<el-form
:inline=
"true"
:model=
"temp"
class=
"demo-form-inline"
label-width=
"90px"
>
...
...
@@ -60,7 +65,7 @@
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogFormVisible = false"
>
{{ $t('table.cancel') }}
</el-button>
<el-button
v-permission=
"['admin']
"
type=
"primary"
@
click=
"createData()"
>
{{ $t('table.confirm') }}
</el-button>
<el-button
:disabled=
"disabled && dialogStatus==='新建'
"
type=
"primary"
@
click=
"createData()"
>
{{ $t('table.confirm') }}
</el-button>
</div>
</el-dialog>
...
...
@@ -92,6 +97,7 @@ export default {
return
{
temp
:
{
},
disabled
:
undefined
,
dialogFormVisible
:
false
,
dialogDeleteVisible
:
false
,
dialogStatus
:
''
,
...
...
@@ -110,6 +116,7 @@ export default {
},
created
()
{
this
.
getConfig
()
this
.
disabled
=
!
this
.
$store
.
getters
.
roles
.
includes
(
'
admin
'
)
},
methods
:
{
getConfig
()
{
...
...
@@ -133,6 +140,9 @@ export default {
this
.
resetTemp
()
this
.
dialogStatus
=
'
新建
'
this
.
dialogFormVisible
=
true
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'
dataForm
'
].
clearValidate
()
})
},
createData
()
{
...
...
@@ -156,6 +166,9 @@ export default {
this
.
temp
=
Object
.
assign
({},
row
)
// copy obj
this
.
dialogStatus
=
'
编辑
'
this
.
dialogFormVisible
=
true
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'
dataForm
'
].
clearValidate
()
})
},
handleDelete
(
row
)
{
...
...
src/views/proconfig/index.vue
View file @
12bbb7ea
...
...
@@ -21,11 +21,7 @@
size=
"medium"
style=
"width: 100%;"
>
<el-table-column
:label=
"$t('table.id')"
prop=
"id"
align=
"center"
width=
"55"
>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
$index
+
1
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"ID"
type=
"index"
align=
"center"
width=
"55"
/>
<el-table-column
label=
"服务名称"
align=
"center"
>
<template
slot-scope=
"scope"
>
...
...
@@ -33,33 +29,21 @@
</
template
>
</el-table-column>
<el-table-column
label=
"服务描述"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<span
>
{{
scope
.
row
.
des
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"服务描述"
prop=
"des"
align=
"center"
/>
<el-table-column
label=
"线上域名"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
host_name
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"线上域名"
prop=
"host_name"
align=
"center"
/>
<el-table-column
label=
"负责人"
width=
"80px"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
auth
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"负责人"
width=
"80px"
prop=
"auth"
align=
"center"
/>
<el-table-column
label=
"状态"
width=
"90px"
align=
"center"
>
<
template
slot-scope=
"
scope
"
>
<el-tag
:type=
"
scope.row.is_active | statusFilter"
>
{{
scope
.
row
.
is_active
|
activeFileter
}}
</el-tag>
<
template
slot-scope=
"
{row}
"
>
<el-tag
:type=
"
row.is_active | statusFilter"
>
{{
row
.
is_active
|
activeFileter
}}
</el-tag>
</
template
>
</el-table-column>
<el-table-column
label=
"部署容器"
width=
"90px"
align=
"center"
>
<
template
slot-scope=
"
scope
"
>
<el-tag
:type=
"
scope.row.deploy_to_testenv | statusFilter"
>
{{
scope
.
row
.
deploy_to_testenv
|
deployFileter
}}
</el-tag>
<
template
slot-scope=
"
{row}
"
>
<el-tag
:type=
"
row.deploy_to_testenv | statusFilter"
>
{{
row
.
deploy_to_testenv
|
deployFileter
}}
</el-tag>
</
template
>
</el-table-column>
...
...
@@ -67,9 +51,9 @@
label=
"API地址"
align=
"center"
width=
"80px"
>
<
template
slot-scope=
"
scope
"
>
<el-tooltip
:content=
"
scope.
row.api"
class=
"item"
effect=
"dark"
placement=
"top"
>
<el-button
v-
if=
"scope.row.api"
type=
"primary"
icon=
"el-icon-time"
circle
@
click=
"openUrl(scope.
row.api)"
/>
<
template
slot-scope=
"
{row}
"
>
<el-tooltip
:content=
"row.api"
class=
"item"
effect=
"dark"
placement=
"top"
>
<el-button
v-
show=
"row.api"
type=
"primary"
icon=
"el-icon-time"
circle
@
click=
"openUrl(
row.api)"
/>
</el-tooltip>
</
template
>
</el-table-column>
...
...
@@ -78,9 +62,9 @@
label=
"DDL地址"
width=
"80px"
align=
"center"
>
<
template
slot-scope=
"
scope
"
>
<el-tooltip
:content=
"
scope.
row.ddl"
class=
"item"
effect=
"dark"
placement=
"top"
>
<el-button
v-
if=
"scope.row.ddl"
type=
"success"
icon=
"el-icon-time"
circle
@
click=
"openUrl(scope.
row.ddl)"
/>
<
template
slot-scope=
"
{row}
"
>
<el-tooltip
:content=
"row.ddl"
class=
"item"
effect=
"dark"
placement=
"top"
>
<el-button
v-
show=
"row.ddl"
type=
"success"
icon=
"el-icon-time"
circle
@
click=
"openUrl(
row.ddl)"
/>
</el-tooltip>
</
template
>
</el-table-column>
...
...
@@ -89,9 +73,9 @@
label=
"Wiki"
width=
"80px"
align=
"center"
>
<
template
slot-scope=
"
scope
"
>
<el-tooltip
:content=
"
scope.
row.wiki"
class=
"item"
effect=
"dark"
placement=
"top"
>
<el-button
v-
if=
"scope.row.wiki"
type=
"warning"
icon=
"el-icon-time"
circle
@
click=
"openUrl(scope.
row.wiki)"
/>
<
template
slot-scope=
"
{row}
"
>
<el-tooltip
:content=
"row.wiki"
class=
"item"
effect=
"dark"
placement=
"top"
>
<el-button
v-
show=
"row.wiki"
type=
"warning"
icon=
"el-icon-time"
circle
@
click=
"openUrl(
row.wiki)"
/>
</el-tooltip>
</
template
>
</el-table-column>
...
...
@@ -100,24 +84,24 @@
label=
"Git地址"
width=
"80px"
align=
"center"
>
<
template
slot-scope=
"
scope
"
>
<el-tooltip
:content=
"
scope.
row.git_path"
class=
"item"
effect=
"dark"
placement=
"top"
>
<el-button
v-
if=
"scope.
row.git_path"
type=
"info"
icon=
"el-icon-tickets"
circle
/>
<
template
slot-scope=
"
{row}
"
>
<el-tooltip
:content=
"row.git_path"
class=
"item"
effect=
"dark"
placement=
"top"
>
<el-button
v-
show=
"
row.git_path"
type=
"info"
icon=
"el-icon-tickets"
circle
/>
</el-tooltip>
</
template
>
</el-table-column>
<el-table-column
:label=
"$t('table.actions')"
align=
"center"
width=
"70"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"
scope
"
>
<el-button
type=
"primary"
size=
"mini"
@
click=
"handleUpdate(
scope.
row)"
>
{{
$t
(
'
table.edit
'
)
}}
</el-button>
<!--
<el-button
size=
"mini"
type=
"danger"
@
click=
"handleDelete(
scope.
row)"
>
{{
$t
(
'
table.delete
'
)
}}
<
template
slot-scope=
"
{row}
"
>
<el-button
type=
"primary"
size=
"mini"
@
click=
"handleUpdate(row)"
>
{{
$t
(
'
table.edit
'
)
}}
</el-button>
<!--
<el-button
size=
"mini"
type=
"danger"
@
click=
"handleDelete(row)"
>
{{
$t
(
'
table.delete
'
)
}}
</el-button>
-->
</
template
>
</el-table-column>
</el-table>
<el-dialog
:title=
"textMap[dialogStatus]"
:visible.sync=
"dialogFormVisible"
>
<el-form
ref=
"dataForm"
:
model=
"temp"
label-position=
"left"
label-width=
"10
5px"
style=
"width: 90%; margin-left:40px;"
>
<el-form
ref=
"dataForm"
:
rules=
"rules"
:model=
"temp"
label-position=
"left"
label-width=
"11
5px"
style=
"width: 90%; margin-left:40px;"
>
<el-form-item
label=
"类型"
prop=
"type"
>
<el-select
v-model=
"temp.type"
class=
"filter-item"
placeholder=
"Please select"
>
<el-option
v-for=
"item in typeOptions"
:key=
"item.key"
:label=
"item.display_name"
:value=
"item.key"
/>
...
...
@@ -126,47 +110,80 @@
<el-form-item
label=
"Git地址"
prop=
"git_path"
style=
"width: 100%;"
>
<el-input
v-model=
"temp.git_path"
/>
</el-form-item>
<el-form-item
label=
"是否服役"
>
<el-form-item
label=
"负责人"
style=
"width: 100%;"
prop=
"auth"
>
<el-input
v-model=
"temp.auth"
/>
</el-form-item>
<el-form-item
label=
"项目描述"
style=
"width: 100%;"
>
<el-input
:autosize=
"{ minRows: 1, maxRows: 4}"
v-model=
"temp.des"
type=
"textarea"
placeholder=
"Please input"
/>
</el-form-item>
<el-form-item
label=
"API"
style=
"width: 100%;"
>
<el-input
v-model=
"temp.api"
/>
</el-form-item>
<el-form-item
label=
"数据库DDL"
style=
"width: 100%;"
>
<el-input
v-model=
"temp.ddl"
/>
</el-form-item>
<el-form-item
label=
"Wiki"
style=
"width: 100%;"
>
<el-input
v-model=
"temp.wiki"
/>
</el-form-item>
<el-form-item
label=
"是否服役"
prop=
"is_active"
>
<el-select
v-model=
"temp.is_active"
class=
"filter-item"
placeholder=
"Please select"
>
<el-option
v-for=
"item in avtiveOptions"
:key=
"item.key"
:label=
"item.display_name"
:value=
"item.key"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"是否部署容器"
>
<el-form-item
label=
"是否部署容器"
prop=
"deploy_to_testenv"
>
<el-select
v-model=
"temp.deploy_to_testenv"
class=
"filter-item"
placeholder=
"Please select"
>
<el-option
v-for=
"item in deployOptions"
:key=
"item.key"
:label=
"item.display_name"
:value=
"item.key"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"项目描述"
style=
"width: 100%;"
>
<el-input
:autosize=
"{ minRows: 2, maxRows: 4}"
v-model=
"temp.des"
type=
"textarea"
placeholder=
"Please input"
/>
</el-form-item>
<el-form-item
label=
"线上域名"
style=
"width: 100%;"
>
<el-form-item
v-if=
"temp.deploy_to_testenv"
label=
"线上域名"
prop=
"host_name"
style=
"width: 100%;"
>
<el-input
v-model=
"temp.host_name"
/>
</el-form-item>
<el-form-item
label=
"负责人"
style=
"width: 100%;"
>
<el-input
v-model=
"temp.auth"
/>
</el-form-item>
<el-form-item
label=
"配置文件路径"
style=
"width: 100%;"
>
<el-form-item
v-if=
"temp.deploy_to_testenv"
label=
"配置文件路径"
style=
"width: 100%;"
>
<el-input
v-model=
"temp.config_path"
/>
</el-form-item>
<el-form-item
label=
"Build文件路径"
style=
"width: 100%;"
>
<el-form-item
v-if=
"temp.deploy_to_testenv"
label=
"Build文件路径"
style=
"width: 100%;"
>
<el-input
v-model=
"temp.jar_path"
/>
</el-form-item>
<el-form-item
label=
"日志路径"
style=
"width: 100%;"
>
<el-form-item
v-if=
"temp.deploy_to_testenv"
label=
"日志路径"
style=
"width: 100%;"
>
<el-input
v-model=
"temp.log_path"
/>
</el-form-item>
<el-form-item
label=
"部署命令"
style=
"width: 100%;"
>
<el-form-item
v-if=
"temp.deploy_to_testenv"
label=
"部署命令"
style=
"width: 100%;"
>
<el-input
v-model=
"temp.build_command"
/>
</el-form-item>
<el-form-item
label=
"API"
style=
"width: 100%;"
>
<el-input
v-model=
"temp.api"
/>
</el-form-item>
<el-form-item
label=
"数据库DDL"
style=
"width: 100%;"
>
<el-input
v-model=
"temp.ddl"
/>
</el-form-item>
<el-form-item
label=
"Wiki"
style=
"width: 100%;"
>
<el-input
v-model=
"temp.wiki"
/>
<el-alert
v-show=
"temp.type==='java' && temp.deploy_to_testenv"
style=
"margin-bottom:20px"
title=
"编辑启动命令需要管理员权限"
type=
"warning"
/>
<el-form-item
v-show=
"temp.type==='java' && temp.deploy_to_testenv"
label=
"启动命令"
style=
"width: 100%;"
>
<el-input
:autosize=
"{ minRows: 2, maxRows: 10}"
v-model=
"temp.start_command"
:disabled=
"disabled"
type=
"textarea"
placeholder=
"Please input"
/>
</el-form-item>
<el-card
v-permission=
"['admin']"
v-if=
"temp.deploy_to_testenv"
class=
"box-card"
>
<div
slot=
"header"
>
<span>
Kubernetes设置
</span>
</div>
<el-form
:inline=
"true"
size=
"medium"
>
<el-form-item
label=
"CPU request"
style=
"width:40%"
prop=
"cpuRequest"
>
<el-input
v-model=
"temp.cpuRequest"
/>
</el-form-item>
<el-form-item
label=
"CPU limit"
style=
"width:40%"
prop=
"cpuLimit"
>
<el-input
v-model=
"temp.cpuLimit"
/>
</el-form-item>
<el-form-item
label=
"内存 request"
style=
"width:40%"
prop=
"memRequest"
>
<el-input
v-model=
"temp.memRequest"
/>
</el-form-item>
<el-form-item
label=
"内存 limit"
style=
"width:40%"
prop=
"memLimit"
>
<el-input
v-model=
"temp.memLimit"
/>
</el-form-item>
</el-form>
</el-card>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogFormVisible = false"
>
{{ $t('table.cancel') }}
</el-button>
...
...
@@ -190,6 +207,7 @@
<
script
>
import
{
getProjects
,
saveProject
,
deleteProject
}
from
'
@/api/proconfig
'
import
waves
from
'
@/directive/waves
'
// Waves directive
import
permission
from
'
@/directive/permission/index.js
'
// 权限判断指令
const
typeOptions
=
[
{
key
:
'
java
'
,
display_name
:
'
Java
'
},
...
...
@@ -219,7 +237,7 @@ const deployKeyValue = deployOptions.reduce((acc, cur) => {
},
{})
export
default
{
directives
:
{
waves
},
directives
:
{
waves
,
permission
},
filters
:
{
statusFilter
(
status
)
{
const
statusMap
=
{
...
...
@@ -256,7 +274,16 @@ export default {
},
proconfigs
:
[],
avtiveOptions
,
deployOptions
deployOptions
,
disabled
:
undefined
,
rules
:
{
type
:
[{
required
:
true
,
message
:
'
请选择
'
,
trigger
:
'
change
'
}],
git_path
:
[{
required
:
true
,
message
:
'
请输入
'
,
trigger
:
'
change
'
}],
is_active
:
[{
required
:
true
,
message
:
'
请选择
'
,
trigger
:
'
change
'
}],
deploy_to_testenv
:
[{
required
:
true
,
message
:
'
请选择
'
,
trigger
:
'
change
'
}],
host_name
:
[{
required
:
true
,
message
:
'
请输入
'
,
trigger
:
'
change
'
}],
auth
:
[{
required
:
true
,
message
:
'
请输入
'
,
trigger
:
'
change
'
}]
}
}
},
watch
:
{
...
...
@@ -266,9 +293,9 @@ export default {
deep
:
true
}
},
//
created() {
// this.getProjects(
)
//
},
created
()
{
this
.
disabled
=
!
this
.
$store
.
getters
.
roles
.
includes
(
'
admin
'
)
},
methods
:
{
getProjects
()
{
for
(
const
prop
in
this
.
listQuery
)
{
...
...
@@ -299,28 +326,9 @@ export default {
}
this
.
getProjects
()
},
resetTemp
()
{
this
.
temp
=
{
is_active
:
undefined
,
deploy_to_testenv
:
undefined
,
type
:
''
,
project_name
:
''
,
git_path
:
''
,
host_name
:
''
,
log_path
:
''
,
config_path
:
''
,
des
:
''
,
auth
:
''
,
jar_path
:
''
,
command1
:
''
,
build_command
:
''
,
api
:
''
,
ddl
:
''
,
wiki
:
''
}
},
handleCreate
()
{
this
.
resetTemp
()
this
.
temp
=
{}
this
.
dialogStatus
=
'
create
'
this
.
dialogFormVisible
=
true
this
.
$nextTick
(()
=>
{
...
...
@@ -331,7 +339,6 @@ export default {
this
.
$refs
[
'
dataForm
'
].
validate
((
valid
)
=>
{
if
(
valid
)
{
saveProject
(
this
.
temp
).
then
(()
=>
{
// this.proconfigs.unshift(this.temp)
this
.
dialogFormVisible
=
false
this
.
$notify
({
title
:
'
成功
'
,
...
...
@@ -348,9 +355,9 @@ export default {
this
.
temp
=
Object
.
assign
({},
row
)
// copy obj
this
.
dialogStatus
=
'
update
'
this
.
dialogFormVisible
=
true
//
this.$nextTick(() => {
//
this.$refs['dataForm'].clearValidate()
//
})
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'
dataForm
'
].
clearValidate
()
})
},
handleDelete
(
row
)
{
...
...
@@ -373,9 +380,3 @@ export default {
}
}
</
script
>
<
style
scoped
>
.el-form-item
{
width
:
600px
;
}
</
style
>
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