diff --git a/client/src/app/+admin/admin.component.ts b/client/src/app/+admin/admin.component.ts index 630bfe253..d4d912c40 100644 --- a/client/src/app/+admin/admin.component.ts +++ b/client/src/app/+admin/admin.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from '@angular/core' -import { AuthService, ScreenService } from '@app/core' +import { AuthService, ScreenService, ServerService } from '@app/core' import { ListOverflowItem } from '@app/shared/shared-main' import { TopMenuDropdownParam } from '@app/shared/shared-main/misc/top-menu-dropdown.component' import { UserRight } from '@shared/models' @@ -14,7 +14,8 @@ export class AdminComponent implements OnInit { constructor ( private auth: AuthService, - private screen: ScreenService + private screen: ScreenService, + private server: ServerService ) { } get isBroadcastMessageDisplayed () { @@ -22,6 +23,14 @@ export class AdminComponent implements OnInit { } ngOnInit () { + this.server.configReloaded.subscribe(() => this.buildMenu()) + + this.buildMenu() + } + + private buildMenu () { + this.menuEntries = [] + this.buildOverviewItems() this.buildFederationItems() this.buildModerationItems() @@ -157,9 +166,23 @@ export class AdminComponent implements OnInit { children: [] } + if (this.isRemoteRunnersEnabled() && this.hasRunnersRight()) { + systemItems.children.push({ + label: $localize`Remote runners`, + iconName: 'codesandbox', + routerLink: '/admin/system/runners/runners-list' + }) + + systemItems.children.push({ + label: $localize`Runner jobs`, + iconName: 'globe', + routerLink: '/admin/system/runners/jobs-list' + }) + } + if (this.hasJobsRight()) { systemItems.children.push({ - label: $localize`Jobs`, + label: $localize`Local jobs`, iconName: 'circle-tick', routerLink: '/admin/system/jobs' }) @@ -226,6 +249,10 @@ export class AdminComponent implements OnInit { return this.auth.getUser().hasRight(UserRight.MANAGE_JOBS) } + private hasRunnersRight () { + return this.auth.getUser().hasRight(UserRight.MANAGE_RUNNERS) + } + private hasDebugRight () { return this.auth.getUser().hasRight(UserRight.MANAGE_DEBUG) } @@ -241,4 +268,10 @@ export class AdminComponent implements OnInit { private hasRegistrationsRight () { return this.auth.getUser().hasRight(UserRight.MANAGE_REGISTRATIONS) } + + private isRemoteRunnersEnabled () { + const config = this.server.getHTMLConfig() + + return config.transcoding.remoteRunners.enabled || config.live.transcoding.remoteRunners.enabled + } } diff --git a/client/src/app/+admin/admin.module.ts b/client/src/app/+admin/admin.module.ts index 891ff4ed1..006cb025a 100644 --- a/client/src/app/+admin/admin.module.ts +++ b/client/src/app/+admin/admin.module.ts @@ -56,9 +56,17 @@ import { PluginShowInstalledComponent } from './plugins' import { SharedAdminModule } from './shared' -import { JobService, LogsComponent, LogsService } from './system' +import { + JobService, + LogsComponent, + LogsService, + RunnerJobListComponent, + RunnerListComponent, + RunnerRegistrationTokenListComponent, + RunnerService +} from './system' import { DebugComponent, DebugService } from './system/debug' -import { JobsComponent } from './system/jobs/jobs.component' +import { JobsComponent } from './system/jobs' @NgModule({ imports: [ @@ -125,7 +133,11 @@ import { JobsComponent } from './system/jobs/jobs.component' EditHomepageComponent, RegistrationListComponent, - ProcessRegistrationModalComponent + ProcessRegistrationModalComponent, + + RunnerRegistrationTokenListComponent, + RunnerListComponent, + RunnerJobListComponent ], exports: [ @@ -140,7 +152,8 @@ import { JobsComponent } from './system/jobs/jobs.component' PluginApiService, EditConfigurationService, VideoAdminService, - AdminRegistrationService + AdminRegistrationService, + RunnerService ] }) export class AdminModule { } diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts index 0526ed8f1..335aedb67 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts @@ -190,6 +190,9 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit { }, webtorrent: { enabled: null + }, + remoteRunners: { + enabled: null } }, live: { @@ -208,7 +211,10 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit { threads: TRANSCODING_THREADS_VALIDATOR, profile: null, resolutions: {}, - alwaysTranscodeOriginalResolution: null + alwaysTranscodeOriginalResolution: null, + remoteRunners: { + enabled: null + } } }, videoStudio: { diff --git a/client/src/app/+admin/config/edit-custom-config/edit-live-configuration.component.html b/client/src/app/+admin/config/edit-custom-config/edit-live-configuration.component.html index c90c34c80..34ce8efa6 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-live-configuration.component.html +++ b/client/src/app/+admin/config/edit-custom-config/edit-live-configuration.component.html @@ -110,6 +110,20 @@ +
{{ runnerJob.payload }}+
{{ runnerJob.privatePayload }}+
{{ runnerJob.error }}+