Unify paginator disabling when no result is displayable, fix batch domain add for non-https
This commit is contained in:
parent
36004aa7b0
commit
b8cf27c0f8
|
@ -1,6 +1,8 @@
|
|||
<p-table
|
||||
[value]="followers" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage"
|
||||
[value]="followers" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
|
||||
[sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)"
|
||||
[showCurrentPageReport]="true" i18n-currentPageReportTemplate
|
||||
currentPageReportTemplate="Showing {first} to {last} of {totalRecords} followers"
|
||||
>
|
||||
<ng-template pTemplate="caption">
|
||||
<div class="caption">
|
||||
|
|
|
@ -14,7 +14,8 @@ import { I18n } from '@ngx-translate/i18n-polyfill'
|
|||
export class FollowersListComponent extends RestTable implements OnInit {
|
||||
followers: ActorFollow[] = []
|
||||
totalRecords = 0
|
||||
rowsPerPage = 10
|
||||
rowsPerPageOptions = [ 20, 50, 100 ]
|
||||
rowsPerPage = this.rowsPerPageOptions[0]
|
||||
sort: SortMeta = { field: 'createdAt', order: -1 }
|
||||
pagination: RestPagination = { count: this.rowsPerPage, start: 0 }
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<p-table
|
||||
[value]="following" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage"
|
||||
[value]="following" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
|
||||
[sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)"
|
||||
[showCurrentPageReport]="true" i18n-currentPageReportTemplate
|
||||
currentPageReportTemplate="Showing {first} to {last} of {totalRecords} hosts"
|
||||
>
|
||||
<ng-template pTemplate="caption">
|
||||
<div class="caption">
|
||||
|
@ -29,7 +31,12 @@
|
|||
|
||||
<ng-template pTemplate="body" let-follow>
|
||||
<tr>
|
||||
<td>{{ follow.following.host }}</td>
|
||||
<td>
|
||||
<a [href]="'https://' + follow.following.host" i18n-title title="Open instance in a new tab" target="_blank" rel="noopener noreferrer">
|
||||
{{ follow.following.host }}
|
||||
<span class="glyphicon glyphicon-new-window"></span>
|
||||
</a>
|
||||
</td>
|
||||
|
||||
<td *ngIf="follow.state === 'accepted'" i18n>Accepted</td>
|
||||
<td *ngIf="follow.state === 'pending'" i18n>Pending</td>
|
||||
|
@ -51,11 +58,17 @@
|
|||
<td colspan="6">
|
||||
<div class="empty-table-message">
|
||||
<ng-container *ngIf="search" i18n>No host found matching current filters.</ng-container>
|
||||
<ng-container *ngIf="!search" i18n>Your instance is not follwing any host.</ng-container>
|
||||
<ng-container *ngIf="!search" i18n>Your instance is not following anyone.</ng-container>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</ng-template>
|
||||
</p-table>
|
||||
|
||||
<my-batch-domains-modal #batchDomainsModal i18n-action action="Follow domains" (domains)="addFollowing($event)"></my-batch-domains-modal>
|
||||
<my-batch-domains-modal #batchDomainsModal i18n-action action="Follow domains" (domains)="addFollowing($event)">
|
||||
<ng-container ngProjectAs="warning">
|
||||
<div i18n *ngIf="httpEnabled() === false" class="alert alert-warning">
|
||||
It seems that you are not on a HTTPS server. Your webserver needs to have TLS activated in order to follow servers.
|
||||
</div>
|
||||
</ng-container>
|
||||
</my-batch-domains-modal>
|
||||
|
|
|
@ -1,6 +1,20 @@
|
|||
@import '_variables';
|
||||
@import '_mixins';
|
||||
|
||||
a {
|
||||
@include disable-default-a-behaviour;
|
||||
display: inline-block;
|
||||
|
||||
&, &:hover {
|
||||
color: var(--mainForegroundColor);
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: 80%;
|
||||
color: var(--inputPlaceholderColor);
|
||||
}
|
||||
}
|
||||
|
||||
.caption {
|
||||
justify-content: flex-end;
|
||||
|
||||
|
|
|
@ -18,7 +18,8 @@ export class FollowingListComponent extends RestTable implements OnInit {
|
|||
|
||||
following: ActorFollow[] = []
|
||||
totalRecords = 0
|
||||
rowsPerPage = 10
|
||||
rowsPerPageOptions = [ 20, 50, 100 ]
|
||||
rowsPerPage = this.rowsPerPageOptions[0]
|
||||
sort: SortMeta = { field: 'createdAt', order: -1 }
|
||||
pagination: RestPagination = { count: this.rowsPerPage, start: 0 }
|
||||
|
||||
|
@ -43,6 +44,10 @@ export class FollowingListComponent extends RestTable implements OnInit {
|
|||
this.batchDomainsModal.openModal()
|
||||
}
|
||||
|
||||
httpEnabled () {
|
||||
return window.location.protocol === 'https:'
|
||||
}
|
||||
|
||||
async addFollowing (hosts: string[]) {
|
||||
this.followService.follow(hosts).subscribe(
|
||||
() => {
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
</div>
|
||||
|
||||
<p-table
|
||||
[value]="videoRedundancies" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage"
|
||||
[value]="videoRedundancies" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage"
|
||||
[sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id"
|
||||
>
|
||||
<ng-template pTemplate="header">
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<p-table
|
||||
[value]="blockedAccounts" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
|
||||
[value]="blockedAccounts" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
|
||||
[sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)"
|
||||
[showCurrentPageReport]="true" i18n-currentPageReportTemplate
|
||||
currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} muted accounts"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<p-table
|
||||
[value]="blockedServers" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
|
||||
[value]="blockedServers" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
|
||||
[sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)"
|
||||
[showCurrentPageReport]="true" i18n-currentPageReportTemplate
|
||||
currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} muted instances"
|
||||
|
@ -54,10 +54,4 @@
|
|||
</ng-template>
|
||||
</p-table>
|
||||
|
||||
<my-batch-domains-modal #batchDomainsModal i18n-action action="Mute domains" (domains)="onDomainsToBlock($event)">
|
||||
<ng-container ngProjectAs="warning">
|
||||
<div i18n *ngIf="httpEnabled() === false" class="alert alert-warning">
|
||||
It seems that you are not on a HTTPS server. Your webserver needs to have TLS activated in order to follow servers.
|
||||
</div>
|
||||
</ng-container>
|
||||
</my-batch-domains-modal>
|
||||
<my-batch-domains-modal #batchDomainsModal i18n-action action="Mute domains" (domains)="onDomainsToBlock($event)"></my-batch-domains-modal>
|
||||
|
|
|
@ -51,10 +51,6 @@ export class InstanceServerBlocklistComponent extends RestTable implements OnIni
|
|||
)
|
||||
}
|
||||
|
||||
httpEnabled () {
|
||||
return window.location.protocol === 'https:'
|
||||
}
|
||||
|
||||
addServersToBlock () {
|
||||
this.batchDomainsModal.openModal()
|
||||
}
|
||||
|
|
|
@ -154,7 +154,7 @@
|
|||
|
||||
<!-- report text -->
|
||||
<div class="mt-3 d-flex">
|
||||
<span class="col-3 moderation-expanded-label" i18n>Report</span>
|
||||
<span class="col-3 moderation-expanded-label" i18n>Report #{{ videoAbuse.id }}</span>
|
||||
<span class="col-9 moderation-expanded-text" [innerHTML]="videoAbuse.reasonHtml"></span>
|
||||
</div>
|
||||
<div class="mt-3 d-flex" *ngIf="videoAbuse.moderationComment">
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<p-table
|
||||
[value]="blacklist" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
|
||||
[value]="blacklist" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
|
||||
[sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id"
|
||||
[showCurrentPageReport]="true" i18n-currentPageReportTemplate
|
||||
currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} blacklisted videos"
|
||||
|
|
|
@ -89,10 +89,10 @@ export class PluginListInstalledComponent implements OnInit {
|
|||
|
||||
getNoResultMessage () {
|
||||
if (this.pluginType === PluginType.PLUGIN) {
|
||||
return this.i18n('You don\'t have plugins installed yet.')
|
||||
return this.i18n("You don't have plugins installed yet.")
|
||||
}
|
||||
|
||||
return this.i18n('You don\'t have themes installed yet.')
|
||||
return this.i18n("You don't have themes installed yet.")
|
||||
}
|
||||
|
||||
isUpdateAvailable (plugin: PeerTubePlugin) {
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
</div>
|
||||
|
||||
<p-table
|
||||
[value]="jobs" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage" dataKey="uniqId"
|
||||
[value]="jobs" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" dataKey="uniqId"
|
||||
[sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" [first]="pagination.start"
|
||||
[tableStyle]="{'table-layout':'auto'}"
|
||||
>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
</div>
|
||||
|
||||
<p-table
|
||||
[value]="users" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage"
|
||||
[value]="users" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage"
|
||||
[sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id"
|
||||
[(selection)]="selectedUsers"
|
||||
[showCurrentPageReport]="true" i18n-currentPageReportTemplate
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
</div>
|
||||
|
||||
<p-table
|
||||
[value]="blockedAccounts" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage"
|
||||
[value]="blockedAccounts" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage"
|
||||
[sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)"
|
||||
>
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
</div>
|
||||
|
||||
<p-table
|
||||
[value]="blockedServers" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage"
|
||||
[value]="blockedServers" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage"
|
||||
[sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)"
|
||||
>
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<p-table
|
||||
[value]="videoChangeOwnerships"
|
||||
[lazy]="true"
|
||||
[paginator]="true"
|
||||
[paginator]="totalRecords > 0"
|
||||
[totalRecords]="totalRecords"
|
||||
[rows]="rowsPerPage"
|
||||
[sortField]="sort.field"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<p-table
|
||||
[value]="videoImports" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage"
|
||||
[value]="videoImports" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage"
|
||||
[sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id"
|
||||
>
|
||||
<ng-template pTemplate="header">
|
||||
|
|
Loading…
Reference in New Issue