⚡ 优化执行逻辑.
This commit is contained in:
@@ -30,6 +30,7 @@ export interface ExecLogQueryResponse extends TableData, ExecLogQueryExtraRespon
|
||||
startTime: number;
|
||||
finishTime: number;
|
||||
hostIdList: Array<number>;
|
||||
hosts: Array<ExecHostLogQueryResponse>;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -72,6 +73,13 @@ export function getExecLogPage(request: ExecLogQueryRequest) {
|
||||
return axios.post<DataGrid<ExecLogQueryResponse>>('/asset/exec-log/query', request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询执行记录
|
||||
*/
|
||||
export function getExecLog(id: number) {
|
||||
return axios.get<ExecLogQueryResponse>('/asset/exec-log/query', { params: { id } });
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询主机执行记录
|
||||
*/
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import type { ExecLogQueryResponse } from './exec-log';
|
||||
import axios from 'axios';
|
||||
|
||||
/**
|
||||
@@ -28,44 +29,18 @@ export interface ExecTailRequest {
|
||||
hostExecIdList?: Array<number>;
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行命令响应
|
||||
*/
|
||||
export interface ExecCommandResponse {
|
||||
id: number;
|
||||
status: string;
|
||||
startTime: number;
|
||||
finishTime: number;
|
||||
hosts: Array<ExecCommandHostResponse>;
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行命令主机响应
|
||||
*/
|
||||
export interface ExecCommandHostResponse {
|
||||
id: number;
|
||||
hostId: number;
|
||||
hostName: string;
|
||||
hostAddress: string;
|
||||
status: string;
|
||||
exitStatus: number;
|
||||
errorMessage: string;
|
||||
startTime: number;
|
||||
finishTime: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量执行命令
|
||||
*/
|
||||
export function batchExecCommand(request: ExecCommandRequest) {
|
||||
return axios.post<ExecCommandResponse>('/asset/exec/exec-command', request);
|
||||
return axios.post<ExecLogQueryResponse>('/asset/exec/exec-command', request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 重新执行命令
|
||||
*/
|
||||
export function reExecCommand(request: ExecCommandRequest) {
|
||||
return axios.post<ExecCommandResponse>('/asset/exec/re-exec-command', request);
|
||||
return axios.post<ExecLogQueryResponse>('/asset/exec/re-exec-command', request);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user