feat: 首次提交,添加Web界面和Redis支持的数据管理系统
This commit is contained in:
62
web/src/views/TokenDetailView.vue
Normal file
62
web/src/views/TokenDetailView.vue
Normal file
@@ -0,0 +1,62 @@
|
||||
<script setup lang="ts">
|
||||
import {useCounterStore} from "@/stores/counter.ts";
|
||||
import {ref} from 'vue'
|
||||
import axios from "@/axios.ts";
|
||||
|
||||
const result = ref()
|
||||
|
||||
const getInfo = () => {
|
||||
axios.get('/api/token/info', {
|
||||
params: {
|
||||
token: useCounterStore().token
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.status == 200) {
|
||||
result.value = res.data.result
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const deleteDedup = () => {
|
||||
axios.delete('/api/token/info', {
|
||||
params: {
|
||||
token: useCounterStore().token,
|
||||
dedup_bf: true
|
||||
}
|
||||
})
|
||||
}
|
||||
const deleteRedis = () => {
|
||||
axios.delete('/api/token/info', {
|
||||
params: {
|
||||
token: useCounterStore().token,
|
||||
cache_list: true
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
getInfo()
|
||||
setInterval(getInfo, 5000)
|
||||
</script>
|
||||
|
||||
|
||||
<template>
|
||||
<p>当前Token:{{ useCounterStore().token }}</p>
|
||||
<el-button type="danger" @click="deleteDedup">删除去重记录值</el-button>
|
||||
<el-button type="danger" @click="deleteRedis">删除Redis数据</el-button>
|
||||
<el-divider/>
|
||||
<el-button type="primary" @click="getInfo">手动刷新</el-button>
|
||||
<el-descriptions
|
||||
:title="'Token信息 - ' + useCounterStore().token+'(每5秒刷新)'"
|
||||
direction="vertical"
|
||||
:column="4"
|
||||
border
|
||||
>
|
||||
<el-descriptions-item label="去重对象">{{ result?.dedup_object }}</el-descriptions-item>
|
||||
<el-descriptions-item label="去重记录值">{{ result?.dedup_items_number }}</el-descriptions-item>
|
||||
<el-descriptions-item label="Redis中数据条数">{{ result?.cache_list_number }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
Reference in New Issue
Block a user