diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-09-14 23:03:43 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-09-14 23:03:43 +0200 |
commit | 315cc0cc1871ab2a6d6c1bb61cf7b9f10511c3a9 (patch) | |
tree | 68cb1b103cc073e0c2ad3de651dfe26c6fe03477 /client/src | |
parent | 3523b64a03d677c2f8df61c121ff4fcb1d9db7f9 (diff) | |
download | PeerTube-315cc0cc1871ab2a6d6c1bb61cf7b9f10511c3a9.tar.gz PeerTube-315cc0cc1871ab2a6d6c1bb61cf7b9f10511c3a9.tar.zst PeerTube-315cc0cc1871ab2a6d6c1bb61cf7b9f10511c3a9.zip |
Add info when server is processing a video at upload
Diffstat (limited to 'client/src')
6 files changed, 37 insertions, 29 deletions
diff --git a/client/src/app/shared/rest/rest-extractor.service.ts b/client/src/app/shared/rest/rest-extractor.service.ts index 1f6222da8..62c600d25 100644 --- a/client/src/app/shared/rest/rest-extractor.service.ts +++ b/client/src/app/shared/rest/rest-extractor.service.ts | |||
@@ -40,15 +40,13 @@ export class RestExtractor { | |||
40 | handleError (err: HttpErrorResponse) { | 40 | handleError (err: HttpErrorResponse) { |
41 | let errorMessage | 41 | let errorMessage |
42 | 42 | ||
43 | console.log(err) | ||
44 | |||
45 | if (err.error instanceof Error) { | 43 | if (err.error instanceof Error) { |
46 | // A client-side or network error occurred. Handle it accordingly. | 44 | // A client-side or network error occurred. Handle it accordingly. |
47 | errorMessage = err.error.message | 45 | errorMessage = err.error.message |
48 | console.error('An error occurred:', errorMessage) | 46 | console.error('An error occurred:', errorMessage) |
49 | } else if (err.status !== undefined) { | 47 | } else if (err.status !== undefined) { |
50 | const body = err.error | 48 | const body = err.error |
51 | errorMessage = body.error | 49 | errorMessage = body ? body.error : 'Unknown error.' |
52 | console.error(`Backend returned code ${err.status}, body was: ${errorMessage}`) | 50 | console.error(`Backend returned code ${err.status}, body was: ${errorMessage}`) |
53 | } else { | 51 | } else { |
54 | errorMessage = err | 52 | errorMessage = err |
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 cf8fc2b80..698152ff9 100644 --- a/client/src/app/videos/video-edit/video-add.component.html +++ b/client/src/app/videos/video-edit/video-add.component.html | |||
@@ -102,7 +102,12 @@ | |||
102 | </div> | 102 | </div> |
103 | 103 | ||
104 | <div class="progress"> | 104 | <div class="progress"> |
105 | <progressbar [value]="progressPercent" max="100"></progressbar> | 105 | <progressbar [value]="progressPercent" max="100"> |
106 | <ng-template [ngIf]="progressPercent === 100"> | ||
107 | <span class="glyphicon glyphicon-refresh glyphicon-refresh-animate"></span> | ||
108 | Server is processing the video | ||
109 | </ng-template> | ||
110 | </progressbar> | ||
106 | </div> | 111 | </div> |
107 | 112 | ||
108 | <div class="form-group"> | 113 | <div class="form-group"> |
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 537ef9bc3..21311b184 100644 --- a/client/src/app/videos/video-edit/video-add.component.ts +++ b/client/src/app/videos/video-edit/video-add.component.ts | |||
@@ -151,11 +151,15 @@ export class VideoAddComponent extends FormReactive implements OnInit { | |||
151 | this.notificationsService.success('Success', 'Video uploaded.') | 151 | this.notificationsService.success('Success', 'Video uploaded.') |
152 | 152 | ||
153 | // Display all the videos once it's finished | 153 | // Display all the videos once it's finished |
154 | this.router.navigate([ '/videos/list ']) | 154 | this.router.navigate([ '/videos/list' ]) |
155 | } | 155 | } |
156 | }, | 156 | }, |
157 | 157 | ||
158 | err => this.error = err.message | 158 | err => { |
159 | // Reset progress | ||
160 | this.progressPercent = 0 | ||
161 | this.error = err.message | ||
162 | } | ||
159 | ) | 163 | ) |
160 | } | 164 | } |
161 | } | 165 | } |
diff --git a/client/src/app/videos/video-list/loader.component.scss b/client/src/app/videos/video-list/loader.component.scss deleted file mode 100644 index 44cf1f9da..000000000 --- a/client/src/app/videos/video-list/loader.component.scss +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | // Thanks https://gist.github.com/alexandrevicenzi/680147013e902a4eaa5d | ||
2 | .glyphicon-refresh-animate { | ||
3 | -animation: spin .7s infinite linear; | ||
4 | -ms-animation: spin .7s infinite linear; | ||
5 | -webkit-animation: spinw .7s infinite linear; | ||
6 | -moz-animation: spinm .7s infinite linear; | ||
7 | } | ||
8 | |||
9 | @keyframes spin { | ||
10 | from { transform: scale(1) rotate(0deg);} | ||
11 | to { transform: scale(1) rotate(360deg);} | ||
12 | } | ||
13 | |||
14 | @-webkit-keyframes spinw { | ||
15 | from { -webkit-transform: rotate(0deg);} | ||
16 | to { -webkit-transform: rotate(360deg);} | ||
17 | } | ||
18 | |||
19 | @-moz-keyframes spinm { | ||
20 | from { -moz-transform: rotate(0deg);} | ||
21 | to { -moz-transform: rotate(360deg);} | ||
22 | } | ||
diff --git a/client/src/app/videos/video-list/loader.component.ts b/client/src/app/videos/video-list/loader.component.ts index e5780e0fa..f37d70c85 100644 --- a/client/src/app/videos/video-list/loader.component.ts +++ b/client/src/app/videos/video-list/loader.component.ts | |||
@@ -2,7 +2,7 @@ import { Component, Input } from '@angular/core' | |||
2 | 2 | ||
3 | @Component({ | 3 | @Component({ |
4 | selector: 'my-loader', | 4 | selector: 'my-loader', |
5 | styleUrls: [ './loader.component.scss' ], | 5 | styleUrls: [ ], |
6 | templateUrl: './loader.component.html' | 6 | templateUrl: './loader.component.html' |
7 | }) | 7 | }) |
8 | 8 | ||
diff --git a/client/src/sass/application.scss b/client/src/sass/application.scss index cd573841d..8e2666944 100644 --- a/client/src/sass/application.scss +++ b/client/src/sass/application.scss | |||
@@ -47,6 +47,29 @@ input.readonly { | |||
47 | } | 47 | } |
48 | } | 48 | } |
49 | 49 | ||
50 | // Thanks https://gist.github.com/alexandrevicenzi/680147013e902a4eaa5d | ||
51 | .glyphicon-refresh-animate { | ||
52 | -animation: spin .7s infinite linear; | ||
53 | -ms-animation: spin .7s infinite linear; | ||
54 | -webkit-animation: spinw .7s infinite linear; | ||
55 | -moz-animation: spinm .7s infinite linear; | ||
56 | } | ||
57 | |||
58 | @keyframes spin { | ||
59 | from { transform: scale(1) rotate(0deg);} | ||
60 | to { transform: scale(1) rotate(360deg);} | ||
61 | } | ||
62 | |||
63 | @-webkit-keyframes spinw { | ||
64 | from { -webkit-transform: rotate(0deg);} | ||
65 | to { -webkit-transform: rotate(360deg);} | ||
66 | } | ||
67 | |||
68 | @-moz-keyframes spinm { | ||
69 | from { -moz-transform: rotate(0deg);} | ||
70 | to { -moz-transform: rotate(360deg);} | ||
71 | } | ||
72 | |||
50 | /* ngprime data table customizations */ | 73 | /* ngprime data table customizations */ |
51 | p-datatable { | 74 | p-datatable { |
52 | .action-cell { | 75 | .action-cell { |