]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+admin/overview/videos/video-list.component.html
Support videos stats in client
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / overview / videos / video-list.component.html
index 1f1e9cc6e3b35b1c0588b51071a8b62303d7016b..75d9be5f1c7f14e2e677a4f50e8e689b020c3219 100644 (file)
@@ -5,11 +5,11 @@
 
 <p-table
   [value]="videos" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
-  [sortField]="sort.field" [sortOrder]="sort.order"  dataKey="id" [resizableColumns]="true" [(selection)]="selectedVideos"
-  [lazy]="true" (onLazyLoad)="loadLazy($event)" [lazyLoadOnInit]="false"
+  [sortField]="sort.field" [sortOrder]="sort.order" dataKey="id" [resizableColumns]="true" [(selection)]="selectedVideos"
+  [lazy]="true" (onLazyLoad)="loadLazy($event)" [lazyLoadOnInit]="false" [selectionPageOnly]="true"
   [showCurrentPageReport]="true" i18n-currentPageReportTemplate
   currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} videos"
-  (onPage)="onPage($event)" [expandedRowKeys]="expandedRows"
+  [expandedRowKeys]="expandedRows" [ngClass]="{ loading: loading }"
 >
   <ng-template pTemplate="caption">
     <div class="caption">
         </my-action-dropdown>
       </div>
 
-      <div class="ml-auto">
+      <div class="ml-auto right-form">
         <my-advanced-input-filter [filters]="inputFilters" (search)="onSearch($event)"></my-advanced-input-filter>
+
+        <my-button i18n-label label="Refresh" icon="refresh" (click)="reloadData()"></my-button>
       </div>
 
     </div>
@@ -37,6 +39,7 @@
       <th style="width: 60px;"></th>
       <th i18n>Video</th>
       <th i18n>Info</th>
+      <th i18n>Files</th>
       <th style="width: 150px;" i18n pSortableColumn="publishedAt">Published <p-sortIcon field="publishedAt"></p-sortIcon></th>
     </tr>
   </ng-template>
@@ -54,8 +57,8 @@
 
       <td class="action-cell">
         <my-video-actions-dropdown
-          placement="bottom auto" buttonDirection="horizontal" [buttonStyled]="true" [video]="video"
-          [displayOptions]="videoActionsOptions" (videoRemoved)="onVideoRemoved()"
+          placement="bottom auto" buttonDirection="horizontal" [buttonStyled]="true" [video]="video" [displayOptions]="videoActionsOptions"
+          (videoRemoved)="reloadData()" (videoFilesRemoved)="reloadData()" (transcodingCreated)="reloadData()"
         ></my-video-actions-dropdown>
       </td>
 
       </td>
 
       <td>
-        <span class="badge badge-blue" i18n>{{ video.privacy.label }}</span>
+        <span class="badge badge-blue" *ngIf="video.isLocal">Local</span>
+        <span class="badge badge-purple" *ngIf="!video.isLocal">Remote</span>
+
+        <span [ngClass]="getPrivacyBadgeClass(video)" class="badge">{{ video.privacy.label }}</span>
+
         <span *ngIf="video.nsfw" class="badge badge-red" i18n>NSFW</span>
-        <span *ngIf="video.blocked" class="badge badge-red" i18n>NSFW</span>
+
+        <span *ngIf="isUnpublished(video)" class="badge badge-yellow" i18n>{{ video.state.label }}</span>
+
+        <span *ngIf="isAccountBlocked(video)" class="badge badge-red" i18n>Account muted</span>
+        <span *ngIf="isServerBlocked(video)" class="badge badge-red" i18n>Server muted</span>
+
+        <span *ngIf="isVideoBlocked(video)" class="badge badge-red" i18n>Blocked</span>
+      </td>
+
+      <td>
+        <span *ngIf="isHLS(video)" class="badge badge-blue">HLS</span>
+        <span *ngIf="isWebTorrent(video)" class="badge badge-blue">WebTorrent ({{ video.files.length }})</span>
+        <span *ngIf="video.isLive" class="badge badge-blue">Live</span>
+
+        <span *ngIf="!isImport(video) && !video.isLive && video.isLocal">{{ getFilesSize(video) | bytes: 1 }}</span>
       </td>
 
       <td>
 
   <ng-template pTemplate="rowexpansion" let-video>
     <tr>
-      <td colspan="50">
-        <my-embed [video]="video"></my-embed>
+      <td class="video-info expand-cell" colspan="7">
+        <div>
+          <div *ngIf="isWebTorrent(video)">
+            WebTorrent:
+
+            <ul>
+              <li *ngFor="let file of video.files">
+                {{ file.resolution.label }}: {{ file.size | bytes: 1 }}
+              </li>
+            </ul>
+          </div>
+
+          <div *ngIf="isHLS(video)">
+            HLS:
+
+            <ul>
+              <li *ngFor="let file of video.streamingPlaylists[0].files">
+                {{ file.resolution.label }}: {{ file.size | bytes: 1 }}
+              </li>
+            </ul>
+          </div>
+
+          <my-embed class="ml-auto" [video]="video"></my-embed>
+        </div>
       </td>
     </tr>
   </ng-template>
 </p-table>
+
+<my-video-block #videoBlockModal (videoBlocked)="reloadData()"></my-video-block>