fix(Redis监控): fix review

This commit is contained in:
luowenfeng
2022-07-08 11:47:02 +08:00
parent a8ebc56472
commit c0b1f62afd
4 changed files with 58 additions and 32 deletions

View File

@ -17,9 +17,9 @@ export function getKeyList() {
}
// 获取键名列表
export function getKeyDefineKeys(keyDefine) {
export function getKeyDefines(keyDefine) {
return request({
url: '/infra/redis/get-key/' + keyDefine,
url: '/infra/redis/get-key-Defines?keyDefine=' + keyDefine,
method: 'get'
})
}
@ -27,15 +27,15 @@ export function getKeyDefineKeys(keyDefine) {
// 获取缓存内容
export function getKeyValue(keyDefine, key) {
return request({
url: '/infra/redis/get-key/' + keyDefine + "/" + key,
url: '/infra/redis/get-key-value?keyDefine=' + keyDefine + "&cacheKey=" + key,
method: 'get'
})
}
// 根据键名删除缓存
export function clearCacheKey(key) {
export function deleteKeyValue(key) {
return request({
url: '/infra/redis/clear-key/' + key,
url: '/infra/redis/delete-key-value?cacheKey=' + key,
method: 'delete'
})
}

View File

@ -188,7 +188,7 @@
</template>
<script>
import { getCache, getKeyList, getKeyDefineKeys, getKeyValue, clearCacheKey } from "@/api/infra/redis";
import { getCache, getKeyList, getKeyDefines, getKeyValue, deleteKeyValue } from "@/api/infra/redis";
import echarts from "echarts";
export default {
@ -303,7 +303,7 @@ export default {
// 获取键名列表
handleCacheKeys (keyDefine){
const cacheName = keyDefine !== undefined ? keyDefine : this.keyTemplate;
getKeyDefineKeys(cacheName).then(response => {
getKeyDefines(cacheName).then(response => {
this.cachekeys = response.data
this.cacheForm = {}
})
@ -324,7 +324,7 @@ export default {
// 删除缓存
handleClearCacheKey(key){
clearCacheKey(key).then(response =>{
deleteKeyValue(key).then(response =>{
this.$modal.msgSuccess("清理缓存键名[" + key + "]成功");
this.handleCacheKeys();
})