diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-04-19 23:42:06 +0200 |
---|---|---|
committer | Rigel Kent <par@rigelk.eu> | 2020-05-01 16:41:02 +0200 |
commit | b8cf27c0f86d205a279d03b83e0e6728f46da67f (patch) | |
tree | 71222cc9dbd8b4c7fede48d3cfcfce9aa05a5ad3 /client/src/app/+admin/follows | |
parent | 36004aa7b0de5cb69a452090770221b192a78eb8 (diff) | |
download | PeerTube-b8cf27c0f86d205a279d03b83e0e6728f46da67f.tar.gz PeerTube-b8cf27c0f86d205a279d03b83e0e6728f46da67f.tar.zst PeerTube-b8cf27c0f86d205a279d03b83e0e6728f46da67f.zip |
Unify paginator disabling when no result is displayable, fix batch domain add for non-https
Diffstat (limited to 'client/src/app/+admin/follows')
6 files changed, 43 insertions, 8 deletions
diff --git a/client/src/app/+admin/follows/followers-list/followers-list.component.html b/client/src/app/+admin/follows/followers-list/followers-list.component.html index d4f2b8dcc..41f557510 100644 --- a/client/src/app/+admin/follows/followers-list/followers-list.component.html +++ b/client/src/app/+admin/follows/followers-list/followers-list.component.html | |||
@@ -1,6 +1,8 @@ | |||
1 | <p-table | 1 | <p-table |
2 | [value]="followers" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage" | 2 | [value]="followers" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions" |
3 | [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" | 3 | [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" |
4 | [showCurrentPageReport]="true" i18n-currentPageReportTemplate | ||
5 | currentPageReportTemplate="Showing {first} to {last} of {totalRecords} followers" | ||
4 | > | 6 | > |
5 | <ng-template pTemplate="caption"> | 7 | <ng-template pTemplate="caption"> |
6 | <div class="caption"> | 8 | <div class="caption"> |
diff --git a/client/src/app/+admin/follows/followers-list/followers-list.component.ts b/client/src/app/+admin/follows/followers-list/followers-list.component.ts index 81a91c1d1..00f447bb2 100644 --- a/client/src/app/+admin/follows/followers-list/followers-list.component.ts +++ b/client/src/app/+admin/follows/followers-list/followers-list.component.ts | |||
@@ -14,7 +14,8 @@ import { I18n } from '@ngx-translate/i18n-polyfill' | |||
14 | export class FollowersListComponent extends RestTable implements OnInit { | 14 | export class FollowersListComponent extends RestTable implements OnInit { |
15 | followers: ActorFollow[] = [] | 15 | followers: ActorFollow[] = [] |
16 | totalRecords = 0 | 16 | totalRecords = 0 |
17 | rowsPerPage = 10 | 17 | rowsPerPageOptions = [ 20, 50, 100 ] |
18 | rowsPerPage = this.rowsPerPageOptions[0] | ||
18 | sort: SortMeta = { field: 'createdAt', order: -1 } | 19 | sort: SortMeta = { field: 'createdAt', order: -1 } |
19 | pagination: RestPagination = { count: this.rowsPerPage, start: 0 } | 20 | pagination: RestPagination = { count: this.rowsPerPage, start: 0 } |
20 | 21 | ||
diff --git a/client/src/app/+admin/follows/following-list/following-list.component.html b/client/src/app/+admin/follows/following-list/following-list.component.html index e4189d334..5fb0f4900 100644 --- a/client/src/app/+admin/follows/following-list/following-list.component.html +++ b/client/src/app/+admin/follows/following-list/following-list.component.html | |||
@@ -1,6 +1,8 @@ | |||
1 | <p-table | 1 | <p-table |
2 | [value]="following" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage" | 2 | [value]="following" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions" |
3 | [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" | 3 | [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" |
4 | [showCurrentPageReport]="true" i18n-currentPageReportTemplate | ||
5 | currentPageReportTemplate="Showing {first} to {last} of {totalRecords} hosts" | ||
4 | > | 6 | > |
5 | <ng-template pTemplate="caption"> | 7 | <ng-template pTemplate="caption"> |
6 | <div class="caption"> | 8 | <div class="caption"> |
@@ -29,7 +31,12 @@ | |||
29 | 31 | ||
30 | <ng-template pTemplate="body" let-follow> | 32 | <ng-template pTemplate="body" let-follow> |
31 | <tr> | 33 | <tr> |
32 | <td>{{ follow.following.host }}</td> | 34 | <td> |
35 | <a [href]="'https://' + follow.following.host" i18n-title title="Open instance in a new tab" target="_blank" rel="noopener noreferrer"> | ||
36 | {{ follow.following.host }} | ||
37 | <span class="glyphicon glyphicon-new-window"></span> | ||
38 | </a> | ||
39 | </td> | ||
33 | 40 | ||
34 | <td *ngIf="follow.state === 'accepted'" i18n>Accepted</td> | 41 | <td *ngIf="follow.state === 'accepted'" i18n>Accepted</td> |
35 | <td *ngIf="follow.state === 'pending'" i18n>Pending</td> | 42 | <td *ngIf="follow.state === 'pending'" i18n>Pending</td> |
@@ -51,11 +58,17 @@ | |||
51 | <td colspan="6"> | 58 | <td colspan="6"> |
52 | <div class="empty-table-message"> | 59 | <div class="empty-table-message"> |
53 | <ng-container *ngIf="search" i18n>No host found matching current filters.</ng-container> | 60 | <ng-container *ngIf="search" i18n>No host found matching current filters.</ng-container> |
54 | <ng-container *ngIf="!search" i18n>Your instance is not follwing any host.</ng-container> | 61 | <ng-container *ngIf="!search" i18n>Your instance is not following anyone.</ng-container> |
55 | </div> | 62 | </div> |
56 | </td> | 63 | </td> |
57 | </tr> | 64 | </tr> |
58 | </ng-template> | 65 | </ng-template> |
59 | </p-table> | 66 | </p-table> |
60 | 67 | ||
61 | <my-batch-domains-modal #batchDomainsModal i18n-action action="Follow domains" (domains)="addFollowing($event)"></my-batch-domains-modal> | 68 | <my-batch-domains-modal #batchDomainsModal i18n-action action="Follow domains" (domains)="addFollowing($event)"> |
69 | <ng-container ngProjectAs="warning"> | ||
70 | <div i18n *ngIf="httpEnabled() === false" class="alert alert-warning"> | ||
71 | It seems that you are not on a HTTPS server. Your webserver needs to have TLS activated in order to follow servers. | ||
72 | </div> | ||
73 | </ng-container> | ||
74 | </my-batch-domains-modal> | ||
diff --git a/client/src/app/+admin/follows/following-list/following-list.component.scss b/client/src/app/+admin/follows/following-list/following-list.component.scss index f4656b88d..563f8d2bc 100644 --- a/client/src/app/+admin/follows/following-list/following-list.component.scss +++ b/client/src/app/+admin/follows/following-list/following-list.component.scss | |||
@@ -1,6 +1,20 @@ | |||
1 | @import '_variables'; | 1 | @import '_variables'; |
2 | @import '_mixins'; | 2 | @import '_mixins'; |
3 | 3 | ||
4 | a { | ||
5 | @include disable-default-a-behaviour; | ||
6 | display: inline-block; | ||
7 | |||
8 | &, &:hover { | ||
9 | color: var(--mainForegroundColor); | ||
10 | } | ||
11 | |||
12 | span { | ||
13 | font-size: 80%; | ||
14 | color: var(--inputPlaceholderColor); | ||
15 | } | ||
16 | } | ||
17 | |||
4 | .caption { | 18 | .caption { |
5 | justify-content: flex-end; | 19 | justify-content: flex-end; |
6 | 20 | ||
diff --git a/client/src/app/+admin/follows/following-list/following-list.component.ts b/client/src/app/+admin/follows/following-list/following-list.component.ts index a4dd07302..e1b1f8aeb 100644 --- a/client/src/app/+admin/follows/following-list/following-list.component.ts +++ b/client/src/app/+admin/follows/following-list/following-list.component.ts | |||
@@ -18,7 +18,8 @@ export class FollowingListComponent extends RestTable implements OnInit { | |||
18 | 18 | ||
19 | following: ActorFollow[] = [] | 19 | following: ActorFollow[] = [] |
20 | totalRecords = 0 | 20 | totalRecords = 0 |
21 | rowsPerPage = 10 | 21 | rowsPerPageOptions = [ 20, 50, 100 ] |
22 | rowsPerPage = this.rowsPerPageOptions[0] | ||
22 | sort: SortMeta = { field: 'createdAt', order: -1 } | 23 | sort: SortMeta = { field: 'createdAt', order: -1 } |
23 | pagination: RestPagination = { count: this.rowsPerPage, start: 0 } | 24 | pagination: RestPagination = { count: this.rowsPerPage, start: 0 } |
24 | 25 | ||
@@ -43,6 +44,10 @@ export class FollowingListComponent extends RestTable implements OnInit { | |||
43 | this.batchDomainsModal.openModal() | 44 | this.batchDomainsModal.openModal() |
44 | } | 45 | } |
45 | 46 | ||
47 | httpEnabled () { | ||
48 | return window.location.protocol === 'https:' | ||
49 | } | ||
50 | |||
46 | async addFollowing (hosts: string[]) { | 51 | async addFollowing (hosts: string[]) { |
47 | this.followService.follow(hosts).subscribe( | 52 | this.followService.follow(hosts).subscribe( |
48 | () => { | 53 | () => { |
diff --git a/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.html b/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.html index f3b980970..debde2f85 100644 --- a/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.html +++ b/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.html | |||
@@ -12,7 +12,7 @@ | |||
12 | </div> | 12 | </div> |
13 | 13 | ||
14 | <p-table | 14 | <p-table |
15 | [value]="videoRedundancies" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage" | 15 | [value]="videoRedundancies" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" |
16 | [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id" | 16 | [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id" |
17 | > | 17 | > |
18 | <ng-template pTemplate="header"> | 18 | <ng-template pTemplate="header"> |