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
6ab0294b
Commit
6ab0294b
authored
Dec 29, 2021
by
王晓铜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加sql监控页面
parent
572b3595
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
274 additions
and
343 deletions
+274
-343
sqlMonitor.js
src/api/sqlMonitor.js
+57
-0
index.js
src/router/index.js
+15
-1
menu.json
src/views/layout/leftAside/menu.json
+13
-0
AddSqlMonitor.vue
src/views/monitor/AddSqlMonitor.vue
+39
-0
SqlMonitorList.vue
src/views/monitor/SqlMonitorList.vue
+150
-0
AddTestDescription.vue
src/views/qa/AddTestDescription.vue
+0
-342
No files found.
src/api/sqlMonitor.js
0 → 100644
View file @
6ab0294b
import
holmesRequest
from
'
@/utils/holmesRequest
'
// 获取sql监控列表
export
function
getSqlMonitorList
(
queryInfo
)
{
return
holmesRequest
({
url
:
'
/monitor/task/list
'
,
method
:
'
get
'
,
params
:
queryInfo
})
}
// 新增sql监控
export
function
addSqlMonitor
(
data
)
{
return
holmesRequest
({
url
:
'
/monitor/task/add
'
,
method
:
'
post
'
,
data
})
}
// 编辑sql监控
export
function
editSqlMonitor
(
data
)
{
return
holmesRequest
({
url
:
'
/monitor/task/edit
'
,
method
:
'
post
'
,
data
})
}
// 删除sql监控
export
function
delSqlMonitor
(
data
)
{
return
holmesRequest
({
url
:
'
/monitor/task/delete
'
,
method
:
'
post
'
,
data
})
}
// 执行sql监控
export
function
executeSqlMonitor
(
data
)
{
return
holmesRequest
({
url
:
'
/monitor/task/execute
'
,
method
:
'
post
'
,
data
})
}
// 发送sql监控
export
function
sendTestSqlMonitor
(
data
)
{
return
holmesRequest
({
url
:
'
/monitor/task/test
'
,
method
:
'
post
'
,
data
})
}
// 获取数据源列表
export
function
getSqlMonitorData
(
queryInfo
)
{
return
holmesRequest
({
url
:
'
/monitor/ds/list
'
,
method
:
'
post
'
,
params
:
queryInfo
})
}
src/router/index.js
View file @
6ab0294b
...
...
@@ -61,7 +61,9 @@ import BindAddress from '../views/yxm/BindAddress'
import
TestDescription
from
'
../views/qa/TestDescription
'
// 新添加提测说明详情页面(2021-11-10)
import
DetailTestDescription
from
'
../views/qa/DetailTestDescription
'
// 新添加sql监控(2021-12-28)
import
SqlMonitorList
from
'
../views/monitor/SqlMonitorList
'
import
AddSqlMonitor
from
'
../views/monitor/AddSqlMonitor
'
const
originalPush
=
Router
.
prototype
.
push
Router
.
prototype
.
push
=
function
push
(
location
)
{
return
originalPush
.
call
(
this
,
location
).
catch
(
err
=>
err
)
...
...
@@ -319,6 +321,18 @@ const router = new Router({
path
:
'
/qa/detailTestDescription
'
,
name
:
DetailTestDescription
,
component
:
DetailTestDescription
},
// 添加sql监控列表页面(2021-12-28)
{
path
:
'
/monitor/sqlMonitorList
'
,
name
:
SqlMonitorList
,
component
:
SqlMonitorList
},
// 添加sql监控新增页面(2021-12-28)
{
path
:
'
/monitor/addSqlMonitor
'
,
name
:
AddSqlMonitor
,
component
:
AddSqlMonitor
}
]
}
...
...
src/views/layout/leftAside/menu.json
View file @
6ab0294b
...
...
@@ -268,6 +268,19 @@
},
{
"id"
:
9
,
"title"
:
"线上监控"
,
"icon"
:
"iconfont icon-quality"
,
"child"
:
[
{
"id"
:
1
,
"title"
:
"sql监控"
,
"icon"
:
"iconfont icon-explain"
,
"path"
:
"/monitor/sqlMonitorList"
}
]
},
{
"id"
:
10
,
"title"
:
"用户权限管理"
,
"icon"
:
"iconfont icon-mg-role"
,
"child"
:
[
...
...
src/views/monitor/AddSqlMonitor.vue
0 → 100644
View file @
6ab0294b
<
template
>
<div>
<el-card>
<el-form
ref=
"caseFormRef"
:model=
"caseForm"
label-width=
"90px"
>
<el-form-item
label=
"模块名称:"
style=
"width:200px"
>
<el-input
v-model=
"sqlMonitorForm.taskName"
placeholder=
"请输入监控名称"
></el-input>
</el-form-item>
<el-form-item
label=
"数据源"
>
<el-select
v-model=
"sqlMonitorForm.dsId"
placeholder=
"请选择数据源"
clearable
>
<el-option
v-for=
"item in dataSourceList"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
></el-option>
</el-select>
</el-form-item>
</el-form>
</el-card>
</div>
</
template
>
<
script
>
import
{
getSqlMonitorData
}
from
'
@/api/sqlMonitor
'
export
default
{
data
()
{
return
{
sqlMonitorForm
:
{},
dataSourceList
:
[]
}
},
created
()
{
this
.
getSqlMonitorDataSource
()
},
methods
:
{
// 获取数据源列表
getSqlMonitorDataSource
()
{
getSqlMonitorData
().
then
((
resp
)
=>
{
console
.
log
(
'
www
'
,
resp
)
})
}
}
}
</
script
>
src/views/monitor/SqlMonitorList.vue
0 → 100644
View file @
6ab0294b
<
template
>
<div>
<el-card>
<div>
服务名称:
<el-select
v-model=
"queryModuleInfo.serviceName"
placeholder=
"请选择服务名称"
filterable
clearable
>
<el-option
v-for=
"item in serviceList"
:key=
"item.name"
:label=
"item.name"
:value=
"item.name"
></el-option>
</el-select>
<el-input
v-model=
"queryModuleInfo.taskName"
clearable
placeholder=
"请输入监控名称"
style=
"width: 300px;"
>
</el-input>
<el-button
type=
"primary"
style=
"margin-left:10px"
icon=
"el-icon-search"
@
click=
"queryData"
>
查询
</el-button>
<el-button
type=
"primary"
style=
"margin-left:10px"
icon=
"el-icon-circle-plus"
@
click=
"addSqlMonitor"
v-permission=
"('monitor:sql:add')"
>
新增
</el-button>
</div>
<el-table
:data=
"sqlMonitorList"
border
style=
"width: 100%;margin-top:20px"
>
<el-table-column
type=
'index'
width=
"50px"
>
<template
slot-scope=
"scope"
>
<span>
{{
(
queryModuleInfo
.
pageNum
-
1
)
*
queryModuleInfo
.
pageSize
+
scope
.
$index
+
1
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"监控名称"
prop=
"taskName"
width=
"180px"
></el-table-column>
<el-table-column
label=
"执行策略"
prop=
"taskCron"
width=
"180px"
></el-table-column>
<el-table-column
label=
"sql"
width=
"150px"
>
<
template
slot-scope=
"scope"
>
<el-popover
placement=
"top-start"
title=
"sql"
width=
"50"
trigger=
"hover"
:content=
"scope.row.sql"
>
<div
slot=
"reference"
style=
"color:#409EFF"
>
SQL
</div>
</el-popover>
</
template
>
</el-table-column>
<el-table-column
label=
"服务名称"
prop=
"serviceName"
width=
"100px"
></el-table-column>
<el-table-column
label=
"数据源"
prop=
"dsName"
width=
"80px"
></el-table-column>
<el-table-column
label=
"负责人"
prop=
"owner"
width=
"80px"
></el-table-column>
<el-table-column
label=
"当前状态"
width=
"80px"
>
<
template
slot-scope=
"scope"
>
<p
v-if=
"scope.row.status===1"
>
启用
</p>
<p
v-if=
"scope.row.status===0"
>
禁用
</p>
</
template
>
</el-table-column>
<el-table-column
label=
"创建时间"
prop=
"createTime"
width=
"180px"
></el-table-column>
<el-table-column
label=
"操作"
>
<slot
slot-scope=
"scope"
>
<el-button
type=
"warning"
icon=
"el-icon-edit"
@
click=
"openEditDialog(scope.row)"
v-permission=
"('monitor:sql:edit')"
>
编辑
</el-button>
<el-button
type=
"success"
icon=
"el-icon-success"
@
click=
"openEditDialog(scope.row)"
v-permission=
"('monitor:sql:enable')"
style=
"margin-left:1px"
>
启用
</el-button>
<el-button
type=
"danger"
icon=
"el-icon-delete"
@
click=
"delSqlMonitor(scope.row)"
v-permission=
"('monitor:sql:del')"
style=
"margin-left:1px"
>
删除
</el-button>
</slot>
</el-table-column>
</el-table>
<el-pagination
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page.sync=
"queryModuleInfo.pageNum"
:page-size=
"queryModuleInfo.pageSize"
layout=
"total, prev, pager, next"
:total=
"totalNum"
>
</el-pagination>
</el-card>
</div>
</template>
<
script
>
import
{
getSqlMonitorList
,
delSqlMonitor
}
from
'
@/api/sqlMonitor
'
import
{
getGitProjectList
}
from
'
@/api/jira
'
export
default
{
data
()
{
return
{
queryModuleInfo
:
{
serviceName
:
''
,
taskName
:
''
,
pageNum
:
1
,
pageSize
:
10
},
totalNum
:
0
,
sqlMonitorList
:
[],
serviceList
:
[]
}
},
created
()
{
this
.
getSqlMonitorList
()
this
.
getServiceList
()
},
methods
:
{
// 获取sql监控列表
getSqlMonitorList
()
{
getSqlMonitorList
(
this
.
queryModuleInfo
).
then
((
resp
)
=>
{
this
.
sqlMonitorList
=
resp
.
data
.
data
.
list
this
.
totalNum
=
resp
.
data
.
data
.
total
// console.log('返回信息', resp)
})
},
// 查询按钮
queryData
()
{
this
.
getSqlMonitorList
()
},
// 添加按钮
addSqlMonitor
()
{
this
.
$router
.
push
({
path
:
`/monitor/addSqlMonitor`
})
},
// 获取服务列表
getServiceList
()
{
getGitProjectList
().
then
((
resp
)
=>
{
this
.
serviceList
=
resp
.
data
.
data
})
},
// 对话框方法
openMessage
(
message
,
confirmText
,
doit
)
{
this
.
$messageBox
.
confirm
(
message
,
'
确定
'
,
{
cancelButtonText
:
'
取消
'
,
confirmButtonText
:
confirmText
,
type
:
'
warning
'
})
.
then
(()
=>
{
doit
()
})
.
catch
(()
=>
{})
},
// 删除sql监控
delSqlMonitor
(
row
)
{
this
.
openMessage
(
'
您确定要删除吗?
'
,
'
删除
'
,
()
=>
{
delSqlMonitor
(
row
)
.
then
((
resp
)
=>
{
if
(
resp
.
data
.
businessCode
===
'
0000
'
)
{
this
.
$message
.
success
(
resp
.
data
.
msg
)
this
.
getSqlMonitorList
()
}
else
{
this
.
$message
.
error
(
resp
.
data
.
msg
)
}
})
.
catch
((
error
)
=>
{
this
.
$message
({
type
:
'
error
'
,
message
:
error
})
})
})
},
handleSizeChange
(
newSize
)
{
this
.
queryModuleInfo
.
pageSize
=
newSize
this
.
getSqlMonitorList
()
},
handleCurrentChange
(
newPage
)
{
this
.
queryModuleInfo
.
pageNum
=
newPage
this
.
getSqlMonitorList
()
}
}
}
</
script
>
<
style
lang=
"less"
scoped
>
.el-select {
margin-right: 20px;
}
</
style
>
src/views/qa/AddTestDescription.vue
deleted
100644 → 0
View file @
572b3595
This diff is collapsed.
Click to expand it.
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