- 新增网络扫描功能,支持批量发现 AMT 设备 - 实现左右分栏布局,左侧扫描配置,右侧结果列表 - 支持 CIDR 和点分十进制两种子网掩码格式 - 优化多线程扫描性能(50 个并发线程) - 使用 CompletableFuture 提升异步效率 - 添加 HTTP 连接超时配置(连接 3 秒,响应 5 秒) - 前端请求超时增加到 10 分钟 - 优化进度条显示,使用不确定进度条 - 移除 AMT 自动添加模式下的设备信息输入框 - 添加扫描时间统计和详细日志输出 性能提升: - 扫描速度提升约 70% - /24 网段从 26 秒降至 7 秒 - /28 网段从 2 秒降至 0.5 秒
112 lines
2.0 KiB
TypeScript
112 lines
2.0 KiB
TypeScript
import { request } from '../request';
|
|
|
|
/**
|
|
* 获取设备列表
|
|
*/
|
|
export function fetchDeviceList(params: Api.Common.PageRequest) {
|
|
return request<Api.Common.PageResponse<Api.Device.Device>>({
|
|
url: '/device/list',
|
|
method: 'post',
|
|
data: params
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 创建设备
|
|
*/
|
|
export function fetchCreateDevice(data: Api.Device.DeviceEdit) {
|
|
return request<boolean>({
|
|
url: '/device/create',
|
|
method: 'post',
|
|
data
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 更新设备
|
|
*/
|
|
export function fetchUpdateDevice(data: Api.Device.DeviceEdit) {
|
|
return request<boolean>({
|
|
url: '/device/update',
|
|
method: 'post',
|
|
data
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 删除设备
|
|
*/
|
|
export function fetchDeleteDevice(id: number) {
|
|
return request<boolean>({
|
|
url: '/device/delete',
|
|
method: 'post',
|
|
data: { id }
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 批量删除设备
|
|
*/
|
|
export function fetchBatchDeleteDevice(ids: number[]) {
|
|
return request<boolean>({
|
|
url: '/device/batchDelete',
|
|
method: 'post',
|
|
data: { ids }
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 获取设备详情
|
|
*/
|
|
export function fetchDeviceDetail(id: number) {
|
|
return request<Api.Device.Device>({
|
|
url: '/device/detail',
|
|
method: 'get',
|
|
params: { id }
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 获取设备统计信息
|
|
*/
|
|
export function fetchDeviceStatistics() {
|
|
return request<Record<string, number>>({
|
|
url: '/device/statistics',
|
|
method: 'get'
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 测试 AMT 连接
|
|
*/
|
|
export function fetchTestAmtConnection(data: Api.Device.AmtTestRequest) {
|
|
return request<boolean>({
|
|
url: '/device/amt/test',
|
|
method: 'post',
|
|
data
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 获取 AMT 设备信息
|
|
*/
|
|
export function fetchAmtDeviceInfo(data: Api.Device.AmtTestRequest) {
|
|
return request<Api.Device.AmtDeviceInfo>({
|
|
url: '/device/amt/getInfo',
|
|
method: 'post',
|
|
data
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 扫描网络段
|
|
*/
|
|
export function fetchScanNetwork(data: Api.Device.NetworkScanRequest) {
|
|
return request<Api.Device.NetworkScanResult>({
|
|
url: '/device/amt/scanNetwork',
|
|
method: 'post',
|
|
data,
|
|
timeout: 10 * 60 * 1000 // 10 分钟超时
|
|
});
|
|
}
|