diff options
author | Chocobozzz <me@florianbigard.com> | 2021-02-18 11:07:08 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2021-02-18 13:38:09 +0100 |
commit | b3d5cb92b100406df98e5cd1f54eff9cd2078b1c (patch) | |
tree | 234c9b0b799424c1599af0dee27e84e4ad7240ff /client/src/app/+admin | |
parent | d9a2a03196275065c28f4a0b7d4d7bc9992d77a1 (diff) | |
download | PeerTube-b3d5cb92b100406df98e5cd1f54eff9cd2078b1c.tar.gz PeerTube-b3d5cb92b100406df98e5cd1f54eff9cd2078b1c.tar.zst PeerTube-b3d5cb92b100406df98e5cd1f54eff9cd2078b1c.zip |
Add ability to update torrents cache in client
Diffstat (limited to 'client/src/app/+admin')
3 files changed, 18 insertions, 1 deletions
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-advanced-configuration.component.html b/client/src/app/+admin/config/edit-custom-config/edit-advanced-configuration.component.html index 6018ff5e0..0ab80e5a9 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-advanced-configuration.component.html +++ b/client/src/app/+admin/config/edit-custom-config/edit-advanced-configuration.component.html | |||
@@ -38,6 +38,20 @@ | |||
38 | 38 | ||
39 | <div *ngIf="formErrors.cache.captions.size" class="form-error">{{ formErrors.cache.captions.size }}</div> | 39 | <div *ngIf="formErrors.cache.captions.size" class="form-error">{{ formErrors.cache.captions.size }}</div> |
40 | </div> | 40 | </div> |
41 | |||
42 | <div class="form-group" formGroupName="torrents"> | ||
43 | <label i18n for="cacheTorrentsSize">Number of video torrents to keep in cache</label> | ||
44 | |||
45 | <div class="number-with-unit"> | ||
46 | <input | ||
47 | type="number" min="0" id="cacheTorrentsSize" class="form-control" | ||
48 | formControlName="size" [ngClass]="{ 'input-error': formErrors['cache.torrents.size'] }" | ||
49 | > | ||
50 | <span i18n>{getCacheSize('torrents'), plural, =1 {cached torrent} other {cached torrents}}</span> | ||
51 | </div> | ||
52 | |||
53 | <div *ngIf="formErrors.cache.torrents.size" class="form-error">{{ formErrors.cache.torrents.size }}</div> | ||
54 | </div> | ||
41 | </ng-container> | 55 | </ng-container> |
42 | 56 | ||
43 | </div> | 57 | </div> |
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-advanced-configuration.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-advanced-configuration.component.ts index 934438a50..01ff022c5 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-advanced-configuration.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-advanced-configuration.component.ts | |||
@@ -12,7 +12,7 @@ export class EditAdvancedConfigurationComponent { | |||
12 | @Input() form: FormGroup | 12 | @Input() form: FormGroup |
13 | @Input() formErrors: any | 13 | @Input() formErrors: any |
14 | 14 | ||
15 | getCacheSize (type: 'captions' | 'previews') { | 15 | getCacheSize (type: 'captions' | 'previews' | 'torrents') { |
16 | return this.form.value['cache'][type]['size'] | 16 | return this.form.value['cache'][type]['size'] |
17 | } | 17 | } |
18 | } | 18 | } |
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 2c7a10937..4b35d65fc 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 | |||
@@ -105,6 +105,9 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit { | |||
105 | }, | 105 | }, |
106 | captions: { | 106 | captions: { |
107 | size: CACHE_CAPTIONS_SIZE_VALIDATOR | 107 | size: CACHE_CAPTIONS_SIZE_VALIDATOR |
108 | }, | ||
109 | torrents: { | ||
110 | size: CACHE_CAPTIONS_SIZE_VALIDATOR | ||
108 | } | 111 | } |
109 | }, | 112 | }, |
110 | signup: { | 113 | signup: { |