{scriptData?.map((items) => (
= ({
await getTaskStartEditDispaly(record.id).then(({ data }) => {
const transformModalFormdata = {
...data,
- script_type: scriptTypeOption.find(
- (it) => it.label === data?.script_type,
- )?.value,
id: record.id,
headerGroupValue,
execution_date: data?.params?.execution_date
@@ -182,11 +179,11 @@ const PublicAndExecutionOperateRender: FC = ({
: undefined,
params: {
...data.params,
- 'preset-protes': data?.params?.['preset-protes']
- ? (data?.params['preset-protes'])
- .split(', ')
- .map((item) => item.trim())
- : [],
+ // 'preset-protes': data?.params?.['preset-protes']
+ // ? (data?.params['preset-protes'])
+ // .split(', ')
+ // .map((item) => item.trim())
+ // : [],
},
};
itemsRef.current = transformModalFormdata;
@@ -591,9 +588,6 @@ const ExecutionOperateRender: FC = ({
await getTaskStartEditDispaly(record.id).then(({ data }) => {
const transformModalFormdata = {
...data,
- script_type: scriptTypeOption.find(
- (it) => it.label === data?.script_type,
- )?.value,
headerGroupValue,
sched_type: 3,
timestamp:
@@ -608,11 +602,11 @@ const ExecutionOperateRender: FC = ({
: undefined,
params: {
...data.params,
- 'preset-protes': data?.params?.['preset-protes']
- ? (data?.params['preset-protes'])
- .split(', ')
- .map((item) => item.trim())
- : [],
+ // 'preset-protes': data?.params?.['preset-protes']
+ // ? (data?.params['preset-protes'])
+ // .split(', ')
+ // .map((item) => item.trim())
+ // : [],
},
};
itemsRef.current = transformModalFormdata;
diff --git a/src/pages/TaskScript/compoment/CreateTaskItems.tsx b/src/pages/TaskScript/compoment/CreateTaskItems.tsx
index 3d16cf5..8c58265 100644
--- a/src/pages/TaskScript/compoment/CreateTaskItems.tsx
+++ b/src/pages/TaskScript/compoment/CreateTaskItems.tsx
@@ -37,7 +37,7 @@ type TScriptGrounpList = Array<{ value: string; label: string }>;
type TCreateTaskItemsProps = (
title: string,
- scriptTypeValue: '端口与漏洞扫描' | '敏感信息',
+ scriptTypeValue: 'portAndVulScan' | 'weakinfo',
scriptGroupList: TScriptGrounpList,
scannerDataList?: TScannerDataList,
) => ItemType[] | any;
@@ -351,18 +351,18 @@ const CreateTaskItems: TCreateTaskItemsProps = (
{({ setFieldValue }) => {
return (
-
{scriptTypeValue ===
- '端口与漏洞扫描'
+ 'portAndVulScan'
? '扫描目标'
: '关键词'}
}
name={[
'params',
- scriptTypeValue === '端口与漏洞扫描'
+ scriptTypeValue === 'portAndVulScan'
? 'target'
: 'keyword',
]}
@@ -385,7 +385,7 @@ const CreateTaskItems: TCreateTaskItemsProps = (
[
'params',
scriptTypeValue ===
- '端口与漏洞扫描'
+ 'portAndVulScan'
? 'target'
: 'keyword',
],
@@ -418,7 +418,7 @@ const CreateTaskItems: TCreateTaskItemsProps = (
[
'params',
scriptTypeValue ===
- '端口与漏洞扫描'
+ 'portAndVulScan'
? 'target'
: 'keyword',
],
@@ -430,7 +430,7 @@ const CreateTaskItems: TCreateTaskItemsProps = (
);
}}
- {scriptTypeValue === '端口与漏洞扫描' && (
+ {scriptTypeValue === 'portAndVulScan' && (
-
{({ setFieldValue }) => {
return (
@@ -465,7 +465,7 @@ const CreateTaskItems: TCreateTaskItemsProps = (
}}
)}
- {scriptTypeValue === '端口与漏洞扫描' && (
+ {scriptTypeValue === 'portAndVulScan' && (
-
{({ setFieldValue }) => (
-
)}
- {scriptTypeValue === '端口与漏洞扫描' && (
+ {scriptTypeValue === 'portAndVulScan' && (
-
@@ -537,7 +537,7 @@ const CreateTaskItems: TCreateTaskItemsProps = (
)}
- {scriptTypeValue === '端口与漏洞扫描' && (
+ {scriptTypeValue === 'portAndVulScan' && (
-
@@ -656,7 +656,7 @@ const CreateTaskItems: TCreateTaskItemsProps = (
);
}}
- {scriptTypeValue === '端口与漏洞扫描' && (
+ {scriptTypeValue === 'portAndVulScan' && (
- {
const preScannerStr = Array.isArray(
diff --git a/src/pages/TaskScript/compoment/StartUpScriptModal.tsx b/src/pages/TaskScript/compoment/StartUpScriptModal.tsx
index 7634af3..4be1433 100644
--- a/src/pages/TaskScript/compoment/StartUpScriptModal.tsx
+++ b/src/pages/TaskScript/compoment/StartUpScriptModal.tsx
@@ -142,9 +142,10 @@ const StartUpScriptModal = forwardRef<
async open(items, scriptGroupList) {
await runAsync()
.then(() => {
+ console.log(items, 'items');
const targetSetFormData = {
task_id: `[${items?.script_name}]-[${dayjs().format('M月DD日')}]-[${randomString(6)}]-`,
- script_type: items?.script_type,
+ // script_type: items?.script_type,
...items,
execution_date:
diff --git a/src/pages/TaskScript/compoment/TaskScriptDrawer.tsx b/src/pages/TaskScript/compoment/TaskScriptDrawer.tsx
index 23e1273..38a6278 100644
--- a/src/pages/TaskScript/compoment/TaskScriptDrawer.tsx
+++ b/src/pages/TaskScript/compoment/TaskScriptDrawer.tsx
@@ -78,7 +78,7 @@ const TaskScriptDrawer = forwardRef<
loading={loading}
drawer={drawer}
title={title}
- width={'60%'}
+ width={'75%'}
onClose={() => {
form.resetFields();
}}
diff --git a/src/pages/TaskScript/data.ts b/src/pages/TaskScript/data.ts
index a5d4144..f5652f8 100644
--- a/src/pages/TaskScript/data.ts
+++ b/src/pages/TaskScript/data.ts
@@ -46,11 +46,14 @@ const transformFormData = (values: any): TPostTaskStartRequest => {
params: {
...values.params,
plugins: values.params?.plugins?.ScriptName?.ids?.join(','),
- 'enable-brute': `${values?.params?.['enable-brute']}`,
- 'enbale-cve-baseline': `${values?.params?.['enbale-cve-baseline']}`,
- 'preset-protes': values?.params?.['preset-protes']
- ? `${values?.params?.['preset-protes']?.join()}`
- : undefined,
+ 'enable-brute':
+ typeof values?.params?.['enable-brute'] === 'boolean'
+ ? `${values?.params?.['enable-brute']}`
+ : undefined,
+ 'enbale-cve-baseline':
+ typeof values?.params?.['enbale-cve-baseline'] === 'boolean'
+ ? `${values?.params?.['enbale-cve-baseline']}`
+ : undefined,
},
param_files: values?.param_files
? {
@@ -70,9 +73,6 @@ const transformFormData = (values: any): TPostTaskStartRequest => {
task_type: 'batch-invoking-script',
enable_sched: values?.['sched_type'] !== 1 ? true : false,
timestamp: undefined,
- script_type: scriptTypeOption.find(
- (it) => it.label === values?.script_type,
- )?.value,
};
};