Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qa-platform-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
QA
qa-platform-ui
Commits
668eec26
Commit
668eec26
authored
Aug 25, 2021
by
黎博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
2cb6d6a4
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
107 additions
and
18 deletions
+107
-18
k8s.js
src/api/k8s.js
+9
-0
main.js
src/main.js
+1
-0
DevEnv.vue
src/views/docker/DevEnv.vue
+2
-0
EnvDetail.vue
src/views/docker/EnvDetail.vue
+89
-12
ProConfig.vue
src/views/docker/ProConfig.vue
+2
-2
Login.vue
src/views/login/Login.vue
+4
-4
No files found.
src/api/k8s.js
View file @
668eec26
...
@@ -134,3 +134,12 @@ export function syncMq(data) {
...
@@ -134,3 +134,12 @@ export function syncMq(data) {
data
data
})
})
}
}
// 清空redis缓存
export
function
flushRedis
(
data
)
{
return
request
({
url
:
'
/k8s/redis/flush
'
,
method
:
'
post
'
,
data
})
}
src/main.js
View file @
668eec26
...
@@ -68,6 +68,7 @@ Vue.prototype.$echarts = echarts
...
@@ -68,6 +68,7 @@ Vue.prototype.$echarts = echarts
Vue
.
prototype
.
$message
=
Message
Vue
.
prototype
.
$message
=
Message
Vue
.
prototype
.
$loading
=
Loading
Vue
.
prototype
.
$loading
=
Loading
Vue
.
prototype
.
$messageBox
=
MessageBox
Vue
.
prototype
.
$messageBox
=
MessageBox
Vue
.
prototype
.
$confirm
=
MessageBox
.
confirm
Vue
.
prototype
.
$bus
=
bus
Vue
.
prototype
.
$bus
=
bus
// axios.defaults.baseURL = 'https://qa-platform-pre.liangkebang.net'
// axios.defaults.baseURL = 'https://qa-platform-pre.liangkebang.net'
// axios.defaults.baseURL = 'http://localhost:8082'
// axios.defaults.baseURL = 'http://localhost:8082'
...
...
src/views/docker/DevEnv.vue
View file @
668eec26
...
@@ -75,6 +75,8 @@ export default {
...
@@ -75,6 +75,8 @@ export default {
this
.
$router
.
push
({
this
.
$router
.
push
({
path
:
`/docker/env`
path
:
`/docker/env`
})
})
// 强制刷新整个页面
this
.
$router
.
go
(
0
)
},
},
handleSyncMysql
()
{
handleSyncMysql
()
{
this
.
$router
.
push
(
'
/effect/database
'
)
this
.
$router
.
push
(
'
/effect/database
'
)
...
...
src/views/docker/EnvDetail.vue
View file @
668eec26
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
</el-button>
</el-button>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item
@
click.native=
"syncDb"
>
同步线上MySQL
</el-dropdown-item>
<el-dropdown-item
@
click.native=
"syncDb"
>
同步线上MySQL
</el-dropdown-item>
<el-dropdown-item
@
click.native=
"
syncMq
"
>
同步线上MQ
</el-dropdown-item>
<el-dropdown-item
@
click.native=
"
handleMqSync
"
>
同步线上MQ
</el-dropdown-item>
<el-dropdown-item
@
click.native=
"clearRedis"
>
清理Redis缓存
</el-dropdown-item>
<el-dropdown-item
@
click.native=
"clearRedis"
>
清理Redis缓存
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown-menu>
</el-dropdown>
</el-dropdown>
...
@@ -295,6 +295,8 @@
...
@@ -295,6 +295,8 @@
<el-button
type=
"primary"
@
click=
"updateService()"
>
确 定
</el-button>
<el-button
type=
"primary"
@
click=
"updateService()"
>
确 定
</el-button>
</span>
</span>
</el-dialog>
</el-dialog>
<!-- 详细信息对话框 -->
<el-dialog
:visible.sync=
"centerDialogVisible"
title=
"详细信息"
height=
"500px"
center
>
<el-dialog
:visible.sync=
"centerDialogVisible"
title=
"详细信息"
height=
"500px"
center
>
<div
class=
"editor-container"
>
<div
class=
"editor-container"
>
<json-viewer
:expand-depth=
3
:value=
'detailValue'
style=
"margin-top:-25px"
></json-viewer>
<json-viewer
:expand-depth=
3
:value=
'detailValue'
style=
"margin-top:-25px"
></json-viewer>
...
@@ -304,6 +306,22 @@
...
@@ -304,6 +306,22 @@
<el-button
type=
"primary"
@
click=
"centerDialogVisible = false"
>
确 定
</el-button>
<el-button
type=
"primary"
@
click=
"centerDialogVisible = false"
>
确 定
</el-button>
</span>
</span>
</el-dialog>
</el-dialog>
<!-- 同步MQ对话框 -->
<el-dialog
title=
"同步MQ"
:visible.sync=
"mqSyncDialogVisible"
width=
"50%"
:before-close=
"handleClose"
>
<el-form
ref=
"mqDataForm"
label-position=
"left"
label-width=
"130px"
style=
"width: 95%; margin-left:20px;"
>
<el-form-item
label=
"Namespace名称"
>
<el-input
v-model=
"namespace"
:disabled=
"true"
/>
</el-form-item>
<el-form-item
label=
"服务地址"
>
<el-input
v-model=
"mqUrl"
:disabled=
"true"
/>
</el-form-item>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"mqSyncDialogVisible = false"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"syncMQ()"
>
开始同步
</el-button>
</span>
</el-dialog>
</div>
</div>
</template>
</template>
...
@@ -318,7 +336,9 @@ import {
...
@@ -318,7 +336,9 @@ import {
serviceRedeploy
,
serviceRedeploy
,
serviceUpdate
,
serviceUpdate
,
serviceDelete
,
serviceDelete
,
getDockerProjectType
getDockerProjectType
,
syncMq
,
flushRedis
}
from
'
@/api/k8s
'
}
from
'
@/api/k8s
'
export
default
{
export
default
{
data
()
{
data
()
{
...
@@ -352,7 +372,16 @@ export default {
...
@@ -352,7 +372,16 @@ export default {
mysqlName
:
''
,
mysqlName
:
''
,
// 当前选中的项目名
// 当前选中的项目名
serviceName
:
''
,
serviceName
:
''
,
updateServiceParams
:
{}
updateServiceParams
:
{},
mqSyncDialogVisible
:
false
,
mqUrl
:
''
,
mqDataForm
:
{},
loadingOptions
:
{
text
:
'
加载中...
'
,
lock
:
true
,
spinner
:
'
el-icon-loading
'
,
background
:
'
rgba(0,0,0,0.7)
'
}
}
}
},
},
created
()
{
created
()
{
...
@@ -379,9 +408,11 @@ export default {
...
@@ -379,9 +408,11 @@ export default {
},
},
// 获取服务列表
// 获取服务列表
getServiceList
()
{
getServiceList
()
{
const
tLoading
=
this
.
$loading
.
service
(
this
.
loadingOptions
)
getServiceList
({
namespace
:
this
.
namespace
}).
then
((
resp
)
=>
{
getServiceList
({
namespace
:
this
.
namespace
}).
then
((
resp
)
=>
{
const
serviceList
=
resp
.
data
.
data
const
serviceList
=
resp
.
data
.
data
this
.
array2Object
(
serviceList
)
this
.
array2Object
(
serviceList
)
tLoading
.
close
()
})
})
},
},
// 刷新,重新获取服务列表
// 刷新,重新获取服务列表
...
@@ -418,11 +449,56 @@ export default {
...
@@ -418,11 +449,56 @@ export default {
)
)
},
},
// 同步数据库
// 同步数据库
syncDb
()
{},
syncDb
()
{
// 通过Mq
this
.
$router
.
push
(
'
/effect/database
'
)
syncMq
()
{},
},
// 打开MQ同步对话框
handleMqSync
()
{
getServiceDetail
({
namespace
:
this
.
namespace
,
serviceType
:
'
base
'
,
serviceName
:
'
rabbitmq
'
}).
then
((
resp
)
=>
{
if
(
resp
.
data
.
data
!=
null
)
{
this
.
mqUrl
=
resp
.
data
.
data
.
lanIp
+
'
:
'
+
resp
.
data
.
data
.
portMappings
[
1
].
nodePort
}
else
{
return
this
.
$message
.
error
(
'
当前环境没有MQ!
'
)
}
})
this
.
mqSyncDialogVisible
=
true
},
// 同步MQ
syncMQ
()
{
var
formdata
=
new
FormData
()
formdata
.
set
(
'
host
'
,
this
.
mqUrl
)
syncMq
(
formdata
).
then
((
resp
)
=>
{
if
(
resp
.
data
.
data
===
true
)
{
this
.
mqSyncDialogVisible
=
false
return
this
.
$message
.
success
(
'
同步成功!
'
)
}
else
{
return
this
.
$message
.
error
(
'
同步失败!
'
)
}
})
},
// 清空redis
// 清空redis
clearRedis
()
{},
clearRedis
()
{
this
.
$confirm
(
`此操作将清空
${
this
.
namespace
}
环境所有Redis缓存, 是否继续?`
,
'
提示
'
,
{
confirmButtonText
:
'
确定
'
,
cancelButtonText
:
'
取消
'
,
type
:
'
warning
'
}).
then
(()
=>
{
var
formdata
=
new
FormData
()
formdata
.
set
(
'
namespace
'
,
this
.
namespace
)
flushRedis
(
formdata
).
then
((
resp
)
=>
{
if
(
resp
.
data
.
data
)
{
return
this
.
$message
.
success
(
resp
.
data
.
msg
)
}
else
{
return
this
.
$message
.
error
(
resp
.
data
.
msg
)
}
})
})
},
// 获取服务详情
// 获取服务详情
getServiceDetails
(
service
)
{
getServiceDetails
(
service
)
{
getServiceDetail
({
getServiceDetail
({
...
@@ -442,10 +518,10 @@ export default {
...
@@ -442,10 +518,10 @@ export default {
serviceRedeploy
(
formdata
).
then
((
resp
)
=>
{
serviceRedeploy
(
formdata
).
then
((
resp
)
=>
{
if
(
resp
.
data
.
data
===
true
)
{
if
(
resp
.
data
.
data
===
true
)
{
this
.
getServiceList
()
this
.
getServiceList
()
return
this
.
$message
.
success
(
'
重置成功!
'
)
return
this
.
$message
.
success
(
`服务
${
service
.
serviceName
}
重置成功!`
)
}
else
{
}
else
{
this
.
getServiceList
()
this
.
getServiceList
()
return
this
.
$message
.
error
(
'
重置失败!
'
)
return
this
.
$message
.
error
(
`服务
${
service
.
serviceName
}
重置失败!`
)
}
}
})
})
},
},
...
@@ -484,10 +560,11 @@ export default {
...
@@ -484,10 +560,11 @@ export default {
},
},
// 调用接口更新服务
// 调用接口更新服务
updateService
()
{
updateService
()
{
this
.
updateServiceParams
[
'
image
'
]
=
'
qa-test/
'
+
this
.
serviceName
+
'
:
'
+
this
.
tagName
this
.
updateServiceParams
[
'
image
'
]
=
'
qa-test/
'
+
this
.
serviceName
+
'
:
'
+
this
.
tagName
serviceUpdate
(
this
.
updateServiceParams
).
then
((
resp
)
=>
{
serviceUpdate
(
this
.
updateServiceParams
).
then
((
resp
)
=>
{
if
(
resp
.
data
.
data
===
true
)
{
if
(
resp
.
data
.
data
===
true
)
{
this
.
getServiceList
()
//
this.getServiceList()
this
.
updateDialogVisible
=
false
this
.
updateDialogVisible
=
false
return
this
.
$message
.
success
(
'
更新成功!
'
)
return
this
.
$message
.
success
(
'
更新成功!
'
)
}
else
{
}
else
{
...
@@ -497,7 +574,7 @@ export default {
...
@@ -497,7 +574,7 @@ export default {
},
},
// 删除服务
// 删除服务
deleteService
(
service
)
{
deleteService
(
service
)
{
this
.
$
messageBox
(
this
.
$
confirm
(
`此操作将删除
${
service
.
serviceName
}
服务, 是否继续?`
,
`此操作将删除
${
service
.
serviceName
}
服务, 是否继续?`
,
'
提示
'
,
'
提示
'
,
{
{
...
...
src/views/docker/ProConfig.vue
View file @
668eec26
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
<el-option
v-for=
"item in avtiveOptions"
:key=
"item.key"
:label=
"item.label"
:value=
"item.key"
/>
<el-option
v-for=
"item in avtiveOptions"
:key=
"item.key"
:label=
"item.label"
:value=
"item.key"
/>
</el-select>
</el-select>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-search"
@
click=
"getProjectList"
>
搜索
</el-button>
<el-button
class=
"filter-item"
type=
"primary"
icon=
"el-icon-search"
@
click=
"getProjectList"
>
搜索
</el-button>
<el-button
class=
"filter-item"
style=
"margin-left: 10px;"
type=
"primary"
icon=
"el-icon-edit"
@
click=
"handleCreate"
>
添加
</el-button>
<el-button
class=
"filter-item"
style=
"margin-left: 10px;"
type=
"primary"
icon=
"el-icon-edit"
v-permission=
"('docker:proconfig:add')"
@
click=
"handleCreate"
>
添加
</el-button>
</div>
</div>
<!-- 表格 -->
<!-- 表格 -->
...
@@ -82,7 +82,7 @@
...
@@ -82,7 +82,7 @@
<el-table-column
label=
"操作"
align=
"center"
width=
"80"
class-name=
"small-padding fixed-width"
>
<el-table-column
label=
"操作"
align=
"center"
width=
"80"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"primary"
size=
"mini"
@
click=
"handleUpdate(scope.row)"
>
编辑
</el-button>
<el-button
type=
"primary"
size=
"mini"
v-permission=
"('docker:proconfig:edit')"
@
click=
"handleUpdate(scope.row)"
>
编辑
</el-button>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
...
...
src/views/login/Login.vue
View file @
668eec26
...
@@ -10,8 +10,8 @@
...
@@ -10,8 +10,8 @@
<el-input
type=
"password"
@
keyup.enter.native=
"login"
v-model=
"loginForm.password"
placeholder=
"请输入用户名"
prefix-icon=
"el-icon-unlock"
show-password
></el-input>
<el-input
type=
"password"
@
keyup.enter.native=
"login"
v-model=
"loginForm.password"
placeholder=
"请输入用户名"
prefix-icon=
"el-icon-unlock"
show-password
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
class=
"input-style"
prop=
"namespace"
>
<el-form-item
class=
"input-style"
prop=
"namespace"
>
<el-select
v-model=
"loginForm.namespace"
placeholder=
"请选择环境"
@
change=
"handleSelectChange"
style=
"width: 100%;"
>
<el-select
v-model=
"loginForm.namespace"
filterable
placeholder=
"请选择环境"
@
change=
"handleSelectChange"
style=
"width: 100%;"
>
<el-option
v-for=
"item in nsOptions"
:key=
"item.
key"
:label=
"item.desc"
:value=
"item.key
"
></el-option>
<el-option
v-for=
"item in nsOptions"
:key=
"item.
name"
:label=
"item.name"
:value=
"item.name
"
></el-option>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
class=
"input-style"
>
<el-form-item
class=
"input-style"
>
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
getNamespaceList
}
from
'
@/api/
getXyqbData/
'
import
{
getNamespaceList
}
from
'
@/api/
k8s
'
import
{
login
}
from
'
@/api/Login/
'
import
{
login
}
from
'
@/api/Login/
'
export
default
{
export
default
{
data
()
{
data
()
{
...
@@ -73,7 +73,7 @@ export default {
...
@@ -73,7 +73,7 @@ export default {
})
})
},
},
getNamespaceList
()
{
getNamespaceList
()
{
getNamespaceList
().
then
((
resp
)
=>
{
getNamespaceList
(
{
env
:
'
all
'
}
).
then
((
resp
)
=>
{
this
.
nsOptions
=
resp
.
data
.
data
this
.
nsOptions
=
resp
.
data
.
data
})
})
}
}
...
...
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