From cd3d847d63239802553b19f359c290a08fa0850c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 10 Dec 2019 10:02:23 +0100 Subject: [PATCH] Add a warning when uploading videos using root --- .../app/videos/+video-edit/video-add.component.html | 8 +++++++- .../app/videos/+video-edit/video-add.component.scss | 11 ++++++++++- .../src/app/videos/+video-edit/video-add.component.ts | 11 ++++++++++- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/client/src/app/videos/+video-edit/video-add.component.html b/client/src/app/videos/+video-edit/video-add.component.html index 72a233b72..a99988600 100644 --- a/client/src/app/videos/+video-edit/video-add.component.html +++ b/client/src/app/videos/+video-edit/video-add.component.html @@ -1,5 +1,11 @@
-
+
+ We recommend you to not use the root user to publish your videos, since it's the super-admin account of your instance. +
+ Instead, create a dedicated account to upload your videos. +
+ +
Import {{ videoName }} Upload {{ videoName }}
diff --git a/client/src/app/videos/+video-edit/video-add.component.scss b/client/src/app/videos/+video-edit/video-add.component.scss index da711ec5b..7acab3744 100644 --- a/client/src/app/videos/+video-edit/video-add.component.scss +++ b/client/src/app/videos/+video-edit/video-add.component.scss @@ -5,13 +5,22 @@ $border-width: 3px; $border-type: solid; $border-color: #EAEAEA; +.margin-content { + padding-top: 50px; +} + +.alert { + font-size: 15px; +} + ::ng-deep .root-tabset.video-add-tabset { + margin-top: 50px; + &.hide-nav > .nav { display: none !important; } & > .nav { - border-bottom: $border-width $border-type $border-color; margin: 0 !important; diff --git a/client/src/app/videos/+video-edit/video-add.component.ts b/client/src/app/videos/+video-edit/video-add.component.ts index 193de441d..911bc884e 100644 --- a/client/src/app/videos/+video-edit/video-add.component.ts +++ b/client/src/app/videos/+video-edit/video-add.component.ts @@ -2,7 +2,7 @@ import { Component, HostListener, ViewChild } from '@angular/core' import { CanComponentDeactivate } from '@app/shared/guards/can-deactivate-guard.service' import { VideoImportUrlComponent } from '@app/videos/+video-edit/video-add-components/video-import-url.component' import { VideoUploadComponent } from '@app/videos/+video-edit/video-add-components/video-upload.component' -import { ServerService } from '@app/core' +import { AuthService, ServerService } from '@app/core' import { VideoImportTorrentComponent } from '@app/videos/+video-edit/video-add-components/video-import-torrent.component' @Component({ @@ -19,6 +19,7 @@ export class VideoAddComponent implements CanComponentDeactivate { videoName: string constructor ( + private auth: AuthService, private serverService: ServerService ) {} @@ -57,4 +58,12 @@ export class VideoAddComponent implements CanComponentDeactivate { isVideoImportTorrentEnabled () { return this.serverService.getConfig().import.videos.torrent.enabled } + + isInSecondStep () { + return !!this.secondStepType + } + + isRootUser () { + return this.auth.getUser().username === 'root' + } }