aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+my-library
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-08-10 11:51:13 +0200
committerChocobozzz <me@florianbigard.com>2022-08-10 14:32:00 +0200
commita3b472a12ec6e57dbe2f650419f8064864686eab (patch)
treef36559488e34493c029b686772e986902150a647 /client/src/app/+my-library
parent0567049a9819d67070aa6d548a75a7e632a4aaa4 (diff)
downloadPeerTube-a3b472a12ec6e57dbe2f650419f8064864686eab.tar.gz
PeerTube-a3b472a12ec6e57dbe2f650419f8064864686eab.tar.zst
PeerTube-a3b472a12ec6e57dbe2f650419f8064864686eab.zip
Add ability to list imports of a channel sync
Diffstat (limited to 'client/src/app/+my-library')
-rw-r--r--client/src/app/+my-library/my-video-channel-syncs/my-video-channel-syncs.component.html9
-rw-r--r--client/src/app/+my-library/my-video-channel-syncs/my-video-channel-syncs.component.ts2
-rw-r--r--client/src/app/+my-library/my-video-channel-syncs/video-channel-sync-edit/video-channel-sync-edit.component.ts2
-rw-r--r--client/src/app/+my-library/my-video-imports/my-video-imports.component.html11
-rw-r--r--client/src/app/+my-library/my-video-imports/my-video-imports.component.scss6
-rw-r--r--client/src/app/+my-library/my-video-imports/my-video-imports.component.ts6
6 files changed, 31 insertions, 5 deletions
diff --git a/client/src/app/+my-library/my-video-channel-syncs/my-video-channel-syncs.component.html b/client/src/app/+my-library/my-video-channel-syncs/my-video-channel-syncs.component.html
index 5141607b1..c2fed8112 100644
--- a/client/src/app/+my-library/my-video-channel-syncs/my-video-channel-syncs.component.html
+++ b/client/src/app/+my-library/my-video-channel-syncs/my-video-channel-syncs.component.html
@@ -30,12 +30,13 @@
30 30
31 <ng-template pTemplate="header"> 31 <ng-template pTemplate="header">
32 <tr> 32 <tr>
33 <th style="width: 10%"><my-global-icon iconName="columns"></my-global-icon></th> 33 <th style="width: 10%"></th>
34 <th style="width: 25%" i18n pSortableColumn="externalChannelUrl">External Channel <p-sortIcon field="externalChannelUrl"></p-sortIcon></th> 34 <th style="width: 25%" i18n pSortableColumn="externalChannelUrl">External Channel <p-sortIcon field="externalChannelUrl"></p-sortIcon></th>
35 <th style="width: 25%" i18n pSortableColumn="videoChannel">Channel <p-sortIcon field="videoChannel"></p-sortIcon></th> 35 <th style="width: 25%" i18n pSortableColumn="videoChannel">Channel <p-sortIcon field="videoChannel"></p-sortIcon></th>
36 <th style="width: 10%" i18n pSortableColumn="state">State <p-sortIcon field="state"></p-sortIcon></th> 36 <th style="width: 10%" i18n pSortableColumn="state">State <p-sortIcon field="state"></p-sortIcon></th>
37 <th style="width: 10%" i18n pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th> 37 <th style="width: 10%" i18n pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th>
38 <th style="width: 10%" i18n pSortableColumn="lastSyncAt">Last synchronization at <p-sortIcon field="lastSyncAt"></p-sortIcon></th> 38 <th style="width: 10%" i18n pSortableColumn="lastSyncAt">Last synchronization at <p-sortIcon field="lastSyncAt"></p-sortIcon></th>
39 <th></th>
39 </tr> 40 </tr>
40 </ng-template> 41 </ng-template>
41 42
@@ -78,6 +79,12 @@
78 79
79 <td>{{ videoChannelSync.createdAt | date: 'short' }}</td> 80 <td>{{ videoChannelSync.createdAt | date: 'short' }}</td>
80 <td>{{ videoChannelSync.lastSyncAt | date: 'short' }}</td> 81 <td>{{ videoChannelSync.lastSyncAt | date: 'short' }}</td>
82
83 <td>
84 <a i18n routerLink="/my-library/video-imports" [queryParams]="{ search: 'videoChannelSyncId:' + videoChannelSync.id }" class="peertube-button-link grey-button">
85 List imports
86 </a>
87 </td>
81 </tr> 88 </tr>
82 </ng-template> 89 </ng-template>
83</p-table> 90</p-table>
diff --git a/client/src/app/+my-library/my-video-channel-syncs/my-video-channel-syncs.component.ts b/client/src/app/+my-library/my-video-channel-syncs/my-video-channel-syncs.component.ts
index 81bdaf9f2..0c429e5dd 100644
--- a/client/src/app/+my-library/my-video-channel-syncs/my-video-channel-syncs.component.ts
+++ b/client/src/app/+my-library/my-video-channel-syncs/my-video-channel-syncs.component.ts
@@ -100,7 +100,7 @@ export class MyVideoChannelSyncsComponent extends RestTable implements OnInit {
100 } 100 }
101 101
102 fullySynchronize (videoChannelSync: VideoChannelSync) { 102 fullySynchronize (videoChannelSync: VideoChannelSync) {
103 this.videoChannelService.importVideos(videoChannelSync.channel.name, videoChannelSync.externalChannelUrl) 103 this.videoChannelService.importVideos(videoChannelSync.channel.name, videoChannelSync.externalChannelUrl, videoChannelSync.id)
104 .subscribe({ 104 .subscribe({
105 next: () => { 105 next: () => {
106 this.notifier.success($localize`Full synchronization requested successfully for ${videoChannelSync.channel.displayName}.`) 106 this.notifier.success($localize`Full synchronization requested successfully for ${videoChannelSync.channel.displayName}.`)
diff --git a/client/src/app/+my-library/my-video-channel-syncs/video-channel-sync-edit/video-channel-sync-edit.component.ts b/client/src/app/+my-library/my-video-channel-syncs/video-channel-sync-edit/video-channel-sync-edit.component.ts
index 836582609..9ceb6dfd1 100644
--- a/client/src/app/+my-library/my-video-channel-syncs/video-channel-sync-edit/video-channel-sync-edit.component.ts
+++ b/client/src/app/+my-library/my-video-channel-syncs/video-channel-sync-edit/video-channel-sync-edit.component.ts
@@ -59,7 +59,7 @@ export class VideoChannelSyncEditComponent extends FormReactive implements OnIni
59 this.videoChannelSyncService.createSync(videoChannelSyncCreate) 59 this.videoChannelSyncService.createSync(videoChannelSyncCreate)
60 .pipe(mergeMap(({ videoChannelSync }) => { 60 .pipe(mergeMap(({ videoChannelSync }) => {
61 return importExistingVideos 61 return importExistingVideos
62 ? this.videoChannelService.importVideos(videoChannelSync.channel.name, videoChannelSync.externalChannelUrl) 62 ? this.videoChannelService.importVideos(videoChannelSync.channel.name, videoChannelSync.externalChannelUrl, videoChannelSync.id)
63 : Promise.resolve(null) 63 : Promise.resolve(null)
64 })) 64 }))
65 .subscribe({ 65 .subscribe({
diff --git a/client/src/app/+my-library/my-video-imports/my-video-imports.component.html b/client/src/app/+my-library/my-video-imports/my-video-imports.component.html
index fb0f6f5a3..866cd1a72 100644
--- a/client/src/app/+my-library/my-video-imports/my-video-imports.component.html
+++ b/client/src/app/+my-library/my-video-imports/my-video-imports.component.html
@@ -3,9 +3,18 @@
3 <ng-container i18n>My imports</ng-container> 3 <ng-container i18n>My imports</ng-container>
4</h1> 4</h1>
5 5
6<div class="mb-4 d-flex justify-content-between">
7 <my-advanced-input-filter (search)="onSearch($event)"></my-advanced-input-filter>
8
9 <a routerLink="/my-library/video-channel-syncs" class="button-link">
10 <my-global-icon iconName="repeat" aria-hidden="true"></my-global-icon>
11 <ng-container i18n>My synchronizations</ng-container>
12 </a>
13</div>
14
6<p-table 15<p-table
7 [value]="videoImports" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [first]="pagination.start" 16 [value]="videoImports" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [first]="pagination.start"
8 [rowsPerPageOptions]="rowsPerPageOptions" [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id" 17 [rowsPerPageOptions]="rowsPerPageOptions" [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" [lazyLoadOnInit]="false" dataKey="id"
9 [showCurrentPageReport]="true" i18n-currentPageReportTemplate 18 [showCurrentPageReport]="true" i18n-currentPageReportTemplate
10 currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} imports" 19 currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} imports"
11 [expandedRowKeys]="expandedRows" 20 [expandedRowKeys]="expandedRows"
diff --git a/client/src/app/+my-library/my-video-imports/my-video-imports.component.scss b/client/src/app/+my-library/my-video-imports/my-video-imports.component.scss
index 7acacd47f..d9b12151e 100644
--- a/client/src/app/+my-library/my-video-imports/my-video-imports.component.scss
+++ b/client/src/app/+my-library/my-video-imports/my-video-imports.component.scss
@@ -8,3 +8,9 @@ pre {
8.video-import-error { 8.video-import-error {
9 color: #ff0000; 9 color: #ff0000;
10} 10}
11
12.button-link {
13 @include peertube-button-link;
14 @include grey-button;
15 @include button-with-icon(18px, 3px, -1px);
16}
diff --git a/client/src/app/+my-library/my-video-imports/my-video-imports.component.ts b/client/src/app/+my-library/my-video-imports/my-video-imports.component.ts
index f01558061..46d689bd1 100644
--- a/client/src/app/+my-library/my-video-imports/my-video-imports.component.ts
+++ b/client/src/app/+my-library/my-video-imports/my-video-imports.component.ts
@@ -33,12 +33,16 @@ export class MyVideoImportsComponent extends RestTable implements OnInit {
33 switch (state) { 33 switch (state) {
34 case VideoImportState.FAILED: 34 case VideoImportState.FAILED:
35 return 'badge-red' 35 return 'badge-red'
36
36 case VideoImportState.REJECTED: 37 case VideoImportState.REJECTED:
37 return 'badge-banned' 38 return 'badge-banned'
39
38 case VideoImportState.PENDING: 40 case VideoImportState.PENDING:
39 return 'badge-yellow' 41 return 'badge-yellow'
42
40 case VideoImportState.PROCESSING: 43 case VideoImportState.PROCESSING:
41 return 'badge-blue' 44 return 'badge-blue'
45
42 default: 46 default:
43 return 'badge-green' 47 return 'badge-green'
44 } 48 }
@@ -87,7 +91,7 @@ export class MyVideoImportsComponent extends RestTable implements OnInit {
87 } 91 }
88 92
89 protected reloadData () { 93 protected reloadData () {
90 this.videoImportService.getMyVideoImports(this.pagination, this.sort) 94 this.videoImportService.getMyVideoImports(this.pagination, this.sort, this.search)
91 .subscribe({ 95 .subscribe({
92 next: resultList => { 96 next: resultList => {
93 this.videoImports = resultList.data 97 this.videoImports = resultList.data