blob: 99d8719a38873cfc7dd5cdd3675d14d2c48a8d5a (
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
|
<div class="admin-sub-header">
<div class="select-filter-block">
<label for="displayType" i18n>Display</label>
<div class="peertube-select-container">
<select id="displayType" name="displayType" [(ngModel)]="displayType" (ngModelChange)="onDisplayTypeChanged()" class="form-control">
<option value="my-videos" i18n>My videos duplicated by remote instances</option>
<option value="remote-videos" i18n>Remote videos duplicated by my instance</option>
</select>
</div>
</div>
</div>
<p-table
[value]="videoRedundancies" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage"
[sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id"
(onPage)="onPage()" [expandedRowKeys]="expandedRows"
>
<ng-template pTemplate="header">
<tr>
<th style="width: 40px;"></th>
<th style="width: 160px;" i18n *ngIf="isDisplayingRemoteVideos()">Strategy</th>
<th i18n pSortableColumn="name">Video name <p-sortIcon field="name"></p-sortIcon></th >
<th i18n>Video URL</th>
<th style="width: 100px;" i18n *ngIf="isDisplayingRemoteVideos()">Total size</th>
<th style="width: 80px;"></th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-expanded="expanded" let-redundancy>
<tr>
<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>
<td *ngIf="isDisplayingRemoteVideos()">{{ getRedundancyStrategy(redundancy) }}</td>
<td>{{ redundancy.name }}</td>
<td>
<a target="_blank" rel="noopener noreferrer" [href]="redundancy.url">{{ redundancy.url }}</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>
<ng-template pTemplate="rowexpansion" let-redundancy>
<tr *ngIf="redundancy.redundancies.files.length !== 0">
<td class="expand-cell" [attr.colspan]="getColspan()">
<div *ngFor="let file of redundancy.redundancies.files" class="expansion-block">
<my-video-redundancy-information [redundancyElement]="file"></my-video-redundancy-information>
</div>
</td>
</tr>
<tr *ngIf="redundancy.redundancies.streamingPlaylists.length !== 0">
<td class="expand-cell" [attr.colspan]="getColspan()">
<div *ngFor="let playlist of redundancy.redundancies.streamingPlaylists">
<my-video-redundancy-information [redundancyElement]="playlist"></my-video-redundancy-information>
</div>
</td>
</tr>
</ng-template>
<ng-template pTemplate="emptymessage">
<tr>
<td colspan="6">
<div class="empty-table-message">
<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>
<div class="chart-blocks">
<div *ngIf="noRedundancies" i18n class="no-results">
No redundancy strategy is enabled on your instance.
</div>
<div class="chart-block" *ngFor="let r of redundanciesGraphsData">
<p-chart type="pie" [data]="r.graphData" [options]="r.options" width="300px" height="300px"></p-chart>
</div>
</div>
</div>
|