diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-04-19 14:11:40 +0200 |
---|---|---|
committer | Rigel Kent <par@rigelk.eu> | 2020-05-01 16:41:02 +0200 |
commit | e0a929179a9dc76e035ca7fda2b61d5ff46afbc5 (patch) | |
tree | 1e6615c612ad6995dcb1c3619342dbbc7db35034 /client/src/app/+admin/moderation/instance-blocklist | |
parent | aeb1bed9835b3b092832160245080d4023c14d91 (diff) | |
download | PeerTube-e0a929179a9dc76e035ca7fda2b61d5ff46afbc5.tar.gz PeerTube-e0a929179a9dc76e035ca7fda2b61d5ff46afbc5.tar.zst PeerTube-e0a929179a9dc76e035ca7fda2b61d5ff46afbc5.zip |
Add filter inputs for blacklisted videos and muted accounts/servers
Diffstat (limited to 'client/src/app/+admin/moderation/instance-blocklist')
4 files changed, 35 insertions, 9 deletions
diff --git a/client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.html b/client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.html index 6d77c8290..d340b5e57 100644 --- a/client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.html +++ b/client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.html | |||
@@ -1,9 +1,19 @@ | |||
1 | <p-table | 1 | <p-table |
2 | [value]="blockedAccounts" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage" | 2 | [value]="blockedAccounts" [lazy]="true" [paginator]="true" [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 | 4 | [showCurrentPageReport]="true" i18n-currentPageReportTemplate |
5 | currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} muted accounts" | 5 | currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} muted accounts" |
6 | > | 6 | > |
7 | <ng-template pTemplate="caption"> | ||
8 | <div class="caption"> | ||
9 | <div class="ml-auto"> | ||
10 | <input | ||
11 | type="text" name="table-filter" id="table-filter" i18n-placeholder placeholder="Filter..." | ||
12 | (keyup)="onSearch($event)" | ||
13 | > | ||
14 | </div> | ||
15 | </div> | ||
16 | </ng-template> | ||
7 | 17 | ||
8 | <ng-template pTemplate="header"> | 18 | <ng-template pTemplate="header"> |
9 | <tr> | 19 | <tr> |
diff --git a/client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.ts b/client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.ts index a3910177f..607b1cbe0 100644 --- a/client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.ts +++ b/client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.ts | |||
@@ -7,13 +7,14 @@ import { AccountBlock, BlocklistService } from '@app/shared/blocklist' | |||
7 | 7 | ||
8 | @Component({ | 8 | @Component({ |
9 | selector: 'my-instance-account-blocklist', | 9 | selector: 'my-instance-account-blocklist', |
10 | styleUrls: [ './instance-account-blocklist.component.scss' ], | 10 | styleUrls: [ '../moderation.component.scss', './instance-account-blocklist.component.scss' ], |
11 | templateUrl: './instance-account-blocklist.component.html' | 11 | templateUrl: './instance-account-blocklist.component.html' |
12 | }) | 12 | }) |
13 | export class InstanceAccountBlocklistComponent extends RestTable implements OnInit { | 13 | export class InstanceAccountBlocklistComponent extends RestTable implements OnInit { |
14 | blockedAccounts: AccountBlock[] = [] | 14 | blockedAccounts: AccountBlock[] = [] |
15 | totalRecords = 0 | 15 | totalRecords = 0 |
16 | rowsPerPage = 10 | 16 | rowsPerPageOptions = [ 20, 50, 100 ] |
17 | rowsPerPage = this.rowsPerPageOptions[0] | ||
17 | sort: SortMeta = { field: 'createdAt', order: -1 } | 18 | sort: SortMeta = { field: 'createdAt', order: -1 } |
18 | pagination: RestPagination = { count: this.rowsPerPage, start: 0 } | 19 | pagination: RestPagination = { count: this.rowsPerPage, start: 0 } |
19 | 20 | ||
@@ -49,7 +50,11 @@ export class InstanceAccountBlocklistComponent extends RestTable implements OnIn | |||
49 | } | 50 | } |
50 | 51 | ||
51 | protected loadData () { | 52 | protected loadData () { |
52 | return this.blocklistService.getInstanceAccountBlocklist(this.pagination, this.sort) | 53 | return this.blocklistService.getInstanceAccountBlocklist({ |
54 | pagination: this.pagination, | ||
55 | sort: this.sort, | ||
56 | search: this.search | ||
57 | }) | ||
53 | .subscribe( | 58 | .subscribe( |
54 | resultList => { | 59 | resultList => { |
55 | this.blockedAccounts = resultList.data | 60 | this.blockedAccounts = resultList.data |
diff --git a/client/src/app/+admin/moderation/instance-blocklist/instance-server-blocklist.component.html b/client/src/app/+admin/moderation/instance-blocklist/instance-server-blocklist.component.html index 19b33a0f5..b6c87fdc8 100644 --- a/client/src/app/+admin/moderation/instance-blocklist/instance-server-blocklist.component.html +++ b/client/src/app/+admin/moderation/instance-blocklist/instance-server-blocklist.component.html | |||
@@ -1,12 +1,18 @@ | |||
1 | <p-table | 1 | <p-table |
2 | [value]="blockedServers" [lazy]="true" [paginator]="true" [totalRecords]="totalRecords" [rows]="rowsPerPage" | 2 | [value]="blockedServers" [lazy]="true" [paginator]="true" [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 | 4 | [showCurrentPageReport]="true" i18n-currentPageReportTemplate |
5 | currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} muted instances" | 5 | currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} muted instances" |
6 | > | 6 | > |
7 | <ng-template pTemplate="caption"> | 7 | <ng-template pTemplate="caption"> |
8 | <div class="caption"> | 8 | <div class="caption"> |
9 | <a class="ml-auto block-button" (click)="addServersToBlock()" (key.enter)="addServersToBlock()"> | 9 | <div class="ml-auto"> |
10 | <input | ||
11 | type="text" name="table-filter" id="table-filter" i18n-placeholder placeholder="Filter..." | ||
12 | (keyup)="onSearch($event)" | ||
13 | > | ||
14 | </div> | ||
15 | <a class="ml-2 block-button" (click)="addServersToBlock()" (key.enter)="addServersToBlock()"> | ||
10 | <my-global-icon iconName="add"></my-global-icon> | 16 | <my-global-icon iconName="add"></my-global-icon> |
11 | <ng-container i18n>Mute domain</ng-container> | 17 | <ng-container i18n>Mute domain</ng-container> |
12 | </a> | 18 | </a> |
diff --git a/client/src/app/+admin/moderation/instance-blocklist/instance-server-blocklist.component.ts b/client/src/app/+admin/moderation/instance-blocklist/instance-server-blocklist.component.ts index 431729ef2..4efadc386 100644 --- a/client/src/app/+admin/moderation/instance-blocklist/instance-server-blocklist.component.ts +++ b/client/src/app/+admin/moderation/instance-blocklist/instance-server-blocklist.component.ts | |||
@@ -9,7 +9,7 @@ import { BatchDomainsModalComponent } from '@app/+admin/config/shared/batch-doma | |||
9 | 9 | ||
10 | @Component({ | 10 | @Component({ |
11 | selector: 'my-instance-server-blocklist', | 11 | selector: 'my-instance-server-blocklist', |
12 | styleUrls: [ './instance-server-blocklist.component.scss' ], | 12 | styleUrls: [ '../moderation.component.scss', './instance-server-blocklist.component.scss' ], |
13 | templateUrl: './instance-server-blocklist.component.html' | 13 | templateUrl: './instance-server-blocklist.component.html' |
14 | }) | 14 | }) |
15 | export class InstanceServerBlocklistComponent extends RestTable implements OnInit { | 15 | export class InstanceServerBlocklistComponent extends RestTable implements OnInit { |
@@ -17,7 +17,8 @@ export class InstanceServerBlocklistComponent extends RestTable implements OnIni | |||
17 | 17 | ||
18 | blockedServers: ServerBlock[] = [] | 18 | blockedServers: ServerBlock[] = [] |
19 | totalRecords = 0 | 19 | totalRecords = 0 |
20 | rowsPerPage = 10 | 20 | rowsPerPageOptions = [ 20, 50, 100 ] |
21 | rowsPerPage = this.rowsPerPageOptions[0] | ||
21 | sort: SortMeta = { field: 'createdAt', order: -1 } | 22 | sort: SortMeta = { field: 'createdAt', order: -1 } |
22 | pagination: RestPagination = { count: this.rowsPerPage, start: 0 } | 23 | pagination: RestPagination = { count: this.rowsPerPage, start: 0 } |
23 | 24 | ||
@@ -72,7 +73,11 @@ export class InstanceServerBlocklistComponent extends RestTable implements OnIni | |||
72 | } | 73 | } |
73 | 74 | ||
74 | protected loadData () { | 75 | protected loadData () { |
75 | return this.blocklistService.getInstanceServerBlocklist(this.pagination, this.sort) | 76 | return this.blocklistService.getInstanceServerBlocklist({ |
77 | pagination: this.pagination, | ||
78 | sort: this.sort, | ||
79 | search: this.search | ||
80 | }) | ||
76 | .subscribe( | 81 | .subscribe( |
77 | resultList => { | 82 | resultList => { |
78 | this.blockedServers = resultList.data | 83 | this.blockedServers = resultList.data |