refactor(token): 优化Token管理界面和重构工作流

This commit is contained in:
2025-09-11 22:47:08 +08:00
parent f883b0a7d8
commit 5e3c0762ab
5 changed files with 29 additions and 30 deletions

View File

@@ -2,7 +2,7 @@ name: 构建上传工具
on: [ push ] on: [ push ]
jobs: jobs:
build: build-tool:
env: env:
RUNNER_TOOL_CACHE: /toolcache RUNNER_TOOL_CACHE: /toolcache
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@@ -2,7 +2,7 @@ name: 部署开发环境
on: [ push ] on: [ push ]
jobs: jobs:
build-and-deploy: deploy-dev:
env: env:
RUNNER_TOOL_CACHE: /toolcache RUNNER_TOOL_CACHE: /toolcache
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@@ -3,7 +3,7 @@ on:
workflow_dispatch: workflow_dispatch:
jobs: jobs:
build-and-deploy: deploy-production:
env: env:
RUNNER_TOOL_CACHE: /toolcache RUNNER_TOOL_CACHE: /toolcache
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@@ -4,11 +4,18 @@ import {ref, watch} from 'vue'
import axios from "@/axios.ts"; import axios from "@/axios.ts";
import {useRoute} from "vue-router" import {useRoute} from "vue-router"
interface optionsType {
value: string
}
const route = useRoute() const route = useRoute()
const result = ref() const result = ref()
const value = ref('') const value = ref('')
const options = ref([] as optionsType[])
value.value = useCounterStore().token
const deleteSpecifyRedisVisible = ref(false)
const inputSpecifyRedis = ref('')
const getInfo = () => { const getInfo = () => {
if (value.value != '') { if (value.value != '') {
@@ -53,12 +60,6 @@ watch(value, (newValue) => {
getInfo() getInfo()
}) })
interface optionsType {
value: string
}
const options = ref([] as optionsType[])
value.value = useCounterStore().token
axios.get('/api/token').then(res => { axios.get('/api/token').then(res => {
if (res.status == 200) { if (res.status == 200) {
@@ -68,9 +69,6 @@ axios.get('/api/token').then(res => {
} }
}) })
const deleteSpecifyRedisVisible = ref(false)
const inputSpecifyRedis = ref('')
const deleteSpecifyRedis = () => { const deleteSpecifyRedis = () => {
axios.delete('/api/token/info', { axios.delete('/api/token/info', {
params: { params: {
@@ -110,8 +108,8 @@ const deleteSpecifyRedis = () => {
> >
<el-descriptions-item label="去重对象">{{ result?.dedup_object }}</el-descriptions-item> <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?.data_format }}</el-descriptions-item>
<el-descriptions-item label="去重记录值">{{ result?.dedup_items_number }}</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?.cache_list_number }}</el-descriptions-item>
</el-descriptions> </el-descriptions>
<p><b>管理</b></p> <p><b>管理</b></p>

View File

@@ -6,13 +6,16 @@ import {useCounterStore} from "@/stores/counter.ts";
import {useRouter} from "vue-router"; import {useRouter} from "vue-router";
const tableData = ref([]) const tableData = ref([])
axios.get("/api/token").then(res => {
tableData.value = res.data.result
})
const input = ref('') const input = ref('')
const value = 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 = [ const options = [
{ {
value: 'uid', value: 'uid',
@@ -31,7 +34,6 @@ const options = [
} }
] ]
const dataFormat = ref('')
const dataFormatOptions = [ const dataFormatOptions = [
{ {
value: 'uid----secid----pid----comment_id', 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 = () => { const addToken = () => {
axios.post('/api/token', {}, { axios.post('/api/token', {}, {
params: { params: {
@@ -63,8 +70,6 @@ const addToken = () => {
}) })
} }
const router = useRouter()
const viewDetails = (row: any) => { const viewDetails = (row: any) => {
useCounterStore().token = row.token useCounterStore().token = row.token
router.push({ router.push({
@@ -72,13 +77,11 @@ const viewDetails = (row: any) => {
}) })
} }
var rowOut: any
const dedupObjectVisible = ref(false)
const dialogDedupObjectVisible = (row: any) => { const dialogDedupObjectVisible = (row: any) => {
rowOut = row rowOut = row
dedupObjectVisible.value = true dedupObjectVisible.value = true
} }
const updateDedupObject = () => { const updateDedupObject = () => {
dedupObjectVisible.value = false dedupObjectVisible.value = false
axios.put('/api/token', {}, { axios.put('/api/token', {}, {
@@ -103,11 +106,11 @@ const updateDedupObject = () => {
}) })
} }
const dataFormatVisible = ref(false)
const dialogDataFormatVisible = (row: any) => { const dialogDataFormatVisible = (row: any) => {
rowOut = row rowOut = row
dataFormatVisible.value = true dataFormatVisible.value = true
} }
const updateDataFormat = () => { const updateDataFormat = () => {
dataFormatVisible.value = false dataFormatVisible.value = false
axios.put('/api/token', {}, { axios.put('/api/token', {}, {
@@ -132,12 +135,11 @@ const updateDataFormat = () => {
}) })
} }
const inputNotes = ref("")
const NotesVisible = ref(false)
const dialogNotesVisible = (row: any) => { const dialogNotesVisible = (row: any) => {
rowOut = row rowOut = row
NotesVisible.value = true NotesVisible.value = true
} }
const updateNotes = () => { const updateNotes = () => {
NotesVisible.value = false NotesVisible.value = false
axios.put('/api/token', {}, { axios.put('/api/token', {}, {
@@ -182,7 +184,6 @@ const deleteToken = (row: any) => {
}) })
} }
const inputPassWord = ref('')
const checkPassword = () => { const checkPassword = () => {
if (inputPassWord.value == "haha") { if (inputPassWord.value == "haha") {
ElMessage({ ElMessage({