diff options
author | Chocobozzz <me@florianbigard.com> | 2019-12-10 10:02:23 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-12-10 10:02:23 +0100 |
commit | cd3d847d63239802553b19f359c290a08fa0850c (patch) | |
tree | 1092b8cf811665c6d33c1e8cb50b5a8aa3a007fb /client/src/app | |
parent | 5e6c69cedd39d7df2d6ceedacad0ac51e6f6862a (diff) | |
download | PeerTube-cd3d847d63239802553b19f359c290a08fa0850c.tar.gz PeerTube-cd3d847d63239802553b19f359c290a08fa0850c.tar.zst PeerTube-cd3d847d63239802553b19f359c290a08fa0850c.zip |
Add a warning when uploading videos using root
Diffstat (limited to 'client/src/app')
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 @@ | |||
1 | <div class="margin-content"> | 1 | <div class="margin-content"> |
2 | <div class="title-page title-page-single"> | 2 | <div class="alert alert-warning" *ngIf="isRootUser()" i18n> |
3 | 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. | ||
4 | <br /> | ||
5 | Instead, <a routerLink="/admin/users">create a dedicated account</a> to upload your videos. | ||
6 | </div> | ||
7 | |||
8 | <div class="title-page title-page-single" *ngIf="isInSecondStep()"> | ||
3 | <ng-container *ngIf="secondStepType === 'import-url' || secondStepType === 'import-torrent'" i18n>Import {{ videoName }}</ng-container> | 9 | <ng-container *ngIf="secondStepType === 'import-url' || secondStepType === 'import-torrent'" i18n>Import {{ videoName }}</ng-container> |
4 | <ng-container *ngIf="secondStepType === 'upload'" i18n>Upload {{ videoName }}</ng-container> | 10 | <ng-container *ngIf="secondStepType === 'upload'" i18n>Upload {{ videoName }}</ng-container> |
5 | </div> | 11 | </div> |
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; | |||
5 | $border-type: solid; | 5 | $border-type: solid; |
6 | $border-color: #EAEAEA; | 6 | $border-color: #EAEAEA; |
7 | 7 | ||
8 | .margin-content { | ||
9 | padding-top: 50px; | ||
10 | } | ||
11 | |||
12 | .alert { | ||
13 | font-size: 15px; | ||
14 | } | ||
15 | |||
8 | ::ng-deep .root-tabset.video-add-tabset { | 16 | ::ng-deep .root-tabset.video-add-tabset { |
17 | margin-top: 50px; | ||
18 | |||
9 | &.hide-nav > .nav { | 19 | &.hide-nav > .nav { |
10 | display: none !important; | 20 | display: none !important; |
11 | } | 21 | } |
12 | 22 | ||
13 | & > .nav { | 23 | & > .nav { |
14 | |||
15 | border-bottom: $border-width $border-type $border-color; | 24 | border-bottom: $border-width $border-type $border-color; |
16 | margin: 0 !important; | 25 | margin: 0 !important; |
17 | 26 | ||
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' | |||
2 | import { CanComponentDeactivate } from '@app/shared/guards/can-deactivate-guard.service' | 2 | import { CanComponentDeactivate } from '@app/shared/guards/can-deactivate-guard.service' |
3 | import { VideoImportUrlComponent } from '@app/videos/+video-edit/video-add-components/video-import-url.component' | 3 | import { VideoImportUrlComponent } from '@app/videos/+video-edit/video-add-components/video-import-url.component' |
4 | import { VideoUploadComponent } from '@app/videos/+video-edit/video-add-components/video-upload.component' | 4 | import { VideoUploadComponent } from '@app/videos/+video-edit/video-add-components/video-upload.component' |
5 | import { ServerService } from '@app/core' | 5 | import { AuthService, ServerService } from '@app/core' |
6 | import { VideoImportTorrentComponent } from '@app/videos/+video-edit/video-add-components/video-import-torrent.component' | 6 | import { VideoImportTorrentComponent } from '@app/videos/+video-edit/video-add-components/video-import-torrent.component' |
7 | 7 | ||
8 | @Component({ | 8 | @Component({ |
@@ -19,6 +19,7 @@ export class VideoAddComponent implements CanComponentDeactivate { | |||
19 | videoName: string | 19 | videoName: string |
20 | 20 | ||
21 | constructor ( | 21 | constructor ( |
22 | private auth: AuthService, | ||
22 | private serverService: ServerService | 23 | private serverService: ServerService |
23 | ) {} | 24 | ) {} |
24 | 25 | ||
@@ -57,4 +58,12 @@ export class VideoAddComponent implements CanComponentDeactivate { | |||
57 | isVideoImportTorrentEnabled () { | 58 | isVideoImportTorrentEnabled () { |
58 | return this.serverService.getConfig().import.videos.torrent.enabled | 59 | return this.serverService.getConfig().import.videos.torrent.enabled |
59 | } | 60 | } |
61 | |||
62 | isInSecondStep () { | ||
63 | return !!this.secondStepType | ||
64 | } | ||
65 | |||
66 | isRootUser () { | ||
67 | return this.auth.getUser().username === 'root' | ||
68 | } | ||
60 | } | 69 | } |