diff options
author | Chocobozzz <me@florianbigard.com> | 2023-07-27 11:44:31 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-07-27 14:17:12 +0200 |
commit | f18003d0ac5c3fc6ec8de2a89102d1e1e89182df (patch) | |
tree | 0b3baa5658478607f3417fe7c747cc3a782f15b3 /shared/server-commands | |
parent | f5af5feb5a41eb6e2796e480402106b55bd10f04 (diff) | |
download | PeerTube-f18003d0ac5c3fc6ec8de2a89102d1e1e89182df.tar.gz PeerTube-f18003d0ac5c3fc6ec8de2a89102d1e1e89182df.tar.zst PeerTube-f18003d0ac5c3fc6ec8de2a89102d1e1e89182df.zip |
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
Diffstat (limited to 'shared/server-commands')
-rw-r--r-- | shared/server-commands/runners/runner-jobs-command.ts | 22 |
1 files changed, 15 insertions, 7 deletions
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 { | |||
8 | isHLSTranscodingPayloadSuccess, | 8 | isHLSTranscodingPayloadSuccess, |
9 | isLiveRTMPHLSTranscodingUpdatePayload, | 9 | isLiveRTMPHLSTranscodingUpdatePayload, |
10 | isWebVideoOrAudioMergeTranscodingPayloadSuccess, | 10 | isWebVideoOrAudioMergeTranscodingPayloadSuccess, |
11 | ListRunnerJobsQuery, | ||
11 | RequestRunnerJobBody, | 12 | RequestRunnerJobBody, |
12 | RequestRunnerJobResult, | 13 | RequestRunnerJobResult, |
13 | ResultList, | 14 | ResultList, |
@@ -27,19 +28,14 @@ import { AbstractCommand, OverrideCommandOptions } from '../shared' | |||
27 | 28 | ||
28 | export class RunnerJobsCommand extends AbstractCommand { | 29 | export class RunnerJobsCommand extends AbstractCommand { |
29 | 30 | ||
30 | list (options: OverrideCommandOptions & { | 31 | list (options: OverrideCommandOptions & ListRunnerJobsQuery = {}) { |
31 | start?: number | ||
32 | count?: number | ||
33 | sort?: string | ||
34 | search?: string | ||
35 | } = {}) { | ||
36 | const path = '/api/v1/runners/jobs' | 32 | const path = '/api/v1/runners/jobs' |
37 | 33 | ||
38 | return this.getRequestBody<ResultList<RunnerJobAdmin>>({ | 34 | return this.getRequestBody<ResultList<RunnerJobAdmin>>({ |
39 | ...options, | 35 | ...options, |
40 | 36 | ||
41 | path, | 37 | path, |
42 | query: pick(options, [ 'start', 'count', 'sort', 'search' ]), | 38 | query: pick(options, [ 'start', 'count', 'sort', 'search', 'stateOneOf' ]), |
43 | implicitToken: true, | 39 | implicitToken: true, |
44 | defaultExpectedStatus: HttpStatusCode.OK_200 | 40 | defaultExpectedStatus: HttpStatusCode.OK_200 |
45 | }) | 41 | }) |
@@ -57,6 +53,18 @@ export class RunnerJobsCommand extends AbstractCommand { | |||
57 | }) | 53 | }) |
58 | } | 54 | } |
59 | 55 | ||
56 | deleteByAdmin (options: OverrideCommandOptions & { jobUUID: string }) { | ||
57 | const path = '/api/v1/runners/jobs/' + options.jobUUID | ||
58 | |||
59 | return this.deleteRequest({ | ||
60 | ...options, | ||
61 | |||
62 | path, | ||
63 | implicitToken: true, | ||
64 | defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 | ||
65 | }) | ||
66 | } | ||
67 | |||
60 | // --------------------------------------------------------------------------- | 68 | // --------------------------------------------------------------------------- |
61 | 69 | ||
62 | request (options: OverrideCommandOptions & RequestRunnerJobBody) { | 70 | request (options: OverrideCommandOptions & RequestRunnerJobBody) { |