mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-09-23 16:00:52 +00:00
* feat: add node selection reports * Merge dev-v2 and resolve PR conflicts --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
41 lines
1.3 KiB
Go
41 lines
1.3 KiB
Go
import http from '@/api';
|
|
import { ResPage } from '../interface';
|
|
import { Log } from '../interface/log';
|
|
import { TimeoutEnum } from '@/enums/http-enum';
|
|
|
|
export const getOperationLogs = (info: Log.SearchOpLog) => {
|
|
return http.post<ResPage<Log.OperationLog>>(`/core/logs/operation`, info);
|
|
};
|
|
|
|
export const getLoginLogs = (info: Log.SearchLgLog, currentNode?: string) => {
|
|
return http.post<ResPage<Log.LoginLogs>>(
|
|
`/core/logs/login`,
|
|
info,
|
|
undefined,
|
|
currentNode ? { CurrentNode: currentNode } : undefined,
|
|
);
|
|
};
|
|
|
|
export const getSystemFiles = (node?: string) => {
|
|
const params = node ? `?operateNode=${node}` : '';
|
|
return http.get<Array<string>>(`/logs/system/files${params}`);
|
|
};
|
|
|
|
export const cleanLogs = (param: Log.CleanLog) => {
|
|
return http.post(`/core/logs/clean`, param);
|
|
};
|
|
|
|
export const searchTasks = (req: Log.SearchTaskReq, node?: string) => {
|
|
const params = node ? `?operateNode=${node}` : '';
|
|
return http.post<ResPage<Log.Task>>(`/logs/tasks/search${params}`, req);
|
|
};
|
|
|
|
export const readTaskLogByLine = (req: Log.TaskLogReadReq, node?: string) => {
|
|
const params = node ? `?operateNode=${node}` : '';
|
|
return http.post<any>(`/logs/tasks/read${params}`, req, TimeoutEnum.T_40S);
|
|
};
|
|
|
|
export const countExecutingTask = () => {
|
|
return http.get<number>(`/logs/tasks/executing/count`);
|
|
};
|