diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-01-12 15:20:03 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-01-12 15:20:03 +0100 |
commit | 99fe265a5fc077cb66c322e7f3d191ff7110aea0 (patch) | |
tree | c9e04ccfcc5496d2300d7c26db5833e494b4cdad /client/src/app/admin | |
parent | fcc5f77b95d330bfcb439c172b7fcc58f3162e4d (diff) | |
parent | 91cc839af88730ba55f84997c56b85ea100070a7 (diff) | |
download | PeerTube-99fe265a5fc077cb66c322e7f3d191ff7110aea0.tar.gz PeerTube-99fe265a5fc077cb66c322e7f3d191ff7110aea0.tar.zst PeerTube-99fe265a5fc077cb66c322e7f3d191ff7110aea0.zip |
Merge branch 'postgresql'
Diffstat (limited to 'client/src/app/admin')
8 files changed, 20 insertions, 14 deletions
diff --git a/client/src/app/admin/friends/friend-list/friend-list.component.html b/client/src/app/admin/friends/friend-list/friend-list.component.html index 4236fc5f6..06258f8c8 100644 --- a/client/src/app/admin/friends/friend-list/friend-list.component.html +++ b/client/src/app/admin/friends/friend-list/friend-list.component.html | |||
@@ -15,7 +15,7 @@ | |||
15 | <td>{{ friend.id }}</td> | 15 | <td>{{ friend.id }}</td> |
16 | <td>{{ friend.host }}</td> | 16 | <td>{{ friend.host }}</td> |
17 | <td>{{ friend.score }}</td> | 17 | <td>{{ friend.score }}</td> |
18 | <td>{{ friend.createdDate | date: 'medium' }}</td> | 18 | <td>{{ friend.createdAt | date: 'medium' }}</td> |
19 | </tr> | 19 | </tr> |
20 | </tbody> | 20 | </tbody> |
21 | </table> | 21 | </table> |
diff --git a/client/src/app/admin/friends/friend-list/friend-list.component.ts b/client/src/app/admin/friends/friend-list/friend-list.component.ts index 88c4800ee..bec10162c 100644 --- a/client/src/app/admin/friends/friend-list/friend-list.component.ts +++ b/client/src/app/admin/friends/friend-list/friend-list.component.ts | |||
@@ -30,7 +30,7 @@ export class FriendListComponent implements OnInit { | |||
30 | 30 | ||
31 | private getFriends() { | 31 | private getFriends() { |
32 | this.friendService.getFriends().subscribe( | 32 | this.friendService.getFriends().subscribe( |
33 | friends => this.friends = friends, | 33 | res => this.friends = res.friends, |
34 | 34 | ||
35 | err => alert(err.text) | 35 | err => alert(err.text) |
36 | ); | 36 | ); |
diff --git a/client/src/app/admin/friends/shared/friend.model.ts b/client/src/app/admin/friends/shared/friend.model.ts index 3c23feebc..462cc82ed 100644 --- a/client/src/app/admin/friends/shared/friend.model.ts +++ b/client/src/app/admin/friends/shared/friend.model.ts | |||
@@ -2,5 +2,5 @@ export interface Friend { | |||
2 | id: string; | 2 | id: string; |
3 | host: string; | 3 | host: string; |
4 | score: number; | 4 | score: number; |
5 | createdDate: Date; | 5 | createdAt: Date; |
6 | } | 6 | } |
diff --git a/client/src/app/admin/friends/shared/friend.service.ts b/client/src/app/admin/friends/shared/friend.service.ts index 8a1ba6b02..85ac04ba0 100644 --- a/client/src/app/admin/friends/shared/friend.service.ts +++ b/client/src/app/admin/friends/shared/friend.service.ts | |||
@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core'; | |||
2 | import { Observable } from 'rxjs/Observable'; | 2 | import { Observable } from 'rxjs/Observable'; |
3 | 3 | ||
4 | import { Friend } from './friend.model'; | 4 | import { Friend } from './friend.model'; |
5 | import { AuthHttp, RestExtractor } from '../../../shared'; | 5 | import { AuthHttp, RestExtractor, ResultList } from '../../../shared'; |
6 | 6 | ||
7 | @Injectable() | 7 | @Injectable() |
8 | export class FriendService { | 8 | export class FriendService { |
@@ -13,11 +13,10 @@ export class FriendService { | |||
13 | private restExtractor: RestExtractor | 13 | private restExtractor: RestExtractor |
14 | ) {} | 14 | ) {} |
15 | 15 | ||
16 | getFriends(): Observable<Friend[]> { | 16 | getFriends() { |
17 | return this.authHttp.get(FriendService.BASE_FRIEND_URL) | 17 | return this.authHttp.get(FriendService.BASE_FRIEND_URL) |
18 | // Not implemented as a data list by the server yet | 18 | .map(this.restExtractor.extractDataList) |
19 | // .map(this.restExtractor.extractDataList) | 19 | .map(this.extractFriends) |
20 | .map((res) => res.json()) | ||
21 | .catch((res) => this.restExtractor.handleError(res)); | 20 | .catch((res) => this.restExtractor.handleError(res)); |
22 | } | 21 | } |
23 | 22 | ||
@@ -36,4 +35,11 @@ export class FriendService { | |||
36 | .map(res => res.status) | 35 | .map(res => res.status) |
37 | .catch((res) => this.restExtractor.handleError(res)); | 36 | .catch((res) => this.restExtractor.handleError(res)); |
38 | } | 37 | } |
38 | |||
39 | private extractFriends(result: ResultList) { | ||
40 | const friends: Friend[] = result.data; | ||
41 | const totalFriends = result.total; | ||
42 | |||
43 | return { friends, totalFriends }; | ||
44 | } | ||
39 | } | 45 | } |
diff --git a/client/src/app/admin/requests/request-stats/request-stats.component.html b/client/src/app/admin/requests/request-stats/request-stats.component.html index b5ac59a9a..6698eac48 100644 --- a/client/src/app/admin/requests/request-stats/request-stats.component.html +++ b/client/src/app/admin/requests/request-stats/request-stats.component.html | |||
@@ -18,6 +18,6 @@ | |||
18 | 18 | ||
19 | <div> | 19 | <div> |
20 | <span class="label-description">Remaining requests:</span> | 20 | <span class="label-description">Remaining requests:</span> |
21 | {{ stats.requests.length }} | 21 | {{ stats.totalRequests }} |
22 | </div> | 22 | </div> |
23 | </div> | 23 | </div> |
diff --git a/client/src/app/admin/requests/request-stats/request-stats.component.ts b/client/src/app/admin/requests/request-stats/request-stats.component.ts index d20b12199..9e2af219c 100644 --- a/client/src/app/admin/requests/request-stats/request-stats.component.ts +++ b/client/src/app/admin/requests/request-stats/request-stats.component.ts | |||
@@ -19,7 +19,7 @@ export class RequestStatsComponent implements OnInit, OnDestroy { | |||
19 | } | 19 | } |
20 | 20 | ||
21 | ngOnDestroy() { | 21 | ngOnDestroy() { |
22 | if (this.stats.secondsInterval !== null) { | 22 | if (this.stats !== null && this.stats.secondsInterval !== null) { |
23 | clearInterval(this.interval); | 23 | clearInterval(this.interval); |
24 | } | 24 | } |
25 | } | 25 | } |
diff --git a/client/src/app/admin/requests/shared/request-stats.model.ts b/client/src/app/admin/requests/shared/request-stats.model.ts index 766e80836..49ecbc79e 100644 --- a/client/src/app/admin/requests/shared/request-stats.model.ts +++ b/client/src/app/admin/requests/shared/request-stats.model.ts | |||
@@ -7,18 +7,18 @@ export class RequestStats { | |||
7 | maxRequestsInParallel: number; | 7 | maxRequestsInParallel: number; |
8 | milliSecondsInterval: number; | 8 | milliSecondsInterval: number; |
9 | remainingMilliSeconds: number; | 9 | remainingMilliSeconds: number; |
10 | requests: Request[]; | 10 | totalRequests: number; |
11 | 11 | ||
12 | constructor(hash: { | 12 | constructor(hash: { |
13 | maxRequestsInParallel: number, | 13 | maxRequestsInParallel: number, |
14 | milliSecondsInterval: number, | 14 | milliSecondsInterval: number, |
15 | remainingMilliSeconds: number, | 15 | remainingMilliSeconds: number, |
16 | requests: Request[]; | 16 | totalRequests: number; |
17 | }) { | 17 | }) { |
18 | this.maxRequestsInParallel = hash.maxRequestsInParallel; | 18 | this.maxRequestsInParallel = hash.maxRequestsInParallel; |
19 | this.milliSecondsInterval = hash.milliSecondsInterval; | 19 | this.milliSecondsInterval = hash.milliSecondsInterval; |
20 | this.remainingMilliSeconds = hash.remainingMilliSeconds; | 20 | this.remainingMilliSeconds = hash.remainingMilliSeconds; |
21 | this.requests = hash.requests; | 21 | this.totalRequests = hash.totalRequests; |
22 | } | 22 | } |
23 | 23 | ||
24 | get remainingSeconds() { | 24 | get remainingSeconds() { |
diff --git a/client/src/app/admin/users/user-list/user-list.component.html b/client/src/app/admin/users/user-list/user-list.component.html index 328b1be77..36193d119 100644 --- a/client/src/app/admin/users/user-list/user-list.component.html +++ b/client/src/app/admin/users/user-list/user-list.component.html | |||
@@ -14,7 +14,7 @@ | |||
14 | <tr *ngFor="let user of users"> | 14 | <tr *ngFor="let user of users"> |
15 | <td>{{ user.id }}</td> | 15 | <td>{{ user.id }}</td> |
16 | <td>{{ user.username }}</td> | 16 | <td>{{ user.username }}</td> |
17 | <td>{{ user.createdDate | date: 'medium' }}</td> | 17 | <td>{{ user.createdAt | date: 'medium' }}</td> |
18 | <td class="text-right"> | 18 | <td class="text-right"> |
19 | <span class="glyphicon glyphicon-remove" *ngIf="!user.isAdmin()" (click)="removeUser(user)"></span> | 19 | <span class="glyphicon glyphicon-remove" *ngIf="!user.isAdmin()" (click)="removeUser(user)"></span> |
20 | </td> | 20 | </td> |