]>
Commit | Line | Data |
---|---|---|
8a8e02a4 | 1 | <form role="form" [formGroup]="form"> |
fd206f0b | 2 | |
63347a0f | 3 | <ngb-tabset class="root-tabset bootstrap"> |
8be1afa1 | 4 | |
ccc00cb2 | 5 | <ngb-tab i18n-title title="Instance information"> |
63347a0f | 6 | <ng-template ngbTabContent> |
8be1afa1 | 7 | |
3866f1a0 | 8 | <ng-container formGroupName="instance"> |
ccc00cb2 C |
9 | |
10 | <div i18n class="inner-form-title">Instance</div> | |
11 | ||
3866f1a0 C |
12 | <div class="form-group"> |
13 | <label i18n for="instanceName">Name</label> | |
14 | <input | |
15 | type="text" id="instanceName" | |
16 | formControlName="name" [ngClass]="{ 'input-error': formErrors.instance.name }" | |
17 | > | |
18 | <div *ngIf="formErrors.instance.name" class="form-error">{{ formErrors.instance.name }}</div> | |
63347a0f | 19 | </div> |
63347a0f | 20 | |
3866f1a0 C |
21 | <div class="form-group"> |
22 | <label i18n for="instanceShortDescription">Short description</label> | |
23 | <textarea | |
8ae03c37 | 24 | id="instanceShortDescription" formControlName="shortDescription" class="small" |
3866f1a0 C |
25 | [ngClass]="{ 'input-error': formErrors['instance.shortDescription'] }" |
26 | ></textarea> | |
27 | <div *ngIf="formErrors.instance.shortDescription" class="form-error">{{ formErrors.instance.shortDescription }}</div> | |
63347a0f | 28 | </div> |
63347a0f | 29 | |
3866f1a0 C |
30 | <div class="form-group"> |
31 | <label i18n for="instanceDescription">Description</label><my-help helpType="markdownText"></my-help> | |
32 | <my-markdown-textarea | |
33 | id="instanceDescription" formControlName="description" textareaWidth="500px" [previewColumn]="true" | |
34 | [classes]="{ 'input-error': formErrors['instance.description'] }" | |
35 | ></my-markdown-textarea> | |
36 | <div *ngIf="formErrors.instance.description" class="form-error">{{ formErrors.instance.description }}</div> | |
63347a0f | 37 | </div> |
63347a0f | 38 | |
3866f1a0 | 39 | <div class="form-group"> |
ccc00cb2 C |
40 | <label i18n for="instanceCategories">Main instance categories</label> |
41 | ||
42 | <div> | |
43 | <p-multiSelect | |
44 | inputId="instanceCategories" [options]="categoryItems" formControlName="categories" showToggleAll="false" | |
45 | [defaultLabel]="getDefaultCategoryLabel()" [selectedItemsLabel]="getSelectedCategoryLabel()" | |
46 | emptyFilterMessage="No results found" i18n-emptyFilterMessage | |
47 | ></p-multiSelect> | |
48 | </div> | |
49 | </div> | |
50 | ||
51 | <div class="form-group"> | |
52 | <label i18n for="instanceLanguages">Main languages you/your moderators speak</label> | |
53 | ||
54 | <div> | |
55 | <p-multiSelect | |
56 | inputId="instanceLanguages" [options]="languageItems" formControlName="languages" showToggleAll="false" | |
57 | [defaultLabel]="getDefaultLanguageLabel()" [selectedItemsLabel]="getSelectedLanguageLabel()" | |
58 | emptyFilterMessage="No results found" i18n-emptyFilterMessage | |
59 | ></p-multiSelect> | |
60 | </div> | |
63347a0f | 61 | </div> |
63347a0f | 62 | |
ccc00cb2 C |
63 | <div i18n class="inner-form-title">Moderation & NSFW</div> |
64 | ||
f8802489 | 65 | <div class="form-group"> |
421d935d C |
66 | <my-peertube-checkbox inputName="instanceIsNSFW" formControlName="isNSFW"> |
67 | <ng-template ptTemplate="label"> | |
68 | <ng-container i18n>This instance is dedicated to sensitive or NSFW content</ng-container> | |
69 | </ng-template> | |
70 | ||
71 | <ng-template ptTemplate="help"> | |
72 | <ng-container i18n> | |
73 | Enabling it will allow other administrators to know that you are mainly federating sensitive content.<br /><br /> | |
74 | Moreover, the NSFW checkbox on video upload will be automatically checked by default. | |
75 | </ng-container> | |
76 | </ng-template> | |
77 | </my-peertube-checkbox> | |
f8802489 C |
78 | </div> |
79 | ||
3866f1a0 C |
80 | <div class="form-group"> |
81 | <label i18n for="instanceDefaultNSFWPolicy">Policy on videos containing sensitive content</label> | |
421d935d C |
82 | |
83 | <my-help> | |
84 | <ng-template ptTemplate="customHtml"> | |
85 | <ng-container i18n> | |
86 | With <strong>Do not list</strong> or <strong>Blur thumbnails</strong>, a confirmation will be requested to watch the video. | |
87 | </ng-container> | |
88 | </ng-template> | |
89 | </my-help> | |
3866f1a0 C |
90 | |
91 | <div class="peertube-select-container"> | |
92 | <select id="instanceDefaultNSFWPolicy" formControlName="defaultNSFWPolicy"> | |
93 | <option i18n value="do_not_list">Do not list</option> | |
94 | <option i18n value="blur">Blur thumbnails</option> | |
95 | <option i18n value="display">Display</option> | |
96 | </select> | |
97 | </div> | |
98 | <div *ngIf="formErrors.instance.defaultNSFWPolicy" class="form-error">{{ formErrors.instance.defaultNSFWPolicy }}</div> | |
63347a0f | 99 | </div> |
ccc00cb2 C |
100 | |
101 | <div class="form-group"> | |
102 | <label i18n for="instanceTerms">Terms</label><my-help helpType="markdownText"></my-help> | |
103 | <my-markdown-textarea | |
104 | id="instanceTerms" formControlName="terms" textareaWidth="500px" [previewColumn]="true" | |
105 | [ngClass]="{ 'input-error': formErrors['instance.terms'] }" | |
106 | ></my-markdown-textarea> | |
107 | <div *ngIf="formErrors.instance.terms" class="form-error">{{ formErrors.instance.terms }}</div> | |
108 | </div> | |
109 | ||
110 | <div class="form-group"> | |
111 | <label i18n for="instanceCodeOfConduct">Code of conduct</label><my-help helpType="markdownText"></my-help> | |
112 | <my-markdown-textarea | |
113 | id="instanceCodeOfConduct" formControlName="codeOfConduct" textareaWidth="500px" [previewColumn]="true" | |
114 | [ngClass]="{ 'input-error': formErrors['instance.codeOfConduct'] }" | |
115 | ></my-markdown-textarea> | |
116 | <div *ngIf="formErrors.instance.codeOfConduct" class="form-error">{{ formErrors.instance.codeOfConduct }}</div> | |
117 | </div> | |
118 | ||
119 | <div class="form-group"> | |
120 | <label i18n for="instanceModerationInformation">Moderation information</label><my-help helpType="markdownText"></my-help> | |
121 | <div class="label-small-info">Who moderates the instance? What is the policy regarding NSFW videos? Political videos? etc</div> | |
122 | ||
123 | <my-markdown-textarea | |
124 | id="instanceModerationInformation" formControlName="moderationInformation" textareaWidth="500px" [previewColumn]="true" | |
125 | [ngClass]="{ 'input-error': formErrors['instance.moderationInformation'] }" | |
126 | ></my-markdown-textarea> | |
127 | <div *ngIf="formErrors.instance.moderationInformation" class="form-error">{{ formErrors.instance.moderationInformation }}</div> | |
128 | </div> | |
129 | ||
130 | <div i18n class="inner-form-title">You and your instance</div> | |
131 | ||
132 | <div class="form-group"> | |
8ae03c37 | 133 | <label i18n for="instanceAdministrator">Who is behind the instance?</label> |
34398be4 | 134 | <div class="label-small-info">A single person? A non-profit? A company?</div> |
ccc00cb2 | 135 | |
8ae03c37 C |
136 | <my-markdown-textarea |
137 | id="instanceAdministrator" formControlName="administrator" textareaWidth="500px" textareaHeight="75px" [previewColumn]="true" | |
138 | [classes]="{ 'input-error': formErrors['instance.administrator'] }" | |
139 | ></my-markdown-textarea> | |
140 | ||
141 | <div *ngIf="formErrors.instance.administrator" class="form-error">{{ formErrors.instance.administrator }}</div> | |
142 | </div> | |
143 | ||
144 | <div class="form-group"> | |
145 | <label i18n for="instanceCreationReason">Why did you create this instance?</label> | |
146 | <div class="label-small-info">To share your personal videos? To open registrations and allow people to upload what they want?</div> | |
147 | ||
ccc00cb2 | 148 | <textarea |
8ae03c37 C |
149 | id="instanceCreationReason" formControlName="creationReason" class="small" |
150 | [ngClass]="{ 'input-error': formErrors['instance.creationReason'] }" | |
ccc00cb2 | 151 | ></textarea> |
8ae03c37 | 152 | <div *ngIf="formErrors.instance.creationReason" class="form-error">{{ formErrors.instance.creationReason }}</div> |
ccc00cb2 C |
153 | </div> |
154 | ||
155 | <div class="form-group"> | |
156 | <label i18n for="instanceMaintenanceLifetime">How long do you plan to maintain this instance?</label> | |
157 | <div class="label-small-info">It's important to know for users who want to register on your instance</div> | |
158 | ||
159 | <textarea | |
8ae03c37 | 160 | id="instanceMaintenanceLifetime" formControlName="maintenanceLifetime" class="small" |
ccc00cb2 C |
161 | [ngClass]="{ 'input-error': formErrors['instance.maintenanceLifetime'] }" |
162 | ></textarea> | |
163 | <div *ngIf="formErrors.instance.maintenanceLifetime" class="form-error">{{ formErrors.instance.maintenanceLifetime }}</div> | |
164 | </div> | |
165 | ||
166 | <div class="form-group"> | |
34398be4 | 167 | <label i18n for="instanceBusinessModel">How will you finance the PeerTube server?</label> |
ccc00cb2 C |
168 | <div class="label-small-info">With you own funds? With users donations? Advertising?</div> |
169 | ||
170 | <textarea | |
8ae03c37 | 171 | id="instanceBusinessModel" formControlName="businessModel" class="small" |
ccc00cb2 C |
172 | [ngClass]="{ 'input-error': formErrors['instance.businessModel'] }" |
173 | ></textarea> | |
174 | <div *ngIf="formErrors.instance.businessModel" class="form-error">{{ formErrors.instance.businessModel }}</div> | |
175 | </div> | |
176 | ||
be04c6fd C |
177 | <div i18n class="inner-form-title">Other information</div> |
178 | ||
179 | <div class="form-group"> | |
34398be4 | 180 | <label i18n for="instanceHardwareInformation">What server/hardware does the instance run on?</label> |
be04c6fd C |
181 | <div class="label-small-info">2vCore 2GB RAM/or directly the link to the server you rent etc</div> |
182 | ||
183 | <my-markdown-textarea | |
184 | id="instanceHardwareInformation" formControlName="hardwareInformation" textareaWidth="500px" textareaHeight="75px" [previewColumn]="true" | |
185 | [classes]="{ 'input-error': formErrors['instance.hardwareInformation'] }" | |
186 | ></my-markdown-textarea> | |
187 | ||
188 | <div *ngIf="formErrors.instance.hardwareInformation" class="form-error">{{ formErrors.instance.hardwareInformation }}</div> | |
189 | </div> | |
190 | ||
3866f1a0 | 191 | </ng-container> |
ccc00cb2 C |
192 | </ng-template> |
193 | </ngb-tab> | |
63347a0f | 194 | |
ccc00cb2 C |
195 | <ngb-tab i18n-title title="Basic configuration"> |
196 | <ng-template ngbTabContent> | |
0dc64777 | 197 | |
ccc00cb2 | 198 | <div i18n class="inner-form-title">Theme & Default route</div> |
7cd4d2ba C |
199 | |
200 | <ng-container formGroupName="theme"> | |
201 | <div class="form-group"> | |
202 | <label i18n for="themeDefault">Global theme</label> | |
203 | ||
204 | <div class="peertube-select-container"> | |
205 | <select formControlName="default" id="themeDefault"> | |
206 | <option i18n value="default">default</option> | |
207 | ||
208 | <option *ngFor="let theme of availableThemes" [value]="theme">{{ theme }}</option> | |
209 | </select> | |
210 | </div> | |
211 | </div> | |
212 | </ng-container> | |
213 | ||
214 | ||
ccc00cb2 C |
215 | <div class="form-group" formGroupName="instance"> |
216 | <label i18n for="instanceDefaultClientRoute">Default client route</label> | |
217 | <div class="peertube-select-container"> | |
218 | <select id="instanceDefaultClientRoute" formControlName="defaultClientRoute"> | |
34398be4 FB |
219 | <option i18n value="/videos/overview">Discover videos</option> |
220 | <option i18n value="/videos/trending">Trending videos</option> | |
221 | <option i18n value="/videos/most-liked">Most liked videos</option> | |
222 | <option i18n value="/videos/recently-added">Recently added videos</option> | |
ccc00cb2 C |
223 | <option i18n value="/videos/local">Local videos</option> |
224 | </select> | |
225 | </div> | |
226 | <div *ngIf="formErrors.instance.defaultClientRoute" class="form-error">{{ formErrors.instance.defaultClientRoute }}</div> | |
227 | </div> | |
228 | ||
3866f1a0 | 229 | <div i18n class="inner-form-title">Signup</div> |
63347a0f | 230 | |
3866f1a0 C |
231 | <ng-container formGroupName="signup"> |
232 | <div class="form-group"> | |
233 | <my-peertube-checkbox | |
234 | inputName="signupEnabled" formControlName="enabled" | |
235 | i18n-labelText labelText="Signup enabled" | |
236 | ></my-peertube-checkbox> | |
63347a0f | 237 | </div> |
3866f1a0 C |
238 | |
239 | <div class="form-group"> | |
240 | <my-peertube-checkbox *ngIf="isSignupEnabled()" | |
241 | inputName="signupRequiresEmailVerification" formControlName="requiresEmailVerification" | |
242 | i18n-labelText labelText="Signup requires email verification" | |
243 | ></my-peertube-checkbox> | |
63347a0f | 244 | </div> |
63347a0f | 245 | |
3866f1a0 C |
246 | <div *ngIf="isSignupEnabled()" class="form-group"> |
247 | <label i18n for="signupLimit">Signup limit</label> | |
248 | <input | |
249 | type="text" id="signupLimit" | |
250 | formControlName="limit" [ngClass]="{ 'input-error': formErrors['signup.limit'] }" | |
251 | > | |
252 | <div *ngIf="formErrors.signup.limit" class="form-error">{{ formErrors.signup.limit }}</div> | |
253 | </div> | |
254 | </ng-container> | |
63347a0f | 255 | |
0dc64777 | 256 | |
3866f1a0 | 257 | <div i18n class="inner-form-title">Users</div> |
63347a0f | 258 | |
3866f1a0 C |
259 | <ng-container formGroupName="user"> |
260 | <div class="form-group"> | |
34398be4 | 261 | <label i18n for="userVideoQuota">Default video quota per user</label> |
3866f1a0 C |
262 | <div class="peertube-select-container"> |
263 | <select id="userVideoQuota" formControlName="videoQuota"> | |
264 | <option *ngFor="let videoQuotaOption of videoQuotaOptions" [value]="videoQuotaOption.value"> | |
265 | {{ videoQuotaOption.label }} | |
266 | </option> | |
267 | </select> | |
268 | </div> | |
269 | <div *ngIf="formErrors.user.videoQuota" class="form-error">{{ formErrors.user.videoQuota }}</div> | |
270 | </div> | |
d9eaee39 | 271 | |
3866f1a0 | 272 | <div class="form-group"> |
34398be4 | 273 | <label i18n for="userVideoQuotaDaily">Default daily upload limit per user</label> |
3866f1a0 C |
274 | <div class="peertube-select-container"> |
275 | <select id="userVideoQuotaDaily" formControlName="videoQuotaDaily"> | |
276 | <option *ngFor="let videoQuotaDailyOption of videoQuotaDailyOptions" [value]="videoQuotaDailyOption.value"> | |
277 | {{ videoQuotaDailyOption.label }} | |
278 | </option> | |
279 | </select> | |
280 | </div> | |
281 | <div *ngIf="formErrors.user.videoQuotaDaily" class="form-error">{{ formErrors.user.videoQuotaDaily }}</div> | |
63347a0f | 282 | </div> |
3866f1a0 | 283 | </ng-container> |
8be1afa1 | 284 | |
0dc64777 | 285 | |
63347a0f C |
286 | <div i18n class="inner-form-title">Import</div> |
287 | ||
3866f1a0 C |
288 | <ng-container formGroupName="import"> |
289 | <ng-container formGroupName="videos"> | |
8be1afa1 | 290 | |
3866f1a0 C |
291 | <div class="form-group" formGroupName="http"> |
292 | <my-peertube-checkbox | |
293 | inputName="importVideosHttpEnabled" formControlName="enabled" | |
294 | i18n-labelText labelText="Video import with HTTP URL (i.e. YouTube) enabled" | |
295 | ></my-peertube-checkbox> | |
296 | </div> | |
297 | ||
298 | <div class="form-group" formGroupName="torrent"> | |
299 | <my-peertube-checkbox | |
300 | inputName="importVideosTorrentEnabled" formControlName="enabled" | |
301 | i18n-labelText labelText="Video import with a torrent file or a magnet URI enabled" | |
302 | ></my-peertube-checkbox> | |
303 | </div> | |
304 | ||
305 | </ng-container> | |
306 | </ng-container> | |
8be1afa1 | 307 | |
0dc64777 | 308 | |
7ccddd7b JM |
309 | <div i18n class="inner-form-title">Auto-blacklist</div> |
310 | ||
311 | <ng-container formGroupName="autoBlacklist"> | |
312 | <ng-container formGroupName="videos"> | |
313 | <ng-container formGroupName="ofUsers"> | |
314 | ||
315 | <div class="form-group"> | |
316 | <my-peertube-checkbox | |
317 | inputName="autoBlacklistVideosOfUsersEnabled" formControlName="enabled" | |
318 | i18n-labelText labelText="New videos of users automatically blacklisted enabled" | |
319 | ></my-peertube-checkbox> | |
320 | </div> | |
321 | ||
322 | </ng-container> | |
323 | </ng-container> | |
324 | </ng-container> | |
325 | ||
0dc64777 C |
326 | |
327 | <div i18n class="inner-form-title">Instance followers</div> | |
328 | ||
329 | <ng-container formGroupName="followers"> | |
330 | <ng-container formGroupName="instance"> | |
331 | ||
332 | <div class="form-group"> | |
333 | <my-peertube-checkbox | |
334 | inputName="followersInstanceEnabled" formControlName="enabled" | |
335 | i18n-labelText labelText="Other instances can follow your instance" | |
336 | ></my-peertube-checkbox> | |
337 | </div> | |
338 | ||
339 | <div class="form-group"> | |
340 | <my-peertube-checkbox | |
341 | inputName="followersInstanceManualApproval" formControlName="manualApproval" | |
342 | i18n-labelText labelText="Manually approve new instance follower" | |
343 | ></my-peertube-checkbox> | |
344 | </div> | |
345 | </ng-container> | |
346 | </ng-container> | |
347 | ||
e1b49ee5 C |
348 | <div i18n class="inner-form-title">Instance followings</div> |
349 | ||
350 | <ng-container formGroupName="followings"> | |
351 | <ng-container formGroupName="instance"> | |
352 | ||
353 | <ng-container formGroupName="autoFollowBack"> | |
354 | <div class="form-group"> | |
355 | <my-peertube-checkbox | |
356 | inputName="followingsInstanceAutoFollowBackEnabled" formControlName="enabled" | |
357 | i18n-labelText labelText="Automatically follow other instances that follow you" | |
358 | ></my-peertube-checkbox> | |
359 | </div> | |
360 | </ng-container> | |
361 | ||
362 | <ng-container formGroupName="autoFollowIndex"> | |
363 | <div class="form-group"> | |
364 | <my-peertube-checkbox | |
365 | inputName="followingsInstanceAutoFollowIndexEnabled" formControlName="enabled" | |
366 | i18n-labelText labelText="Automatically follow instance of the public index (below)" | |
367 | ></my-peertube-checkbox> | |
368 | </div> | |
369 | ||
370 | <div class="form-group"> | |
371 | <label i18n for="followingsInstanceAutoFollowIndexUrl">Index URL</label> | |
372 | <input | |
373 | type="text" id="followingsInstanceAutoFollowIndexUrl" | |
374 | formControlName="indexUrl" [ngClass]="{ 'input-error': formErrors['followings.instance.autoFollowIndex.indexUrl'] }" | |
375 | > | |
376 | <div *ngIf="formErrors.followings.instance.autoFollowIndex.indexUrl" class="form-error">{{ formErrors.followings.instance.autoFollowIndex.indexUrl }}</div> | |
377 | </div> | |
378 | ||
379 | </ng-container> | |
380 | </ng-container> | |
381 | </ng-container> | |
382 | ||
0dc64777 | 383 | |
63347a0f | 384 | <div i18n class="inner-form-title">Administrator</div> |
8be1afa1 | 385 | |
3866f1a0 | 386 | <div class="form-group" formGroupName="admin"> |
63347a0f C |
387 | <label i18n for="adminEmail">Admin email</label> |
388 | <input | |
389 | type="text" id="adminEmail" | |
3866f1a0 | 390 | formControlName="email" [ngClass]="{ 'input-error': formErrors['admin.email'] }" |
63347a0f | 391 | > |
3866f1a0 | 392 | <div *ngIf="formErrors.admin.email" class="form-error">{{ formErrors.admin.email }}</div> |
63347a0f | 393 | </div> |
8be1afa1 | 394 | |
3866f1a0 C |
395 | <div class="form-group" formGroupName="contactForm"> |
396 | <my-peertube-checkbox | |
397 | inputName="enableContactForm" formControlName="enabled" | |
398 | i18n-labelText labelText="Enable contact form" | |
399 | ></my-peertube-checkbox> | |
8be1afa1 | 400 | </div> |
bee0abff | 401 | |
63347a0f C |
402 | </ng-template> |
403 | </ngb-tab> | |
8be1afa1 | 404 | |
63347a0f C |
405 | <ngb-tab i18n-title title="Services"> |
406 | <ng-template ngbTabContent> | |
407 | <div i18n class="inner-form-title">Twitter</div> | |
0f7fedc3 | 408 | |
3866f1a0 C |
409 | <ng-container formGroupName="services"> |
410 | <ng-container formGroupName="twitter"> | |
411 | ||
412 | <div class="form-group"> | |
413 | <label i18n for="signupLimit">Your Twitter username</label> | |
421d935d C |
414 | |
415 | <my-help> | |
416 | <ng-template ptTemplate="customHtml"> | |
417 | <ng-container i18n>Indicates the Twitter account for the website or platform on which the content was published.</ng-container> | |
418 | </ng-template> | |
419 | </my-help> | |
420 | ||
3866f1a0 C |
421 | <input |
422 | type="text" id="servicesTwitterUsername" | |
423 | formControlName="username" [ngClass]="{ 'input-error': formErrors['services.twitter.username'] }" | |
424 | > | |
425 | <div *ngIf="formErrors.services.twitter.username" class="form-error">{{ formErrors.services.twitter.username }}</div> | |
426 | </div> | |
427 | ||
428 | <div class="form-group"> | |
421d935d C |
429 | <my-peertube-checkbox inputName="servicesTwitterWhitelisted" formControlName="whitelisted"> |
430 | <ng-template ptTemplate="label"> | |
431 | <ng-container i18n>Instance whitelisted by Twitter</ng-container> | |
432 | </ng-template> | |
433 | ||
434 | <ng-template ptTemplate="help"> | |
435 | <ng-container i18n> | |
436 | If your instance is whitelisted by Twitter, a video player will be embedded in the Twitter feed on PeerTube video share.<br /> | |
437 | If the instance is not whitelisted, we use an image link card that will redirect on your PeerTube instance.<br /><br /> | |
438 | Check this checkbox, save the configuration and test with a video URL of your instance (https://example.com/videos/watch/blabla) on | |
439 | <a target='_blank' rel='noopener noreferrer' href='https://cards-dev.twitter.com/validator'>https://cards-dev.twitter.com/validator</a> | |
440 | to see if you instance is whitelisted. | |
441 | </ng-container> | |
442 | </ng-template> | |
443 | </my-peertube-checkbox> | |
3866f1a0 C |
444 | </div> |
445 | ||
446 | </ng-container> | |
447 | </ng-container> | |
8be1afa1 | 448 | |
63347a0f C |
449 | </ng-template> |
450 | </ngb-tab> | |
451 | ||
452 | <ngb-tab i18n-title title="Advanced configuration"> | |
453 | <ng-template ngbTabContent> | |
454 | ||
455 | <div i18n class="inner-form-title">Transcoding</div> | |
456 | ||
3866f1a0 | 457 | <ng-container formGroupName="transcoding"> |
14e2014a | 458 | <div class="form-group"> |
421d935d C |
459 | <my-peertube-checkbox inputName="transcodingEnabled" formControlName="enabled"> |
460 | <ng-template ptTemplate="label"> | |
461 | <ng-container i18n>Transcoding enabled</ng-container> | |
462 | </ng-template> | |
463 | ||
464 | <ng-template ptTemplate="help"> | |
465 | <ng-container i18n>If you disable transcoding, many videos from your users will not work!</ng-container> | |
466 | </ng-template> | |
467 | </my-peertube-checkbox> | |
14e2014a C |
468 | </div> |
469 | ||
3866f1a0 C |
470 | <ng-container *ngIf="isTranscodingEnabled()"> |
471 | ||
472 | <div class="form-group"> | |
473 | <my-peertube-checkbox | |
474 | inputName="transcodingAllowAdditionalExtensions" formControlName="allowAdditionalExtensions" | |
475 | i18n-labelText labelText="Allow additional extensions" | |
421d935d C |
476 | > |
477 | <ng-template ptTemplate="help"> | |
34398be4 | 478 | <ng-container i18n>Allow your users to upload .mkv, .mov, .avi and .flv videos</ng-container> |
421d935d C |
479 | </ng-template> |
480 | </my-peertube-checkbox> | |
63347a0f | 481 | </div> |
3866f1a0 | 482 | |
536598cf C |
483 | <div class="form-group"> |
484 | <my-peertube-checkbox | |
485 | inputName="transcodingAllowAudioFiles" formControlName="allowAudioFiles" | |
486 | i18n-labelText labelText="Allow audio files upload" | |
421d935d C |
487 | > |
488 | <ng-template ptTemplate="help"> | |
489 | <ng-container i18n>Allow your users to upload audio files that will be merged with the preview file on upload</ng-container> | |
490 | </ng-template> | |
491 | </my-peertube-checkbox> | |
536598cf C |
492 | </div> |
493 | ||
5a71acd2 C |
494 | <ng-container formGroupName="webtorrent"> |
495 | <div class="form-group" > | |
496 | <my-peertube-checkbox | |
497 | inputName="transcodingWebTorrentEnabled" formControlName="enabled" | |
498 | i18n-labelText labelText="WebTorrent support enabled" | |
499 | > | |
500 | <ng-template ptTemplate="help"> | |
501 | <ng-container i18n> | |
502 | <strong>Experimental, we suggest you to not disable webtorrent support for now</strong> | |
503 | ||
504 | <p>If you also enabled HLS support, it will multiply videos storage by 2</p> | |
505 | </ng-container> | |
506 | </ng-template> | |
507 | </my-peertube-checkbox> | |
508 | </div> | |
509 | </ng-container> | |
510 | ||
5d9e4eaa C |
511 | <ng-container formGroupName="hls"> |
512 | <div class="form-group" > | |
513 | <my-peertube-checkbox | |
514 | inputName="transcodingHlsEnabled" formControlName="enabled" | |
515 | i18n-labelText labelText="HLS support enabled" | |
516 | > | |
517 | <ng-template ptTemplate="help"> | |
518 | <ng-container i18n> | |
5a71acd2 | 519 | <strong>Requires ffmpeg >= 4.1</strong> |
5d9e4eaa C |
520 | |
521 | <p>Generate HLS playlists and fragmented MP4 files resulting in a better playback than with the current default player:</p> | |
522 | <ul> | |
523 | <li>Resolution change is smoother</li> | |
524 | <li>Faster playback in particular with long videos</li> | |
525 | <li>More stable playback (less bugs/infinite loading)</li> | |
526 | </ul> | |
5a71acd2 C |
527 | |
528 | <p>If you also enabled WebTorrent support, it will multiply videos storage by 2</p> | |
5d9e4eaa C |
529 | </ng-container> |
530 | </ng-template> | |
531 | </my-peertube-checkbox> | |
532 | </div> | |
533 | </ng-container> | |
534 | ||
3866f1a0 C |
535 | <div class="form-group"> |
536 | <label i18n for="transcodingThreads">Transcoding threads</label> | |
537 | <div class="peertube-select-container"> | |
538 | <select id="transcodingThreads" formControlName="threads"> | |
539 | <option *ngFor="let transcodingThreadOption of transcodingThreadOptions" [value]="transcodingThreadOption.value"> | |
540 | {{ transcodingThreadOption.label }} | |
541 | </option> | |
542 | </select> | |
543 | </div> | |
544 | <div *ngIf="formErrors.transcoding.threads" class="form-error">{{ formErrors.transcoding.threads }}</div> | |
63347a0f | 545 | </div> |
63347a0f | 546 | |
3866f1a0 C |
547 | <ng-container formGroupName="resolutions"> |
548 | <div class="form-group" *ngFor="let resolution of resolutions"> | |
549 | <my-peertube-checkbox | |
00aa1f0d C |
550 | [inputName]="getResolutionKey(resolution.id)" [formControlName]="resolution.id" |
551 | i18n-labelText labelText="Resolution {{resolution.label}} enabled" | |
3866f1a0 C |
552 | ></my-peertube-checkbox> |
553 | </div> | |
554 | </ng-container> | |
555 | ||
556 | </ng-container> | |
557 | </ng-container> | |
63347a0f | 558 | |
e771dbe0 C |
559 | <div class="inner-form-title"> |
560 | <ng-container i18n>Cache</ng-container> | |
63347a0f | 561 | |
421d935d C |
562 | <my-help> |
563 | <ng-template ptTemplate="customHtml"> | |
564 | <ng-container i18n>Some files are not federated (previews, captions). We fetch them directly from the origin instance and cache them.</ng-container> | |
565 | </ng-template> | |
566 | </my-help> | |
8be1afa1 | 567 | </div> |
63347a0f | 568 | |
3866f1a0 C |
569 | <ng-container formGroupName="cache"> |
570 | <div class="form-group" formGroupName="previews"> | |
571 | <label i18n for="cachePreviewsSize">Previews cache size</label> | |
572 | <input | |
573 | type="text" id="cachePreviewsSize" | |
574 | formControlName="size" [ngClass]="{ 'input-error': formErrors['cache.previews.size'] }" | |
575 | > | |
576 | <div *ngIf="formErrors.cache.previews.size" class="form-error">{{ formErrors.cache.previews.size }}</div> | |
63347a0f | 577 | </div> |
63347a0f | 578 | |
3866f1a0 C |
579 | <div class="form-group" formGroupName="captions"> |
580 | <label i18n for="cacheCaptionsSize">Video captions cache size</label> | |
581 | <input | |
582 | type="text" id="cacheCaptionsSize" | |
583 | formControlName="size" [ngClass]="{ 'input-error': formErrors['cache.captions.size'] }" | |
584 | > | |
585 | <div *ngIf="formErrors.cache.captions.size" class="form-error">{{ formErrors.cache.captions.size }}</div> | |
63347a0f | 586 | </div> |
3866f1a0 | 587 | </ng-container> |
63347a0f C |
588 | |
589 | <div i18n class="inner-form-title">Customizations</div> | |
590 | ||
3866f1a0 C |
591 | <ng-container formGroupName="instance"> |
592 | <ng-container formGroupName="customizations"> | |
593 | <div class="form-group"> | |
594 | <label i18n for="customizationJavascript">JavaScript</label> | |
421d935d C |
595 | <my-help> |
596 | <ng-template ptTemplate="customHtml"> | |
597 | <ng-container i18n> | |
34398be4 | 598 | Write JavaScript code directly.<br />Example: <pre>console.log('my instance is amazing');</pre> |
421d935d C |
599 | </ng-container> |
600 | </ng-template> | |
601 | </my-help> | |
602 | ||
3866f1a0 C |
603 | <textarea |
604 | id="customizationJavascript" formControlName="javascript" | |
605 | [ngClass]="{ 'input-error': formErrors['instance.customizations.javascript'] }" | |
606 | ></textarea> | |
421d935d | 607 | |
3866f1a0 C |
608 | <div *ngIf="formErrors.instance.customizations.javascript" class="form-error">{{ formErrors.instance.customizations.javascript }}</div> |
609 | </div> | |
610 | ||
611 | <div class="form-group"> | |
612 | <label for="customizationCSS">CSS</label> | |
421d935d C |
613 | |
614 | <my-help> | |
615 | <ng-template ptTemplate="customHtml"> | |
616 | <ng-container i18n> | |
34398be4 | 617 | Write CSS code directly. Example:<br /><br /> |
421d935d C |
618 | <pre> |
619 | #custom-css {{ '{' }} | |
620 | color: red; | |
621 | {{ '}' }} | |
622 | </pre> | |
3866f1a0 | 623 | |
7113b5cd | 624 | Prepend with <em>#custom-css</em> to override styles. Example:<br /><br /> |
421d935d C |
625 | <pre> |
626 | #custom-css .logged-in-email {{ '{' }} | |
627 | color: red; | |
628 | {{ '}' }} | |
629 | </pre> | |
630 | </ng-container> | |
631 | </ng-template> | |
632 | </my-help> | |
633 | ||
3866f1a0 C |
634 | <textarea |
635 | id="customizationCSS" formControlName="css" | |
636 | [ngClass]="{ 'input-error': formErrors['instance.customizations.css'] }" | |
637 | ></textarea> | |
638 | <div *ngIf="formErrors.instance.customizations.css" class="form-error">{{ formErrors.instance.customizations.css }}</div> | |
639 | </div> | |
640 | </ng-container> | |
641 | </ng-container> | |
63347a0f | 642 | |
63347a0f C |
643 | </ng-template> |
644 | </ngb-tab> | |
645 | </ngb-tabset> | |
00b5556c | 646 | |
b1d40cff | 647 | <input (click)="formValidated()" type="submit" i18n-value value="Update configuration" [disabled]="!form.valid"> |
34398be4 | 648 | <span class="form-error" i18n *ngIf="!form.valid">It seems like the configuration is invalid. Please search for potential errors in the different tabs.</span> |
fd206f0b | 649 | </form> |