From f18003d0ac5c3fc6ec8de2a89102d1e1e89182df Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 27 Jul 2023 11:44:31 +0200 Subject: Improve runner management * Add ability to remove runner jobs * Add runner job state quick filter * Merge registration tokens and runners tables in the same page * Add copy button to copy registration token --- .../server-commands/runners/runner-jobs-command.ts | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'shared/server-commands') diff --git a/shared/server-commands/runners/runner-jobs-command.ts b/shared/server-commands/runners/runner-jobs-command.ts index 26dbef77a..0a0ffb5d3 100644 --- a/shared/server-commands/runners/runner-jobs-command.ts +++ b/shared/server-commands/runners/runner-jobs-command.ts @@ -8,6 +8,7 @@ import { isHLSTranscodingPayloadSuccess, isLiveRTMPHLSTranscodingUpdatePayload, isWebVideoOrAudioMergeTranscodingPayloadSuccess, + ListRunnerJobsQuery, RequestRunnerJobBody, RequestRunnerJobResult, ResultList, @@ -27,19 +28,14 @@ import { AbstractCommand, OverrideCommandOptions } from '../shared' export class RunnerJobsCommand extends AbstractCommand { - list (options: OverrideCommandOptions & { - start?: number - count?: number - sort?: string - search?: string - } = {}) { + list (options: OverrideCommandOptions & ListRunnerJobsQuery = {}) { const path = '/api/v1/runners/jobs' return this.getRequestBody>({ ...options, path, - query: pick(options, [ 'start', 'count', 'sort', 'search' ]), + query: pick(options, [ 'start', 'count', 'sort', 'search', 'stateOneOf' ]), implicitToken: true, defaultExpectedStatus: HttpStatusCode.OK_200 }) @@ -57,6 +53,18 @@ export class RunnerJobsCommand extends AbstractCommand { }) } + deleteByAdmin (options: OverrideCommandOptions & { jobUUID: string }) { + const path = '/api/v1/runners/jobs/' + options.jobUUID + + return this.deleteRequest({ + ...options, + + path, + implicitToken: true, + defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 + }) + } + // --------------------------------------------------------------------------- request (options: OverrideCommandOptions & RequestRunnerJobBody) { -- cgit v1.2.3