修改缓存管理
This commit is contained in:
parent
4d8ede82b7
commit
ae62676c5e
@ -29,3 +29,30 @@ export function getCacheValue(params?) {
|
||||
params
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @description: 删除缓存名称
|
||||
*/
|
||||
export function deleteCacheName(cacheName) {
|
||||
return http.request({
|
||||
url: '/cache/deleteCacheName/'+cacheName,
|
||||
method: 'DELETE',
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @description: 删除缓存key
|
||||
*/
|
||||
export function deleteCacheKey(cacheKey) {
|
||||
return http.request({
|
||||
url: '/cache/deleteCacheKey/'+cacheKey,
|
||||
method: 'DELETE',
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @description: 清理全部
|
||||
*/
|
||||
export function deleteCacheAll() {
|
||||
return http.request({
|
||||
url: '/cache/deleteCacheAll',
|
||||
method: 'DELETE',
|
||||
});
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<PageWrapper>
|
||||
<div class="cache-box">
|
||||
<el-card :bordered="false" header="缓存列表">
|
||||
<el-card header="缓存列表">
|
||||
<el-table empty-text="暂无数据" border :height="fwbHeight" :data="cacheNameData" row-key="cacheName"
|
||||
ref="cacheNameTable" highlight-current-row @row-click="onCheckedCacheName">
|
||||
<el-table-column type="index" width="80" align="center" label="序号"></el-table-column>
|
||||
@ -10,24 +10,30 @@
|
||||
<el-table-column show-overflow-tooltip align="center" label="备注" prop="message"></el-table-column>
|
||||
<el-table-column align="center" label="操作" width="60" fixed="right">
|
||||
<template #default="{ row}">
|
||||
<el-icon :color="`var(--el-color-danger)`" size="16" @click.stop="handleDelete(row)" style="cursor: pointer;"><Delete /></el-icon>
|
||||
<el-icon :color="`var(--el-color-danger)`" size="16" @click.stop="handleDelete(row,'cacheName')" style="cursor: pointer;"><Delete /></el-icon>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<el-card :bordered="false" header="键名列表">
|
||||
<el-card header="键名列表">
|
||||
<el-table empty-text="暂无数据" border :height="fwbHeight" :data="cacheKeyData" row-key="cacheKey"
|
||||
ref="cacheKeyTable" highlight-current-row @row-click="onCheckedCachKey">
|
||||
<el-table-column type="index" width="80" align="center" label="序号"></el-table-column>
|
||||
<el-table-column show-overflow-tooltip align="center" label="缓存键名" prop="cacheKey" min-width="100"></el-table-column>
|
||||
<el-table-column align="center" label="操作" width="60" fixed="right">
|
||||
<template #default="{ row}">
|
||||
<el-icon :color="`var(--el-color-danger)`" size="16" @click.stop="handleDelete(row)" style="cursor: pointer;"><Delete /></el-icon>
|
||||
<el-icon :color="`var(--el-color-danger)`" size="16" @click.stop="handleDelete(row,'cacheKey')" style="cursor: pointer;"><Delete /></el-icon>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<el-card :bordered="false" header="缓存内容">
|
||||
<el-card>
|
||||
<template #header>
|
||||
<div class="clearfix">
|
||||
<span>缓存内容</span>
|
||||
<el-button @click="clearAll" style="float: right; padding: 3px 0" type="text"><el-icon><RefreshRight/></el-icon>清理全部</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<el-form ref="form" :model="formData" label-width="80px" label-position="top" v-if="cacheKeyData.length > 0">
|
||||
<el-form-item label="缓存名称:">
|
||||
<el-input v-model="formData.cacheName"></el-input>
|
||||
@ -47,7 +53,7 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted,nextTick,reactive } from 'vue';
|
||||
import { getCacheNames, getCacheKeys, getCacheValue } from '@/api/monitor/caches';
|
||||
import { getCacheNames, getCacheKeys, getCacheValue,deleteCacheName,deleteCacheKey,deleteCacheAll } from '@/api/monitor/caches';
|
||||
import { message, confirm } from "@/utils/auth";
|
||||
|
||||
const cacheNameTable = ref()
|
||||
@ -114,11 +120,19 @@ const loadCacheValue = async () => {
|
||||
}
|
||||
}
|
||||
}
|
||||
const handleDelete = async(row)=> {
|
||||
const handleDelete = async(row,type)=> {
|
||||
await confirm('确定要删除?');
|
||||
// await onlineOut(row.tokenId)
|
||||
if(type=='cacheName') {
|
||||
await deleteCacheName(row.cacheName)
|
||||
}else {
|
||||
await deleteCacheKey(row.cacheKey)
|
||||
}
|
||||
message("删除成功");
|
||||
// loadTable()
|
||||
}
|
||||
const clearAll = async()=> {
|
||||
await confirm('确定要清理全部?');
|
||||
await deleteCacheAll()
|
||||
loadCacheNames()
|
||||
}
|
||||
onMounted(() => {
|
||||
loadCacheNames()
|
||||
|
@ -1,13 +1,13 @@
|
||||
<template>
|
||||
<PageWrapper>
|
||||
<div class="serverInfo-box">
|
||||
<el-card :bordered="false" header="CPU">
|
||||
<el-card header="CPU">
|
||||
<el-table empty-text="暂无数据" :data="formData.cpuInfo">
|
||||
<el-table-column show-overflow-tooltip align="center" width="250" label="属性" prop="name"></el-table-column>
|
||||
<el-table-column show-overflow-tooltip align="center" label="值" prop="value"></el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<el-card :bordered="false" header="内存">
|
||||
<el-card header="内存">
|
||||
<el-table empty-text="暂无数据" :data="formData.memoryInfo">
|
||||
<el-table-column show-overflow-tooltip align="center" label="属性" prop="name"></el-table-column>
|
||||
<el-table-column show-overflow-tooltip align="center" label="内存" prop="value1"></el-table-column>
|
||||
@ -15,7 +15,7 @@
|
||||
</el-table>
|
||||
</el-card>
|
||||
</div>
|
||||
<el-card :bordered="false" header="服务器信息">
|
||||
<el-card header="服务器信息">
|
||||
<el-table :data="tabledata" :show-header="false">
|
||||
<el-table-column width="250" align="center">服务器名称</el-table-column>
|
||||
<el-table-column>{{formData.systemInfo.computerName}}</el-table-column>
|
||||
@ -29,7 +29,7 @@
|
||||
<el-table-column align="center">{{formData.systemInfo.osArch}}</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<el-card :bordered="false" header="Java虚拟机信息" style="margin:20px 0;">
|
||||
<el-card header="Java虚拟机信息" style="margin:20px 0;">
|
||||
<el-table :data="tabledata" :show-header="false">
|
||||
<el-table-column width="250" align="center">Java名称</el-table-column>
|
||||
<el-table-column>{{formData.jvmInfo.name}}</el-table-column>
|
||||
@ -55,7 +55,7 @@
|
||||
<el-table-column>{{formData.jvmInfo.inputArgs}}</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<el-card :bordered="false" header="磁盘状态">
|
||||
<el-card header="磁盘状态">
|
||||
<el-table empty-text="暂无数据" :data="formData.diskInfo">
|
||||
<el-table-column show-overflow-tooltip align="center" label="盘符路径" prop="dirName"></el-table-column>
|
||||
<el-table-column show-overflow-tooltip align="center" label="文件系统" prop="sysTypeName"></el-table-column>
|
||||
|
Loading…
Reference in New Issue
Block a user