]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html
Add audio support in upload
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / config / edit-custom-config / edit-custom-config.component.html
1 <form role="form" [formGroup]="form">
2
3 <ngb-tabset class="root-tabset bootstrap">
4
5 <ngb-tab i18n-title title="Basic configuration">
6 <ng-template ngbTabContent>
7
8 <div i18n class="inner-form-title">Instance</div>
9
10 <ng-container formGroupName="instance">
11 <div class="form-group">
12 <label i18n for="instanceName">Name</label>
13 <input
14 type="text" id="instanceName"
15 formControlName="name" [ngClass]="{ 'input-error': formErrors.instance.name }"
16 >
17 <div *ngIf="formErrors.instance.name" class="form-error">{{ formErrors.instance.name }}</div>
18 </div>
19
20 <div class="form-group">
21 <label i18n for="instanceShortDescription">Short description</label>
22 <textarea
23 id="instanceShortDescription" formControlName="shortDescription"
24 [ngClass]="{ 'input-error': formErrors['instance.shortDescription'] }"
25 ></textarea>
26 <div *ngIf="formErrors.instance.shortDescription" class="form-error">{{ formErrors.instance.shortDescription }}</div>
27 </div>
28
29 <div class="form-group">
30 <label i18n for="instanceDescription">Description</label><my-help helpType="markdownText"></my-help>
31 <my-markdown-textarea
32 id="instanceDescription" formControlName="description" textareaWidth="500px" [previewColumn]="true"
33 [classes]="{ 'input-error': formErrors['instance.description'] }"
34 ></my-markdown-textarea>
35 <div *ngIf="formErrors.instance.description" class="form-error">{{ formErrors.instance.description }}</div>
36 </div>
37
38 <div class="form-group">
39 <label i18n for="instanceTerms">Terms</label><my-help helpType="markdownText"></my-help>
40 <my-markdown-textarea
41 id="instanceTerms" formControlName="terms" textareaWidth="500px" [previewColumn]="true"
42 [ngClass]="{ 'input-error': formErrors['instance.terms'] }"
43 ></my-markdown-textarea>
44 <div *ngIf="formErrors.instance.terms" class="form-error">{{ formErrors.instance.terms }}</div>
45 </div>
46
47 <div class="form-group">
48 <my-peertube-checkbox
49 inputName="instanceIsNSFW" formControlName="isNSFW"
50 i18n-labelText labelText="Dedicated to sensitive or NSFW content"
51 i18n-helpHtml helpHtml="Enabling it will allow other administrators to know that you are mainly federating sensitive content.<br /><br />
52 Moreover, the NSFW checkbox on video upload will be automatically checked by default."
53 ></my-peertube-checkbox>
54 </div>
55
56 <div class="form-group">
57 <label i18n for="instanceDefaultClientRoute">Default client route</label>
58 <div class="peertube-select-container">
59 <select id="instanceDefaultClientRoute" formControlName="defaultClientRoute">
60 <option i18n value="/videos/overview">Videos Overview</option>
61 <option i18n value="/videos/trending">Videos Trending</option>
62 <option i18n value="/videos/recently-added">Videos Recently Added</option>
63 <option i18n value="/videos/local">Local videos</option>
64 </select>
65 </div>
66 <div *ngIf="formErrors.instance.defaultClientRoute" class="form-error">{{ formErrors.instance.defaultClientRoute }}</div>
67 </div>
68
69 <div class="form-group">
70 <label i18n for="instanceDefaultNSFWPolicy">Policy on videos containing sensitive content</label>
71 <my-help
72 helpType="custom" i18n-customHtml
73 customHtml="With <strong>Do not list</strong> or <strong>Blur thumbnails</strong>, a confirmation will be requested to watch the video."
74 ></my-help>
75
76 <div class="peertube-select-container">
77 <select id="instanceDefaultNSFWPolicy" formControlName="defaultNSFWPolicy">
78 <option i18n value="do_not_list">Do not list</option>
79 <option i18n value="blur">Blur thumbnails</option>
80 <option i18n value="display">Display</option>
81 </select>
82 </div>
83 <div *ngIf="formErrors.instance.defaultNSFWPolicy" class="form-error">{{ formErrors.instance.defaultNSFWPolicy }}</div>
84 </div>
85 </ng-container>
86
87
88 <div i18n class="inner-form-title">Signup</div>
89
90 <ng-container formGroupName="signup">
91 <div class="form-group">
92 <my-peertube-checkbox
93 inputName="signupEnabled" formControlName="enabled"
94 i18n-labelText labelText="Signup enabled"
95 ></my-peertube-checkbox>
96 </div>
97
98 <div class="form-group">
99 <my-peertube-checkbox *ngIf="isSignupEnabled()"
100 inputName="signupRequiresEmailVerification" formControlName="requiresEmailVerification"
101 i18n-labelText labelText="Signup requires email verification"
102 ></my-peertube-checkbox>
103 </div>
104
105 <div *ngIf="isSignupEnabled()" class="form-group">
106 <label i18n for="signupLimit">Signup limit</label>
107 <input
108 type="text" id="signupLimit"
109 formControlName="limit" [ngClass]="{ 'input-error': formErrors['signup.limit'] }"
110 >
111 <div *ngIf="formErrors.signup.limit" class="form-error">{{ formErrors.signup.limit }}</div>
112 </div>
113 </ng-container>
114
115
116 <div i18n class="inner-form-title">Users</div>
117
118 <ng-container formGroupName="user">
119 <div class="form-group">
120 <label i18n for="userVideoQuota">User default video quota</label>
121 <div class="peertube-select-container">
122 <select id="userVideoQuota" formControlName="videoQuota">
123 <option *ngFor="let videoQuotaOption of videoQuotaOptions" [value]="videoQuotaOption.value">
124 {{ videoQuotaOption.label }}
125 </option>
126 </select>
127 </div>
128 <div *ngIf="formErrors.user.videoQuota" class="form-error">{{ formErrors.user.videoQuota }}</div>
129 </div>
130
131 <div class="form-group">
132 <label i18n for="userVideoQuotaDaily">User default daily upload limit</label>
133 <div class="peertube-select-container">
134 <select id="userVideoQuotaDaily" formControlName="videoQuotaDaily">
135 <option *ngFor="let videoQuotaDailyOption of videoQuotaDailyOptions" [value]="videoQuotaDailyOption.value">
136 {{ videoQuotaDailyOption.label }}
137 </option>
138 </select>
139 </div>
140 <div *ngIf="formErrors.user.videoQuotaDaily" class="form-error">{{ formErrors.user.videoQuotaDaily }}</div>
141 </div>
142 </ng-container>
143
144
145 <div i18n class="inner-form-title">Import</div>
146
147 <ng-container formGroupName="import">
148 <ng-container formGroupName="videos">
149
150 <div class="form-group" formGroupName="http">
151 <my-peertube-checkbox
152 inputName="importVideosHttpEnabled" formControlName="enabled"
153 i18n-labelText labelText="Video import with HTTP URL (i.e. YouTube) enabled"
154 ></my-peertube-checkbox>
155 </div>
156
157 <div class="form-group" formGroupName="torrent">
158 <my-peertube-checkbox
159 inputName="importVideosTorrentEnabled" formControlName="enabled"
160 i18n-labelText labelText="Video import with a torrent file or a magnet URI enabled"
161 ></my-peertube-checkbox>
162 </div>
163
164 </ng-container>
165 </ng-container>
166
167
168 <div i18n class="inner-form-title">Auto-blacklist</div>
169
170 <ng-container formGroupName="autoBlacklist">
171 <ng-container formGroupName="videos">
172 <ng-container formGroupName="ofUsers">
173
174 <div class="form-group">
175 <my-peertube-checkbox
176 inputName="autoBlacklistVideosOfUsersEnabled" formControlName="enabled"
177 i18n-labelText labelText="New videos of users automatically blacklisted enabled"
178 ></my-peertube-checkbox>
179 </div>
180
181 </ng-container>
182 </ng-container>
183 </ng-container>
184
185
186 <div i18n class="inner-form-title">Instance followers</div>
187
188 <ng-container formGroupName="followers">
189 <ng-container formGroupName="instance">
190
191 <div class="form-group">
192 <my-peertube-checkbox
193 inputName="followersInstanceEnabled" formControlName="enabled"
194 i18n-labelText labelText="Other instances can follow your instance"
195 ></my-peertube-checkbox>
196 </div>
197
198 <div class="form-group">
199 <my-peertube-checkbox
200 inputName="followersInstanceManualApproval" formControlName="manualApproval"
201 i18n-labelText labelText="Manually approve new instance follower"
202 ></my-peertube-checkbox>
203 </div>
204 </ng-container>
205 </ng-container>
206
207
208 <div i18n class="inner-form-title">Administrator</div>
209
210 <div class="form-group" formGroupName="admin">
211 <label i18n for="adminEmail">Admin email</label>
212 <input
213 type="text" id="adminEmail"
214 formControlName="email" [ngClass]="{ 'input-error': formErrors['admin.email'] }"
215 >
216 <div *ngIf="formErrors.admin.email" class="form-error">{{ formErrors.admin.email }}</div>
217 </div>
218
219 <div class="form-group" formGroupName="contactForm">
220 <my-peertube-checkbox
221 inputName="enableContactForm" formControlName="enabled"
222 i18n-labelText labelText="Enable contact form"
223 ></my-peertube-checkbox>
224 </div>
225
226 </ng-template>
227 </ngb-tab>
228
229 <ngb-tab i18n-title title="Services">
230 <ng-template ngbTabContent>
231 <div i18n class="inner-form-title">Twitter</div>
232
233 <ng-container formGroupName="services">
234 <ng-container formGroupName="twitter">
235
236 <div class="form-group">
237 <label i18n for="signupLimit">Your Twitter username</label>
238 <my-help
239 helpType="custom" i18n-customHtml
240 customHtml="Indicates the Twitter account for the website or platform on which the content was published."
241 ></my-help>
242 <input
243 type="text" id="servicesTwitterUsername"
244 formControlName="username" [ngClass]="{ 'input-error': formErrors['services.twitter.username'] }"
245 >
246 <div *ngIf="formErrors.services.twitter.username" class="form-error">{{ formErrors.services.twitter.username }}</div>
247 </div>
248
249 <div class="form-group">
250 <my-peertube-checkbox
251 inputName="servicesTwitterWhitelisted" formControlName="whitelisted"
252 i18n-labelText labelText="Instance whitelisted by Twitter"
253 i18n-helpHtml helpHtml="If your instance is whitelisted by Twitter, a video player will be embedded in the Twitter feed on PeerTube video share.<br />
254 If the instance is not whitelisted, we use an image link card that will redirect on your PeerTube instance.<br /><br />
255 Check this checkbox, save the configuration and test with a video URL of your instance (https://example.com/videos/watch/blabla) on <a target='_blank' rel='noopener noreferrer' href='https://cards-dev.twitter.com/validator'>https://cards-dev.twitter.com/validator</a> to see if you instance is whitelisted."
256 ></my-peertube-checkbox>
257 </div>
258
259 </ng-container>
260 </ng-container>
261
262 </ng-template>
263 </ngb-tab>
264
265 <ngb-tab i18n-title title="Advanced configuration">
266 <ng-template ngbTabContent>
267
268 <div i18n class="inner-form-title">Transcoding</div>
269
270 <ng-container formGroupName="transcoding">
271 <div class="form-group">
272 <my-peertube-checkbox
273 inputName="transcodingEnabled" formControlName="enabled"
274 i18n-labelText labelText="Transcoding enabled"
275 i18n-helpHtml helpHtml="If you disable transcoding, many videos from your users will not work!"
276 ></my-peertube-checkbox>
277 </div>
278
279 <ng-container *ngIf="isTranscodingEnabled()">
280
281 <div class="form-group">
282 <my-peertube-checkbox
283 inputName="transcodingAllowAdditionalExtensions" formControlName="allowAdditionalExtensions"
284 i18n-labelText labelText="Allow additional extensions"
285 i18n-helpHtml helpHtml="Allow your users to upload .mkv, .mov, .avi, .flv videos"
286 ></my-peertube-checkbox>
287 </div>
288
289 <div class="form-group">
290 <my-peertube-checkbox
291 inputName="transcodingAllowAudioFiles" formControlName="allowAudioFiles"
292 i18n-labelText labelText="Allow audio files upload"
293 i18n-helpHtml helpHtml="Allow your users to upload audio files that will be merged with the preview file on upload"
294 ></my-peertube-checkbox>
295 </div>
296
297 <div class="form-group">
298 <label i18n for="transcodingThreads">Transcoding threads</label>
299 <div class="peertube-select-container">
300 <select id="transcodingThreads" formControlName="threads">
301 <option *ngFor="let transcodingThreadOption of transcodingThreadOptions" [value]="transcodingThreadOption.value">
302 {{ transcodingThreadOption.label }}
303 </option>
304 </select>
305 </div>
306 <div *ngIf="formErrors.transcoding.threads" class="form-error">{{ formErrors.transcoding.threads }}</div>
307 </div>
308
309 <ng-container formGroupName="resolutions">
310 <div class="form-group" *ngFor="let resolution of resolutions">
311 <my-peertube-checkbox
312 [inputName]="getResolutionKey(resolution)" [formControlName]="resolution"
313 i18n-labelText labelText="Resolution {{resolution}} enabled"
314 ></my-peertube-checkbox>
315 </div>
316 </ng-container>
317
318 </ng-container>
319 </ng-container>
320
321 <div i18n class="inner-form-title">
322 Cache
323
324 <my-help
325 helpType="custom" i18n-customHtml
326 customHtml="Some files are not federated (previews, captions). We fetch them directly from the origin instance and cache them."
327 ></my-help>
328 </div>
329
330 <ng-container formGroupName="cache">
331 <div class="form-group" formGroupName="previews">
332 <label i18n for="cachePreviewsSize">Previews cache size</label>
333 <input
334 type="text" id="cachePreviewsSize"
335 formControlName="size" [ngClass]="{ 'input-error': formErrors['cache.previews.size'] }"
336 >
337 <div *ngIf="formErrors.cache.previews.size" class="form-error">{{ formErrors.cache.previews.size }}</div>
338 </div>
339
340 <div class="form-group" formGroupName="captions">
341 <label i18n for="cacheCaptionsSize">Video captions cache size</label>
342 <input
343 type="text" id="cacheCaptionsSize"
344 formControlName="size" [ngClass]="{ 'input-error': formErrors['cache.captions.size'] }"
345 >
346 <div *ngIf="formErrors.cache.captions.size" class="form-error">{{ formErrors.cache.captions.size }}</div>
347 </div>
348 </ng-container>
349
350 <div i18n class="inner-form-title">Customizations</div>
351
352 <ng-container formGroupName="instance">
353 <ng-container formGroupName="customizations">
354 <div class="form-group">
355 <label i18n for="customizationJavascript">JavaScript</label>
356 <my-help
357 helpType="custom" i18n-customHtml
358 customHtml="Write directly JavaScript code.<br />Example: <pre>console.log('my instance is amazing');</pre>"
359 ></my-help>
360 <textarea
361 id="customizationJavascript" formControlName="javascript"
362 [ngClass]="{ 'input-error': formErrors['instance.customizations.javascript'] }"
363 ></textarea>
364 <div *ngIf="formErrors.instance.customizations.javascript" class="form-error">{{ formErrors.instance.customizations.javascript }}</div>
365 </div>
366
367 <div class="form-group">
368 <label for="customizationCSS">CSS</label>
369 <my-help
370 helpType="custom"
371 i18n-customHtml
372 customHtml="
373 Write directly CSS code. Example:<br /><br />
374 <pre>
375 #custom-css {{ '{' }}
376 color: red;
377 {{ '}' }}
378 </pre>
379
380 Prepend with <em>#custom-css</em> to override styles. Example:<br /><br />
381 <pre>
382 #custom-css .logged-in-email {{ '{' }}
383 color: red;
384 {{ '}' }}
385 </pre>
386 "
387 ></my-help>
388 <textarea
389 id="customizationCSS" formControlName="css"
390 [ngClass]="{ 'input-error': formErrors['instance.customizations.css'] }"
391 ></textarea>
392 <div *ngIf="formErrors.instance.customizations.css" class="form-error">{{ formErrors.instance.customizations.css }}</div>
393 </div>
394 </ng-container>
395 </ng-container>
396
397 </ng-template>
398 </ngb-tab>
399 </ngb-tabset>
400
401 <input (click)="formValidated()" type="submit" i18n-value value="Update configuration" [disabled]="!form.valid">
402 <span class="form-error" i18n *ngIf="!form.valid">It seems the configuration is invalid. Please search potential errors in the different tabs.</span>
403 </form>