diff options
Diffstat (limited to 'client/src/app/core')
-rw-r--r-- | client/src/app/core/rest/rest-table.ts | 14 | ||||
-rw-r--r-- | client/src/app/core/users/user.model.ts | 14 |
2 files changed, 21 insertions, 7 deletions
diff --git a/client/src/app/core/rest/rest-table.ts b/client/src/app/core/rest/rest-table.ts index 1b35ad47d..e6328eddc 100644 --- a/client/src/app/core/rest/rest-table.ts +++ b/client/src/app/core/rest/rest-table.ts | |||
@@ -3,6 +3,9 @@ import { LazyLoadEvent, SortMeta } from 'primeng/api' | |||
3 | import { RestPagination } from './rest-pagination' | 3 | import { RestPagination } from './rest-pagination' |
4 | import { Subject } from 'rxjs' | 4 | import { Subject } from 'rxjs' |
5 | import { debounceTime, distinctUntilChanged } from 'rxjs/operators' | 5 | import { debounceTime, distinctUntilChanged } from 'rxjs/operators' |
6 | import * as debug from 'debug' | ||
7 | |||
8 | const logger = debug('peertube:tables:RestTable') | ||
6 | 9 | ||
7 | export abstract class RestTable { | 10 | export abstract class RestTable { |
8 | 11 | ||
@@ -15,7 +18,7 @@ export abstract class RestTable { | |||
15 | rowsPerPage = this.rowsPerPageOptions[0] | 18 | rowsPerPage = this.rowsPerPageOptions[0] |
16 | expandedRows = {} | 19 | expandedRows = {} |
17 | 20 | ||
18 | private searchStream: Subject<string> | 21 | protected searchStream: Subject<string> |
19 | 22 | ||
20 | abstract getIdentifier (): string | 23 | abstract getIdentifier (): string |
21 | 24 | ||
@@ -37,6 +40,8 @@ export abstract class RestTable { | |||
37 | } | 40 | } |
38 | 41 | ||
39 | loadLazy (event: LazyLoadEvent) { | 42 | loadLazy (event: LazyLoadEvent) { |
43 | logger('Load lazy %o.', event) | ||
44 | |||
40 | this.sort = { | 45 | this.sort = { |
41 | order: event.sortOrder, | 46 | order: event.sortOrder, |
42 | field: event.sortField | 47 | field: event.sortField |
@@ -65,6 +70,9 @@ export abstract class RestTable { | |||
65 | ) | 70 | ) |
66 | .subscribe(search => { | 71 | .subscribe(search => { |
67 | this.search = search | 72 | this.search = search |
73 | |||
74 | logger('On search %s.', this.search) | ||
75 | |||
68 | this.loadData() | 76 | this.loadData() |
69 | }) | 77 | }) |
70 | } | 78 | } |
@@ -75,14 +83,18 @@ export abstract class RestTable { | |||
75 | } | 83 | } |
76 | 84 | ||
77 | onPage (event: { first: number, rows: number }) { | 85 | onPage (event: { first: number, rows: number }) { |
86 | logger('On page %o.', event) | ||
87 | |||
78 | if (this.rowsPerPage !== event.rows) { | 88 | if (this.rowsPerPage !== event.rows) { |
79 | this.rowsPerPage = event.rows | 89 | this.rowsPerPage = event.rows |
80 | this.pagination = { | 90 | this.pagination = { |
81 | start: event.first, | 91 | start: event.first, |
82 | count: this.rowsPerPage | 92 | count: this.rowsPerPage |
83 | } | 93 | } |
94 | |||
84 | this.loadData() | 95 | this.loadData() |
85 | } | 96 | } |
97 | |||
86 | this.expandedRows = {} | 98 | this.expandedRows = {} |
87 | } | 99 | } |
88 | 100 | ||
diff --git a/client/src/app/core/users/user.model.ts b/client/src/app/core/users/user.model.ts index 8ecdf9fcd..31b9c2152 100644 --- a/client/src/app/core/users/user.model.ts +++ b/client/src/app/core/users/user.model.ts | |||
@@ -51,12 +51,14 @@ export class User implements UserServerModel { | |||
51 | videoQuotaDaily: number | 51 | videoQuotaDaily: number |
52 | videoQuotaUsed?: number | 52 | videoQuotaUsed?: number |
53 | videoQuotaUsedDaily?: number | 53 | videoQuotaUsedDaily?: number |
54 | |||
54 | videosCount?: number | 55 | videosCount?: number |
55 | videoAbusesCount?: number | ||
56 | videoAbusesAcceptedCount?: number | ||
57 | videoAbusesCreatedCount?: number | ||
58 | videoCommentsCount?: number | 56 | videoCommentsCount?: number |
59 | 57 | ||
58 | abusesCount?: number | ||
59 | abusesAcceptedCount?: number | ||
60 | abusesCreatedCount?: number | ||
61 | |||
60 | theme: string | 62 | theme: string |
61 | 63 | ||
62 | account: Account | 64 | account: Account |
@@ -89,9 +91,9 @@ export class User implements UserServerModel { | |||
89 | this.videoQuotaUsed = hash.videoQuotaUsed | 91 | this.videoQuotaUsed = hash.videoQuotaUsed |
90 | this.videoQuotaUsedDaily = hash.videoQuotaUsedDaily | 92 | this.videoQuotaUsedDaily = hash.videoQuotaUsedDaily |
91 | this.videosCount = hash.videosCount | 93 | this.videosCount = hash.videosCount |
92 | this.videoAbusesCount = hash.videoAbusesCount | 94 | this.abusesCount = hash.abusesCount |
93 | this.videoAbusesAcceptedCount = hash.videoAbusesAcceptedCount | 95 | this.abusesAcceptedCount = hash.abusesAcceptedCount |
94 | this.videoAbusesCreatedCount = hash.videoAbusesCreatedCount | 96 | this.abusesCreatedCount = hash.abusesCreatedCount |
95 | this.videoCommentsCount = hash.videoCommentsCount | 97 | this.videoCommentsCount = hash.videoCommentsCount |
96 | 98 | ||
97 | this.nsfwPolicy = hash.nsfwPolicy | 99 | this.nsfwPolicy = hash.nsfwPolicy |