aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/overview/videos/video-list.component.html
blob: c4f78cadc7f7f56224dcb8d6d9dc3259f9f3b30a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<h1>
  <my-global-icon iconName="videos" aria-hidden="true"></my-global-icon>
  <ng-container i18n>Videos</ng-container>
</h1>

<p-table
  [value]="videos" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [first]="pagination.start"
  [rowsPerPageOptions]="rowsPerPageOptions" [sortField]="sort.field" [sortOrder]="sort.order" dataKey="id" [resizableColumns]="true"
  [(selection)]="selectedRows" [lazy]="true" (onLazyLoad)="loadLazy($event)" [lazyLoadOnInit]="false" [selectionPageOnly]="true"
  [showCurrentPageReport]="true" i18n-currentPageReportTemplate
  currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} videos"
  [expandedRowKeys]="expandedRows" [ngClass]="{ loading: loading }"
>
  <ng-template pTemplate="caption">
    <div class="caption">
      <div class="left-buttons">
        <my-action-dropdown
          *ngIf="isInSelectionMode()" i18n-label label="Batch actions" theme="orange"
          [actions]="bulkActions" [entry]="selectedRows"
        >
        </my-action-dropdown>
      </div>

      <div class="ms-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>
  </ng-template>

  <ng-template pTemplate="header">
    <tr>
      <th style="width: 40px">
        <p-tableHeaderCheckbox ariaLabel="Select all rows" i18n-ariaLabel></p-tableHeaderCheckbox>
      </th>
      <th style="width: 40px"></th>
      <th style="width: 70px;"></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>

  <ng-template pTemplate="body" let-expanded="expanded" let-video>

    <tr [pSelectableRow]="video">
      <td class="checkbox-cell">
        <p-tableCheckbox [value]="video" ariaLabel="Select this row" i18n-ariaLabel></p-tableCheckbox>
      </td>

      <td class="expand-cell" [pRowToggler]="video">
        <my-table-expander-icon [expanded]="expanded"></my-table-expander-icon>
      </td>

      <td class="action-cell">
        <my-video-actions-dropdown
          placement="bottom auto" buttonDirection="horizontal" [buttonStyled]="true" [video]="video" [displayOptions]="videoActionsOptions"
          (videoRemoved)="reloadData()" (videoFilesRemoved)="reloadData()" (transcodingCreated)="reloadData()"
        ></my-video-actions-dropdown>
      </td>

      <td>
        <my-video-cell [video]="video"></my-video-cell>
      </td>

      <td>
        <span class="pt-badge badge-blue" *ngIf="video.isLocal">Local</span>
        <span class="pt-badge badge-purple" *ngIf="!video.isLocal">Remote</span>

        <span [ngClass]="getPrivacyBadgeClass(video)" class="pt-badge">{{ video.privacy.label }}</span>

        <span *ngIf="video.nsfw" class="pt-badge badge-red" i18n>NSFW</span>

        <span *ngIf="isUnpublished(video)" class="pt-badge badge-yellow" i18n>{{ video.state.label }}</span>

        <span *ngIf="isAccountBlocked(video)" class="pt-badge badge-red" i18n>Account muted</span>
        <span *ngIf="isServerBlocked(video)" class="pt-badge badge-red" i18n>Server muted</span>

        <span *ngIf="isVideoBlocked(video)" class="pt-badge badge-red" i18n>Blocked</span>
      </td>

      <td>
        <span *ngIf="isHLS(video)" class="pt-badge badge-blue">HLS</span>
        <span *ngIf="isWebTorrent(video)" class="pt-badge badge-blue">WebTorrent ({{ video.files.length }})</span>
        <span i18n *ngIf="video.isLive" class="pt-badge badge-blue">Live</span>
        <span i18n *ngIf="hasObjectStorage(video)" class="pt-badge badge-purple">Object storage</span>

        <span *ngIf="!isImport(video) && !video.isLive && video.isLocal">{{ getFilesSize(video) | bytes: 1 }}</span>
      </td>

      <td>
        {{ video.publishedAt | date: 'short' }}
      </td>

    </tr>
  </ng-template>

  <ng-template pTemplate="rowexpansion" let-video>
    <tr>
      <td class="video-info expand-cell" myAutoColspan>
        <div>
          <div *ngIf="isWebTorrent(video)">
            WebTorrent:

            <ul>
              <li *ngFor="let file of video.files">
                <a target="_blank" rel="noopener noreferrer" [href]="file.fileUrl">{{ file.resolution.label }}</a>: {{ file.size | bytes: 1 }}

                <my-global-icon
                  *ngIf="canRemoveOneFile(video)"
                  i18n-ngbTooltip ngbTooltip="Delete this file" iconName="delete" role="button"
                  (click)="removeVideoFile(video, file, 'webtorrent')"
                ></my-global-icon>
              </li>
            </ul>
          </div>

          <div *ngIf="isHLS(video)">
            HLS:

            <ul>
              <li *ngFor="let file of video.streamingPlaylists[0].files">
                <a target="_blank" rel="noopener noreferrer" [href]="file.fileUrl">{{ file.resolution.label }}</a>: {{ file.size | bytes: 1 }}

                <my-global-icon
                  *ngIf="canRemoveOneFile(video)"
                  i18n-ngbTooltip ngbTooltip="Delete this file" iconName="delete" role="button"
                  (click)="removeVideoFile(video, file, 'hls')"
                ></my-global-icon>
              </li>
            </ul>
          </div>

          <my-embed class="ms-auto" [video]="video"></my-embed>
        </div>
      </td>
    </tr>
  </ng-template>
</p-table>

<my-video-block #videoBlockModal (videoBlocked)="reloadData()"></my-video-block>