aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-09-14 23:03:43 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-09-14 23:03:43 +0200
commit315cc0cc1871ab2a6d6c1bb61cf7b9f10511c3a9 (patch)
tree68cb1b103cc073e0c2ad3de651dfe26c6fe03477
parent3523b64a03d677c2f8df61c121ff4fcb1d9db7f9 (diff)
downloadPeerTube-315cc0cc1871ab2a6d6c1bb61cf7b9f10511c3a9.tar.gz
PeerTube-315cc0cc1871ab2a6d6c1bb61cf7b9f10511c3a9.tar.zst
PeerTube-315cc0cc1871ab2a6d6c1bb61cf7b9f10511c3a9.zip
Add info when server is processing a video at upload
-rw-r--r--.eslintignore2
-rw-r--r--.eslintrc213
-rw-r--r--client/src/app/shared/rest/rest-extractor.service.ts4
-rw-r--r--client/src/app/videos/video-edit/video-add.component.html7
-rw-r--r--client/src/app/videos/video-edit/video-add.component.ts8
-rw-r--r--client/src/app/videos/video-list/loader.component.scss22
-rw-r--r--client/src/app/videos/video-list/loader.component.ts2
-rw-r--r--client/src/sass/application.scss23
-rw-r--r--server/initializers/constants.ts2
9 files changed, 38 insertions, 245 deletions
diff --git a/.eslintignore b/.eslintignore
deleted file mode 100644
index a1deda9a2..000000000
--- a/.eslintignore
+++ /dev/null
@@ -1,2 +0,0 @@
1**/*{.,-}min.js
2Gruntfile.js
diff --git a/.eslintrc b/.eslintrc
deleted file mode 100644
index 0a8d7e483..000000000
--- a/.eslintrc
+++ /dev/null
@@ -1,213 +0,0 @@
1ecmaFeatures:
2 modules: true
3 jsx: true
4
5env:
6 amd: true
7 browser: true
8 es6: true
9 jquery: true
10 node: true
11
12# http://eslint.org/docs/rules/
13rules:
14 # Possible Errors
15 comma-dangle: [2, never]
16 no-cond-assign: 2
17 no-console: 0
18 no-constant-condition: 2
19 no-control-regex: 2
20 no-debugger: 2
21 no-dupe-args: 2
22 no-dupe-keys: 2
23 no-duplicate-case: 2
24 no-empty: 2
25 no-empty-character-class: 2
26 no-ex-assign: 2
27 no-extra-boolean-cast: 2
28 no-extra-parens: 0
29 no-extra-semi: 0
30 no-func-assign: 2
31 no-inner-declarations: [2, functions]
32 no-invalid-regexp: 2
33 no-irregular-whitespace: 2
34 no-negated-in-lhs: 2
35 no-obj-calls: 2
36 no-regex-spaces: 2
37 no-sparse-arrays: 2
38 no-unexpected-multiline: 2
39 no-unreachable: 2
40 use-isnan: 2
41 valid-jsdoc: 0
42 valid-typeof: 2
43
44 # Best Practices
45 accessor-pairs: 2
46 block-scoped-var: 0
47 complexity: [2, 6]
48 consistent-return: 0
49 curly: 0
50 default-case: 0
51 dot-location: 0
52 dot-notation: 0
53 eqeqeq: 2
54 guard-for-in: 2
55 no-alert: 2
56 no-caller: 2
57 no-case-declarations: 2
58 no-div-regex: 2
59 no-else-return: 0
60 no-empty-label: 2
61 no-empty-pattern: 2
62 no-eq-null: 2
63 no-eval: 2
64 no-extend-native: 2
65 no-extra-bind: 2
66 no-fallthrough: 2
67 no-floating-decimal: 0
68 no-implicit-coercion: 0
69 no-implied-eval: 2
70 no-invalid-this: 0
71 no-iterator: 2
72 no-labels: 0
73 no-lone-blocks: 2
74 no-loop-func: 2
75 no-magic-number: 0
76 no-multi-spaces: 0
77 no-multi-str: 0
78 no-native-reassign: 2
79 no-new-func: 2
80 no-new-wrappers: 2
81 no-new: 2
82 no-octal-escape: 2
83 no-octal: 2
84 no-proto: 2
85 no-redeclare: 2
86 no-return-assign: 2
87 no-script-url: 2
88 no-self-compare: 2
89 no-sequences: 0
90 no-throw-literal: 0
91 no-unused-expressions: 2
92 no-useless-call: 2
93 no-useless-concat: 2
94 no-void: 2
95 no-warning-comments: 0
96 no-with: 2
97 radix: 2
98 vars-on-top: 0
99 wrap-iife: 2
100 yoda: 0
101
102 # Strict
103 strict: 0
104
105 # Variables
106 init-declarations: 0
107 no-catch-shadow: 2
108 no-delete-var: 2
109 no-label-var: 2
110 no-shadow-restricted-names: 2
111 no-shadow: 0
112 no-undef-init: 2
113 no-undef: 0
114 no-undefined: 0
115 no-unused-vars: 0
116 no-use-before-define: 0
117
118 # Node.js and CommonJS
119 callback-return: 2
120 global-require: 2
121 handle-callback-err: 2
122 no-mixed-requires: 0
123 no-new-require: 0
124 no-path-concat: 2
125 no-process-exit: 2
126 no-restricted-modules: 0
127 no-sync: 0
128
129 # Stylistic Issues
130 array-bracket-spacing: 0
131 block-spacing: 0
132 brace-style: 0
133 camelcase: 0
134 comma-spacing: 0
135 comma-style: 0
136 computed-property-spacing: 0
137 consistent-this: 0
138 eol-last: 0
139 func-names: 0
140 func-style: 0
141 id-length: 0
142 id-match: 0
143 indent: 0
144 jsx-quotes: 0
145 key-spacing: 0
146 linebreak-style: 0
147 lines-around-comment: 0
148 max-depth: 0
149 max-len: 0
150 max-nested-callbacks: 0
151 max-params: 0
152 max-statements: [2, 30]
153 new-cap: 0
154 new-parens: 0
155 newline-after-var: 0
156 no-array-constructor: 0
157 no-bitwise: 0
158 no-continue: 0
159 no-inline-comments: 0
160 no-lonely-if: 0
161 no-mixed-spaces-and-tabs: 0
162 no-multiple-empty-lines: 0
163 no-negated-condition: 0
164 no-nested-ternary: 0
165 no-new-object: 0
166 no-plusplus: 0
167 no-restricted-syntax: 0
168 no-spaced-func: 0
169 no-ternary: 0
170 no-trailing-spaces: 0
171 no-underscore-dangle: 0
172 no-unneeded-ternary: 0
173 object-curly-spacing: 0
174 one-var: 0
175 operator-assignment: 0
176 operator-linebreak: 0
177 padded-blocks: 0
178 quote-props: 0
179 quotes: 0
180 require-jsdoc: 0
181 semi-spacing: 0
182 semi: 0
183 sort-vars: 0
184 space-after-keywords: 0
185 space-before-blocks: 0
186 space-before-function-paren: 0
187 space-before-keywords: 0
188 space-in-parens: 0
189 space-infix-ops: 0
190 space-return-throw-case: 0
191 space-unary-ops: 0
192 spaced-comment: 0
193 wrap-regex: 0
194
195 # ECMAScript 6
196 arrow-body-style: 0
197 arrow-parens: 0
198 arrow-spacing: 0
199 constructor-super: 0
200 generator-star-spacing: 0
201 no-arrow-condition: 0
202 no-class-assign: 0
203 no-const-assign: 0
204 no-dupe-class-members: 0
205 no-this-before-super: 0
206 no-var: 0
207 object-shorthand: 0
208 prefer-arrow-callback: 0
209 prefer-const: 0
210 prefer-reflect: 0
211 prefer-spread: 0
212 prefer-template: 0
213 require-yield: 0
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 */
51p-datatable { 74p-datatable {
52 .action-cell { 75 .action-cell {
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts
index e6af406e3..e01b6a4d4 100644
--- a/server/initializers/constants.ts
+++ b/server/initializers/constants.ts
@@ -314,7 +314,7 @@ const USER_ROLES: { [ id: string ]: UserRole } = {
314 314
315// --------------------------------------------------------------------------- 315// ---------------------------------------------------------------------------
316 316
317const OPENGRAPH_COMMENT = '<!-- opengraph tags -->' 317const OPENGRAPH_COMMENT = '<!-- open graph tags -->'
318 318
319// --------------------------------------------------------------------------- 319// ---------------------------------------------------------------------------
320 320