video-list.component.html 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <h1>
  2. <my-global-icon iconName="videos" aria-hidden="true"></my-global-icon>
  3. <ng-container i18n>Videos</ng-container>
  4. </h1>
  5. <p-table
  6. [value]="videos" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [first]="pagination.start"
  7. [rowsPerPageOptions]="rowsPerPageOptions" [sortField]="sort.field" [sortOrder]="sort.order" dataKey="id" [resizableColumns]="true"
  8. [(selection)]="selectedRows" [lazy]="true" (onLazyLoad)="loadLazy($event)" [lazyLoadOnInit]="false" [selectionPageOnly]="true"
  9. [showCurrentPageReport]="true" i18n-currentPageReportTemplate
  10. currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} videos"
  11. [expandedRowKeys]="expandedRows" [ngClass]="{ loading: loading }"
  12. >
  13. <ng-template pTemplate="caption">
  14. <div class="caption">
  15. <div class="left-buttons">
  16. <my-action-dropdown
  17. *ngIf="isInSelectionMode()" i18n-label label="Batch actions" theme="orange"
  18. [actions]="bulkActions" [entry]="selectedRows"
  19. >
  20. </my-action-dropdown>
  21. </div>
  22. <div class="ms-auto right-form">
  23. <my-advanced-input-filter [filters]="inputFilters" (search)="onSearch($event)"></my-advanced-input-filter>
  24. <my-button i18n-label label="Refresh" icon="refresh" (click)="reloadData()"></my-button>
  25. </div>
  26. </div>
  27. </ng-template>
  28. <ng-template pTemplate="header">
  29. <tr>
  30. <th style="width: 40px">
  31. <p-tableHeaderCheckbox ariaLabel="Select all rows" i18n-ariaLabel></p-tableHeaderCheckbox>
  32. </th>
  33. <th style="width: 40px"></th>
  34. <th style="width: 70px;"></th>
  35. <th i18n>Video</th>
  36. <th i18n>Info</th>
  37. <th i18n>Files</th>
  38. <th style="width: 150px;" i18n pSortableColumn="publishedAt">Published <p-sortIcon field="publishedAt"></p-sortIcon></th>
  39. </tr>
  40. </ng-template>
  41. <ng-template pTemplate="body" let-expanded="expanded" let-video>
  42. <tr [pSelectableRow]="video">
  43. <td class="checkbox-cell">
  44. <p-tableCheckbox [value]="video" ariaLabel="Select this row" i18n-ariaLabel></p-tableCheckbox>
  45. </td>
  46. <td class="expand-cell" [pRowToggler]="video">
  47. <my-table-expander-icon [expanded]="expanded"></my-table-expander-icon>
  48. </td>
  49. <td class="action-cell">
  50. <my-video-actions-dropdown
  51. placement="bottom auto" buttonDirection="horizontal" [buttonStyled]="true" [video]="video" [displayOptions]="videoActionsOptions"
  52. (videoRemoved)="reloadData()" (videoFilesRemoved)="reloadData()" (transcodingCreated)="reloadData()"
  53. ></my-video-actions-dropdown>
  54. </td>
  55. <td>
  56. <my-video-cell [video]="video"></my-video-cell>
  57. </td>
  58. <td>
  59. <span class="pt-badge badge-blue" *ngIf="video.isLocal">Local</span>
  60. <span class="pt-badge badge-purple" *ngIf="!video.isLocal">Remote</span>
  61. <span [ngClass]="getPrivacyBadgeClass(video)" class="pt-badge">{{ video.privacy.label }}</span>
  62. <span *ngIf="video.nsfw" class="pt-badge badge-red" i18n>NSFW</span>
  63. <span *ngIf="isUnpublished(video)" class="pt-badge badge-yellow" i18n>{{ video.state.label }}</span>
  64. <span *ngIf="isAccountBlocked(video)" class="pt-badge badge-red" i18n>Account muted</span>
  65. <span *ngIf="isServerBlocked(video)" class="pt-badge badge-red" i18n>Server muted</span>
  66. <span *ngIf="isVideoBlocked(video)" class="pt-badge badge-red" i18n>Blocked</span>
  67. </td>
  68. <td>
  69. <span *ngIf="hasHLS(video)" class="pt-badge badge-blue">HLS</span>
  70. <span *ngIf="hasWebVideos(video)" class="pt-badge badge-blue">Web Videos ({{ video.files.length }})</span>
  71. <span i18n *ngIf="video.isLive" class="pt-badge badge-blue">Live</span>
  72. <span i18n *ngIf="hasObjectStorage(video)" class="pt-badge badge-purple">Object storage</span>
  73. <span *ngIf="!isImport(video) && !video.isLive && video.isLocal">{{ getFilesSize(video) | bytes: 1 }}</span>
  74. </td>
  75. <td>
  76. {{ video.publishedAt | date: 'short' }}
  77. </td>
  78. </tr>
  79. </ng-template>
  80. <ng-template pTemplate="rowexpansion" let-video>
  81. <tr>
  82. <td class="video-info expand-cell" myAutoColspan>
  83. <div>
  84. <div *ngIf="hasWebVideos(video)">
  85. Web Videos:
  86. <ul>
  87. <li *ngFor="let file of video.files">
  88. <a target="_blank" rel="noopener noreferrer" [href]="file.fileUrl">{{ file.resolution.label }}</a>: {{ file.size | bytes: 1 }}
  89. <my-global-icon
  90. *ngIf="canRemoveOneFile(video)"
  91. i18n-ngbTooltip ngbTooltip="Delete this file" iconName="delete" role="button"
  92. (click)="removeVideoFile(video, file, 'web-videos')"
  93. ></my-global-icon>
  94. </li>
  95. </ul>
  96. </div>
  97. <div *ngIf="hasHLS(video)">
  98. HLS:
  99. <ul>
  100. <li *ngFor="let file of video.streamingPlaylists[0].files">
  101. <a target="_blank" rel="noopener noreferrer" [href]="file.fileUrl">{{ file.resolution.label }}</a>: {{ file.size | bytes: 1 }}
  102. <my-global-icon
  103. *ngIf="canRemoveOneFile(video)"
  104. i18n-ngbTooltip ngbTooltip="Delete this file" iconName="delete" role="button"
  105. (click)="removeVideoFile(video, file, 'hls')"
  106. ></my-global-icon>
  107. </li>
  108. </ul>
  109. </div>
  110. <my-embed class="ms-auto" [video]="video"></my-embed>
  111. </div>
  112. </td>
  113. </tr>
  114. </ng-template>
  115. </p-table>
  116. <my-video-block #videoBlockModal (videoBlocked)="reloadData()"></my-video-block>