diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-06-25 17:19:46 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-06-25 17:19:46 +0200 |
commit | e636eb88101a51399057c86477af6677f5614d48 (patch) | |
tree | ba56f0da932613c8013a2c52905ded1987cd6d6d /client | |
parent | 4f133041819409a72cf70fa2fa6c4df14c6de4fd (diff) | |
download | PeerTube-e636eb88101a51399057c86477af6677f5614d48.tar.gz PeerTube-e636eb88101a51399057c86477af6677f5614d48.tar.zst PeerTube-e636eb88101a51399057c86477af6677f5614d48.zip |
Requests -> RequestSchedulers
Diffstat (limited to 'client')
16 files changed, 36 insertions, 41 deletions
diff --git a/client/src/app/+admin/admin-routing.module.ts b/client/src/app/+admin/admin-routing.module.ts index 839913135..bcc94a9f3 100644 --- a/client/src/app/+admin/admin-routing.module.ts +++ b/client/src/app/+admin/admin-routing.module.ts | |||
@@ -3,7 +3,7 @@ import { RouterModule, Routes } from '@angular/router' | |||
3 | 3 | ||
4 | import { AdminComponent } from './admin.component' | 4 | import { AdminComponent } from './admin.component' |
5 | import { FriendsRoutes } from './friends' | 5 | import { FriendsRoutes } from './friends' |
6 | import { RequestsRoutes } from './requests' | 6 | import { RequestSchedulersRoutes } from './request-schedulers' |
7 | import { UsersRoutes } from './users' | 7 | import { UsersRoutes } from './users' |
8 | import { VideoAbusesRoutes } from './video-abuses' | 8 | import { VideoAbusesRoutes } from './video-abuses' |
9 | 9 | ||
@@ -18,7 +18,7 @@ const adminRoutes: Routes = [ | |||
18 | pathMatch: 'full' | 18 | pathMatch: 'full' |
19 | }, | 19 | }, |
20 | ...FriendsRoutes, | 20 | ...FriendsRoutes, |
21 | ...RequestsRoutes, | 21 | ...RequestSchedulersRoutes, |
22 | ...UsersRoutes, | 22 | ...UsersRoutes, |
23 | ...VideoAbusesRoutes | 23 | ...VideoAbusesRoutes |
24 | ] | 24 | ] |
diff --git a/client/src/app/+admin/admin.module.ts b/client/src/app/+admin/admin.module.ts index 9ecce5dc3..e4ba8e5b7 100644 --- a/client/src/app/+admin/admin.module.ts +++ b/client/src/app/+admin/admin.module.ts | |||
@@ -3,7 +3,7 @@ import { NgModule } from '@angular/core' | |||
3 | import { AdminComponent } from './admin.component' | 3 | import { AdminComponent } from './admin.component' |
4 | import { AdminRoutingModule } from './admin-routing.module' | 4 | import { AdminRoutingModule } from './admin-routing.module' |
5 | import { FriendsComponent, FriendAddComponent, FriendListComponent, FriendService } from './friends' | 5 | import { FriendsComponent, FriendAddComponent, FriendListComponent, FriendService } from './friends' |
6 | import { RequestsComponent, RequestStatsComponent, RequestService } from './requests' | 6 | import { RequestSchedulersComponent, RequestSchedulersStatsComponent, RequestSchedulersService } from './request-schedulers' |
7 | import { UsersComponent, UserAddComponent, UserListComponent, UserService } from './users' | 7 | import { UsersComponent, UserAddComponent, UserListComponent, UserService } from './users' |
8 | import { VideoAbusesComponent, VideoAbuseListComponent } from './video-abuses' | 8 | import { VideoAbusesComponent, VideoAbuseListComponent } from './video-abuses' |
9 | import { SharedModule } from '../shared' | 9 | import { SharedModule } from '../shared' |
@@ -21,8 +21,8 @@ import { SharedModule } from '../shared' | |||
21 | FriendAddComponent, | 21 | FriendAddComponent, |
22 | FriendListComponent, | 22 | FriendListComponent, |
23 | 23 | ||
24 | RequestsComponent, | 24 | RequestSchedulersComponent, |
25 | RequestStatsComponent, | 25 | RequestSchedulersStatsComponent, |
26 | 26 | ||
27 | UsersComponent, | 27 | UsersComponent, |
28 | UserAddComponent, | 28 | UserAddComponent, |
@@ -38,7 +38,7 @@ import { SharedModule } from '../shared' | |||
38 | 38 | ||
39 | providers: [ | 39 | providers: [ |
40 | FriendService, | 40 | FriendService, |
41 | RequestService, | 41 | RequestSchedulersService, |
42 | UserService | 42 | UserService |
43 | ] | 43 | ] |
44 | }) | 44 | }) |
diff --git a/client/src/app/+admin/index.ts b/client/src/app/+admin/index.ts index 11e2587c0..b628a3662 100644 --- a/client/src/app/+admin/index.ts +++ b/client/src/app/+admin/index.ts | |||
@@ -1,6 +1 @@ | |||
1 | export * from './friends' | ||
2 | export * from './requests' | ||
3 | export * from './users' | ||
4 | export * from './admin-routing.module' | ||
5 | export * from './admin.module' | export * from './admin.module' | |
6 | export * from './admin.component' | ||
diff --git a/client/src/app/+admin/request-schedulers/index.ts b/client/src/app/+admin/request-schedulers/index.ts new file mode 100644 index 000000000..87b72e8c7 --- /dev/null +++ b/client/src/app/+admin/request-schedulers/index.ts | |||
@@ -0,0 +1,4 @@ | |||
1 | export * from './request-schedulers-stats' | ||
2 | export * from './shared' | ||
3 | export * from './request-schedulers.component' | ||
4 | export * from './request-schedulers.routes' | ||
diff --git a/client/src/app/+admin/request-schedulers/request-schedulers-stats/index.ts b/client/src/app/+admin/request-schedulers/request-schedulers-stats/index.ts new file mode 100644 index 000000000..a3323e6be --- /dev/null +++ b/client/src/app/+admin/request-schedulers/request-schedulers-stats/index.ts | |||
@@ -0,0 +1 @@ | |||
export * from './request-schedulers-stats.component' | |||
diff --git a/client/src/app/+admin/requests/request-stats/request-stats.component.html b/client/src/app/+admin/request-schedulers/request-schedulers-stats/request-schedulers-stats.component.html index 4508ab4c2..4508ab4c2 100644 --- a/client/src/app/+admin/requests/request-stats/request-stats.component.html +++ b/client/src/app/+admin/request-schedulers/request-schedulers-stats/request-schedulers-stats.component.html | |||
diff --git a/client/src/app/+admin/requests/request-stats/request-stats.component.scss b/client/src/app/+admin/request-schedulers/request-schedulers-stats/request-schedulers-stats.component.scss index b2c413259..b2c413259 100644 --- a/client/src/app/+admin/requests/request-stats/request-stats.component.scss +++ b/client/src/app/+admin/request-schedulers/request-schedulers-stats/request-schedulers-stats.component.scss | |||
diff --git a/client/src/app/+admin/requests/request-stats/request-stats.component.ts b/client/src/app/+admin/request-schedulers/request-schedulers-stats/request-schedulers-stats.component.ts index 140aaf47e..4e3fabc64 100644 --- a/client/src/app/+admin/requests/request-stats/request-stats.component.ts +++ b/client/src/app/+admin/request-schedulers/request-schedulers-stats/request-schedulers-stats.component.ts | |||
@@ -2,22 +2,22 @@ import { Component, OnInit, OnDestroy } from '@angular/core' | |||
2 | 2 | ||
3 | import { NotificationsService } from 'angular2-notifications' | 3 | import { NotificationsService } from 'angular2-notifications' |
4 | 4 | ||
5 | import { RequestService, RequestSchedulerStatsAttributes } from '../shared' | 5 | import { RequestSchedulersService, RequestSchedulerStatsAttributes } from '../shared' |
6 | import { RequestScheduler } from '../../../../../../shared' | 6 | import { RequestSchedulerStats } from '../../../../../../shared' |
7 | 7 | ||
8 | @Component({ | 8 | @Component({ |
9 | selector: 'my-request-stats', | 9 | selector: 'my-request-schedulers-stats', |
10 | templateUrl: './request-stats.component.html', | 10 | templateUrl: './request-schedulers-stats.component.html', |
11 | styleUrls: [ './request-stats.component.scss' ] | 11 | styleUrls: [ './request-schedulers-stats.component.scss' ] |
12 | }) | 12 | }) |
13 | export class RequestStatsComponent implements OnInit, OnDestroy { | 13 | export class RequestSchedulersStatsComponent implements OnInit, OnDestroy { |
14 | statsTitles = { | 14 | statsTitles = { |
15 | requestScheduler: 'Basic request scheduler', | 15 | requestScheduler: 'Basic request scheduler', |
16 | requestVideoEventScheduler: 'Video events request scheduler', | 16 | requestVideoEventScheduler: 'Video events request scheduler', |
17 | requestVideoQaduScheduler: 'Quick and dirty video updates request scheduler' | 17 | requestVideoQaduScheduler: 'Quick and dirty video updates request scheduler' |
18 | } | 18 | } |
19 | 19 | ||
20 | stats: RequestScheduler | 20 | stats: RequestSchedulerStats |
21 | 21 | ||
22 | private intervals: { [ id: string ]: number } = { | 22 | private intervals: { [ id: string ]: number } = { |
23 | requestScheduler: null, | 23 | requestScheduler: null, |
@@ -33,7 +33,7 @@ export class RequestStatsComponent implements OnInit, OnDestroy { | |||
33 | 33 | ||
34 | constructor ( | 34 | constructor ( |
35 | private notificationsService: NotificationsService, | 35 | private notificationsService: NotificationsService, |
36 | private requestService: RequestService | 36 | private requestService: RequestSchedulersService |
37 | ) { } | 37 | ) { } |
38 | 38 | ||
39 | ngOnInit () { | 39 | ngOnInit () { |
diff --git a/client/src/app/+admin/requests/requests.component.ts b/client/src/app/+admin/request-schedulers/request-schedulers.component.ts index 88a90fa4e..5444d6ea5 100644 --- a/client/src/app/+admin/requests/requests.component.ts +++ b/client/src/app/+admin/request-schedulers/request-schedulers.component.ts | |||
@@ -3,5 +3,5 @@ import { Component } from '@angular/core' | |||
3 | @Component({ | 3 | @Component({ |
4 | template: '<router-outlet></router-outlet>' | 4 | template: '<router-outlet></router-outlet>' |
5 | }) | 5 | }) |
6 | export class RequestsComponent { | 6 | export class RequestSchedulersComponent { |
7 | } | 7 | } |
diff --git a/client/src/app/+admin/requests/requests.routes.ts b/client/src/app/+admin/request-schedulers/request-schedulers.routes.ts index 84db3fea8..4961c646b 100644 --- a/client/src/app/+admin/requests/requests.routes.ts +++ b/client/src/app/+admin/request-schedulers/request-schedulers.routes.ts | |||
@@ -1,12 +1,12 @@ | |||
1 | import { Routes } from '@angular/router' | 1 | import { Routes } from '@angular/router' |
2 | 2 | ||
3 | import { RequestsComponent } from './requests.component' | 3 | import { RequestSchedulersComponent } from './request-schedulers.component' |
4 | import { RequestStatsComponent } from './request-stats' | 4 | import { RequestSchedulersStatsComponent } from './request-schedulers-stats' |
5 | 5 | ||
6 | export const RequestsRoutes: Routes = [ | 6 | export const RequestSchedulersRoutes: Routes = [ |
7 | { | 7 | { |
8 | path: 'requests', | 8 | path: 'requests', |
9 | component: RequestsComponent, | 9 | component: RequestSchedulersComponent, |
10 | children: [ | 10 | children: [ |
11 | { | 11 | { |
12 | path: '', | 12 | path: '', |
@@ -15,7 +15,7 @@ export const RequestsRoutes: Routes = [ | |||
15 | }, | 15 | }, |
16 | { | 16 | { |
17 | path: 'stats', | 17 | path: 'stats', |
18 | component: RequestStatsComponent, | 18 | component: RequestSchedulersStatsComponent, |
19 | data: { | 19 | data: { |
20 | meta: { | 20 | meta: { |
21 | title: 'Request stats' | 21 | title: 'Request stats' |
diff --git a/client/src/app/+admin/request-schedulers/shared/index.ts b/client/src/app/+admin/request-schedulers/shared/index.ts new file mode 100644 index 000000000..1a0174409 --- /dev/null +++ b/client/src/app/+admin/request-schedulers/shared/index.ts | |||
@@ -0,0 +1,2 @@ | |||
1 | export * from './request-schedulers-stats-attributes.model' | ||
2 | export * from './request-schedulers.service' | ||
diff --git a/client/src/app/+admin/requests/shared/request-stats-attributes.model.ts b/client/src/app/+admin/request-schedulers/shared/request-schedulers-stats-attributes.model.ts index 394acc73d..6e19a0e44 100644 --- a/client/src/app/+admin/requests/shared/request-stats-attributes.model.ts +++ b/client/src/app/+admin/request-schedulers/shared/request-schedulers-stats-attributes.model.ts | |||
@@ -1,11 +1,11 @@ | |||
1 | import { RequestSchedulerAttributes as FormatedRequestSchedulerAttributes } from '../../../../../../shared' | 1 | import { RequestSchedulerStatsAttributes as FormatedRequestSchedulerStatsAttributes } from '../../../../../../shared' |
2 | 2 | ||
3 | export interface Request { | 3 | export interface Request { |
4 | request: any | 4 | request: any |
5 | to: any | 5 | to: any |
6 | } | 6 | } |
7 | 7 | ||
8 | export class RequestSchedulerStatsAttributes implements FormatedRequestSchedulerAttributes { | 8 | export class RequestSchedulerStatsAttributes implements FormatedRequestSchedulerStatsAttributes { |
9 | requestsLimitPods: number | 9 | requestsLimitPods: number |
10 | requestsLimitPerPod: number | 10 | requestsLimitPerPod: number |
11 | milliSecondsInterval: number | 11 | milliSecondsInterval: number |
diff --git a/client/src/app/+admin/requests/shared/request.service.ts b/client/src/app/+admin/request-schedulers/shared/request-schedulers.service.ts index 53682b111..e9b166f78 100644 --- a/client/src/app/+admin/requests/shared/request.service.ts +++ b/client/src/app/+admin/request-schedulers/shared/request-schedulers.service.ts | |||
@@ -3,27 +3,27 @@ import { Observable } from 'rxjs/Observable' | |||
3 | import 'rxjs/add/operator/catch' | 3 | import 'rxjs/add/operator/catch' |
4 | import 'rxjs/add/operator/map' | 4 | import 'rxjs/add/operator/map' |
5 | 5 | ||
6 | import { RequestScheduler } from '../../../../../../shared' | 6 | import { RequestSchedulerStats } from '../../../../../../shared' |
7 | import { AuthHttp, RestExtractor } from '../../../shared' | 7 | import { AuthHttp, RestExtractor } from '../../../shared' |
8 | import { RequestSchedulerStatsAttributes } from './request-stats-attributes.model' | 8 | import { RequestSchedulerStatsAttributes } from './request-schedulers-stats-attributes.model' |
9 | 9 | ||
10 | @Injectable() | 10 | @Injectable() |
11 | export class RequestService { | 11 | export class RequestSchedulersService { |
12 | private static BASE_REQUEST_URL = API_URL + '/api/v1/requests/' | 12 | private static BASE_REQUEST_URL = API_URL + '/api/v1/request-schedulers/' |
13 | 13 | ||
14 | constructor ( | 14 | constructor ( |
15 | private authHttp: AuthHttp, | 15 | private authHttp: AuthHttp, |
16 | private restExtractor: RestExtractor | 16 | private restExtractor: RestExtractor |
17 | ) {} | 17 | ) {} |
18 | 18 | ||
19 | getStats (): Observable<RequestScheduler> { | 19 | getStats (): Observable<RequestSchedulerStats> { |
20 | return this.authHttp.get(RequestService.BASE_REQUEST_URL + 'stats') | 20 | return this.authHttp.get(RequestSchedulersService.BASE_REQUEST_URL + 'stats') |
21 | .map(this.restExtractor.extractDataGet) | 21 | .map(this.restExtractor.extractDataGet) |
22 | .map(this.buildRequestObjects) | 22 | .map(this.buildRequestObjects) |
23 | .catch((res) => this.restExtractor.handleError(res)) | 23 | .catch((res) => this.restExtractor.handleError(res)) |
24 | } | 24 | } |
25 | 25 | ||
26 | private buildRequestObjects (data: RequestScheduler) { | 26 | private buildRequestObjects (data: RequestSchedulerStats) { |
27 | const requestSchedulers = {} | 27 | const requestSchedulers = {} |
28 | 28 | ||
29 | Object.keys(data).forEach(requestSchedulerName => { | 29 | Object.keys(data).forEach(requestSchedulerName => { |
diff --git a/client/src/app/+admin/requests/index.ts b/client/src/app/+admin/requests/index.ts deleted file mode 100644 index d96a893c3..000000000 --- a/client/src/app/+admin/requests/index.ts +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | export * from './request-stats' | ||
2 | export * from './shared' | ||
3 | export * from './requests.component' | ||
4 | export * from './requests.routes' | ||
diff --git a/client/src/app/+admin/requests/request-stats/index.ts b/client/src/app/+admin/requests/request-stats/index.ts deleted file mode 100644 index 740c401bb..000000000 --- a/client/src/app/+admin/requests/request-stats/index.ts +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | export * from './request-stats.component' | ||
diff --git a/client/src/app/+admin/requests/shared/index.ts b/client/src/app/+admin/requests/shared/index.ts deleted file mode 100644 index 857fe9d29..000000000 --- a/client/src/app/+admin/requests/shared/index.ts +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | export * from './request-stats-attributes.model' | ||
2 | export * from './request.service' | ||