Add a warning when uploading videos using root
This commit is contained in:
parent
5e6c69cedd
commit
cd3d847d63
|
@ -1,5 +1,11 @@
|
||||||
<div class="margin-content">
|
<div class="margin-content">
|
||||||
<div class="title-page title-page-single">
|
<div class="alert alert-warning" *ngIf="isRootUser()" i18n>
|
||||||
|
We recommend you to not use the <strong>root</strong> user to publish your videos, since it's the super-admin account of your instance.
|
||||||
|
<br />
|
||||||
|
Instead, <a routerLink="/admin/users">create a dedicated account</a> to upload your videos.
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="title-page title-page-single" *ngIf="isInSecondStep()">
|
||||||
<ng-container *ngIf="secondStepType === 'import-url' || secondStepType === 'import-torrent'" i18n>Import {{ videoName }}</ng-container>
|
<ng-container *ngIf="secondStepType === 'import-url' || secondStepType === 'import-torrent'" i18n>Import {{ videoName }}</ng-container>
|
||||||
<ng-container *ngIf="secondStepType === 'upload'" i18n>Upload {{ videoName }}</ng-container>
|
<ng-container *ngIf="secondStepType === 'upload'" i18n>Upload {{ videoName }}</ng-container>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -5,13 +5,22 @@ $border-width: 3px;
|
||||||
$border-type: solid;
|
$border-type: solid;
|
||||||
$border-color: #EAEAEA;
|
$border-color: #EAEAEA;
|
||||||
|
|
||||||
|
.margin-content {
|
||||||
|
padding-top: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.alert {
|
||||||
|
font-size: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
::ng-deep .root-tabset.video-add-tabset {
|
::ng-deep .root-tabset.video-add-tabset {
|
||||||
|
margin-top: 50px;
|
||||||
|
|
||||||
&.hide-nav > .nav {
|
&.hide-nav > .nav {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
& > .nav {
|
& > .nav {
|
||||||
|
|
||||||
border-bottom: $border-width $border-type $border-color;
|
border-bottom: $border-width $border-type $border-color;
|
||||||
margin: 0 !important;
|
margin: 0 !important;
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { Component, HostListener, ViewChild } from '@angular/core'
|
||||||
import { CanComponentDeactivate } from '@app/shared/guards/can-deactivate-guard.service'
|
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 { 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 { 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'
|
import { VideoImportTorrentComponent } from '@app/videos/+video-edit/video-add-components/video-import-torrent.component'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -19,6 +19,7 @@ export class VideoAddComponent implements CanComponentDeactivate {
|
||||||
videoName: string
|
videoName: string
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
|
private auth: AuthService,
|
||||||
private serverService: ServerService
|
private serverService: ServerService
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
@ -57,4 +58,12 @@ export class VideoAddComponent implements CanComponentDeactivate {
|
||||||
isVideoImportTorrentEnabled () {
|
isVideoImportTorrentEnabled () {
|
||||||
return this.serverService.getConfig().import.videos.torrent.enabled
|
return this.serverService.getConfig().import.videos.torrent.enabled
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isInSecondStep () {
|
||||||
|
return !!this.secondStepType
|
||||||
|
}
|
||||||
|
|
||||||
|
isRootUser () {
|
||||||
|
return this.auth.getUser().username === 'root'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue