refactor(token): 优化Token管理界面和重构工作流
This commit is contained in:
@@ -4,11 +4,18 @@ import {ref, watch} from 'vue'
|
||||
import axios from "@/axios.ts";
|
||||
import {useRoute} from "vue-router"
|
||||
|
||||
interface optionsType {
|
||||
value: string
|
||||
}
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
const result = ref()
|
||||
const value = ref('')
|
||||
const options = ref([] as optionsType[])
|
||||
value.value = useCounterStore().token
|
||||
const deleteSpecifyRedisVisible = ref(false)
|
||||
const inputSpecifyRedis = ref('')
|
||||
|
||||
|
||||
const getInfo = () => {
|
||||
if (value.value != '') {
|
||||
@@ -53,12 +60,6 @@ watch(value, (newValue) => {
|
||||
getInfo()
|
||||
})
|
||||
|
||||
interface optionsType {
|
||||
value: string
|
||||
}
|
||||
|
||||
const options = ref([] as optionsType[])
|
||||
value.value = useCounterStore().token
|
||||
|
||||
axios.get('/api/token').then(res => {
|
||||
if (res.status == 200) {
|
||||
@@ -68,9 +69,6 @@ axios.get('/api/token').then(res => {
|
||||
}
|
||||
})
|
||||
|
||||
const deleteSpecifyRedisVisible = ref(false)
|
||||
const inputSpecifyRedis = ref('')
|
||||
|
||||
const deleteSpecifyRedis = () => {
|
||||
axios.delete('/api/token/info', {
|
||||
params: {
|
||||
@@ -110,8 +108,8 @@ const deleteSpecifyRedis = () => {
|
||||
>
|
||||
<el-descriptions-item label="去重对象">{{ result?.dedup_object }}</el-descriptions-item>
|
||||
<el-descriptions-item label="上传数据格式">{{ result?.data_format }}</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-item label="去重参考值数量">{{ result?.dedup_items_number }}</el-descriptions-item>
|
||||
<el-descriptions-item label="原始数据数量">{{ result?.cache_list_number }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<p><b>管理</b></p>
|
||||
|
@@ -6,13 +6,16 @@ import {useCounterStore} from "@/stores/counter.ts";
|
||||
import {useRouter} from "vue-router";
|
||||
|
||||
const tableData = ref([])
|
||||
|
||||
axios.get("/api/token").then(res => {
|
||||
tableData.value = res.data.result
|
||||
})
|
||||
|
||||
const input = ref('')
|
||||
const value = ref('')
|
||||
const dataFormat = ref('')
|
||||
const inputPassWord = ref('')
|
||||
const router = useRouter()
|
||||
var rowOut: any
|
||||
const dedupObjectVisible = ref(false)
|
||||
const dataFormatVisible = ref(false)
|
||||
const inputNotes = ref("")
|
||||
const NotesVisible = ref(false)
|
||||
const options = [
|
||||
{
|
||||
value: 'uid',
|
||||
@@ -31,7 +34,6 @@ const options = [
|
||||
}
|
||||
]
|
||||
|
||||
const dataFormat = ref('')
|
||||
const dataFormatOptions = [
|
||||
{
|
||||
value: 'uid----secid----pid----comment_id',
|
||||
@@ -40,6 +42,11 @@ const dataFormatOptions = [
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
axios.get("/api/token").then(res => {
|
||||
tableData.value = res.data.result
|
||||
})
|
||||
|
||||
const addToken = () => {
|
||||
axios.post('/api/token', {}, {
|
||||
params: {
|
||||
@@ -63,8 +70,6 @@ const addToken = () => {
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
const router = useRouter()
|
||||
const viewDetails = (row: any) => {
|
||||
useCounterStore().token = row.token
|
||||
router.push({
|
||||
@@ -72,13 +77,11 @@ const viewDetails = (row: any) => {
|
||||
})
|
||||
}
|
||||
|
||||
var rowOut: any
|
||||
|
||||
const dedupObjectVisible = ref(false)
|
||||
const dialogDedupObjectVisible = (row: any) => {
|
||||
rowOut = row
|
||||
dedupObjectVisible.value = true
|
||||
}
|
||||
|
||||
const updateDedupObject = () => {
|
||||
dedupObjectVisible.value = false
|
||||
axios.put('/api/token', {}, {
|
||||
@@ -103,11 +106,11 @@ const updateDedupObject = () => {
|
||||
})
|
||||
}
|
||||
|
||||
const dataFormatVisible = ref(false)
|
||||
const dialogDataFormatVisible = (row: any) => {
|
||||
rowOut = row
|
||||
dataFormatVisible.value = true
|
||||
}
|
||||
|
||||
const updateDataFormat = () => {
|
||||
dataFormatVisible.value = false
|
||||
axios.put('/api/token', {}, {
|
||||
@@ -132,12 +135,11 @@ const updateDataFormat = () => {
|
||||
})
|
||||
}
|
||||
|
||||
const inputNotes = ref("")
|
||||
const NotesVisible = ref(false)
|
||||
const dialogNotesVisible = (row: any) => {
|
||||
rowOut = row
|
||||
NotesVisible.value = true
|
||||
}
|
||||
|
||||
const updateNotes = () => {
|
||||
NotesVisible.value = false
|
||||
axios.put('/api/token', {}, {
|
||||
@@ -182,7 +184,6 @@ const deleteToken = (row: any) => {
|
||||
})
|
||||
}
|
||||
|
||||
const inputPassWord = ref('')
|
||||
const checkPassword = () => {
|
||||
if (inputPassWord.value == "haha") {
|
||||
ElMessage({
|
||||
|
Reference in New Issue
Block a user