aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-08-03 09:27:30 +0200
committerChocobozzz <me@florianbigard.com>2018-08-06 11:19:16 +0200
commitd7f83948a1af0ef3bed61f83e87e826902c96f7d (patch)
treed22177bcbf22aeb054960372a6bc39bea6077692 /client/src
parented31c059851a30bd5ba9999f8ecb3822d576b9f4 (diff)
downloadPeerTube-d7f83948a1af0ef3bed61f83e87e826902c96f7d.tar.gz
PeerTube-d7f83948a1af0ef3bed61f83e87e826902c96f7d.tar.zst
PeerTube-d7f83948a1af0ef3bed61f83e87e826902c96f7d.zip
Correctly handle video import errors
Diffstat (limited to 'client/src')
-rw-r--r--client/src/app/+my-account/my-account-video-imports/my-account-video-imports.component.html19
-rw-r--r--client/src/app/+my-account/my-account-video-imports/my-account-video-imports.component.scss8
-rw-r--r--client/src/app/videos/+video-edit/video-import.component.html2
3 files changed, 26 insertions, 3 deletions
diff --git a/client/src/app/+my-account/my-account-video-imports/my-account-video-imports.component.html b/client/src/app/+my-account/my-account-video-imports/my-account-video-imports.component.html
index 74ca33fa3..00b2d7cb0 100644
--- a/client/src/app/+my-account/my-account-video-imports/my-account-video-imports.component.html
+++ b/client/src/app/+my-account/my-account-video-imports/my-account-video-imports.component.html
@@ -1,9 +1,10 @@
1<p-table 1<p-table
2 [value]="videoImports" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage" 2 [value]="videoImports" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage"
3 [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" 3 [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id"
4> 4>
5 <ng-template pTemplate="header"> 5 <ng-template pTemplate="header">
6 <tr> 6 <tr>
7 <th style="width: 40px;"></th>
7 <th i18n>URL</th> 8 <th i18n>URL</th>
8 <th i18n>Video</th> 9 <th i18n>Video</th>
9 <th i18n style="width: 150px">State</th> 10 <th i18n style="width: 150px">State</th>
@@ -12,9 +13,15 @@
12 </tr> 13 </tr>
13 </ng-template> 14 </ng-template>
14 15
15 <ng-template pTemplate="body" let-videoImport> 16 <ng-template pTemplate="body" let-expanded="expanded" let-videoImport>
16 <tr> 17 <tr>
17 <td> 18 <td>
19 <span *ngIf="videoImport.error" class="expander" [pRowToggler]="videoImport">
20 <i [ngClass]="expanded ? 'glyphicon glyphicon-menu-down' : 'glyphicon glyphicon-menu-right'"></i>
21 </span>
22 </td>
23
24 <td>
18 <a [href]="videoImport.targetUrl" target="_blank" rel="noopener noreferrer">{{ videoImport.targetUrl }}</a> 25 <a [href]="videoImport.targetUrl" target="_blank" rel="noopener noreferrer">{{ videoImport.targetUrl }}</a>
19 </td> 26 </td>
20 27
@@ -34,4 +41,12 @@
34 </td> 41 </td>
35 </tr> 42 </tr>
36 </ng-template> 43 </ng-template>
44
45 <ng-template pTemplate="rowexpansion" let-videoImport>
46 <tr class="video-import-error" *ngIf="videoImport.error">
47 <td colspan="6">
48 <pre>{{ videoImport.error }}</pre>
49 </td>
50 </tr>
51 </ng-template>
37</p-table> 52</p-table>
diff --git a/client/src/app/+my-account/my-account-video-imports/my-account-video-imports.component.scss b/client/src/app/+my-account/my-account-video-imports/my-account-video-imports.component.scss
index 5e6774739..bdd2f8270 100644
--- a/client/src/app/+my-account/my-account-video-imports/my-account-video-imports.component.scss
+++ b/client/src/app/+my-account/my-account-video-imports/my-account-video-imports.component.scss
@@ -1,2 +1,10 @@
1@import '_variables'; 1@import '_variables';
2@import '_mixins'; 2@import '_mixins';
3
4pre {
5 font-size: 11px;
6}
7
8.video-import-error {
9 color: red;
10} \ No newline at end of file
diff --git a/client/src/app/videos/+video-edit/video-import.component.html b/client/src/app/videos/+video-edit/video-import.component.html
index d59c6a23a..cfad5e289 100644
--- a/client/src/app/videos/+video-edit/video-import.component.html
+++ b/client/src/app/videos/+video-edit/video-import.component.html
@@ -6,7 +6,7 @@
6 <label i18n for="targetUrl">URL</label> 6 <label i18n for="targetUrl">URL</label>
7 <my-help 7 <my-help
8 helpType="custom" i18n-customHtml 8 helpType="custom" i18n-customHtml
9 customHtml="You can import any URL <a href='https://rg3.github.io/youtube-dl/supportedsites.html'>supported by youtube-dl</a> or URL that points to a raw MP4 file. Failure to secure these rights could cause legal trouble to yourself and your instance." 9 customHtml="You can import any URL <a href='https://rg3.github.io/youtube-dl/supportedsites.html' target='_blank' rel='noopener noreferrer'>supported by youtube-dl</a> or URL that points to a raw MP4 file. Failure to secure these rights could cause legal trouble to yourself and your instance."
10 ></my-help> 10 ></my-help>
11 11
12 <input type="text" id="targetUrl" [(ngModel)]="targetUrl" /> 12 <input type="text" id="targetUrl" [(ngModel)]="targetUrl" />