1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 10:49:28 +02:00

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
This commit is contained in:
Chocobozzz 2023-07-27 11:44:31 +02:00
parent f5af5feb5a
commit f18003d0ac
No known key found for this signature in database
GPG key ID: 583A612D890159BE
31 changed files with 446 additions and 88 deletions

View file

@ -1,6 +1,6 @@
import { UploadFilesForCheck } from 'express'
import validator from 'validator'
import { CONSTRAINTS_FIELDS } from '@server/initializers/constants'
import { CONSTRAINTS_FIELDS, RUNNER_JOB_STATES } from '@server/initializers/constants'
import {
LiveRTMPHLSTranscodingSuccess,
RunnerJobSuccessPayload,
@ -11,7 +11,7 @@ import {
VODHLSTranscodingSuccess,
VODWebVideoTranscodingSuccess
} from '@shared/models'
import { exists, isFileValid, isSafeFilename } from '../misc'
import { exists, isArray, isFileValid, isSafeFilename } from '../misc'
const RUNNER_JOBS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.RUNNER_JOBS
@ -56,6 +56,14 @@ function isRunnerJobErrorMessageValid (value: string) {
return validator.isLength(value, RUNNER_JOBS_CONSTRAINTS_FIELDS.ERROR_MESSAGE)
}
function isRunnerJobStateValid (value: any) {
return exists(value) && RUNNER_JOB_STATES[value] !== undefined
}
function isRunnerJobArrayOfStateValid (value: any) {
return isArray(value) && value.every(v => isRunnerJobStateValid(v))
}
// ---------------------------------------------------------------------------
export {
@ -65,7 +73,9 @@ export {
isRunnerJobTokenValid,
isRunnerJobErrorMessageValid,
isRunnerJobProgressValid,
isRunnerJobAbortReasonValid
isRunnerJobAbortReasonValid,
isRunnerJobArrayOfStateValid,
isRunnerJobStateValid
}
// ---------------------------------------------------------------------------