blob: 37c6ad6b4b056e11631bc5b2e09a1b88b4fde2f5 (
plain) (
tree)
|
|
<p-table
[value]="videoImports" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage"
[sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id"
(onPage)="onPage($event)" [expandedRowKeys]="expandedRows"
>
<ng-template pTemplate="header">
<tr>
<th style="width: 40px;"></th>
<th i18n>Target</th>
<th i18n>Video</th>
<th i18n style="width: 150px">State</th>
<th i18n pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th>
<th></th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-expanded="expanded" let-videoImport>
<tr>
<td class="expand-cell">
<span *ngIf="videoImport.error" class="expander" [pRowToggler]="videoImport" i18n-ngbTooltip ngbTooltip="See the error">
<i [ngClass]="expanded ? 'glyphicon glyphicon-menu-down' : 'glyphicon glyphicon-menu-right'"></i>
</span>
</td>
<td>
<a *ngIf="videoImport.targetUrl; else torrent" [href]="videoImport.targetUrl" target="_blank" rel="noopener noreferrer">{{ videoImport.targetUrl }}</a>
<ng-template #torrent>
<span [title]="videoImport.torrentName || videoImport.magnetUri">{{ videoImport.torrentName || videoImport.magnetUri }}</span>
</ng-template>
</td>
<td>
<ng-container *ngIf="isVideoImportPending(videoImport)">{{ videoImport.video?.name }}</ng-container>
<ng-container *ngIf="isVideoImportSuccess(videoImport) && videoImport.video">
<a [href]="getVideoUrl(videoImport.video)" target="_blank" rel="noopener noreferrer">{{ videoImport.video?.name }}</a>
</ng-container>
<ng-container *ngIf="isVideoImportSuccess(videoImport) && !videoImport.video" i18n>This video was deleted</ng-container>
<ng-container *ngIf="isVideoImportFailed(videoImport)"></ng-container>
</td>
<td>{{ videoImport.state.label }}</td>
<td>{{ videoImport.createdAt }}</td>
<td class="action-cell">
<my-edit-button *ngIf="isVideoImportSuccess(videoImport) && videoImport.video" [routerLink]="getEditVideoUrl(videoImport.video)"></my-edit-button>
</td>
</tr>
</ng-template>
<ng-template pTemplate="rowexpansion" let-videoImport>
<tr class="video-import-error" *ngIf="videoImport.error">
<td colspan="6">
<pre>{{ videoImport.error }}</pre>
</td>
</tr>
</ng-template>
</p-table>
|