diff --git a/frontend/src/api/core/ApiError.ts b/frontend/src/api/core/ApiError.ts index af12586..ec7b16a 100644 --- a/frontend/src/api/core/ApiError.ts +++ b/frontend/src/api/core/ApiError.ts @@ -2,8 +2,8 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { ApiRequestOptions } from './ApiRequestOptions.ts'; -import type { ApiResult } from './ApiResult.ts'; +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; export class ApiError extends Error { public readonly url: string; diff --git a/frontend/src/api/core/OpenAPI.ts b/frontend/src/api/core/OpenAPI.ts index 79a2ba4..a0a9ed4 100644 --- a/frontend/src/api/core/OpenAPI.ts +++ b/frontend/src/api/core/OpenAPI.ts @@ -2,7 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { ApiRequestOptions } from './ApiRequestOptions.ts'; +import type { ApiRequestOptions } from './ApiRequestOptions'; type Resolver = (options: ApiRequestOptions) => Promise; type Headers = Record; diff --git a/frontend/src/api/core/request.ts b/frontend/src/api/core/request.ts index ffff887..1dc6fef 100644 --- a/frontend/src/api/core/request.ts +++ b/frontend/src/api/core/request.ts @@ -6,12 +6,12 @@ import axios from 'axios'; import type { AxiosError, AxiosRequestConfig, AxiosResponse, AxiosInstance } from 'axios'; import FormData from 'form-data'; -import { ApiError } from './ApiError.ts'; -import type { ApiRequestOptions } from './ApiRequestOptions.ts'; -import type { ApiResult } from './ApiResult.ts'; -import { CancelablePromise } from './CancelablePromise.ts'; -import type { OnCancel } from './CancelablePromise.ts'; -import type { OpenAPIConfig } from './OpenAPI.ts'; +import { ApiError } from './ApiError'; +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; +import { CancelablePromise } from './CancelablePromise'; +import type { OnCancel } from './CancelablePromise'; +import type { OpenAPIConfig } from './OpenAPI'; export const isDefined = (value: T | null | undefined): value is Exclude => { return value !== undefined && value !== null; diff --git a/frontend/src/api/index.ts b/frontend/src/api/index.ts index 623ca45..1deabeb 100644 --- a/frontend/src/api/index.ts +++ b/frontend/src/api/index.ts @@ -2,50 +2,53 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export { ApiError } from './core/ApiError.ts'; -export { CancelablePromise, CancelError } from './core/CancelablePromise.ts'; -export { OpenAPI } from './core/OpenAPI.ts'; -export type { OpenAPIConfig } from './core/OpenAPI.ts'; +export { ApiError } from './core/ApiError'; +export { CancelablePromise, CancelError } from './core/CancelablePromise'; +export { OpenAPI } from './core/OpenAPI'; +export type { OpenAPIConfig } from './core/OpenAPI'; -export type { HTTPValidationError } from './models/HTTPValidationError.ts'; -export type { InfoOut } from './models/InfoOut.ts'; -export type { OutBase } from './models/OutBase.ts'; -export type { PlanCreateIn } from './models/PlanCreateIn.ts'; -export type { PlanCreateOut } from './models/PlanCreateOut.ts'; -export type { PlanDeleteIn } from './models/PlanDeleteIn.ts'; -export type { PlanGetIn } from './models/PlanGetIn.ts'; -export type { PlanGetOut } from './models/PlanGetOut.ts'; -export type { PlanReorderIn } from './models/PlanReorderIn.ts'; -export type { PlanUpdateIn } from './models/PlanUpdateIn.ts'; -export type { QueueCreateOut } from './models/QueueCreateOut.ts'; -export type { QueueDeleteIn } from './models/QueueDeleteIn.ts'; -export type { QueueGetIn } from './models/QueueGetIn.ts'; -export type { QueueGetOut } from './models/QueueGetOut.ts'; -export type { QueueItemCreateOut } from './models/QueueItemCreateOut.ts'; -export type { QueueItemDeleteIn } from './models/QueueItemDeleteIn.ts'; -export type { QueueItemReorderIn } from './models/QueueItemReorderIn.ts'; -export type { QueueItemUpdateIn } from './models/QueueItemUpdateIn.ts'; -export type { QueueReorderIn } from './models/QueueReorderIn.ts'; -export type { QueueSetInBase } from './models/QueueSetInBase.ts'; -export type { QueueUpdateIn } from './models/QueueUpdateIn.ts'; -export { ScriptCreateIn } from './models/ScriptCreateIn.ts'; -export type { ScriptCreateOut } from './models/ScriptCreateOut.ts'; -export type { ScriptDeleteIn } from './models/ScriptDeleteIn.ts'; -export type { ScriptGetIn } from './models/ScriptGetIn.ts'; -export type { ScriptGetOut } from './models/ScriptGetOut.ts'; -export type { ScriptReorderIn } from './models/ScriptReorderIn.ts'; -export type { ScriptUpdateIn } from './models/ScriptUpdateIn.ts'; -export type { SettingGetOut } from './models/SettingGetOut.ts'; -export type { SettingUpdateIn } from './models/SettingUpdateIn.ts'; -export type { TimeSetCreateOut } from './models/TimeSetCreateOut.ts'; -export type { TimeSetDeleteIn } from './models/TimeSetDeleteIn.ts'; -export type { TimeSetReorderIn } from './models/TimeSetReorderIn.ts'; -export type { TimeSetUpdateIn } from './models/TimeSetUpdateIn.ts'; -export type { UserCreateOut } from './models/UserCreateOut.ts'; -export type { UserDeleteIn } from './models/UserDeleteIn.ts'; -export type { UserInBase } from './models/UserInBase.ts'; -export type { UserReorderIn } from './models/UserReorderIn.ts'; -export type { UserUpdateIn } from './models/UserUpdateIn.ts'; -export type { ValidationError } from './models/ValidationError.ts'; +export type { DispatchIn } from './models/DispatchIn'; +export type { HTTPValidationError } from './models/HTTPValidationError'; +export type { InfoOut } from './models/InfoOut'; +export type { OutBase } from './models/OutBase'; +export type { PlanCreateIn } from './models/PlanCreateIn'; +export type { PlanCreateOut } from './models/PlanCreateOut'; +export type { PlanDeleteIn } from './models/PlanDeleteIn'; +export type { PlanGetIn } from './models/PlanGetIn'; +export type { PlanGetOut } from './models/PlanGetOut'; +export type { PlanReorderIn } from './models/PlanReorderIn'; +export type { PlanUpdateIn } from './models/PlanUpdateIn'; +export type { QueueCreateOut } from './models/QueueCreateOut'; +export type { QueueDeleteIn } from './models/QueueDeleteIn'; +export type { QueueGetIn } from './models/QueueGetIn'; +export type { QueueGetOut } from './models/QueueGetOut'; +export type { QueueItemCreateOut } from './models/QueueItemCreateOut'; +export type { QueueItemDeleteIn } from './models/QueueItemDeleteIn'; +export type { QueueItemReorderIn } from './models/QueueItemReorderIn'; +export type { QueueItemUpdateIn } from './models/QueueItemUpdateIn'; +export type { QueueReorderIn } from './models/QueueReorderIn'; +export type { QueueSetInBase } from './models/QueueSetInBase'; +export type { QueueUpdateIn } from './models/QueueUpdateIn'; +export { ScriptCreateIn } from './models/ScriptCreateIn'; +export type { ScriptCreateOut } from './models/ScriptCreateOut'; +export type { ScriptDeleteIn } from './models/ScriptDeleteIn'; +export type { ScriptGetIn } from './models/ScriptGetIn'; +export type { ScriptGetOut } from './models/ScriptGetOut'; +export type { ScriptReorderIn } from './models/ScriptReorderIn'; +export type { ScriptUpdateIn } from './models/ScriptUpdateIn'; +export type { SettingGetOut } from './models/SettingGetOut'; +export type { SettingUpdateIn } from './models/SettingUpdateIn'; +export { TaskCreateIn } from './models/TaskCreateIn'; +export type { TaskCreateOut } from './models/TaskCreateOut'; +export type { TimeSetCreateOut } from './models/TimeSetCreateOut'; +export type { TimeSetDeleteIn } from './models/TimeSetDeleteIn'; +export type { TimeSetReorderIn } from './models/TimeSetReorderIn'; +export type { TimeSetUpdateIn } from './models/TimeSetUpdateIn'; +export type { UserCreateOut } from './models/UserCreateOut'; +export type { UserDeleteIn } from './models/UserDeleteIn'; +export type { UserInBase } from './models/UserInBase'; +export type { UserReorderIn } from './models/UserReorderIn'; +export type { UserUpdateIn } from './models/UserUpdateIn'; +export type { ValidationError } from './models/ValidationError'; -export { Service } from './services/Service.ts'; +export { Service } from './services/Service'; diff --git a/frontend/src/api/models/DispatchIn.ts b/frontend/src/api/models/DispatchIn.ts new file mode 100644 index 0000000..69e9b8d --- /dev/null +++ b/frontend/src/api/models/DispatchIn.ts @@ -0,0 +1,11 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type DispatchIn = { + /** + * 目标任务ID,设置类任务可选对应脚本ID或用户ID,代理类任务可选对应队列ID或脚本ID + */ + taskId: string; +}; + diff --git a/frontend/src/api/models/HTTPValidationError.ts b/frontend/src/api/models/HTTPValidationError.ts index 216ff15..f9b1a79 100644 --- a/frontend/src/api/models/HTTPValidationError.ts +++ b/frontend/src/api/models/HTTPValidationError.ts @@ -2,7 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { ValidationError } from './ValidationError.ts'; +import type { ValidationError } from './ValidationError'; export type HTTPValidationError = { detail?: Array; }; diff --git a/frontend/src/api/models/TaskCreateIn.ts b/frontend/src/api/models/TaskCreateIn.ts new file mode 100644 index 0000000..19547dd --- /dev/null +++ b/frontend/src/api/models/TaskCreateIn.ts @@ -0,0 +1,25 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type TaskCreateIn = { + /** + * 目标任务ID,设置类任务可选对应脚本ID或用户ID,代理类任务可选对应队列ID或脚本ID + */ + taskId: string; + /** + * 任务模式 + */ + mode: TaskCreateIn.mode; +}; +export namespace TaskCreateIn { + /** + * 任务模式 + */ + export enum mode { + _ = '自动代理', + _ = '人工排查', + _ = '设置脚本', + } +} + diff --git a/frontend/src/api/models/TaskCreateOut.ts b/frontend/src/api/models/TaskCreateOut.ts new file mode 100644 index 0000000..a1cbd6b --- /dev/null +++ b/frontend/src/api/models/TaskCreateOut.ts @@ -0,0 +1,23 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type TaskCreateOut = { + /** + * 状态码 + */ + code?: number; + /** + * 操作状态 + */ + status?: string; + /** + * 操作消息 + */ + message?: string; + /** + * 新创建的任务ID + */ + taskId: string; +}; + diff --git a/frontend/src/api/services/Service.ts b/frontend/src/api/services/Service.ts index d1283b9..b04c4c8 100644 --- a/frontend/src/api/services/Service.ts +++ b/frontend/src/api/services/Service.ts @@ -2,47 +2,50 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { InfoOut } from '../models/InfoOut.ts'; -import type { OutBase } from '../models/OutBase.ts'; -import type { PlanCreateIn } from '../models/PlanCreateIn.ts'; -import type { PlanCreateOut } from '../models/PlanCreateOut.ts'; -import type { PlanDeleteIn } from '../models/PlanDeleteIn.ts'; -import type { PlanGetIn } from '../models/PlanGetIn.ts'; -import type { PlanGetOut } from '../models/PlanGetOut.ts'; -import type { PlanReorderIn } from '../models/PlanReorderIn.ts'; -import type { PlanUpdateIn } from '../models/PlanUpdateIn.ts'; -import type { QueueCreateOut } from '../models/QueueCreateOut.ts'; -import type { QueueDeleteIn } from '../models/QueueDeleteIn.ts'; -import type { QueueGetIn } from '../models/QueueGetIn.ts'; -import type { QueueGetOut } from '../models/QueueGetOut.ts'; -import type { QueueItemCreateOut } from '../models/QueueItemCreateOut.ts'; -import type { QueueItemDeleteIn } from '../models/QueueItemDeleteIn.ts'; -import type { QueueItemReorderIn } from '../models/QueueItemReorderIn.ts'; -import type { QueueItemUpdateIn } from '../models/QueueItemUpdateIn.ts'; -import type { QueueReorderIn } from '../models/QueueReorderIn.ts'; -import type { QueueSetInBase } from '../models/QueueSetInBase.ts'; -import type { QueueUpdateIn } from '../models/QueueUpdateIn.ts'; -import type { ScriptCreateIn } from '../models/ScriptCreateIn.ts'; -import type { ScriptCreateOut } from '../models/ScriptCreateOut.ts'; -import type { ScriptDeleteIn } from '../models/ScriptDeleteIn.ts'; -import type { ScriptGetIn } from '../models/ScriptGetIn.ts'; -import type { ScriptGetOut } from '../models/ScriptGetOut.ts'; -import type { ScriptReorderIn } from '../models/ScriptReorderIn.ts'; -import type { ScriptUpdateIn } from '../models/ScriptUpdateIn.ts'; -import type { SettingGetOut } from '../models/SettingGetOut.ts'; -import type { SettingUpdateIn } from '../models/SettingUpdateIn.ts'; -import type { TimeSetCreateOut } from '../models/TimeSetCreateOut.ts'; -import type { TimeSetDeleteIn } from '../models/TimeSetDeleteIn.ts'; -import type { TimeSetReorderIn } from '../models/TimeSetReorderIn.ts'; -import type { TimeSetUpdateIn } from '../models/TimeSetUpdateIn.ts'; -import type { UserCreateOut } from '../models/UserCreateOut.ts'; -import type { UserDeleteIn } from '../models/UserDeleteIn.ts'; -import type { UserInBase } from '../models/UserInBase.ts'; -import type { UserReorderIn } from '../models/UserReorderIn.ts'; -import type { UserUpdateIn } from '../models/UserUpdateIn.ts'; -import type { CancelablePromise } from '../core/CancelablePromise.ts'; -import { OpenAPI } from '../core/OpenAPI.ts'; -import { request as __request } from '../core/request.ts'; +import type { DispatchIn } from '../models/DispatchIn'; +import type { InfoOut } from '../models/InfoOut'; +import type { OutBase } from '../models/OutBase'; +import type { PlanCreateIn } from '../models/PlanCreateIn'; +import type { PlanCreateOut } from '../models/PlanCreateOut'; +import type { PlanDeleteIn } from '../models/PlanDeleteIn'; +import type { PlanGetIn } from '../models/PlanGetIn'; +import type { PlanGetOut } from '../models/PlanGetOut'; +import type { PlanReorderIn } from '../models/PlanReorderIn'; +import type { PlanUpdateIn } from '../models/PlanUpdateIn'; +import type { QueueCreateOut } from '../models/QueueCreateOut'; +import type { QueueDeleteIn } from '../models/QueueDeleteIn'; +import type { QueueGetIn } from '../models/QueueGetIn'; +import type { QueueGetOut } from '../models/QueueGetOut'; +import type { QueueItemCreateOut } from '../models/QueueItemCreateOut'; +import type { QueueItemDeleteIn } from '../models/QueueItemDeleteIn'; +import type { QueueItemReorderIn } from '../models/QueueItemReorderIn'; +import type { QueueItemUpdateIn } from '../models/QueueItemUpdateIn'; +import type { QueueReorderIn } from '../models/QueueReorderIn'; +import type { QueueSetInBase } from '../models/QueueSetInBase'; +import type { QueueUpdateIn } from '../models/QueueUpdateIn'; +import type { ScriptCreateIn } from '../models/ScriptCreateIn'; +import type { ScriptCreateOut } from '../models/ScriptCreateOut'; +import type { ScriptDeleteIn } from '../models/ScriptDeleteIn'; +import type { ScriptGetIn } from '../models/ScriptGetIn'; +import type { ScriptGetOut } from '../models/ScriptGetOut'; +import type { ScriptReorderIn } from '../models/ScriptReorderIn'; +import type { ScriptUpdateIn } from '../models/ScriptUpdateIn'; +import type { SettingGetOut } from '../models/SettingGetOut'; +import type { SettingUpdateIn } from '../models/SettingUpdateIn'; +import type { TaskCreateIn } from '../models/TaskCreateIn'; +import type { TaskCreateOut } from '../models/TaskCreateOut'; +import type { TimeSetCreateOut } from '../models/TimeSetCreateOut'; +import type { TimeSetDeleteIn } from '../models/TimeSetDeleteIn'; +import type { TimeSetReorderIn } from '../models/TimeSetReorderIn'; +import type { TimeSetUpdateIn } from '../models/TimeSetUpdateIn'; +import type { UserCreateOut } from '../models/UserCreateOut'; +import type { UserDeleteIn } from '../models/UserDeleteIn'; +import type { UserInBase } from '../models/UserInBase'; +import type { UserReorderIn } from '../models/UserReorderIn'; +import type { UserUpdateIn } from '../models/UserUpdateIn'; +import type { CancelablePromise } from '../core/CancelablePromise'; +import { OpenAPI } from '../core/OpenAPI'; +import { request as __request } from '../core/request'; export class Service { /** * 获取关卡号信息 @@ -77,6 +80,17 @@ export class Service { url: '/api/info/apps_info', }); } + /** + * 信息总览 + * @returns InfoOut Successful Response + * @throws ApiError + */ + public static addOverviewApiInfoGetOverviewPost(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/info/get/overview', + }); + } /** * 添加脚本 * @param requestBody @@ -582,6 +596,44 @@ export class Service { }, }); } + /** + * 添加任务 + * @param requestBody + * @returns TaskCreateOut Successful Response + * @throws ApiError + */ + public static addTaskApiDispatchStartPost( + requestBody: TaskCreateIn, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/dispatch/start', + body: requestBody, + mediaType: 'application/json', + errors: { + 422: `Validation Error`, + }, + }); + } + /** + * 中止任务 + * @param requestBody + * @returns OutBase Successful Response + * @throws ApiError + */ + public static stopTaskApiDispatchStopPost( + requestBody: DispatchIn, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/dispatch/stop', + body: requestBody, + mediaType: 'application/json', + errors: { + 422: `Validation Error`, + }, + }); + } /** * 查询配置 * 查询配置