|
@@ -20,6 +20,8 @@ import React, { useEffect, useRef, useState } from 'react';
|
|
|
*
|
|
*
|
|
|
* 备注:后端 config 为统一 JSON 配置,约定 key:
|
|
* 备注:后端 config 为统一 JSON 配置,约定 key:
|
|
|
* rest_duration(休息时长,分钟)、daily_max_pages(每日最大页数/条数,0=不限)
|
|
* rest_duration(休息时长,分钟)、daily_max_pages(每日最大页数/条数,0=不限)
|
|
|
|
|
+ * login_exception_limit(登录异常次数上限,0=不限)
|
|
|
|
|
+ * total_exception_limit(总异常次数上限,0=不限)
|
|
|
*/
|
|
*/
|
|
|
const PlatformConfig: React.FC = () => {
|
|
const PlatformConfig: React.FC = () => {
|
|
|
const actionRef = useRef<ActionType>();
|
|
const actionRef = useRef<ActionType>();
|
|
@@ -45,6 +47,8 @@ const PlatformConfig: React.FC = () => {
|
|
|
platform: record?.platform,
|
|
platform: record?.platform,
|
|
|
rest_duration: cfg.rest_duration ?? 0,
|
|
rest_duration: cfg.rest_duration ?? 0,
|
|
|
daily_max_pages: cfg.daily_max_pages ?? 0,
|
|
daily_max_pages: cfg.daily_max_pages ?? 0,
|
|
|
|
|
+ login_exception_limit: cfg.login_exception_limit ?? 0,
|
|
|
|
|
+ total_exception_limit: cfg.total_exception_limit ?? 0,
|
|
|
status: record?.status,
|
|
status: record?.status,
|
|
|
};
|
|
};
|
|
|
};
|
|
};
|
|
@@ -54,6 +58,8 @@ const PlatformConfig: React.FC = () => {
|
|
|
return {
|
|
return {
|
|
|
rest_duration: Number(values.rest_duration ?? 0),
|
|
rest_duration: Number(values.rest_duration ?? 0),
|
|
|
daily_max_pages: Number(values.daily_max_pages ?? 0),
|
|
daily_max_pages: Number(values.daily_max_pages ?? 0),
|
|
|
|
|
+ login_exception_limit: Number(values.login_exception_limit ?? 0),
|
|
|
|
|
+ total_exception_limit: Number(values.total_exception_limit ?? 0),
|
|
|
};
|
|
};
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -86,6 +92,20 @@ const PlatformConfig: React.FC = () => {
|
|
|
type: 'number',
|
|
type: 'number',
|
|
|
help: '0 表示不限制',
|
|
help: '0 表示不限制',
|
|
|
},
|
|
},
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '登录异常次数上限',
|
|
|
|
|
+ isRequired: true,
|
|
|
|
|
+ value: 'login_exception_limit',
|
|
|
|
|
+ type: 'number',
|
|
|
|
|
+ help: '超过此次数则不允许拉取任务,0 表示不限制',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ label: '总异常次数上限',
|
|
|
|
|
+ isRequired: true,
|
|
|
|
|
+ value: 'total_exception_limit',
|
|
|
|
|
+ type: 'number',
|
|
|
|
|
+ help: '超过此次数则不允许拉取任务,0 表示不限制',
|
|
|
|
|
+ },
|
|
|
]}
|
|
]}
|
|
|
ref={modiyFormModalRef}
|
|
ref={modiyFormModalRef}
|
|
|
getDetail={() => flattenConfig(data)}
|
|
getDetail={() => flattenConfig(data)}
|
|
@@ -152,6 +172,26 @@ const PlatformConfig: React.FC = () => {
|
|
|
? '不限'
|
|
? '不限'
|
|
|
: record?.config?.daily_max_pages ?? '-',
|
|
: record?.config?.daily_max_pages ?? '-',
|
|
|
},
|
|
},
|
|
|
|
|
+ {
|
|
|
|
|
+ title: '登录异常次数上限',
|
|
|
|
|
+ dataIndex: ['config', 'login_exception_limit'],
|
|
|
|
|
+ key: 'login_exception_limit',
|
|
|
|
|
+ hideInSearch: true,
|
|
|
|
|
+ renderText: (_, record: any) =>
|
|
|
|
|
+ record?.config?.login_exception_limit === 0
|
|
|
|
|
+ ? '不限'
|
|
|
|
|
+ : record?.config?.login_exception_limit ?? '-',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ title: '总异常次数上限',
|
|
|
|
|
+ dataIndex: ['config', 'total_exception_limit'],
|
|
|
|
|
+ key: 'total_exception_limit',
|
|
|
|
|
+ hideInSearch: true,
|
|
|
|
|
+ renderText: (_, record: any) =>
|
|
|
|
|
+ record?.config?.total_exception_limit === 0
|
|
|
|
|
+ ? '不限'
|
|
|
|
|
+ : record?.config?.total_exception_limit ?? '-',
|
|
|
|
|
+ },
|
|
|
{
|
|
{
|
|
|
title: '状态',
|
|
title: '状态',
|
|
|
dataIndex: 'status',
|
|
dataIndex: 'status',
|
|
@@ -231,7 +271,7 @@ const PlatformConfig: React.FC = () => {
|
|
|
editable={{
|
|
editable={{
|
|
|
type: 'multiple',
|
|
type: 'multiple',
|
|
|
}}
|
|
}}
|
|
|
- scroll={{ x: '150%' }}
|
|
|
|
|
|
|
+ scroll={{ x: '200%' }}
|
|
|
noSearch
|
|
noSearch
|
|
|
toolbar={{
|
|
toolbar={{
|
|
|
actions: [
|
|
actions: [
|