|
|
@@ -475,6 +475,50 @@
|
|
|
</a-tag>
|
|
|
</span>
|
|
|
</template>
|
|
|
+ <template #general_link_parse_pool="{ record }">
|
|
|
+ <a-space direction="vertical" size="small">
|
|
|
+ <a-tooltip
|
|
|
+ content="使用该账号的 AppKey、AppSecret 和 PID 为其他账号解析短链,账号需保持在线"
|
|
|
+ >
|
|
|
+ <a-space>
|
|
|
+ <a-switch
|
|
|
+ :model-value="
|
|
|
+ record.enable_general_link_parse_pool
|
|
|
+ "
|
|
|
+ size="small"
|
|
|
+ @change="
|
|
|
+ changeAttr(
|
|
|
+ record.id,
|
|
|
+ 'enable_general_link_parse_pool',
|
|
|
+ $event
|
|
|
+ )
|
|
|
+ "
|
|
|
+ />
|
|
|
+ <span>加入万能解析池</span>
|
|
|
+ </a-space>
|
|
|
+ </a-tooltip>
|
|
|
+ <a-tooltip
|
|
|
+ content="优先使用池内账号;无可用账号时按下探网址设置处理"
|
|
|
+ >
|
|
|
+ <a-space>
|
|
|
+ <a-switch
|
|
|
+ :model-value="
|
|
|
+ record.use_general_link_parse_pool
|
|
|
+ "
|
|
|
+ size="small"
|
|
|
+ @change="
|
|
|
+ changeAttr(
|
|
|
+ record.id,
|
|
|
+ 'use_general_link_parse_pool',
|
|
|
+ $event
|
|
|
+ )
|
|
|
+ "
|
|
|
+ />
|
|
|
+ <span>使用万能解析池</span>
|
|
|
+ </a-space>
|
|
|
+ </a-tooltip>
|
|
|
+ </a-space>
|
|
|
+ </template>
|
|
|
<template #time="{ record }">
|
|
|
<div style="color: gray">
|
|
|
<div
|
|
|
@@ -487,9 +531,15 @@
|
|
|
dayjs(record.last_time).format('MM-DD HH:mm')
|
|
|
}}</div
|
|
|
>
|
|
|
- <template v-if="formatDateTime(record.login_time) !== '-'">
|
|
|
- <div v-if="getLoginAgeHours(record.login_time) < 48">
|
|
|
- 登录:{{ formatDateTime(record.login_time) }}</div
|
|
|
+ <template
|
|
|
+ v-if="formatDateTime(record.login_time) !== '-'"
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ v-if="getLoginAgeHours(record.login_time) < 48"
|
|
|
+ >
|
|
|
+ 登录:{{
|
|
|
+ formatDateTime(record.login_time)
|
|
|
+ }}</div
|
|
|
>
|
|
|
<a-tooltip v-else>
|
|
|
<template #content>
|
|
|
@@ -542,6 +592,11 @@
|
|
|
@change="search"
|
|
|
/>
|
|
|
</template>
|
|
|
+ <template #qps_limit="{ record }">
|
|
|
+ <a-link @click="openQpsModal(record)">
|
|
|
+ {{ record.qps_limit > 0 ? record.qps_limit : '不限' }}
|
|
|
+ </a-link>
|
|
|
+ </template>
|
|
|
<template #hourly_calls_limit="{ record }">
|
|
|
<a-tag
|
|
|
bordered
|
|
|
@@ -573,8 +628,82 @@
|
|
|
{{ record.daily_calls_limit }}
|
|
|
</a-tag>
|
|
|
</template>
|
|
|
+ <template #aiopen_risk="{ record }">
|
|
|
+ <span v-if="!record.aiopen_risk?.applicable">-</span>
|
|
|
+ <a-popover
|
|
|
+ v-else-if="record.aiopen_risk.triggered"
|
|
|
+ position="left"
|
|
|
+ >
|
|
|
+ <a-tag bordered color="red">调用已达上限</a-tag>
|
|
|
+ <template #content>
|
|
|
+ <a-descriptions
|
|
|
+ :column="1"
|
|
|
+ size="small"
|
|
|
+ style="min-width: 320px"
|
|
|
+ >
|
|
|
+ <a-descriptions-item label="首次触发">
|
|
|
+ {{
|
|
|
+ formatDateTime(
|
|
|
+ record.aiopen_risk
|
|
|
+ .first_trigger_time
|
|
|
+ )
|
|
|
+ }}
|
|
|
+ </a-descriptions-item>
|
|
|
+ <a-descriptions-item label="成功 / 请求">
|
|
|
+ {{
|
|
|
+ record.aiopen_risk
|
|
|
+ .success_count_at_trigger
|
|
|
+ }}
|
|
|
+ /
|
|
|
+ {{
|
|
|
+ record.aiopen_risk
|
|
|
+ .request_count_at_trigger
|
|
|
+ }}
|
|
|
+ </a-descriptions-item>
|
|
|
+ <a-descriptions-item label="预计释放">
|
|
|
+ {{
|
|
|
+ formatDateTime(
|
|
|
+ record.aiopen_risk.release_time
|
|
|
+ )
|
|
|
+ }}
|
|
|
+ </a-descriptions-item>
|
|
|
+ <a-descriptions-item label="原因">
|
|
|
+ {{ record.aiopen_risk.reason }}
|
|
|
+ </a-descriptions-item>
|
|
|
+ </a-descriptions>
|
|
|
+ </template>
|
|
|
+ </a-popover>
|
|
|
+ <a-tag v-else bordered color="green">正常</a-tag>
|
|
|
+ </template>
|
|
|
</a-table>
|
|
|
</a-card>
|
|
|
+
|
|
|
+ <a-modal
|
|
|
+ v-model:visible="qpsModalVisible"
|
|
|
+ title="设置账号 QPS"
|
|
|
+ :confirm-loading="qpsSaving"
|
|
|
+ @ok="saveQpsLimit"
|
|
|
+ @cancel="closeQpsModal"
|
|
|
+ >
|
|
|
+ <a-form :model="qpsForm" layout="vertical">
|
|
|
+ <a-form-item label="账号">
|
|
|
+ {{ qpsAccount?.company || qpsAccount?.name }}
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item label="QPS 限制">
|
|
|
+ <a-input-number
|
|
|
+ v-model="qpsForm.qps_limit"
|
|
|
+ :min="0"
|
|
|
+ :precision="0"
|
|
|
+ :step="1"
|
|
|
+ placeholder="0 表示不限制"
|
|
|
+ style="width: 100%"
|
|
|
+ />
|
|
|
+ </a-form-item>
|
|
|
+ </a-form>
|
|
|
+ <a-typography-text type="secondary">
|
|
|
+ 设置为 0 时不限制该账号 QPS。
|
|
|
+ </a-typography-text>
|
|
|
+ </a-modal>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -629,6 +758,12 @@
|
|
|
const showColumns = ref<Column[]>([]);
|
|
|
|
|
|
const size = ref<SizeProps>('mini');
|
|
|
+ const qpsModalVisible = ref(false);
|
|
|
+ const qpsSaving = ref(false);
|
|
|
+ const qpsAccount = ref<TkPoolRecord | null>(null);
|
|
|
+ const qpsForm = reactive({
|
|
|
+ qps_limit: 0,
|
|
|
+ });
|
|
|
|
|
|
const basePagination: Pagination = {
|
|
|
current: 1,
|
|
|
@@ -684,6 +819,13 @@
|
|
|
align: 'right',
|
|
|
width: 200,
|
|
|
},
|
|
|
+ {
|
|
|
+ title: 'QPS 限制',
|
|
|
+ dataIndex: 'qps_limit',
|
|
|
+ slotName: 'qps_limit',
|
|
|
+ align: 'right',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
{
|
|
|
title: '小时调用',
|
|
|
slotName: 'hourly_calls_limit',
|
|
|
@@ -698,6 +840,13 @@
|
|
|
align: 'right',
|
|
|
width: 150,
|
|
|
},
|
|
|
+ {
|
|
|
+ title: 'AI风控',
|
|
|
+ slotName: 'aiopen_risk',
|
|
|
+ dataIndex: 'aiopen_risk',
|
|
|
+ align: 'center',
|
|
|
+ width: 140,
|
|
|
+ },
|
|
|
{
|
|
|
title: '每日收益限额',
|
|
|
slotName: 'daily_income_limit',
|
|
|
@@ -731,6 +880,12 @@
|
|
|
width: 480,
|
|
|
align: 'center',
|
|
|
},
|
|
|
+ {
|
|
|
+ title: '万能解析',
|
|
|
+ slotName: 'general_link_parse_pool',
|
|
|
+ width: 210,
|
|
|
+ align: 'center',
|
|
|
+ },
|
|
|
{
|
|
|
title: '时间',
|
|
|
slotName: 'time',
|
|
|
@@ -825,6 +980,47 @@
|
|
|
router.push({ name: 'updateCookies' });
|
|
|
};
|
|
|
|
|
|
+ const openQpsModal = (record: TkPoolRecord) => {
|
|
|
+ qpsAccount.value = record;
|
|
|
+ qpsForm.qps_limit = Math.max(
|
|
|
+ 0,
|
|
|
+ Math.trunc(Number(record.qps_limit) || 0)
|
|
|
+ );
|
|
|
+ qpsModalVisible.value = true;
|
|
|
+ };
|
|
|
+
|
|
|
+ const closeQpsModal = () => {
|
|
|
+ qpsModalVisible.value = false;
|
|
|
+ qpsAccount.value = null;
|
|
|
+ qpsForm.qps_limit = 0;
|
|
|
+ };
|
|
|
+
|
|
|
+ const saveQpsLimit = async () => {
|
|
|
+ if (!qpsAccount.value) return;
|
|
|
+
|
|
|
+ qpsSaving.value = true;
|
|
|
+ try {
|
|
|
+ const { data } = await TkUpdateAccount({
|
|
|
+ id: qpsAccount.value.id,
|
|
|
+ name: 'qps_limit',
|
|
|
+ val: Math.max(0, Math.trunc(Number(qpsForm.qps_limit) || 0)),
|
|
|
+ });
|
|
|
+ const msg = data.msg || '更新成功!';
|
|
|
+ if (data.success) {
|
|
|
+ Message.success(msg);
|
|
|
+ closeQpsModal();
|
|
|
+ search();
|
|
|
+ } else {
|
|
|
+ Message.error(msg);
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e);
|
|
|
+ Message.error('更新失败');
|
|
|
+ } finally {
|
|
|
+ qpsSaving.value = false;
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
const billView = async (data: TkPoolRecord) => {
|
|
|
router.push({
|
|
|
name: 'taobao_bill_dailys',
|