-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
104 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import { FC } from 'react'; | ||
|
||
import { WizardTable } from '@/compoments'; | ||
|
||
import { getAssetsProts } from '@/apis/taskDetail'; | ||
import { CreateTableProps } from '@/compoments/WizardTable/types'; | ||
import { Tag } from 'antd'; | ||
import dayjs from 'dayjs'; | ||
import { TGetAssetsProtsResponse } from '@/apis/taskDetail/types'; | ||
|
||
const PortAssets: FC = () => { | ||
const [page] = WizardTable.usePage(); | ||
|
||
const ProtColumns: CreateTableProps<TGetAssetsProtsResponse>['columns'] = [ | ||
{ | ||
title: '网络地址', | ||
dataIndex: 'hosts', | ||
columnsHeaderFilterType: 'input', | ||
width: 180, | ||
render: (_, render) => | ||
render?.ip_integer ? render?.ip_integer : '-', | ||
}, | ||
{ | ||
title: '端口', | ||
dataIndex: 'ports', | ||
columnsHeaderFilterType: 'input', | ||
width: 60, | ||
render: (_, render) => | ||
render?.port ? <Tag color="default">{render?.port}</Tag> : '-', | ||
}, | ||
{ | ||
title: '协议', | ||
dataIndex: 'proto', | ||
width: 60, | ||
render: (value) => | ||
value ? <Tag color="success">{value}</Tag> : '-', | ||
}, | ||
{ | ||
title: '服务指纹', | ||
dataIndex: 'services', | ||
columnsHeaderFilterType: 'input', | ||
width: 180, | ||
render: (_, render) => | ||
render?.fingerprint ? render?.fingerprint : '-', | ||
}, | ||
{ | ||
title: '最近更新时间', | ||
dataIndex: 'updated_at', | ||
width: 260, | ||
render: (value) => | ||
value ? dayjs.unix(value).format('YYYY-MM-DD HH:ss') : '-', | ||
}, | ||
]; | ||
|
||
const dowload_request = async () => { | ||
return 111; | ||
}; | ||
|
||
return ( | ||
<WizardTable | ||
page={page} | ||
rowKey={'id'} | ||
columns={ProtColumns} | ||
tableHeader={{ | ||
title: '端口资产列表', | ||
options: { | ||
dowloadFile: { | ||
dowload_request, | ||
}, | ||
}, | ||
}} | ||
request={async (params, filter) => { | ||
const { data } = await getAssetsProts({ | ||
...params, | ||
...filter, | ||
}); | ||
|
||
return { | ||
list: data?.list ?? [], | ||
pagemeta: data?.pagemeta, | ||
}; | ||
}} | ||
/> | ||
); | ||
}; | ||
|
||
export { PortAssets }; |
This file was deleted.
Oops, something went wrong.