]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.html
Remove unnecessary onPage event on admin tables
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / follows / video-redundancies-list / video-redundancies-list.component.html
index 07362b3b93d4f58a0155652aebe6b00f728ce8fa..f13a0c3782cce35d5d7508b0137295b49df6797a 100644 (file)
@@ -1,3 +1,8 @@
+<h1>
+  <my-global-icon iconName="videos" aria-hidden="true"></my-global-icon>
+  <ng-container i18n>Videos redundancies</ng-container>
+</h1>
+
 <div class="admin-sub-header">
   <div class="select-filter-block">
     <label for="displayType" i18n>Display</label>
 </div>
 
 <p-table
-  [value]="videoRedundancies" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage"
+  [value]="videoRedundancies" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
   [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id"
+  [expandedRowKeys]="expandedRows"
 >
   <ng-template pTemplate="header">
     <tr>
-      <th style="width: 40px"></th>
-      <th i18n *ngIf="isDisplayingRemoteVideos()">Strategy</th>
-      <th i18n pSortableColumn="name">Video name <p-sortIcon field="name"></p-sortIcon></th>
-      <th i18n>Video URL</th>
-      <th i18n *ngIf="isDisplayingRemoteVideos()">Total size</th>
-      <th style="width: 80px;"></th>
+      <th style="width: 40px;"></th>
+      <th style="width: 150px;" i18n>Action</th>
+      <th style="width: 160px;" i18n *ngIf="isDisplayingRemoteVideos()">Strategy</th>
+      <th i18n pSortableColumn="name">Video <p-sortIcon field="name"></p-sortIcon></th >
+      <th style="width: 100px;" i18n *ngIf="isDisplayingRemoteVideos()">Total size</th>
     </tr>
   </ng-template>
 
   <ng-template pTemplate="body" let-expanded="expanded" let-redundancy>
     <tr>
+      <td class="expand-cell" [pRowToggler]="redundancy">
+        <my-table-expander-icon i18n-ngbTooltip ngbTooltip="List redundancies" [expanded]="expanded"></my-table-expander-icon>
+      </td>
 
-      <td>
-        <span class="expander" i18n-ngbTooltip ngbTooltip="List redundancies" [pRowToggler]="redundancy">
-          <i [ngClass]="expanded ? 'glyphicon glyphicon-menu-down' : 'glyphicon glyphicon-menu-right'"></i>
-        </span>
+      <td class="action-cell">
+        <my-delete-button label (click)="removeRedundancy(redundancy)"></my-delete-button>
       </td>
 
       <td *ngIf="isDisplayingRemoteVideos()">{{ getRedundancyStrategy(redundancy) }}</td>
 
-      <td>{{ redundancy.name }}</td>
-
       <td>
-        <a target="_blank" rel="noopener noreferrer" [href]="redundancy.url">{{ redundancy.url }}</a>
+        <a [href]="redundancy.url" i18n-title title="Open video in a new tab" target="_blank" rel="noopener noreferrer">
+          {{ redundancy.name }}
+          <span class="glyphicon glyphicon-new-window"></span>
+        </a>
       </td>
 
       <td *ngIf="isDisplayingRemoteVideos()">{{ getTotalSize(redundancy) | bytes: 1 }}</td>
-
-      <td class="action-cell">
-        <my-delete-button (click)="removeRedundancy(redundancy)"></my-delete-button>
-      </td>
     </tr>
   </ng-template>
 
       </td>
     </tr>
   </ng-template>
+
+  <ng-template pTemplate="emptymessage">
+    <tr>
+      <td colspan="6">
+        <div class="no-results">
+          <ng-container *ngIf="isDisplayingRemoteVideos()" i18n>Your instance doesn't mirror any video.</ng-container>
+          <ng-container *ngIf="!isDisplayingRemoteVideos()" i18n>Your instance has no mirrored videos.</ng-container>
+        </div>
+      </td>
+    </tr>
+  </ng-template>
 </p-table>
 
 
 <div class="redundancies-charts" *ngIf="isDisplayingRemoteVideos()">
-  <div class="form-sub-title" i18n>Enabled strategies stats</div>
+  <h6 i18n>Enabled strategies stats</h6>
 
   <div class="chart-blocks">