]>
Commit | Line | Data |
---|---|---|
1 | <h1> | |
2 | <my-global-icon iconName="following" aria-hidden="true"></my-global-icon> | |
3 | <ng-container i18n>Instances you follow</ng-container> | |
4 | </h1> | |
5 | ||
6 | <p-table | |
7 | [value]="following" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions" | |
8 | [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" (onPage)="onPage($event)" | |
9 | [showCurrentPageReport]="true" i18n-currentPageReportTemplate | |
10 | currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} hosts" | |
11 | > | |
12 | <ng-template pTemplate="caption"> | |
13 | <div class="caption"> | |
14 | <div class="left-buttons"> | |
15 | <a class="follow-button" (click)="addDomainsToFollow()" (key.enter)="addDomainsToFollow()"> | |
16 | <my-global-icon iconName="following" aria-hidden="true"></my-global-icon> | |
17 | <ng-container i18n>Follow instances</ng-container> | |
18 | </a> | |
19 | </div> | |
20 | ||
21 | <div class="ml-auto has-feedback has-clear"> | |
22 | <input | |
23 | type="text" name="table-filter" id="table-filter" i18n-placeholder placeholder="Filter..." | |
24 | (keyup)="onSearch($event)" | |
25 | > | |
26 | <a class="glyphicon glyphicon-remove-sign form-control-feedback form-control-clear" (click)="resetSearch()"></a> | |
27 | <span class="sr-only" i18n>Clear filters</span> | |
28 | </div> | |
29 | </div> | |
30 | </ng-template> | |
31 | ||
32 | <ng-template pTemplate="header"> | |
33 | <tr> | |
34 | <th style="width: 150px;" i18n>Action</th> | |
35 | <th i18n>Host</th> | |
36 | <th style="width: 100px;" i18n pSortableColumn="state">State <p-sortIcon field="state"></p-sortIcon></th> | |
37 | <th style="width: 150px;" i18n pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th> | |
38 | <th style="width: 160px;" i18n pSortableColumn="redundancyAllowed">Redundancy allowed <p-sortIcon field="redundancyAllowed"></p-sortIcon></th> | |
39 | </tr> | |
40 | </ng-template> | |
41 | ||
42 | <ng-template pTemplate="body" let-follow> | |
43 | <tr> | |
44 | <td class="action-cell"> | |
45 | <my-delete-button label="Unfollow" i18n-label (click)="removeFollowing(follow)"></my-delete-button> | |
46 | </td> | |
47 | <td> | |
48 | <a [href]="'https://' + follow.following.host" i18n-title title="Open instance in a new tab" target="_blank" rel="noopener noreferrer"> | |
49 | {{ follow.following.host }} | |
50 | <span class="glyphicon glyphicon-new-window"></span> | |
51 | </a> | |
52 | </td> | |
53 | ||
54 | <td *ngIf="follow.state === 'accepted'"> | |
55 | <span class="badge badge-green" i18n>Accepted</span> | |
56 | </td> | |
57 | <td *ngIf="follow.state === 'pending'"> | |
58 | <span class="badge badge-yellow" i18n>Pending</span> | |
59 | </td> | |
60 | ||
61 | <td>{{ follow.createdAt | date: 'short' }}</td> | |
62 | <td> | |
63 | <my-redundancy-checkbox | |
64 | [host]="follow.following.host" [redundancyAllowed]="follow.following.hostRedundancyAllowed" | |
65 | ></my-redundancy-checkbox> | |
66 | </td> | |
67 | </tr> | |
68 | </ng-template> | |
69 | ||
70 | <ng-template pTemplate="emptymessage"> | |
71 | <tr> | |
72 | <td colspan="6"> | |
73 | <div class="no-results"> | |
74 | <ng-container *ngIf="search" i18n>No host found matching current filters.</ng-container> | |
75 | <ng-container *ngIf="!search" i18n>Your instance is not following anyone.</ng-container> | |
76 | </div> | |
77 | </td> | |
78 | </tr> | |
79 | </ng-template> | |
80 | </p-table> | |
81 | ||
82 | <my-batch-domains-modal #batchDomainsModal i18n-action action="Follow domains" (domains)="addFollowing($event)"> | |
83 | <ng-container ngProjectAs="warning"> | |
84 | <div i18n *ngIf="httpEnabled() === false" class="alert alert-warning"> | |
85 | It seems that you are not on a HTTPS server. Your webserver needs to have TLS activated in order to follow servers. | |
86 | </div> | |
87 | </ng-container> | |
88 | </my-batch-domains-modal> |