aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/follows/following-list
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+admin/follows/following-list')
-rw-r--r--client/src/app/+admin/follows/following-list/following-list.component.html21
-rw-r--r--client/src/app/+admin/follows/following-list/following-list.component.scss14
-rw-r--r--client/src/app/+admin/follows/following-list/following-list.component.ts7
3 files changed, 37 insertions, 5 deletions
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
4a {
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 () => {