aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+admin')
-rw-r--r--client/src/app/+admin/admin-routing.module.ts8
-rw-r--r--client/src/app/+admin/admin.component.ts6
-rw-r--r--client/src/app/+admin/admin.module.ts52
-rw-r--r--client/src/app/+admin/config/config.routes.ts2
-rw-r--r--client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts16
-rw-r--r--client/src/app/+admin/config/shared/batch-domains-modal.component.html43
-rw-r--r--client/src/app/+admin/config/shared/batch-domains-modal.component.scss3
-rw-r--r--client/src/app/+admin/config/shared/batch-domains-modal.component.ts54
-rw-r--r--client/src/app/+admin/config/shared/batch-domains-validators.service.ts68
-rw-r--r--client/src/app/+admin/config/shared/config.service.ts6
-rw-r--r--client/src/app/+admin/follows/followers-list/followers-list.component.ts11
-rw-r--r--client/src/app/+admin/follows/following-list/following-list.component.ts14
-rw-r--r--client/src/app/+admin/follows/follows.routes.ts9
-rw-r--r--client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts2
-rw-r--r--client/src/app/+admin/follows/video-redundancies-list/index.ts1
-rw-r--r--client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts12
-rw-r--r--client/src/app/+admin/moderation/index.ts1
-rw-r--r--client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.ts6
-rw-r--r--client/src/app/+admin/moderation/instance-blocklist/instance-server-blocklist.component.ts6
-rw-r--r--client/src/app/+admin/moderation/moderation.component.ts2
-rw-r--r--client/src/app/+admin/moderation/moderation.routes.ts8
-rw-r--r--client/src/app/+admin/moderation/video-abuse-list/moderation-comment-modal.component.ts8
-rw-r--r--client/src/app/+admin/moderation/video-abuse-list/video-abuse-details.component.ts5
-rw-r--r--client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.ts25
-rw-r--r--client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts18
-rw-r--r--client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts15
-rw-r--r--client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts14
-rw-r--r--client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts15
-rw-r--r--client/src/app/+admin/plugins/shared/plugin-api.service.ts26
-rw-r--r--client/src/app/+admin/system/debug/debug.component.ts4
-rw-r--r--client/src/app/+admin/system/debug/debug.service.ts7
-rw-r--r--client/src/app/+admin/system/index.ts1
-rw-r--r--client/src/app/+admin/system/jobs/job.service.ts9
-rw-r--r--client/src/app/+admin/system/jobs/jobs.component.ts12
-rw-r--r--client/src/app/+admin/system/logs/log-row.model.ts2
-rw-r--r--client/src/app/+admin/system/logs/logs.component.ts6
-rw-r--r--client/src/app/+admin/system/logs/logs.service.ts9
-rw-r--r--client/src/app/+admin/system/system.routes.ts12
-rw-r--r--client/src/app/+admin/users/user-edit/user-create.component.ts15
-rw-r--r--client/src/app/+admin/users/user-edit/user-edit.ts11
-rw-r--r--client/src/app/+admin/users/user-edit/user-password.component.ts10
-rw-r--r--client/src/app/+admin/users/user-edit/user-update.component.ts18
-rw-r--r--client/src/app/+admin/users/user-list/user-list.component.ts13
-rw-r--r--client/src/app/+admin/users/users.routes.ts8
44 files changed, 190 insertions, 403 deletions
diff --git a/client/src/app/+admin/admin-routing.module.ts b/client/src/app/+admin/admin-routing.module.ts
index 79c57221b..986dae8eb 100644
--- a/client/src/app/+admin/admin-routing.module.ts
+++ b/client/src/app/+admin/admin-routing.module.ts
@@ -1,15 +1,13 @@
1import { NgModule } from '@angular/core' 1import { NgModule } from '@angular/core'
2import { RouterModule, Routes } from '@angular/router' 2import { RouterModule, Routes } from '@angular/router'
3import { ConfigRoutes } from '@app/+admin/config' 3import { ConfigRoutes } from '@app/+admin/config'
4 4import { ModerationRoutes } from '@app/+admin/moderation/moderation.routes'
5import { PluginsRoutes } from '@app/+admin/plugins/plugins.routes'
6import { SystemRoutes } from '@app/+admin/system'
5import { MetaGuard } from '@ngx-meta/core' 7import { MetaGuard } from '@ngx-meta/core'
6
7import { AdminComponent } from './admin.component' 8import { AdminComponent } from './admin.component'
8import { FollowsRoutes } from './follows' 9import { FollowsRoutes } from './follows'
9import { UsersRoutes } from './users' 10import { UsersRoutes } from './users'
10import { ModerationRoutes } from '@app/+admin/moderation/moderation.routes'
11import { SystemRoutes } from '@app/+admin/system'
12import { PluginsRoutes } from '@app/+admin/plugins/plugins.routes'
13 11
14const adminRoutes: Routes = [ 12const adminRoutes: Routes = [
15 { 13 {
diff --git a/client/src/app/+admin/admin.component.ts b/client/src/app/+admin/admin.component.ts
index a97a33cf5..e47c7a8f4 100644
--- a/client/src/app/+admin/admin.component.ts
+++ b/client/src/app/+admin/admin.component.ts
@@ -1,8 +1,8 @@
1import { Component, OnInit } from '@angular/core' 1import { Component, OnInit } from '@angular/core'
2import { UserRight } from '../../../../shared' 2import { AuthService } from '@app/core'
3import { AuthService } from '../core/auth/auth.service' 3import { ListOverflowItem } from '@app/shared/shared-main'
4import { ListOverflowItem } from '@app/shared/misc/list-overflow.component'
5import { I18n } from '@ngx-translate/i18n-polyfill' 4import { I18n } from '@ngx-translate/i18n-polyfill'
5import { UserRight } from '@shared/models'
6 6
7@Component({ 7@Component({
8 templateUrl: './admin.component.html' 8 templateUrl: './admin.component.html'
diff --git a/client/src/app/+admin/admin.module.ts b/client/src/app/+admin/admin.module.ts
index eccec8a49..728227a84 100644
--- a/client/src/app/+admin/admin.module.ts
+++ b/client/src/app/+admin/admin.module.ts
@@ -1,39 +1,41 @@
1import { NgModule } from '@angular/core' 1import { ChartModule } from 'primeng/chart'
2import { ConfigComponent, EditCustomConfigComponent } from '@app/+admin/config' 2import { SelectButtonModule } from 'primeng/selectbutton'
3import { ConfigService } from '@app/+admin/config/shared/config.service'
4import { TableModule } from 'primeng/table' 3import { TableModule } from 'primeng/table'
5import { SharedModule } from '../shared' 4import { NgModule } from '@angular/core'
5import { SharedFormModule } from '@app/shared/shared-forms'
6import { SharedGlobalIconModule } from '@app/shared/shared-icons'
7import { SharedMainModule } from '@app/shared/shared-main'
8import { SharedModerationModule } from '@app/shared/shared-moderation'
6import { AdminRoutingModule } from './admin-routing.module' 9import { AdminRoutingModule } from './admin-routing.module'
7import { AdminComponent } from './admin.component' 10import { AdminComponent } from './admin.component'
11import { ConfigComponent, EditCustomConfigComponent } from './config'
12import { ConfigService } from './config/shared/config.service'
8import { FollowersListComponent, FollowsComponent, VideoRedundanciesListComponent } from './follows' 13import { FollowersListComponent, FollowsComponent, VideoRedundanciesListComponent } from './follows'
9import { FollowingListComponent } from './follows/following-list/following-list.component' 14import { FollowingListComponent } from './follows/following-list/following-list.component'
10import { UserCreateComponent, UserListComponent, UserPasswordComponent, UsersComponent, UserUpdateComponent } from './users' 15import { RedundancyCheckboxComponent } from './follows/shared/redundancy-checkbox.component'
11import { 16import { VideoRedundancyInformationComponent } from './follows/video-redundancies-list/video-redundancy-information.component'
12 ModerationCommentModalComponent, 17import { ModerationCommentModalComponent, VideoAbuseListComponent, VideoBlockListComponent } from './moderation'
13 VideoAbuseListComponent, 18import { InstanceAccountBlocklistComponent, InstanceServerBlocklistComponent } from './moderation/instance-blocklist'
14 VideoBlockListComponent 19import { ModerationComponent } from './moderation/moderation.component'
15} from './moderation'
16import { ModerationComponent } from '@app/+admin/moderation/moderation.component'
17import { RedundancyCheckboxComponent } from '@app/+admin/follows/shared/redundancy-checkbox.component'
18import { InstanceAccountBlocklistComponent, InstanceServerBlocklistComponent } from '@app/+admin/moderation/instance-blocklist'
19import { JobsComponent } from '@app/+admin/system/jobs/jobs.component'
20import { JobService, LogsComponent, LogsService, SystemComponent } from '@app/+admin/system'
21import { DebugComponent, DebugService } from '@app/+admin/system/debug'
22import { PluginsComponent } from '@app/+admin/plugins/plugins.component'
23import { PluginListInstalledComponent } from '@app/+admin/plugins/plugin-list-installed/plugin-list-installed.component'
24import { PluginSearchComponent } from '@app/+admin/plugins/plugin-search/plugin-search.component'
25import { PluginShowInstalledComponent } from '@app/+admin/plugins/plugin-show-installed/plugin-show-installed.component'
26import { SelectButtonModule } from 'primeng/selectbutton'
27import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service'
28import { VideoRedundancyInformationComponent } from '@app/+admin/follows/video-redundancies-list/video-redundancy-information.component'
29import { ChartModule } from 'primeng/chart'
30import { VideoAbuseDetailsComponent } from './moderation/video-abuse-list/video-abuse-details.component' 20import { VideoAbuseDetailsComponent } from './moderation/video-abuse-list/video-abuse-details.component'
21import { PluginListInstalledComponent } from './plugins/plugin-list-installed/plugin-list-installed.component'
22import { PluginSearchComponent } from './plugins/plugin-search/plugin-search.component'
23import { PluginShowInstalledComponent } from './plugins/plugin-show-installed/plugin-show-installed.component'
24import { PluginsComponent } from './plugins/plugins.component'
25import { PluginApiService } from './plugins/shared/plugin-api.service'
26import { JobService, LogsComponent, LogsService, SystemComponent } from './system'
27import { DebugComponent, DebugService } from './system/debug'
28import { JobsComponent } from './system/jobs/jobs.component'
29import { UserCreateComponent, UserListComponent, UserPasswordComponent, UsersComponent, UserUpdateComponent } from './users'
31 30
32@NgModule({ 31@NgModule({
33 imports: [ 32 imports: [
34 AdminRoutingModule, 33 AdminRoutingModule,
35 34
36 SharedModule, 35 SharedMainModule,
36 SharedFormModule,
37 SharedModerationModule,
38 SharedGlobalIconModule,
37 39
38 TableModule, 40 TableModule,
39 SelectButtonModule, 41 SelectButtonModule,
diff --git a/client/src/app/+admin/config/config.routes.ts b/client/src/app/+admin/config/config.routes.ts
index 2ca2f8fde..7c1a1a166 100644
--- a/client/src/app/+admin/config/config.routes.ts
+++ b/client/src/app/+admin/config/config.routes.ts
@@ -1,7 +1,7 @@
1import { Routes } from '@angular/router' 1import { Routes } from '@angular/router'
2import { EditCustomConfigComponent } from '@app/+admin/config/edit-custom-config' 2import { EditCustomConfigComponent } from '@app/+admin/config/edit-custom-config'
3import { UserRightGuard } from '@app/core' 3import { UserRightGuard } from '@app/core'
4import { UserRight } from '../../../../../shared/models/users' 4import { UserRight } from '@shared/models'
5import { ConfigComponent } from './config.component' 5import { ConfigComponent } from './config.component'
6 6
7export const ConfigRoutes: Routes = [ 7export const ConfigRoutes: Routes = [
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
index 3a47ba25e..69629770f 100644
--- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
+++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
@@ -1,16 +1,14 @@
1import { AfterViewChecked, Component, OnInit, ViewChild } from '@angular/core'
2import { ConfigService } from '@app/+admin/config/shared/config.service'
3import { ServerService } from '@app/core/server/server.service'
4import { CustomConfigValidatorsService, FormReactive, UserValidatorsService } from '@app/shared'
5import { Notifier } from '@app/core'
6import { CustomConfig } from '../../../../../../shared/models/server/custom-config.model'
7import { I18n } from '@ngx-translate/i18n-polyfill'
8import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
9import { SelectItem } from 'primeng/api' 1import { SelectItem } from 'primeng/api'
10import { forkJoin } from 'rxjs' 2import { forkJoin } from 'rxjs'
11import { ServerConfig } from '@shared/models'
12import { ViewportScroller } from '@angular/common' 3import { ViewportScroller } from '@angular/common'
4import { AfterViewChecked, Component, OnInit, ViewChild } from '@angular/core'
5import { ConfigService } from '@app/+admin/config/shared/config.service'
6import { Notifier } from '@app/core'
7import { ServerService } from '@app/core/server/server.service'
8import { CustomConfigValidatorsService, FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms'
13import { NgbNav } from '@ng-bootstrap/ng-bootstrap' 9import { NgbNav } from '@ng-bootstrap/ng-bootstrap'
10import { I18n } from '@ngx-translate/i18n-polyfill'
11import { CustomConfig, ServerConfig } from '@shared/models'
14 12
15@Component({ 13@Component({
16 selector: 'my-edit-custom-config', 14 selector: 'my-edit-custom-config',
diff --git a/client/src/app/+admin/config/shared/batch-domains-modal.component.html b/client/src/app/+admin/config/shared/batch-domains-modal.component.html
deleted file mode 100644
index 1b85c8f48..000000000
--- a/client/src/app/+admin/config/shared/batch-domains-modal.component.html
+++ /dev/null
@@ -1,43 +0,0 @@
1<ng-template #modal>
2 <div class="modal-header">
3 <h4 i18n class="modal-title">{{ action }}</h4>
4
5 <my-global-icon iconName="cross" aria-label="Close" role="button" (click)="hide()"></my-global-icon>
6 </div>
7
8 <div class="modal-body">
9 <form novalidate [formGroup]="form" (ngSubmit)="submit()">
10 <div class="form-group">
11 <label i18n for="hosts">1 host (without "http://") per line</label>
12
13 <textarea
14 [placeholder]="placeholder" formControlName="domains" type="text" id="hosts" name="hosts"
15 class="form-control" [ngClass]="{ 'input-error': formErrors['domains'] }" ngbAutofocus
16 ></textarea>
17
18 <div *ngIf="formErrors.domains" class="form-error">
19 {{ formErrors.domains }}
20
21 <div *ngIf="form.controls['domains'].errors.validDomains">
22 {{ form.controls['domains'].errors.validDomains.value }}
23 </div>
24 </div>
25 </div>
26
27 <ng-content select="warning"></ng-content>
28
29 <div class="form-group inputs">
30 <input
31 type="button" role="button" i18n-value value="Cancel" class="action-button action-button-cancel"
32 (click)="hide()" (key.enter)="hide()"
33 >
34
35 <input
36 type="submit" [value]="action" class="action-button-submit"
37 [disabled]="!form.valid"
38 >
39 </div>
40 </form>
41 </div>
42
43</ng-template>
diff --git a/client/src/app/+admin/config/shared/batch-domains-modal.component.scss b/client/src/app/+admin/config/shared/batch-domains-modal.component.scss
deleted file mode 100644
index 9621a566f..000000000
--- a/client/src/app/+admin/config/shared/batch-domains-modal.component.scss
+++ /dev/null
@@ -1,3 +0,0 @@
1textarea {
2 height: 200px;
3}
diff --git a/client/src/app/+admin/config/shared/batch-domains-modal.component.ts b/client/src/app/+admin/config/shared/batch-domains-modal.component.ts
deleted file mode 100644
index 620f2726b..000000000
--- a/client/src/app/+admin/config/shared/batch-domains-modal.component.ts
+++ /dev/null
@@ -1,54 +0,0 @@
1import { Component, OnInit, ViewChild, Input, Output, EventEmitter } from '@angular/core'
2import { I18n } from '@ngx-translate/i18n-polyfill'
3import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
4import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref'
5import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
6import { FormReactive } from '@app/shared/forms'
7import { BatchDomainsValidatorsService } from './batch-domains-validators.service'
8
9@Component({
10 selector: 'my-batch-domains-modal',
11 templateUrl: './batch-domains-modal.component.html',
12 styleUrls: [ './batch-domains-modal.component.scss' ]
13})
14export class BatchDomainsModalComponent extends FormReactive implements OnInit {
15 @ViewChild('modal', { static: true }) modal: NgbModal
16 @Input() placeholder = 'example.com'
17 @Input() action: string
18 @Output() domains = new EventEmitter<string[]>()
19
20 private openedModal: NgbModalRef
21
22 constructor (
23 protected formValidatorService: FormValidatorService,
24 private modalService: NgbModal,
25 private batchDomainsValidatorsService: BatchDomainsValidatorsService,
26 private i18n: I18n
27 ) {
28 super()
29 }
30
31 ngOnInit () {
32 if (!this.action) this.action = this.i18n('Process domains')
33
34 this.buildForm({
35 domains: this.batchDomainsValidatorsService.DOMAINS
36 })
37 }
38
39 openModal () {
40 this.openedModal = this.modalService.open(this.modal, { centered: true })
41 }
42
43 hide () {
44 this.openedModal.close()
45 }
46
47 submit () {
48 this.domains.emit(
49 this.batchDomainsValidatorsService.getNotEmptyHosts(this.form.controls['domains'].value)
50 )
51 this.form.reset()
52 this.hide()
53 }
54}
diff --git a/client/src/app/+admin/config/shared/batch-domains-validators.service.ts b/client/src/app/+admin/config/shared/batch-domains-validators.service.ts
deleted file mode 100644
index 46fa6514d..000000000
--- a/client/src/app/+admin/config/shared/batch-domains-validators.service.ts
+++ /dev/null
@@ -1,68 +0,0 @@
1import { I18n } from '@ngx-translate/i18n-polyfill'
2import { Validators, ValidatorFn } from '@angular/forms'
3import { Injectable } from '@angular/core'
4import { BuildFormValidator, validateHost } from '@app/shared/forms/form-validators'
5
6@Injectable()
7export class BatchDomainsValidatorsService {
8 readonly DOMAINS: BuildFormValidator
9
10 constructor (private i18n: I18n) {
11 this.DOMAINS = {
12 VALIDATORS: [ Validators.required, this.validDomains, this.isHostsUnique ],
13 MESSAGES: {
14 'required': this.i18n('Domain is required.'),
15 'validDomains': this.i18n('Domains entered are invalid.'),
16 'uniqueDomains': this.i18n('Domains entered contain duplicates.')
17 }
18 }
19 }
20
21 getNotEmptyHosts (hosts: string) {
22 return hosts
23 .split('\n')
24 .filter((host: string) => host && host.length !== 0) // Eject empty hosts
25 }
26
27 private validDomains: ValidatorFn = (control) => {
28 if (!control.value) return null
29
30 const newHostsErrors = []
31 const hosts = this.getNotEmptyHosts(control.value)
32
33 for (const host of hosts) {
34 if (validateHost(host) === false) {
35 newHostsErrors.push(this.i18n('{{host}} is not valid', { host }))
36 }
37 }
38
39 /* Is not valid. */
40 if (newHostsErrors.length !== 0) {
41 return {
42 'validDomains': {
43 reason: 'invalid',
44 value: newHostsErrors.join('. ') + '.'
45 }
46 }
47 }
48
49 /* Is valid. */
50 return null
51 }
52
53 private isHostsUnique: ValidatorFn = (control) => {
54 if (!control.value) return null
55
56 const hosts = this.getNotEmptyHosts(control.value)
57
58 if (hosts.every((host: string) => hosts.indexOf(host) === hosts.lastIndexOf(host))) {
59 return null
60 } else {
61 return {
62 'uniqueDomains': {
63 reason: 'invalid'
64 }
65 }
66 }
67 }
68}
diff --git a/client/src/app/+admin/config/shared/config.service.ts b/client/src/app/+admin/config/shared/config.service.ts
index 874b8094d..f182946b8 100644
--- a/client/src/app/+admin/config/shared/config.service.ts
+++ b/client/src/app/+admin/config/shared/config.service.ts
@@ -1,10 +1,10 @@
1import { catchError } from 'rxjs/operators' 1import { catchError } from 'rxjs/operators'
2import { HttpClient } from '@angular/common/http' 2import { HttpClient } from '@angular/common/http'
3import { Injectable } from '@angular/core' 3import { Injectable } from '@angular/core'
4import { CustomConfig } from '../../../../../../shared/models/server/custom-config.model' 4import { RestExtractor } from '@app/core'
5import { environment } from '../../../../environments/environment'
6import { RestExtractor } from '../../../shared'
7import { I18n } from '@ngx-translate/i18n-polyfill' 5import { I18n } from '@ngx-translate/i18n-polyfill'
6import { CustomConfig } from '@shared/models'
7import { environment } from '../../../../environments/environment'
8 8
9@Injectable() 9@Injectable()
10export class ConfigService { 10export class ConfigService {
diff --git a/client/src/app/+admin/follows/followers-list/followers-list.component.ts b/client/src/app/+admin/follows/followers-list/followers-list.component.ts
index 17352a601..63135f898 100644
--- a/client/src/app/+admin/follows/followers-list/followers-list.component.ts
+++ b/client/src/app/+admin/follows/followers-list/followers-list.component.ts
@@ -1,10 +1,9 @@
1import { Component, OnInit } from '@angular/core'
2import { ConfirmService, Notifier } from '@app/core'
3import { SortMeta } from 'primeng/api' 1import { SortMeta } from 'primeng/api'
4import { ActorFollow } from '../../../../../../shared/models/actors/follow.model' 2import { Component, OnInit } from '@angular/core'
5import { RestPagination, RestTable } from '../../../shared' 3import { ConfirmService, Notifier, RestPagination, RestTable } from '@app/core'
6import { FollowService } from '@app/shared/instance/follow.service' 4import { InstanceFollowService } from '@app/shared/shared-instance'
7import { I18n } from '@ngx-translate/i18n-polyfill' 5import { I18n } from '@ngx-translate/i18n-polyfill'
6import { ActorFollow } from '@shared/models'
8 7
9@Component({ 8@Component({
10 selector: 'my-followers-list', 9 selector: 'my-followers-list',
@@ -21,7 +20,7 @@ export class FollowersListComponent extends RestTable implements OnInit {
21 private confirmService: ConfirmService, 20 private confirmService: ConfirmService,
22 private notifier: Notifier, 21 private notifier: Notifier,
23 private i18n: I18n, 22 private i18n: I18n,
24 private followService: FollowService 23 private followService: InstanceFollowService
25 ) { 24 ) {
26 super() 25 super()
27 } 26 }
diff --git a/client/src/app/+admin/follows/following-list/following-list.component.ts b/client/src/app/+admin/follows/following-list/following-list.component.ts
index 6ddbf02d6..dae8923b5 100644
--- a/client/src/app/+admin/follows/following-list/following-list.component.ts
+++ b/client/src/app/+admin/follows/following-list/following-list.component.ts
@@ -1,12 +1,10 @@
1import { Component, OnInit, ViewChild } from '@angular/core'
2import { Notifier } from '@app/core'
3import { SortMeta } from 'primeng/api' 1import { SortMeta } from 'primeng/api'
4import { ActorFollow } from '../../../../../../shared/models/actors/follow.model' 2import { Component, OnInit, ViewChild } from '@angular/core'
5import { ConfirmService } from '../../../core/confirm/confirm.service' 3import { ConfirmService, Notifier, RestPagination, RestTable } from '@app/core'
6import { RestPagination, RestTable } from '../../../shared' 4import { InstanceFollowService } from '@app/shared/shared-instance'
7import { FollowService } from '@app/shared/instance/follow.service' 5import { BatchDomainsModalComponent } from '@app/shared/shared-moderation'
8import { I18n } from '@ngx-translate/i18n-polyfill' 6import { I18n } from '@ngx-translate/i18n-polyfill'
9import { BatchDomainsModalComponent } from '@app/+admin/config/shared/batch-domains-modal.component' 7import { ActorFollow } from '@shared/models'
10 8
11@Component({ 9@Component({
12 selector: 'my-followers-list', 10 selector: 'my-followers-list',
@@ -24,7 +22,7 @@ export class FollowingListComponent extends RestTable implements OnInit {
24 constructor ( 22 constructor (
25 private notifier: Notifier, 23 private notifier: Notifier,
26 private confirmService: ConfirmService, 24 private confirmService: ConfirmService,
27 private followService: FollowService, 25 private followService: InstanceFollowService,
28 private i18n: I18n 26 private i18n: I18n
29 ) { 27 ) {
30 super() 28 super()
diff --git a/client/src/app/+admin/follows/follows.routes.ts b/client/src/app/+admin/follows/follows.routes.ts
index 8270ae444..817074536 100644
--- a/client/src/app/+admin/follows/follows.routes.ts
+++ b/client/src/app/+admin/follows/follows.routes.ts
@@ -1,11 +1,10 @@
1import { Routes } from '@angular/router' 1import { Routes } from '@angular/router'
2 2import { VideoRedundanciesListComponent } from '@app/+admin/follows/video-redundancies-list'
3import { UserRightGuard } from '../../core' 3import { UserRightGuard } from '@app/core'
4import { FollowsComponent } from './follows.component' 4import { UserRight } from '@shared/models'
5import { FollowersListComponent } from './followers-list' 5import { FollowersListComponent } from './followers-list'
6import { UserRight } from '../../../../../shared'
7import { FollowingListComponent } from './following-list/following-list.component' 6import { FollowingListComponent } from './following-list/following-list.component'
8import { VideoRedundanciesListComponent } from '@app/+admin/follows/video-redundancies-list' 7import { FollowsComponent } from './follows.component'
9 8
10export const FollowsRoutes: Routes = [ 9export const FollowsRoutes: Routes = [
11 { 10 {
diff --git a/client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts b/client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts
index 9d7883d97..662143abc 100644
--- a/client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts
+++ b/client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts
@@ -1,7 +1,7 @@
1import { Component, Input } from '@angular/core' 1import { Component, Input } from '@angular/core'
2import { Notifier } from '@app/core' 2import { Notifier } from '@app/core'
3import { RedundancyService } from '@app/shared/shared-main'
3import { I18n } from '@ngx-translate/i18n-polyfill' 4import { I18n } from '@ngx-translate/i18n-polyfill'
4import { RedundancyService } from '@app/shared/video/redundancy.service'
5 5
6@Component({ 6@Component({
7 selector: 'my-redundancy-checkbox', 7 selector: 'my-redundancy-checkbox',
diff --git a/client/src/app/+admin/follows/video-redundancies-list/index.ts b/client/src/app/+admin/follows/video-redundancies-list/index.ts
index 6a7c7f483..07e734b1a 100644
--- a/client/src/app/+admin/follows/video-redundancies-list/index.ts
+++ b/client/src/app/+admin/follows/video-redundancies-list/index.ts
@@ -1 +1,2 @@
1export * from './video-redundancies-list.component' 1export * from './video-redundancies-list.component'
2export * from './video-redundancy-information.component'
diff --git a/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts b/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts
index 267a1f58e..0048882bc 100644
--- a/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts
+++ b/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts
@@ -1,14 +1,12 @@
1import { Component, OnInit } from '@angular/core' 1import { BytesPipe } from 'ngx-pipes'
2import { Notifier, ServerService } from '@app/core'
3import { SortMeta } from 'primeng/api' 2import { SortMeta } from 'primeng/api'
4import { ConfirmService } from '../../../core/confirm/confirm.service' 3import { Component, OnInit } from '@angular/core'
5import { RestPagination, RestTable } from '../../../shared' 4import { ConfirmService, Notifier, RestPagination, RestTable, ServerService } from '@app/core'
5import { peertubeLocalStorage } from '@app/helpers/peertube-web-storage'
6import { RedundancyService } from '@app/shared/shared-main'
6import { I18n } from '@ngx-translate/i18n-polyfill' 7import { I18n } from '@ngx-translate/i18n-polyfill'
7import { VideoRedundanciesTarget, VideoRedundancy } from '@shared/models' 8import { VideoRedundanciesTarget, VideoRedundancy } from '@shared/models'
8import { peertubeLocalStorage } from '@app/shared/misc/peertube-web-storage'
9import { VideosRedundancyStats } from '@shared/models/server' 9import { VideosRedundancyStats } from '@shared/models/server'
10import { BytesPipe } from 'ngx-pipes'
11import { RedundancyService } from '@app/shared/video/redundancy.service'
12 10
13@Component({ 11@Component({
14 selector: 'my-video-redundancies-list', 12 selector: 'my-video-redundancies-list',
diff --git a/client/src/app/+admin/moderation/index.ts b/client/src/app/+admin/moderation/index.ts
index e99244b74..16249236c 100644
--- a/client/src/app/+admin/moderation/index.ts
+++ b/client/src/app/+admin/moderation/index.ts
@@ -1,3 +1,4 @@
1export * from './instance-blocklist'
1export * from './video-abuse-list' 2export * from './video-abuse-list'
2export * from './video-block-list' 3export * from './video-block-list'
3export * from './moderation.component' 4export * from './moderation.component'
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 90a176194..d9fec29ce 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
@@ -1,10 +1,10 @@
1import { Component } from '@angular/core' 1import { Component } from '@angular/core'
2import { GenericAccountBlocklistComponent, BlocklistComponentType } from '@app/shared/blocklist' 2import { BlocklistComponentType, GenericAccountBlocklistComponent } from '@app/shared/shared-moderation'
3 3
4@Component({ 4@Component({
5 selector: 'my-instance-account-blocklist', 5 selector: 'my-instance-account-blocklist',
6 styleUrls: [ '../moderation.component.scss', '../../../shared/blocklist/account-blocklist.component.scss' ], 6 styleUrls: [ '../moderation.component.scss', '../../../shared/shared-moderation/account-blocklist.component.scss' ],
7 templateUrl: '../../../shared/blocklist/account-blocklist.component.html' 7 templateUrl: '../../../shared/shared-moderation/account-blocklist.component.html'
8}) 8})
9export class InstanceAccountBlocklistComponent extends GenericAccountBlocklistComponent { 9export class InstanceAccountBlocklistComponent extends GenericAccountBlocklistComponent {
10 mode = BlocklistComponentType.Instance 10 mode = BlocklistComponentType.Instance
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 9d4ec174a..3afae529f 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
@@ -1,10 +1,10 @@
1import { Component } from '@angular/core' 1import { Component } from '@angular/core'
2import { GenericServerBlocklistComponent, BlocklistComponentType } from '@app/shared/blocklist' 2import { GenericServerBlocklistComponent, BlocklistComponentType } from '@app/shared/shared-moderation'
3 3
4@Component({ 4@Component({
5 selector: 'my-instance-server-blocklist', 5 selector: 'my-instance-server-blocklist',
6 styleUrls: [ '../../../shared/blocklist/server-blocklist.component.scss' ], 6 styleUrls: [ '../../../shared/shared-moderation/server-blocklist.component.scss' ],
7 templateUrl: '../../../shared/blocklist/server-blocklist.component.html' 7 templateUrl: '../../../shared/shared-moderation/server-blocklist.component.html'
8}) 8})
9export class InstanceServerBlocklistComponent extends GenericServerBlocklistComponent { 9export class InstanceServerBlocklistComponent extends GenericServerBlocklistComponent {
10 mode = BlocklistComponentType.Instance 10 mode = BlocklistComponentType.Instance
diff --git a/client/src/app/+admin/moderation/moderation.component.ts b/client/src/app/+admin/moderation/moderation.component.ts
index 1b1df6f09..806f9d100 100644
--- a/client/src/app/+admin/moderation/moderation.component.ts
+++ b/client/src/app/+admin/moderation/moderation.component.ts
@@ -1,6 +1,6 @@
1import { Component, OnInit } from '@angular/core' 1import { Component, OnInit } from '@angular/core'
2import { UserRight } from '../../../../../shared'
3import { AuthService, ServerService } from '@app/core' 2import { AuthService, ServerService } from '@app/core'
3import { UserRight } from '@shared/models'
4 4
5@Component({ 5@Component({
6 templateUrl: './moderation.component.html', 6 templateUrl: './moderation.component.html',
diff --git a/client/src/app/+admin/moderation/moderation.routes.ts b/client/src/app/+admin/moderation/moderation.routes.ts
index c08333f17..cd837bcb9 100644
--- a/client/src/app/+admin/moderation/moderation.routes.ts
+++ b/client/src/app/+admin/moderation/moderation.routes.ts
@@ -1,10 +1,10 @@
1import { Routes } from '@angular/router' 1import { Routes } from '@angular/router'
2import { UserRight } from '../../../../../shared' 2import { InstanceAccountBlocklistComponent, InstanceServerBlocklistComponent } from '@app/+admin/moderation/instance-blocklist'
3import { UserRightGuard } from '@app/core' 3import { ModerationComponent } from '@app/+admin/moderation/moderation.component'
4import { VideoAbuseListComponent } from '@app/+admin/moderation/video-abuse-list' 4import { VideoAbuseListComponent } from '@app/+admin/moderation/video-abuse-list'
5import { VideoBlockListComponent } from '@app/+admin/moderation/video-block-list' 5import { VideoBlockListComponent } from '@app/+admin/moderation/video-block-list'
6import { ModerationComponent } from '@app/+admin/moderation/moderation.component' 6import { UserRightGuard } from '@app/core'
7import { InstanceAccountBlocklistComponent, InstanceServerBlocklistComponent } from '@app/+admin/moderation/instance-blocklist' 7import { UserRight } from '@shared/models'
8 8
9export const ModerationRoutes: Routes = [ 9export const ModerationRoutes: Routes = [
10 { 10 {
diff --git a/client/src/app/+admin/moderation/video-abuse-list/moderation-comment-modal.component.ts b/client/src/app/+admin/moderation/video-abuse-list/moderation-comment-modal.component.ts
index a0471f2b0..3cd763ca4 100644
--- a/client/src/app/+admin/moderation/video-abuse-list/moderation-comment-modal.component.ts
+++ b/client/src/app/+admin/moderation/video-abuse-list/moderation-comment-modal.component.ts
@@ -1,11 +1,11 @@
1import { Component, EventEmitter, OnInit, Output, ViewChild } from '@angular/core' 1import { Component, EventEmitter, OnInit, Output, ViewChild } from '@angular/core'
2import { Notifier } from '@app/core' 2import { Notifier } from '@app/core'
3import { FormReactive, VideoAbuseService, VideoAbuseValidatorsService } from '../../../shared' 3import { FormReactive, FormValidatorService, VideoAbuseValidatorsService } from '@app/shared/shared-forms'
4import { I18n } from '@ngx-translate/i18n-polyfill' 4import { VideoAbuseService } from '@app/shared/shared-moderation'
5import { NgbModal } from '@ng-bootstrap/ng-bootstrap' 5import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
6import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' 6import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref'
7import { FormValidatorService } from '../../../shared/forms/form-validators/form-validator.service' 7import { I18n } from '@ngx-translate/i18n-polyfill'
8import { VideoAbuse } from '../../../../../../shared/models/videos' 8import { VideoAbuse } from '@shared/models'
9 9
10@Component({ 10@Component({
11 selector: 'my-moderation-comment-modal', 11 selector: 'my-moderation-comment-modal',
diff --git a/client/src/app/+admin/moderation/video-abuse-list/video-abuse-details.component.ts b/client/src/app/+admin/moderation/video-abuse-list/video-abuse-details.component.ts
index 13485124f..9aa70288d 100644
--- a/client/src/app/+admin/moderation/video-abuse-list/video-abuse-details.component.ts
+++ b/client/src/app/+admin/moderation/video-abuse-list/video-abuse-details.component.ts
@@ -1,9 +1,8 @@
1import { Component, Input } from '@angular/core' 1import { Component, Input } from '@angular/core'
2import { Actor } from '@app/shared/actor/actor.model' 2import { Actor } from '@app/shared/shared-main'
3import { I18n } from '@ngx-translate/i18n-polyfill'
3import { VideoAbusePredefinedReasonsString } from '../../../../../../shared/models/videos/abuse/video-abuse-reason.model' 4import { VideoAbusePredefinedReasonsString } from '../../../../../../shared/models/videos/abuse/video-abuse-reason.model'
4import { ProcessedVideoAbuse } from './video-abuse-list.component' 5import { ProcessedVideoAbuse } from './video-abuse-list.component'
5import { I18n } from '@ngx-translate/i18n-polyfill'
6import { durationToString } from '@app/shared/misc/utils'
7 6
8@Component({ 7@Component({
9 selector: 'my-video-abuse-details', 8 selector: 'my-video-abuse-details',
diff --git a/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.ts b/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.ts
index d7f5beef3..b0a655e71 100644
--- a/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.ts
+++ b/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.ts
@@ -1,23 +1,16 @@
1import { Component, OnInit, ViewChild, AfterViewInit } from '@angular/core'
2import { Account } from '@app/shared/account/account.model'
3import { Notifier } from '@app/core'
4import { SortMeta } from 'primeng/api' 1import { SortMeta } from 'primeng/api'
5import { VideoAbuse, VideoAbuseState } from '../../../../../../shared' 2import { filter } from 'rxjs/operators'
6import { RestPagination, RestTable, VideoAbuseService, VideoBlockService } from '../../../shared'
7import { I18n } from '@ngx-translate/i18n-polyfill'
8import { DropdownAction } from '../../../shared/buttons/action-dropdown.component'
9import { ConfirmService } from '../../../core/index'
10import { ModerationCommentModalComponent } from './moderation-comment-modal.component'
11import { Video } from '../../../shared/video/video.model'
12import { MarkdownService } from '@app/shared/renderer'
13import { Actor } from '@app/shared/actor/actor.model'
14import { buildVideoEmbed, buildVideoLink } from 'src/assets/player/utils' 3import { buildVideoEmbed, buildVideoLink } from 'src/assets/player/utils'
4import { environment } from 'src/environments/environment'
5import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core'
15import { DomSanitizer } from '@angular/platform-browser' 6import { DomSanitizer } from '@angular/platform-browser'
16import { BlocklistService } from '@app/shared/blocklist'
17import { VideoService } from '@app/shared/video/video.service'
18import { ActivatedRoute, Params, Router } from '@angular/router' 7import { ActivatedRoute, Params, Router } from '@angular/router'
19import { filter } from 'rxjs/operators' 8import { ConfirmService, MarkdownService, Notifier, RestPagination, RestTable } from '@app/core'
20import { environment } from 'src/environments/environment' 9import { Account, Actor, DropdownAction, Video, VideoService } from '@app/shared/shared-main'
10import { BlocklistService, VideoAbuseService, VideoBlockService } from '@app/shared/shared-moderation'
11import { I18n } from '@ngx-translate/i18n-polyfill'
12import { VideoAbuse, VideoAbuseState } from '@shared/models'
13import { ModerationCommentModalComponent } from './moderation-comment-modal.component'
21 14
22export type ProcessedVideoAbuse = VideoAbuse & { 15export type ProcessedVideoAbuse = VideoAbuse & {
23 moderationCommentHtml?: string, 16 moderationCommentHtml?: string,
diff --git a/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts b/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts
index c0ac32242..c03f9248e 100644
--- a/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts
+++ b/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts
@@ -1,16 +1,12 @@
1import { Component, OnInit, AfterViewInit } from '@angular/core'
2import { SortMeta } from 'primeng/api' 1import { SortMeta } from 'primeng/api'
3import { Notifier, ServerService } from '@app/core'
4import { ConfirmService } from '../../../core'
5import { RestPagination, RestTable, VideoBlockService } from '../../../shared'
6import { VideoBlacklist, VideoBlacklistType } from '../../../../../../shared'
7import { I18n } from '@ngx-translate/i18n-polyfill'
8import { DropdownAction } from '../../../shared/buttons/action-dropdown.component'
9import { Video } from '../../../shared/video/video.model'
10import { MarkdownService } from '@app/shared/renderer'
11import { Params, ActivatedRoute, Router } from '@angular/router'
12import { filter, switchMap } from 'rxjs/operators' 2import { filter, switchMap } from 'rxjs/operators'
13import { VideoService } from '@app/shared/video/video.service' 3import { AfterViewInit, Component, OnInit } from '@angular/core'
4import { ActivatedRoute, Params, Router } from '@angular/router'
5import { ConfirmService, MarkdownService, Notifier, RestPagination, RestTable, ServerService } from '@app/core'
6import { DropdownAction, Video, VideoService } from '@app/shared/shared-main'
7import { VideoBlockService } from '@app/shared/shared-moderation'
8import { I18n } from '@ngx-translate/i18n-polyfill'
9import { VideoBlacklist, VideoBlacklistType } from '@shared/models'
14 10
15@Component({ 11@Component({
16 selector: 'my-video-block-list', 12 selector: 'my-video-block-list',
diff --git a/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts b/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts
index a8973f2b2..af31f1144 100644
--- a/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts
+++ b/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts
@@ -1,14 +1,13 @@
1import { Subject } from 'rxjs'
1import { Component, OnInit } from '@angular/core' 2import { Component, OnInit } from '@angular/core'
2import { PluginType } from '@shared/models/plugins/plugin.type'
3import { I18n } from '@ngx-translate/i18n-polyfill'
4import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service'
5import { ComponentPagination, hasMoreItems } from '@app/shared/rest/component-pagination.model'
6import { ConfirmService, Notifier } from '@app/core'
7import { PeerTubePlugin } from '@shared/models/plugins/peertube-plugin.model'
8import { ActivatedRoute, Router } from '@angular/router' 3import { ActivatedRoute, Router } from '@angular/router'
9import { compareSemVer } from '@shared/core-utils/miscs/miscs' 4import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service'
5import { ComponentPagination, ConfirmService, hasMoreItems, Notifier } from '@app/core'
10import { PluginService } from '@app/core/plugins/plugin.service' 6import { PluginService } from '@app/core/plugins/plugin.service'
11import { Subject } from 'rxjs' 7import { I18n } from '@ngx-translate/i18n-polyfill'
8import { compareSemVer } from '@shared/core-utils/miscs/miscs'
9import { PeerTubePlugin } from '@shared/models/plugins/peertube-plugin.model'
10import { PluginType } from '@shared/models/plugins/plugin.type'
12 11
13@Component({ 12@Component({
14 selector: 'my-plugin-list-installed', 13 selector: 'my-plugin-list-installed',
diff --git a/client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts b/client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts
index dc59e759b..ccf9f1ed5 100644
--- a/client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts
+++ b/client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts
@@ -1,14 +1,12 @@
1import { Subject } from 'rxjs'
2import { debounceTime, distinctUntilChanged } from 'rxjs/operators'
1import { Component, OnInit } from '@angular/core' 3import { Component, OnInit } from '@angular/core'
2import { Notifier, ServerService } from '@app/core'
3import { ConfirmService } from '../../../core'
4import { I18n } from '@ngx-translate/i18n-polyfill'
5import { PluginType } from '@shared/models/plugins/plugin.type'
6import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service'
7import { ComponentPagination, hasMoreItems } from '@app/shared/rest/component-pagination.model'
8import { ActivatedRoute, Router } from '@angular/router' 4import { ActivatedRoute, Router } from '@angular/router'
5import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service'
6import { ComponentPagination, ConfirmService, hasMoreItems, Notifier, ServerService } from '@app/core'
7import { I18n } from '@ngx-translate/i18n-polyfill'
9import { PeerTubePluginIndex } from '@shared/models/plugins/peertube-plugin-index.model' 8import { PeerTubePluginIndex } from '@shared/models/plugins/peertube-plugin-index.model'
10import { Subject } from 'rxjs' 9import { PluginType } from '@shared/models/plugins/plugin.type'
11import { debounceTime, distinctUntilChanged } from 'rxjs/operators'
12 10
13@Component({ 11@Component({
14 selector: 'my-plugin-search', 12 selector: 'my-plugin-search',
diff --git a/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts b/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts
index 13d12b145..dde03f1da 100644
--- a/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts
+++ b/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts
@@ -1,13 +1,12 @@
1import { Component, OnDestroy, OnInit } from '@angular/core'
2import { PeerTubePlugin } from '@shared/models/plugins/peertube-plugin.model'
3import { I18n } from '@ngx-translate/i18n-polyfill'
4import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service'
5import { Notifier } from '@app/core'
6import { ActivatedRoute } from '@angular/router'
7import { Subscription } from 'rxjs' 1import { Subscription } from 'rxjs'
8import { map, switchMap } from 'rxjs/operators' 2import { map, switchMap } from 'rxjs/operators'
9import { BuildFormArgument, FormReactive, FormValidatorService } from '@app/shared' 3import { Component, OnDestroy, OnInit } from '@angular/core'
10import { RegisterServerSettingOptions } from '@shared/models/plugins/register-server-setting.model' 4import { ActivatedRoute } from '@angular/router'
5import { Notifier } from '@app/core'
6import { BuildFormArgument, FormReactive, FormValidatorService } from '@app/shared/shared-forms'
7import { I18n } from '@ngx-translate/i18n-polyfill'
8import { PeerTubePlugin, RegisterServerSettingOptions } from '@shared/models'
9import { PluginApiService } from '../shared/plugin-api.service'
11 10
12@Component({ 11@Component({
13 selector: 'my-plugin-show-installed', 12 selector: 'my-plugin-show-installed',
diff --git a/client/src/app/+admin/plugins/shared/plugin-api.service.ts b/client/src/app/+admin/plugins/shared/plugin-api.service.ts
index f6ef68e9c..bf9129e01 100644
--- a/client/src/app/+admin/plugins/shared/plugin-api.service.ts
+++ b/client/src/app/+admin/plugins/shared/plugin-api.service.ts
@@ -1,19 +1,21 @@
1import { Observable } from 'rxjs'
1import { catchError, map, switchMap } from 'rxjs/operators' 2import { catchError, map, switchMap } from 'rxjs/operators'
2import { HttpClient, HttpParams } from '@angular/common/http' 3import { HttpClient, HttpParams } from '@angular/common/http'
3import { Injectable } from '@angular/core' 4import { Injectable } from '@angular/core'
4import { environment } from '../../../../environments/environment' 5import { ComponentPagination, RestExtractor, RestService } from '@app/core'
5import { RestExtractor, RestService } from '../../../shared'
6import { I18n } from '@ngx-translate/i18n-polyfill'
7import { PluginType } from '@shared/models/plugins/plugin.type'
8import { ComponentPagination } from '@app/shared/rest/component-pagination.model'
9import { peertubeTranslate, ResultList } from '@shared/models'
10import { PeerTubePlugin } from '@shared/models/plugins/peertube-plugin.model'
11import { ManagePlugin } from '@shared/models/plugins/manage-plugin.model'
12import { InstallOrUpdatePlugin } from '@shared/models/plugins/install-plugin.model'
13import { PeerTubePluginIndex } from '@shared/models/plugins/peertube-plugin-index.model'
14import { RegisteredServerSettings, RegisterServerSettingOptions } from '@shared/models/plugins/register-server-setting.model'
15import { PluginService } from '@app/core/plugins/plugin.service' 6import { PluginService } from '@app/core/plugins/plugin.service'
16import { Observable } from 'rxjs' 7import { I18n } from '@ngx-translate/i18n-polyfill'
8import {
9 InstallOrUpdatePlugin,
10 ManagePlugin,
11 PeerTubePlugin,
12 PeerTubePluginIndex,
13 peertubeTranslate,
14 PluginType,
15 RegisteredServerSettings,
16 ResultList
17} from '@shared/models'
18import { environment } from '../../../../environments/environment'
17 19
18@Injectable() 20@Injectable()
19export class PluginApiService { 21export class PluginApiService {
diff --git a/client/src/app/+admin/system/debug/debug.component.ts b/client/src/app/+admin/system/debug/debug.component.ts
index 8a77f79f7..a88d837f3 100644
--- a/client/src/app/+admin/system/debug/debug.component.ts
+++ b/client/src/app/+admin/system/debug/debug.component.ts
@@ -1,7 +1,7 @@
1import { Component, OnInit } from '@angular/core' 1import { Component, OnInit } from '@angular/core'
2import { Notifier } from '@app/core' 2import { Notifier } from '@app/core'
3import { Debug } from '@shared/models/server' 3import { Debug } from '@shared/models'
4import { DebugService } from '@app/+admin/system/debug/debug.service' 4import { DebugService } from './debug.service'
5 5
6@Component({ 6@Component({
7 templateUrl: './debug.component.html', 7 templateUrl: './debug.component.html',
diff --git a/client/src/app/+admin/system/debug/debug.service.ts b/client/src/app/+admin/system/debug/debug.service.ts
index 6c722d177..ab1d0a7fa 100644
--- a/client/src/app/+admin/system/debug/debug.service.ts
+++ b/client/src/app/+admin/system/debug/debug.service.ts
@@ -1,10 +1,10 @@
1import { Observable } from 'rxjs'
1import { catchError } from 'rxjs/operators' 2import { catchError } from 'rxjs/operators'
2import { HttpClient } from '@angular/common/http' 3import { HttpClient } from '@angular/common/http'
3import { Injectable } from '@angular/core' 4import { Injectable } from '@angular/core'
4import { Observable } from 'rxjs' 5import { RestExtractor } from '@app/core'
6import { Debug } from '@shared/models'
5import { environment } from '../../../../environments/environment' 7import { environment } from '../../../../environments/environment'
6import { RestExtractor, RestService } from '../../../shared'
7import { Debug } from '@shared/models/server'
8 8
9@Injectable() 9@Injectable()
10export class DebugService { 10export class DebugService {
@@ -12,7 +12,6 @@ export class DebugService {
12 12
13 constructor ( 13 constructor (
14 private authHttp: HttpClient, 14 private authHttp: HttpClient,
15 private restService: RestService,
16 private restExtractor: RestExtractor 15 private restExtractor: RestExtractor
17 ) {} 16 ) {}
18 17
diff --git a/client/src/app/+admin/system/index.ts b/client/src/app/+admin/system/index.ts
index 226d999d2..8cced0cdb 100644
--- a/client/src/app/+admin/system/index.ts
+++ b/client/src/app/+admin/system/index.ts
@@ -1,3 +1,4 @@
1export * from './debug'
1export * from './jobs' 2export * from './jobs'
2export * from './logs' 3export * from './logs'
3export * from './system.component' 4export * from './system.component'
diff --git a/client/src/app/+admin/system/jobs/job.service.ts b/client/src/app/+admin/system/jobs/job.service.ts
index 1e2291ad1..1ac50f050 100644
--- a/client/src/app/+admin/system/jobs/job.service.ts
+++ b/client/src/app/+admin/system/jobs/job.service.ts
@@ -1,12 +1,11 @@
1import { SortMeta } from 'primeng/api'
2import { Observable } from 'rxjs'
1import { catchError, map } from 'rxjs/operators' 3import { catchError, map } from 'rxjs/operators'
2import { HttpClient, HttpParams } from '@angular/common/http' 4import { HttpClient, HttpParams } from '@angular/common/http'
3import { Injectable } from '@angular/core' 5import { Injectable } from '@angular/core'
4import { SortMeta } from 'primeng/api' 6import { RestExtractor, RestPagination, RestService } from '@app/core'
5import { Observable } from 'rxjs' 7import { Job, ResultList } from '@shared/models'
6import { ResultList } from '../../../../../../shared'
7import { Job } from '../../../../../../shared/models/server/job.model'
8import { environment } from '../../../../environments/environment' 8import { environment } from '../../../../environments/environment'
9import { RestExtractor, RestPagination, RestService } from '../../../shared'
10import { JobStateClient } from '../../../../types/job-state-client.type' 9import { JobStateClient } from '../../../../types/job-state-client.type'
11import { JobTypeClient } from '../../../../types/job-type-client.type' 10import { JobTypeClient } from '../../../../types/job-type-client.type'
12 11
diff --git a/client/src/app/+admin/system/jobs/jobs.component.ts b/client/src/app/+admin/system/jobs/jobs.component.ts
index 4f7f7c368..38a78de33 100644
--- a/client/src/app/+admin/system/jobs/jobs.component.ts
+++ b/client/src/app/+admin/system/jobs/jobs.component.ts
@@ -1,14 +1,12 @@
1import { Component, OnInit } from '@angular/core'
2import { peertubeLocalStorage } from '@app/shared/misc/peertube-web-storage'
3import { Notifier } from '@app/core'
4import { SortMeta } from 'primeng/api' 1import { SortMeta } from 'primeng/api'
5import { Job, JobType } from '../../../../../../shared/index' 2import { Component, OnInit } from '@angular/core'
6import { JobState } from '../../../../../../shared/models' 3import { Notifier, RestPagination, RestTable } from '@app/core'
7import { RestPagination, RestTable } from '../../../shared' 4import { peertubeLocalStorage } from '@app/helpers/peertube-web-storage'
8import { JobService } from './job.service'
9import { I18n } from '@ngx-translate/i18n-polyfill' 5import { I18n } from '@ngx-translate/i18n-polyfill'
6import { Job, JobState, JobType } from '@shared/models'
10import { JobStateClient } from '../../../../types/job-state-client.type' 7import { JobStateClient } from '../../../../types/job-state-client.type'
11import { JobTypeClient } from '../../../../types/job-type-client.type' 8import { JobTypeClient } from '../../../../types/job-type-client.type'
9import { JobService } from './job.service'
12 10
13@Component({ 11@Component({
14 selector: 'my-jobs', 12 selector: 'my-jobs',
diff --git a/client/src/app/+admin/system/logs/log-row.model.ts b/client/src/app/+admin/system/logs/log-row.model.ts
index b22581b5a..615778210 100644
--- a/client/src/app/+admin/system/logs/log-row.model.ts
+++ b/client/src/app/+admin/system/logs/log-row.model.ts
@@ -1,4 +1,4 @@
1import { LogLevel } from '@shared/models/server/log-level.type' 1import { LogLevel } from '@shared/models'
2import omit from 'lodash-es/omit' 2import omit from 'lodash-es/omit'
3 3
4export class LogRow { 4export class LogRow {
diff --git a/client/src/app/+admin/system/logs/logs.component.ts b/client/src/app/+admin/system/logs/logs.component.ts
index b63f11953..51f047188 100644
--- a/client/src/app/+admin/system/logs/logs.component.ts
+++ b/client/src/app/+admin/system/logs/logs.component.ts
@@ -1,9 +1,9 @@
1import { Component, ElementRef, OnInit, ViewChild } from '@angular/core' 1import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'
2import { LogsService } from '@app/+admin/system/logs/logs.service'
3import { Notifier } from '@app/core' 2import { Notifier } from '@app/core'
4import { LogRow } from '@app/+admin/system/logs/log-row.model'
5import { I18n } from '@ngx-translate/i18n-polyfill' 3import { I18n } from '@ngx-translate/i18n-polyfill'
6import { LogLevel } from '@shared/models/server/log-level.type' 4import { LogLevel } from '@shared/models'
5import { LogRow } from './log-row.model'
6import { LogsService } from './logs.service'
7 7
8@Component({ 8@Component({
9 templateUrl: './logs.component.html', 9 templateUrl: './logs.component.html',
diff --git a/client/src/app/+admin/system/logs/logs.service.ts b/client/src/app/+admin/system/logs/logs.service.ts
index 41b38c7ba..69439a179 100644
--- a/client/src/app/+admin/system/logs/logs.service.ts
+++ b/client/src/app/+admin/system/logs/logs.service.ts
@@ -1,11 +1,11 @@
1import { Observable } from 'rxjs'
1import { catchError, map } from 'rxjs/operators' 2import { catchError, map } from 'rxjs/operators'
2import { HttpClient, HttpParams } from '@angular/common/http' 3import { HttpClient, HttpParams } from '@angular/common/http'
3import { Injectable } from '@angular/core' 4import { Injectable } from '@angular/core'
4import { Observable } from 'rxjs' 5import { RestExtractor } from '@app/core'
6import { LogLevel } from '@shared/models'
5import { environment } from '../../../../environments/environment' 7import { environment } from '../../../../environments/environment'
6import { RestExtractor, RestService } from '../../../shared' 8import { LogRow } from './log-row.model'
7import { LogRow } from '@app/+admin/system/logs/log-row.model'
8import { LogLevel } from '@shared/models/server/log-level.type'
9 9
10@Injectable() 10@Injectable()
11export class LogsService { 11export class LogsService {
@@ -14,7 +14,6 @@ export class LogsService {
14 14
15 constructor ( 15 constructor (
16 private authHttp: HttpClient, 16 private authHttp: HttpClient,
17 private restService: RestService,
18 private restExtractor: RestExtractor 17 private restExtractor: RestExtractor
19 ) {} 18 ) {}
20 19
diff --git a/client/src/app/+admin/system/system.routes.ts b/client/src/app/+admin/system/system.routes.ts
index 2d851794d..0e8d98519 100644
--- a/client/src/app/+admin/system/system.routes.ts
+++ b/client/src/app/+admin/system/system.routes.ts
@@ -1,10 +1,10 @@
1import { Routes } from '@angular/router' 1import { Routes } from '@angular/router'
2import { UserRightGuard } from '../../core' 2import { UserRightGuard } from '@app/core'
3import { UserRight } from '../../../../../shared' 3import { UserRight } from '@shared/models'
4import { JobsComponent } from '@app/+admin/system/jobs/jobs.component' 4import { DebugComponent } from './debug'
5import { LogsComponent } from '@app/+admin/system/logs' 5import { JobsComponent } from './jobs/jobs.component'
6import { SystemComponent } from '@app/+admin/system/system.component' 6import { LogsComponent } from './logs'
7import { DebugComponent } from '@app/+admin/system/debug' 7import { SystemComponent } from './system.component'
8 8
9export const SystemRoutes: Routes = [ 9export const SystemRoutes: Routes = [
10 { 10 {
diff --git a/client/src/app/+admin/users/user-edit/user-create.component.ts b/client/src/app/+admin/users/user-edit/user-create.component.ts
index b459eb8fa..f9f5b90bd 100644
--- a/client/src/app/+admin/users/user-edit/user-create.component.ts
+++ b/client/src/app/+admin/users/user-edit/user-create.component.ts
@@ -1,14 +1,11 @@
1import { Component, OnInit } from '@angular/core' 1import { Component, OnInit } from '@angular/core'
2import { Router, ActivatedRoute } from '@angular/router' 2import { ActivatedRoute, Router } from '@angular/router'
3import { AuthService, Notifier, ServerService } from '@app/core'
4import { UserCreate, UserRole } from '../../../../../../shared'
5import { UserEdit } from './user-edit'
6import { I18n } from '@ngx-translate/i18n-polyfill'
7import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
8import { UserValidatorsService } from '@app/shared/forms/form-validators/user-validators.service'
9import { ConfigService } from '@app/+admin/config/shared/config.service' 3import { ConfigService } from '@app/+admin/config/shared/config.service'
10import { UserService } from '@app/shared' 4import { AuthService, Notifier, ScreenService, ServerService, UserService } from '@app/core'
11import { ScreenService } from '@app/shared/misc/screen.service' 5import { FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms'
6import { I18n } from '@ngx-translate/i18n-polyfill'
7import { UserCreate, UserRole } from '@shared/models'
8import { UserEdit } from './user-edit'
12 9
13@Component({ 10@Component({
14 selector: 'my-user-create', 11 selector: 'my-user-create',
diff --git a/client/src/app/+admin/users/user-edit/user-edit.ts b/client/src/app/+admin/users/user-edit/user-edit.ts
index 5f5cc590c..8fa4b0635 100644
--- a/client/src/app/+admin/users/user-edit/user-edit.ts
+++ b/client/src/app/+admin/users/user-edit/user-edit.ts
@@ -1,11 +1,8 @@
1import { AuthService, ServerService } from '../../../core'
2import { FormReactive } from '../../../shared'
3import { ServerConfig, USER_ROLE_LABELS, UserRole, VideoResolution } from '../../../../../../shared'
4import { ConfigService } from '@app/+admin/config/shared/config.service'
5import { UserAdminFlag } from '@shared/models/users/user-flag.model'
6import { OnInit } from '@angular/core' 1import { OnInit } from '@angular/core'
7import { User } from '@app/shared/users/user.model' 2import { ConfigService } from '@app/+admin/config/shared/config.service'
8import { ScreenService } from '@app/shared/misc/screen.service' 3import { AuthService, ScreenService, ServerService, User } from '@app/core'
4import { FormReactive } from '@app/shared/shared-forms'
5import { ServerConfig, USER_ROLE_LABELS, UserAdminFlag, UserRole, VideoResolution } from '@shared/models'
9 6
10export abstract class UserEdit extends FormReactive implements OnInit { 7export abstract class UserEdit extends FormReactive implements OnInit {
11 videoQuotaOptions: { value: string, label: string, disabled?: boolean }[] = [] 8 videoQuotaOptions: { value: string, label: string, disabled?: boolean }[] = []
diff --git a/client/src/app/+admin/users/user-edit/user-password.component.ts b/client/src/app/+admin/users/user-edit/user-password.component.ts
index ecad000f7..33c7de31f 100644
--- a/client/src/app/+admin/users/user-edit/user-password.component.ts
+++ b/client/src/app/+admin/users/user-edit/user-password.component.ts
@@ -1,12 +1,8 @@
1import { Component, Input, OnInit } from '@angular/core' 1import { Component, Input, OnInit } from '@angular/core'
2import { ActivatedRoute, Router } from '@angular/router' 2import { Notifier, UserService } from '@app/core'
3import { UserService } from '@app/shared/users/user.service' 3import { FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms'
4import { Notifier } from '../../../core'
5import { User, UserUpdate } from '../../../../../../shared'
6import { I18n } from '@ngx-translate/i18n-polyfill' 4import { I18n } from '@ngx-translate/i18n-polyfill'
7import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' 5import { UserUpdate } from '@shared/models'
8import { UserValidatorsService } from '@app/shared/forms/form-validators/user-validators.service'
9import { FormReactive } from '../../../shared'
10 6
11@Component({ 7@Component({
12 selector: 'my-user-password', 8 selector: 'my-user-password',
diff --git a/client/src/app/+admin/users/user-edit/user-update.component.ts b/client/src/app/+admin/users/user-edit/user-update.component.ts
index 035c0d4bb..870880fee 100644
--- a/client/src/app/+admin/users/user-edit/user-update.component.ts
+++ b/client/src/app/+admin/users/user-edit/user-update.component.ts
@@ -1,18 +1,12 @@
1import { Subscription } from 'rxjs'
1import { Component, OnDestroy, OnInit } from '@angular/core' 2import { Component, OnDestroy, OnInit } from '@angular/core'
2import { ActivatedRoute, Router } from '@angular/router' 3import { ActivatedRoute, Router } from '@angular/router'
3import { Subscription } from 'rxjs'
4import { AuthService, Notifier } from '@app/core'
5import { ServerService } from '../../../core'
6import { UserEdit } from './user-edit'
7import { User as UserType, UserUpdate, UserRole } from '../../../../../../shared'
8import { I18n } from '@ngx-translate/i18n-polyfill'
9import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
10import { UserValidatorsService } from '@app/shared/forms/form-validators/user-validators.service'
11import { ConfigService } from '@app/+admin/config/shared/config.service' 4import { ConfigService } from '@app/+admin/config/shared/config.service'
12import { UserService } from '@app/shared' 5import { AuthService, Notifier, ScreenService, ServerService, User, UserService } from '@app/core'
13import { UserAdminFlag } from '@shared/models/users/user-flag.model' 6import { FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms'
14import { User } from '@app/shared/users/user.model' 7import { I18n } from '@ngx-translate/i18n-polyfill'
15import { ScreenService } from '@app/shared/misc/screen.service' 8import { User as UserType, UserAdminFlag, UserRole, UserUpdate } from '@shared/models'
9import { UserEdit } from './user-edit'
16 10
17@Component({ 11@Component({
18 selector: 'my-user-update', 12 selector: 'my-user-update',
diff --git a/client/src/app/+admin/users/user-list/user-list.component.ts b/client/src/app/+admin/users/user-list/user-list.component.ts
index da50b7ed0..8f01c7d51 100644
--- a/client/src/app/+admin/users/user-list/user-list.component.ts
+++ b/client/src/app/+admin/users/user-list/user-list.component.ts
@@ -1,13 +1,10 @@
1import { Component, OnInit, ViewChild } from '@angular/core'
2import { AuthService, Notifier } from '@app/core'
3import { SortMeta } from 'primeng/api' 1import { SortMeta } from 'primeng/api'
4import { ConfirmService, ServerService } from '../../../core' 2import { Component, OnInit, ViewChild } from '@angular/core'
5import { RestPagination, RestTable, UserService } from '../../../shared' 3import { AuthService, ConfirmService, Notifier, RestPagination, RestTable, ServerService, UserService } from '@app/core'
4import { Actor, DropdownAction } from '@app/shared/shared-main'
5import { UserBanModalComponent } from '@app/shared/shared-moderation'
6import { I18n } from '@ngx-translate/i18n-polyfill' 6import { I18n } from '@ngx-translate/i18n-polyfill'
7import { ServerConfig, User } from '../../../../../../shared' 7import { ServerConfig, User } from '@shared/models'
8import { UserBanModalComponent } from '@app/shared/moderation'
9import { DropdownAction } from '@app/shared/buttons/action-dropdown.component'
10import { Actor } from '@app/shared/actor/actor.model'
11 8
12@Component({ 9@Component({
13 selector: 'my-user-list', 10 selector: 'my-user-list',
diff --git a/client/src/app/+admin/users/users.routes.ts b/client/src/app/+admin/users/users.routes.ts
index 2d4f9305e..6560f0260 100644
--- a/client/src/app/+admin/users/users.routes.ts
+++ b/client/src/app/+admin/users/users.routes.ts
@@ -1,11 +1,9 @@
1import { Routes } from '@angular/router' 1import { Routes } from '@angular/router'
2 2import { ServerConfigResolver, UserRightGuard } from '@app/core'
3import { UserRightGuard } from '../../core' 3import { UserRight } from '@shared/models'
4import { UserRight } from '../../../../../shared'
5import { UsersComponent } from './users.component'
6import { UserCreateComponent, UserUpdateComponent } from './user-edit' 4import { UserCreateComponent, UserUpdateComponent } from './user-edit'
7import { UserListComponent } from './user-list' 5import { UserListComponent } from './user-list'
8import { ServerConfigResolver } from '@app/core/routing/server-config-resolver.service' 6import { UsersComponent } from './users.component'
9 7
10export const UsersRoutes: Routes = [ 8export const UsersRoutes: Routes = [
11 { 9 {