Commit 39b07fea authored by 黎博's avatar 黎博

新增清除缓存页面

parent 4e6101fb
import request from '@/utils/request' import request from '@/utils/request'
import holmesRequest from '@/utils/holmesRequest'
export function kdspDecrypt(queryInfo) { export function kdspDecrypt(queryInfo) {
return request({ return request({
...@@ -38,3 +39,19 @@ export function getLoginInfoList(queryInfo) { ...@@ -38,3 +39,19 @@ export function getLoginInfoList(queryInfo) {
params: queryInfo params: queryInfo
}) })
} }
export function getClearCacheList(queryInfo) {
return holmesRequest({
url: '/effect/cacheList',
method: 'get',
params: queryInfo
})
}
export function clearCache(queryInfo) {
return holmesRequest({
url: '/effect/clearcache',
method: 'get',
params: queryInfo
})
}
...@@ -16,6 +16,7 @@ import JenkinsBuildInfo from '../views/effect/JenkinsBuildInfo' ...@@ -16,6 +16,7 @@ import JenkinsBuildInfo from '../views/effect/JenkinsBuildInfo'
import LoginWhiteList from '../views/effect/LoginWhiteList' import LoginWhiteList from '../views/effect/LoginWhiteList'
import JiraNotify from '../views/jira/Notify' import JiraNotify from '../views/jira/Notify'
import RiskControl from '../views/vcc/RiskControl' import RiskControl from '../views/vcc/RiskControl'
import ClearCache from '../views/effect/ClearCache'
Vue.use(Router) Vue.use(Router)
...@@ -86,6 +87,10 @@ const router = new Router({ ...@@ -86,6 +87,10 @@ const router = new Router({
{ {
'path': '/vcc/risk', 'path': '/vcc/risk',
component: RiskControl component: RiskControl
},
{
'path': '/effect/clearcache',
component: ClearCache
} }
] ]
} }
......
<template>
<div>
<el-table :data="cacheList" border style="width: 100%">
<el-table-column type="index" width="50"></el-table-column>
<el-table-column prop="name" label="描述" width="180">
</el-table-column>
<el-table-column prop="url" label="地址" width="500">
</el-table-column>
<el-table-column label="操作">
<slot slot-scope="scope">
<el-button type="primary" @click="clearCache(scope.row)">清除缓存</el-button>
</slot>
</el-table-column>
</el-table>
<!-- <div class="result">清除结果:{{ clearResult }}</div> -->
</div>
</template>
<script>
import { getClearCacheList, clearCache } from '@/api/effect'
export default {
data() {
return {
getCacheListParam: {
pageNum: 1,
pageSize: 10
},
cacheList: [],
clearCacheParams: {
id: '',
namespace: window.sessionStorage.getItem('env')
},
clearResult: ''
}
},
created() {
this.getCacheList()
},
methods: {
getCacheList() {
getClearCacheList(this.getCacheListParam).then((resp) => {
this.cacheList = resp.data.data
})
},
clearCache(row) {
this.clearCacheParams.id = row.id
clearCache(this.clearCacheParams).then((resp) => {
this.clearResult = resp.data.data
if (resp.data.data.code === '0000') {
this.$message.success('缓存清除成功!')
} else {
this.$message.error('缓存清除失败!')
}
})
}
}
}
</script>
<style lang="less" scoped>
.result {
margin-top: 20px;
}
</style>
...@@ -91,6 +91,12 @@ ...@@ -91,6 +91,12 @@
"title": "jira-钉钉通知", "title": "jira-钉钉通知",
"icon": "el-icon-ice-tea", "icon": "el-icon-ice-tea",
"path": "/effect/jira/notify" "path": "/effect/jira/notify"
},
{
"id": 5,
"title": "缓存清理",
"icon": "el-icon-milk-tea",
"path": "/effect/clearcache"
} }
] ]
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment