feat: 合并Gin_Vue
This commit is contained in:
21
src/views/monitor/cache/index.vue
vendored
21
src/views/monitor/cache/index.vue
vendored
@@ -13,6 +13,7 @@ import { PageContainer } from '@ant-design-vue/pro-layout';
|
||||
import { ColumnsType } from 'ant-design-vue/lib/table/Table';
|
||||
import { message } from 'ant-design-vue/lib';
|
||||
import { hasPermissions } from '@/plugins/auth-user';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
const route = useRoute();
|
||||
|
||||
/**路由标题 */
|
||||
@@ -43,7 +44,7 @@ function fnCacheKeyInfo(cacheKey: string) {
|
||||
cacheKeyInfo.loading = true;
|
||||
getCacheValue(cacheKeyTable.cacheName, cacheKey).then(res => {
|
||||
isClick.value = false;
|
||||
if (res.code === 200) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
cacheKeyInfo.data = Object.assign(cacheKeyInfo.data, res.data);
|
||||
cacheKeyInfo.loading = false;
|
||||
}
|
||||
@@ -106,7 +107,7 @@ function fnCacheKeyClear(cacheKey: string) {
|
||||
clearCacheKey(cacheKeyTable.cacheName, cacheKey).then(res => {
|
||||
hide();
|
||||
isClick.value = false;
|
||||
if (res.code === 200) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `已删除缓存键名 ${cacheKey}`,
|
||||
duration: 3,
|
||||
@@ -139,7 +140,7 @@ function fnCacheKeyList(cacheName: string = 'load') {
|
||||
cacheKeyTable.loading = true;
|
||||
listCacheKey(cacheName).then(res => {
|
||||
isClick.value = false;
|
||||
if (res.code === 200 && res.data) {
|
||||
if (res.code === RESULT_CODE_SUCCESS && res.data) {
|
||||
cacheKeyTable.cacheName = cacheName;
|
||||
cacheKeyTable.data = res.data;
|
||||
cacheKeyTable.loading = false;
|
||||
@@ -204,7 +205,7 @@ function fnClearCacheSafe() {
|
||||
clearCacheSafe().then(res => {
|
||||
hide();
|
||||
isClick.value = false;
|
||||
if (res.code === 200) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: '已完成安全清理缓存',
|
||||
duration: 3,
|
||||
@@ -231,7 +232,7 @@ function fnCacheNameClear(cacheName: string) {
|
||||
clearCacheName(cacheName).then(res => {
|
||||
hide();
|
||||
isClick.value = false;
|
||||
if (res.code === 200) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `已清理缓存名称 ${cacheName}`,
|
||||
duration: 3,
|
||||
@@ -257,7 +258,7 @@ function fnCacheNameList() {
|
||||
cacheNameTable.loading = true;
|
||||
listCacheName().then(res => {
|
||||
isClick.value = false;
|
||||
if (res.code === 200 && res.data) {
|
||||
if (res.code === RESULT_CODE_SUCCESS && res.data) {
|
||||
cacheNameTable.data = res.data;
|
||||
cacheNameTable.loading = false;
|
||||
}
|
||||
@@ -316,11 +317,12 @@ onMounted(() => {
|
||||
:columns="cacheNameTableColumns"
|
||||
:data-source="cacheNameTable.data"
|
||||
:loading="cacheNameTable.loading"
|
||||
:scroll="{ y: 1200 }"
|
||||
:pagination="false"
|
||||
:row-selection="{
|
||||
type: 'radio',
|
||||
onChange: (selectedRowKeys: (string|number)[]) => fnCacheKeyList(selectedRowKeys[0] as string),
|
||||
}"
|
||||
:pagination="false"
|
||||
>
|
||||
<template
|
||||
#customFilterDropdown="{
|
||||
@@ -337,7 +339,7 @@ onMounted(() => {
|
||||
:value="selectedKeys[0]"
|
||||
style="width: 188px; margin-bottom: 8px; display: block"
|
||||
@change="
|
||||
(e:any) => setSelectedKeys(e.target.value ? [e.target.value] : [])
|
||||
(e:any)=> setSelectedKeys(e.target.value ? [e.target.value] : [])
|
||||
"
|
||||
@pressEnter="confirm()"
|
||||
/>
|
||||
@@ -397,11 +399,12 @@ onMounted(() => {
|
||||
:columns="cacheKeyTableColumns"
|
||||
:data-source="cacheKeyTable.data"
|
||||
:loading="cacheKeyTable.loading"
|
||||
:scroll="{ y: 1200 }"
|
||||
:pagination="false"
|
||||
:row-selection="{
|
||||
type: 'radio',
|
||||
onChange: (selectedRowKeys: (string|number)[]) => fnCacheKeyInfo(selectedRowKeys[0] as string),
|
||||
}"
|
||||
:pagination="false"
|
||||
>
|
||||
<template
|
||||
#customFilterDropdown="{
|
||||
|
||||
3
src/views/monitor/cache/info.vue
vendored
3
src/views/monitor/cache/info.vue
vendored
@@ -15,6 +15,7 @@ import { PageContainer } from '@ant-design-vue/pro-layout';
|
||||
import { getCache } from '@/api/monitor/cache';
|
||||
import { reactive, ref, onMounted } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
const route = useRoute();
|
||||
|
||||
echarts.use([
|
||||
@@ -136,7 +137,7 @@ function commandStatsChart() {
|
||||
onMounted(() => {
|
||||
getCache()
|
||||
.then(res => {
|
||||
if (res.code === 200 && res.data) {
|
||||
if (res.code === RESULT_CODE_SUCCESS && res.data) {
|
||||
cache.info = res.data.info;
|
||||
cache.dbSize = res.data.dbSize;
|
||||
cache.commandStats = res.data.commandStats;
|
||||
|
||||
Reference in New Issue
Block a user