修复检测
This commit is contained in:
parent
1bed46e11b
commit
26b5e94023
@ -59,6 +59,14 @@ export function setAccountPoolUnavailable(module, data) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function updateAccountPoolUsable(module, data) {
|
||||||
|
return request({
|
||||||
|
url: `${base(module)}/updateUsable`,
|
||||||
|
method: 'post',
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
export function updateAccountPoolPlatform(module, data) {
|
export function updateAccountPoolPlatform(module, data) {
|
||||||
return request({
|
return request({
|
||||||
url: `${base(module)}/updatePlatform`,
|
url: `${base(module)}/updatePlatform`,
|
||||||
|
|||||||
@ -14,7 +14,6 @@
|
|||||||
|
|
||||||
<!-- 菜单主体 -->
|
<!-- 菜单主体 -->
|
||||||
<el-menu
|
<el-menu
|
||||||
v-else
|
|
||||||
:collapse="isCollapse"
|
:collapse="isCollapse"
|
||||||
:collapse-transition="false"
|
:collapse-transition="false"
|
||||||
:background-color="asideBgColor"
|
:background-color="asideBgColor"
|
||||||
@ -23,6 +22,7 @@
|
|||||||
:active-background-color="activeBgColor"
|
:active-background-color="activeBgColor"
|
||||||
class="el-menu-vertical-demo"
|
class="el-menu-vertical-demo"
|
||||||
:unique-opened="true"
|
:unique-opened="true"
|
||||||
|
:default-openeds="defaultOpeneds"
|
||||||
@select="handleMenuSelect"
|
@select="handleMenuSelect"
|
||||||
:default-active="route.path"
|
:default-active="route.path"
|
||||||
>
|
>
|
||||||
@ -284,10 +284,29 @@ const currentModule = computed(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const displayMenus = computed(() => {
|
const displayMenus = computed(() => {
|
||||||
// 侧边栏始终展示完整菜单树,不随当前路由切换为“子菜单视图”
|
// 侧边栏始终展示完整菜单树,不随当前路由切换为"子菜单视图"
|
||||||
return list.value;
|
return list.value;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const findOpenMenuPaths = (menus, targetPath, ancestors = []) => {
|
||||||
|
for (const menu of menus) {
|
||||||
|
const currentPath = menu.path || menu.id.toString();
|
||||||
|
if (menu.path && (targetPath === menu.path || targetPath.startsWith(menu.path + "/"))) {
|
||||||
|
return [...ancestors, currentPath];
|
||||||
|
}
|
||||||
|
if (menu.children && menu.children.length > 0) {
|
||||||
|
const found = findOpenMenuPaths(menu.children, targetPath, [...ancestors, currentPath]);
|
||||||
|
if (found) return found;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
|
const defaultOpeneds = computed(() => {
|
||||||
|
const result = findOpenMenuPaths(displayMenus.value, route.path);
|
||||||
|
return result || [];
|
||||||
|
});
|
||||||
|
|
||||||
const asideTitle = computed(() => {
|
const asideTitle = computed(() => {
|
||||||
if (isCollapse.value) return "管理";
|
if (isCollapse.value) return "管理";
|
||||||
return "菜单";
|
return "菜单";
|
||||||
@ -311,7 +330,7 @@ const processMenus = (menus) => {
|
|||||||
.map((menu) => ({
|
.map((menu) => ({
|
||||||
id: menu.id,
|
id: menu.id,
|
||||||
path: menu.path,
|
path: menu.path,
|
||||||
icon: menu.icon || "Document",
|
icon: menu.icon || null,
|
||||||
title: menu.title,
|
title: menu.title,
|
||||||
route: menu.path,
|
route: menu.path,
|
||||||
component_path: menu.component_path,
|
component_path: menu.component_path,
|
||||||
@ -541,13 +560,13 @@ h3 {
|
|||||||
// 高亮样式
|
// 高亮样式
|
||||||
.el-menu-item.is-active {
|
.el-menu-item.is-active {
|
||||||
html:not(.dark) & {
|
html:not(.dark) & {
|
||||||
background-color: rgba(57, 115, 255, 0.3) !important;
|
background-color: rgba(255, 255, 255, 0.2) !important;
|
||||||
|
border-left: 3px solid #ffffff;
|
||||||
}
|
}
|
||||||
html.dark & {
|
html.dark & {
|
||||||
background-color: rgba(60, 60, 60, 0.8) !important;
|
background-color: rgba(60, 60, 60, 0.8) !important;
|
||||||
}
|
}
|
||||||
color: #ffffff !important;
|
color: #ffffff !important;
|
||||||
border-left: 3px solid #4f84ff;
|
|
||||||
margin-left: -3px;
|
margin-left: -3px;
|
||||||
|
|
||||||
.menu-icon {
|
.menu-icon {
|
||||||
@ -574,12 +593,17 @@ h3 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
&.is-opened .el-sub-menu__title {
|
&.is-opened .el-sub-menu__title {
|
||||||
background: rgba(255, 255, 255, 0.08) !important;
|
background: rgba(255, 255, 255, 0.12) !important;
|
||||||
|
margin-left: -3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-menu-item {
|
.el-menu-item {
|
||||||
padding-left: 48px !important;
|
padding-left: 48px !important;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
|
|
||||||
|
&.is-active {
|
||||||
|
background: rgba(255, 255, 255, 0.18) !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -604,6 +628,10 @@ h3 {
|
|||||||
.el-sub-menu.is-opened .el-sub-menu__title {
|
.el-sub-menu.is-opened .el-sub-menu__title {
|
||||||
background: rgba(64, 158, 255, 0.08) !important;
|
background: rgba(64, 158, 255, 0.08) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.el-sub-menu .el-menu-item.is-active {
|
||||||
|
background: rgba(64, 158, 255, 0.15) !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -22,8 +22,10 @@ const remarkText = ref("");
|
|||||||
const remarkDialogVisible = ref(false);
|
const remarkDialogVisible = ref(false);
|
||||||
const platformDialogVisible = ref(false);
|
const platformDialogVisible = ref(false);
|
||||||
const unavailableDialogVisible = ref(false);
|
const unavailableDialogVisible = ref(false);
|
||||||
|
const usableDialogVisible = ref(false);
|
||||||
const unextractDialogVisible = ref(false);
|
const unextractDialogVisible = ref(false);
|
||||||
const platformForm = reactive({ platform: "local" });
|
const platformForm = reactive({ platform: "local" });
|
||||||
|
const usableForm = reactive({ usable: 1 });
|
||||||
|
|
||||||
const TYPE_MAP = {
|
const TYPE_MAP = {
|
||||||
account: { label: "账号密码", type: "success" },
|
account: { label: "账号密码", type: "success" },
|
||||||
@ -82,6 +84,12 @@ watch(
|
|||||||
(row) => {
|
(row) => {
|
||||||
remarkText.value = row?.remark || "";
|
remarkText.value = row?.remark || "";
|
||||||
platformForm.platform = row?.extractedPlatform || "local";
|
platformForm.platform = row?.extractedPlatform || "local";
|
||||||
|
const raw = row?.isUsed;
|
||||||
|
if (raw === null || raw === undefined || raw === "") {
|
||||||
|
usableForm.usable = 1;
|
||||||
|
} else {
|
||||||
|
usableForm.usable = Number(raw) === 0 ? 0 : 1;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{ immediate: true },
|
{ immediate: true },
|
||||||
);
|
);
|
||||||
@ -107,6 +115,26 @@ function onSetUnavailable() {
|
|||||||
unavailableDialogVisible.value = false;
|
unavailableDialogVisible.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function openUsableDialog() {
|
||||||
|
const raw = props.row?.isUsed;
|
||||||
|
if (raw === null || raw === undefined || raw === "") {
|
||||||
|
usableForm.usable = 1;
|
||||||
|
} else {
|
||||||
|
usableForm.usable = Number(raw) === 0 ? 0 : 1;
|
||||||
|
}
|
||||||
|
usableDialogVisible.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function onUpdateUsable() {
|
||||||
|
if (!props.row?.id) return;
|
||||||
|
emit("detail-action", {
|
||||||
|
action: "usable",
|
||||||
|
id: props.row.id,
|
||||||
|
usable: usableForm.usable,
|
||||||
|
});
|
||||||
|
usableDialogVisible.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
function onUpdatePlatform() {
|
function onUpdatePlatform() {
|
||||||
if (!props.row?.id) return;
|
if (!props.row?.id) return;
|
||||||
emit("detail-action", {
|
emit("detail-action", {
|
||||||
@ -299,6 +327,9 @@ function copyAll() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="copy-actions">
|
<div class="copy-actions">
|
||||||
|
<el-button type="success" plain @click="openUsableDialog">
|
||||||
|
改可用状态
|
||||||
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
type="danger"
|
type="danger"
|
||||||
plain
|
plain
|
||||||
@ -334,6 +365,28 @@ function copyAll() {
|
|||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-dialog
|
||||||
|
v-model="usableDialogVisible"
|
||||||
|
title="改可用状态"
|
||||||
|
width="420px"
|
||||||
|
append-to-body
|
||||||
|
>
|
||||||
|
<el-form label-width="84px">
|
||||||
|
<el-form-item label="可用状态">
|
||||||
|
<el-radio-group v-model="usableForm.usable">
|
||||||
|
<el-radio :value="1">可用</el-radio>
|
||||||
|
<el-radio :value="0">不可用</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="usableDialogVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" :loading="saveLoading" @click="onUpdateUsable">
|
||||||
|
确认修改
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
<el-dialog
|
<el-dialog
|
||||||
v-model="unavailableDialogVisible"
|
v-model="unavailableDialogVisible"
|
||||||
title="改不可用"
|
title="改不可用"
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { computed, h, nextTick, onMounted, onUnmounted, reactive, ref, watch } from "vue";
|
import { computed, h, nextTick, onMounted, onUnmounted, reactive, ref, watch } from "vue";
|
||||||
import { ElMessage, ElMessageBox } from "element-plus";
|
import { ElMessage, ElMessageBox } from "element-plus";
|
||||||
|
import { Loading } from "@element-plus/icons-vue";
|
||||||
import Edit from "./components/edit.vue";
|
import Edit from "./components/edit.vue";
|
||||||
import DetailDialog from "./components/detail.vue";
|
import DetailDialog from "./components/detail.vue";
|
||||||
import ExtractDialog from "./components/extract.vue";
|
import ExtractDialog from "./components/extract.vue";
|
||||||
@ -13,6 +14,7 @@ import {
|
|||||||
getAccountPoolList,
|
getAccountPoolList,
|
||||||
updateAccountPoolRemark,
|
updateAccountPoolRemark,
|
||||||
setAccountPoolUnavailable,
|
setAccountPoolUnavailable,
|
||||||
|
updateAccountPoolUsable,
|
||||||
updateAccountPoolPlatform,
|
updateAccountPoolPlatform,
|
||||||
unextractAccountPool,
|
unextractAccountPool,
|
||||||
replenishAccountPool,
|
replenishAccountPool,
|
||||||
@ -20,6 +22,35 @@ import {
|
|||||||
} from "@/api/accountPool";
|
} from "@/api/accountPool";
|
||||||
|
|
||||||
const moduleKey = "cursor";
|
const moduleKey = "cursor";
|
||||||
|
const PAGINATION_STORAGE_KEY = `accountPool:${moduleKey}:pagination`;
|
||||||
|
|
||||||
|
function loadStoredPagination() {
|
||||||
|
try {
|
||||||
|
const raw = sessionStorage.getItem(PAGINATION_STORAGE_KEY);
|
||||||
|
if (!raw) return { page: 1, pageSize: 20 };
|
||||||
|
const saved = JSON.parse(raw);
|
||||||
|
const pageSize = Number(saved.pageSize);
|
||||||
|
const page = Number(saved.page);
|
||||||
|
return {
|
||||||
|
page: Number.isFinite(page) && page >= 1 ? page : 1,
|
||||||
|
pageSize: [20, 50, 100].includes(pageSize) ? pageSize : 20,
|
||||||
|
};
|
||||||
|
} catch {
|
||||||
|
return { page: 1, pageSize: 20 };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function savePagination() {
|
||||||
|
sessionStorage.setItem(
|
||||||
|
PAGINATION_STORAGE_KEY,
|
||||||
|
JSON.stringify({
|
||||||
|
page: pagination.page,
|
||||||
|
pageSize: pagination.pageSize,
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const storedPagination = loadStoredPagination();
|
||||||
|
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const editVisible = ref(false);
|
const editVisible = ref(false);
|
||||||
@ -58,10 +89,24 @@ const selectedRows = ref([]);
|
|||||||
const detailRow = ref(null);
|
const detailRow = ref(null);
|
||||||
const detailRemarkSaving = ref(false);
|
const detailRemarkSaving = ref(false);
|
||||||
const probeLoadingId = ref(null);
|
const probeLoadingId = ref(null);
|
||||||
|
const batchProbeDialogVisible = ref(false);
|
||||||
|
const batchProbePhase = ref("running");
|
||||||
|
const batchProbeProgress = reactive({
|
||||||
|
total: 0,
|
||||||
|
current: 0,
|
||||||
|
currentId: null,
|
||||||
|
percent: 0,
|
||||||
|
});
|
||||||
|
const batchProbeSummary = reactive({
|
||||||
|
total: 0,
|
||||||
|
available: 0,
|
||||||
|
unavailable: 0,
|
||||||
|
skipped: 0,
|
||||||
|
});
|
||||||
const isMobile = ref(false);
|
const isMobile = ref(false);
|
||||||
const pagination = reactive({
|
const pagination = reactive({
|
||||||
page: 1,
|
page: storedPagination.page,
|
||||||
pageSize: 20,
|
pageSize: storedPagination.pageSize,
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 跳转未提取末页时跳过 watcher,避免先被重置到第 1 页 */
|
/** 跳转未提取末页时跳过 watcher,避免先被重置到第 1 页 */
|
||||||
@ -99,6 +144,7 @@ watch(
|
|||||||
watch(
|
watch(
|
||||||
() => [pagination.page, pagination.pageSize],
|
() => [pagination.page, pagination.pageSize],
|
||||||
() => {
|
() => {
|
||||||
|
savePagination();
|
||||||
if (skipWatchFetchDuringUnusedJump.value) return;
|
if (skipWatchFetchDuringUnusedJump.value) return;
|
||||||
fetchList();
|
fetchList();
|
||||||
},
|
},
|
||||||
@ -272,6 +318,11 @@ async function handleDetailAction(payload) {
|
|||||||
let res;
|
let res;
|
||||||
if (payload.action === "unavailable") {
|
if (payload.action === "unavailable") {
|
||||||
res = await setAccountPoolUnavailable(moduleKey, { id: payload.id });
|
res = await setAccountPoolUnavailable(moduleKey, { id: payload.id });
|
||||||
|
} else if (payload.action === "usable") {
|
||||||
|
res = await updateAccountPoolUsable(moduleKey, {
|
||||||
|
id: payload.id,
|
||||||
|
usable: payload.usable,
|
||||||
|
});
|
||||||
} else if (payload.action === "platform") {
|
} else if (payload.action === "platform") {
|
||||||
res = await updateAccountPoolPlatform(moduleKey, {
|
res = await updateAccountPoolPlatform(moduleKey, {
|
||||||
id: payload.id,
|
id: payload.id,
|
||||||
@ -538,6 +589,10 @@ async function fetchList() {
|
|||||||
const list = Array.isArray(res?.data?.list) ? res.data.list : [];
|
const list = Array.isArray(res?.data?.list) ? res.data.list : [];
|
||||||
tableData.value = list.map(normalizeRow);
|
tableData.value = list.map(normalizeRow);
|
||||||
total.value = Number(res?.data?.total || 0);
|
total.value = Number(res?.data?.total || 0);
|
||||||
|
const maxPage = Math.max(1, Math.ceil(total.value / pagination.pageSize));
|
||||||
|
if (pagination.page > maxPage) {
|
||||||
|
pagination.page = maxPage;
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
@ -683,6 +738,35 @@ function formatCursorProbeDialogText(d) {
|
|||||||
return '该TOKEN可用';
|
return '该TOKEN可用';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function formatCursorProbeDetail(d) {
|
||||||
|
if (!d) return '';
|
||||||
|
|
||||||
|
const parts = [];
|
||||||
|
|
||||||
|
// 提取关键信息
|
||||||
|
if (d.httpStatus) parts.push(`HTTP状态: ${d.httpStatus}`);
|
||||||
|
if (d.endpoint) parts.push(`接口: ${d.endpoint}`);
|
||||||
|
if (d.probeMessage) parts.push(`探测方式: ${d.probeMessage}`);
|
||||||
|
if (d.bytesRead) parts.push(`响应大小: ${d.bytesRead} 字节`);
|
||||||
|
if (d.streamProtocol) parts.push(`协议: ${d.streamProtocol}`);
|
||||||
|
|
||||||
|
// 提取检测结论
|
||||||
|
if (d.detail) {
|
||||||
|
// 解析流匹配信息
|
||||||
|
const matchPrefix = '流中匹配:';
|
||||||
|
if (d.detail.includes(matchPrefix)) {
|
||||||
|
const matchStart = d.detail.indexOf(matchPrefix);
|
||||||
|
const matchEnd = d.detail.indexOf(';', matchStart);
|
||||||
|
const matchText = matchEnd > 0 ? d.detail.substring(matchStart, matchEnd) : d.detail.substring(matchStart);
|
||||||
|
parts.push(`检测结论: ${matchText}`);
|
||||||
|
} else {
|
||||||
|
parts.push(`检测结论: ${d.detail}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return parts.join('\n');
|
||||||
|
}
|
||||||
|
|
||||||
async function handleProbeToken(row) {
|
async function handleProbeToken(row) {
|
||||||
if (!row?.token) {
|
if (!row?.token) {
|
||||||
ElMessage.warning('该行无 Token');
|
ElMessage.warning('该行无 Token');
|
||||||
@ -700,10 +784,43 @@ async function handleProbeToken(row) {
|
|||||||
}
|
}
|
||||||
const d = res?.data || {};
|
const d = res?.data || {};
|
||||||
const text = formatCursorProbeDialogText(d);
|
const text = formatCursorProbeDialogText(d);
|
||||||
|
const isOk = d.ok === true;
|
||||||
|
|
||||||
|
// 构建详细信息
|
||||||
|
const detailItems = [];
|
||||||
|
if (d.httpStatus) detailItems.push(`HTTP状态: ${d.httpStatus}`);
|
||||||
|
if (d.endpoint) detailItems.push(`接口: ${d.endpoint}`);
|
||||||
|
if (d.probeMessage) detailItems.push(`探测方式: ${d.probeMessage}`);
|
||||||
|
if (d.bytesRead) detailItems.push(`响应大小: ${d.bytesRead} 字节`);
|
||||||
|
if (d.streamProtocol) detailItems.push(`协议: ${d.streamProtocol}`);
|
||||||
|
|
||||||
|
// 提取检测结论(从 detail 字段)
|
||||||
|
if (d.detail) {
|
||||||
|
const matchPrefix = '流中匹配:';
|
||||||
|
if (d.detail.includes(matchPrefix)) {
|
||||||
|
const matchStart = d.detail.indexOf(matchPrefix);
|
||||||
|
const matchEnd = d.detail.indexOf(';', matchStart);
|
||||||
|
const matchText = matchEnd > 0 ? d.detail.substring(matchStart, matchEnd) : d.detail.substring(matchStart);
|
||||||
|
detailItems.push(`检测结论: ${matchText}`);
|
||||||
|
} else {
|
||||||
|
detailItems.push(`检测结论: ${d.detail}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await ElMessageBox({
|
await ElMessageBox({
|
||||||
title: '检测结果',
|
title: isOk ? '检测结果 - 可用' : '检测结果 - 不可用',
|
||||||
message: h('div', { class: 'cursor-probe-result' }, text),
|
message: h('div', { class: 'cursor-probe-result cursor-expire-result' }, [
|
||||||
|
h('div', {
|
||||||
|
style: `text-align:center;font-size:18px;font-weight:700;margin-bottom:12px;color:${isOk ? '#67c23a' : '#f56c6c'}`
|
||||||
|
}, text),
|
||||||
|
detailItems.length > 0 ? h('div', {
|
||||||
|
style: 'text-align:left;font-size:13px;color:#606266;margin-bottom:8px;line-height:1.8'
|
||||||
|
}, detailItems.map(item => h('div', null, `• ${item}`))) : null,
|
||||||
|
d.streamNote ? h('div', {
|
||||||
|
style: 'text-align:left;font-size:12px;color:#909399;margin-top:8px;padding:8px;background:#f5f7fa;border-radius:4px;white-space:pre-wrap;line-height:1.6;'
|
||||||
|
}, d.streamNote) : null,
|
||||||
|
]),
|
||||||
confirmButtonText: '关闭',
|
confirmButtonText: '关闭',
|
||||||
customClass: 'cursor-probe-dialog',
|
customClass: 'cursor-probe-dialog',
|
||||||
closeOnClickModal: true,
|
closeOnClickModal: true,
|
||||||
@ -741,36 +858,61 @@ async function handleBatchProbe() {
|
|||||||
} catch {
|
} catch {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
loading.value = true;
|
|
||||||
let ok = 0;
|
let available = 0;
|
||||||
let fail = 0;
|
let unavailable = 0;
|
||||||
|
|
||||||
|
batchProbePhase.value = "running";
|
||||||
|
batchProbeProgress.total = rows.length;
|
||||||
|
batchProbeProgress.current = 0;
|
||||||
|
batchProbeProgress.currentId = null;
|
||||||
|
batchProbeProgress.percent = 0;
|
||||||
|
batchProbeDialogVisible.value = true;
|
||||||
|
await nextTick();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
for (const row of rows) {
|
for (let i = 0; i < rows.length; i += 1) {
|
||||||
|
const row = rows[i];
|
||||||
|
batchProbeProgress.current = i + 1;
|
||||||
|
batchProbeProgress.currentId = row.id;
|
||||||
|
batchProbeProgress.percent = Math.round((i / rows.length) * 100);
|
||||||
|
await nextTick();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await probeAccountPoolToken(moduleKey, {
|
const res = await probeAccountPoolToken(moduleKey, {
|
||||||
id: row.id,
|
id: row.id,
|
||||||
accessToken: row.token,
|
accessToken: row.token,
|
||||||
});
|
});
|
||||||
if (res?.code === 200) {
|
if (res?.code === 200 && res?.data?.ok === true) {
|
||||||
ok += 1;
|
available += 1;
|
||||||
} else {
|
} else {
|
||||||
fail += 1;
|
unavailable += 1;
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
fail += 1;
|
unavailable += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
batchProbeProgress.percent = Math.round(((i + 1) / rows.length) * 100);
|
||||||
|
await nextTick();
|
||||||
}
|
}
|
||||||
if (fail > 0) {
|
|
||||||
ElMessage.warning(`批量检测完成:成功 ${ok} 条,失败 ${fail} 条`);
|
batchProbeSummary.total = rows.length;
|
||||||
} else {
|
batchProbeSummary.available = available;
|
||||||
ElMessage.success(`批量检测完成:共 ${ok} 条`);
|
batchProbeSummary.unavailable = unavailable;
|
||||||
}
|
batchProbeSummary.skipped = skipped;
|
||||||
|
batchProbePhase.value = "done";
|
||||||
await fetchList();
|
await fetchList();
|
||||||
} finally {
|
} catch {
|
||||||
loading.value = false;
|
batchProbeDialogVisible.value = false;
|
||||||
|
ElMessage.error("批量检测异常");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function closeBatchProbeDialog() {
|
||||||
|
batchProbeDialogVisible.value = false;
|
||||||
|
batchProbePhase.value = "running";
|
||||||
|
}
|
||||||
|
|
||||||
// async function handleBatchProbeExpireTime() {
|
// async function handleBatchProbeExpireTime() {
|
||||||
// if (!selectedRows.value.length) {
|
// if (!selectedRows.value.length) {
|
||||||
// ElMessage.warning("请先选择数据");
|
// ElMessage.warning("请先选择数据");
|
||||||
@ -954,13 +1096,13 @@ async function handleBatchProbe() {
|
|||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="accessToken失效时间" width="190" align="center">
|
<!-- <el-table-column label="accessToken失效时间" width="190" align="center">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag :type="accessTokenExpireTagType(row.accessTokenExpireStatus)" size="small">
|
<el-tag :type="accessTokenExpireTagType(row.accessTokenExpireStatus)" size="small">
|
||||||
{{ row.accessTokenExpireText || "-" }}
|
{{ row.accessTokenExpireText || "-" }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column label="提取平台" width="120">
|
<el-table-column label="提取平台" width="120">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag
|
<el-tag
|
||||||
@ -1012,7 +1154,7 @@ async function handleBatchProbe() {
|
|||||||
v-model:current-page="pagination.page"
|
v-model:current-page="pagination.page"
|
||||||
v-model:page-size="pagination.pageSize"
|
v-model:page-size="pagination.pageSize"
|
||||||
background
|
background
|
||||||
:layout="isMobile ? 'prev, pager, next' : 'total, prev, pager, next, jumper'"
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
:page-sizes="[20, 50, 100]"
|
:page-sizes="[20, 50, 100]"
|
||||||
:total="total"
|
:total="total"
|
||||||
/>
|
/>
|
||||||
@ -1094,6 +1236,61 @@ async function handleBatchProbe() {
|
|||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-dialog
|
||||||
|
v-model="batchProbeDialogVisible"
|
||||||
|
:title="batchProbePhase === 'running' ? '批量检测中' : '批量检测结果'"
|
||||||
|
width="440px"
|
||||||
|
align-center
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
:close-on-press-escape="false"
|
||||||
|
:show-close="batchProbePhase === 'done'"
|
||||||
|
@close="closeBatchProbeDialog"
|
||||||
|
>
|
||||||
|
<div v-if="batchProbePhase === 'running'" class="batch-probe-progress">
|
||||||
|
<div class="batch-probe-icon">
|
||||||
|
<el-icon class="is-loading" :size="36" color="#409eff">
|
||||||
|
<Loading />
|
||||||
|
</el-icon>
|
||||||
|
</div>
|
||||||
|
<el-progress
|
||||||
|
:percentage="batchProbeProgress.percent"
|
||||||
|
:stroke-width="14"
|
||||||
|
striped
|
||||||
|
striped-flow
|
||||||
|
:duration="8"
|
||||||
|
/>
|
||||||
|
<div class="batch-probe-status">
|
||||||
|
正在检测第 {{ batchProbeProgress.current }} / {{ batchProbeProgress.total }} 条
|
||||||
|
</div>
|
||||||
|
<div v-if="batchProbeProgress.currentId" class="batch-probe-id">
|
||||||
|
当前 ID:{{ batchProbeProgress.currentId }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else class="batch-probe-summary">
|
||||||
|
<div class="batch-probe-summary-title">检测完成</div>
|
||||||
|
<div class="batch-probe-summary-grid">
|
||||||
|
<div class="summary-item">
|
||||||
|
<span class="summary-label">共检测</span>
|
||||||
|
<span class="summary-value">{{ batchProbeSummary.total }} 条</span>
|
||||||
|
</div>
|
||||||
|
<div class="summary-item available">
|
||||||
|
<span class="summary-label">可用</span>
|
||||||
|
<span class="summary-value">{{ batchProbeSummary.available }} 条</span>
|
||||||
|
</div>
|
||||||
|
<div class="summary-item unavailable">
|
||||||
|
<span class="summary-label">失效</span>
|
||||||
|
<span class="summary-value">{{ batchProbeSummary.unavailable }} 条</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-if="batchProbeSummary.skipped > 0" class="batch-probe-skipped">
|
||||||
|
已跳过无 Token {{ batchProbeSummary.skipped }} 条
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<template v-if="batchProbePhase === 'done'" #footer>
|
||||||
|
<el-button type="primary" @click="closeBatchProbeDialog">关闭</el-button>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
<!-- 接口说明抽屉 -->
|
<!-- 接口说明抽屉 -->
|
||||||
<el-drawer
|
<el-drawer
|
||||||
v-model="apiDocVisible"
|
v-model="apiDocVisible"
|
||||||
@ -1247,7 +1444,7 @@ async function handleBatchProbe() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
:deep(.pool-batch-extract-dialog) {
|
:deep(.pool-batch-extract-dialog) {
|
||||||
max-width: 420px;
|
max-width: 600px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
@ -1285,6 +1482,12 @@ async function handleBatchProbe() {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pager :deep(.el-pagination) {
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: center;
|
||||||
|
row-gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
:deep(.pool-batch-extract-dialog) {
|
:deep(.pool-batch-extract-dialog) {
|
||||||
width: calc(100vw - 24px) !important;
|
width: calc(100vw - 24px) !important;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
@ -1412,6 +1615,88 @@ async function handleBatchProbe() {
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #409eff;
|
color: #409eff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.batch-probe-progress {
|
||||||
|
padding: 8px 4px 4px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.batch-probe-icon {
|
||||||
|
margin-bottom: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.batch-probe-status {
|
||||||
|
margin-top: 16px;
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #303133;
|
||||||
|
}
|
||||||
|
|
||||||
|
.batch-probe-id {
|
||||||
|
margin-top: 8px;
|
||||||
|
font-size: 13px;
|
||||||
|
color: #909399;
|
||||||
|
}
|
||||||
|
|
||||||
|
.batch-probe-summary {
|
||||||
|
padding: 8px 4px 4px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.batch-probe-summary-title {
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #303133;
|
||||||
|
margin-bottom: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.batch-probe-summary-grid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary-item {
|
||||||
|
padding: 14px 10px;
|
||||||
|
border-radius: 12px;
|
||||||
|
background: #f5f7fa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary-item.available {
|
||||||
|
background: #f0f9eb;
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary-item.unavailable {
|
||||||
|
background: #fef0f0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary-label {
|
||||||
|
display: block;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #909399;
|
||||||
|
margin-bottom: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary-value {
|
||||||
|
display: block;
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #303133;
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary-item.available .summary-value {
|
||||||
|
color: #67c23a;
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary-item.unavailable .summary-value {
|
||||||
|
color: #f56c6c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.batch-probe-skipped {
|
||||||
|
margin-top: 14px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #909399;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
@ -1427,6 +1712,7 @@ async function handleBatchProbe() {
|
|||||||
/* Cursor 探测结果弹窗(teleport 到 body,需非 scoped) */
|
/* Cursor 探测结果弹窗(teleport 到 body,需非 scoped) */
|
||||||
.cursor-probe-dialog .el-message-box__message {
|
.cursor-probe-dialog .el-message-box__message {
|
||||||
padding: 12px 8px 4px;
|
padding: 12px 8px 4px;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
.cursor-probe-dialog .cursor-probe-result {
|
.cursor-probe-dialog .cursor-probe-result {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|||||||
@ -27,6 +27,7 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
|
host: "127.0.0.1",
|
||||||
port: 5000,
|
port: 5000,
|
||||||
// 开发时前端在 5000,接口走相对路径 /platform/*、/backend/*,转发到本地 Go(当前 httpport=8081)
|
// 开发时前端在 5000,接口走相对路径 /platform/*、/backend/*,转发到本地 Go(当前 httpport=8081)
|
||||||
proxy: {
|
proxy: {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user