]>
Commit | Line | Data |
---|---|---|
8a8e02a4 | 1 | <form role="form" [formGroup]="form"> |
fd206f0b | 2 | |
63347a0f | 3 | <ngb-tabset class="root-tabset bootstrap"> |
8be1afa1 | 4 | |
63347a0f C |
5 | <ngb-tab i18n-title title="Basic configuration"> |
6 | <ng-template ngbTabContent> | |
8be1afa1 | 7 | |
63347a0f | 8 | <div i18n class="inner-form-title">Instance</div> |
8be1afa1 | 9 | |
3866f1a0 C |
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> | |
63347a0f | 18 | </div> |
63347a0f | 19 | |
3866f1a0 C |
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> | |
63347a0f | 27 | </div> |
63347a0f | 28 | |
3866f1a0 C |
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> | |
63347a0f | 36 | </div> |
63347a0f | 37 | |
3866f1a0 C |
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> | |
63347a0f | 45 | </div> |
63347a0f | 46 | |
f8802489 C |
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 | ||
3866f1a0 C |
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> | |
63347a0f | 67 | </div> |
3866f1a0 C |
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> | |
63347a0f | 84 | </div> |
3866f1a0 | 85 | </ng-container> |
63347a0f | 86 | |
0dc64777 | 87 | |
7cd4d2ba C |
88 | <div i18n class="inner-form-title">Theme</div> |
89 | ||
90 | <ng-container formGroupName="theme"> | |
91 | <div class="form-group"> | |
92 | <label i18n for="themeDefault">Global theme</label> | |
93 | ||
94 | <div class="peertube-select-container"> | |
95 | <select formControlName="default" id="themeDefault"> | |
96 | <option i18n value="default">default</option> | |
97 | ||
98 | <option *ngFor="let theme of availableThemes" [value]="theme">{{ theme }}</option> | |
99 | </select> | |
100 | </div> | |
101 | </div> | |
102 | </ng-container> | |
103 | ||
104 | ||
3866f1a0 | 105 | <div i18n class="inner-form-title">Signup</div> |
63347a0f | 106 | |
3866f1a0 C |
107 | <ng-container formGroupName="signup"> |
108 | <div class="form-group"> | |
109 | <my-peertube-checkbox | |
110 | inputName="signupEnabled" formControlName="enabled" | |
111 | i18n-labelText labelText="Signup enabled" | |
112 | ></my-peertube-checkbox> | |
63347a0f | 113 | </div> |
3866f1a0 C |
114 | |
115 | <div class="form-group"> | |
116 | <my-peertube-checkbox *ngIf="isSignupEnabled()" | |
117 | inputName="signupRequiresEmailVerification" formControlName="requiresEmailVerification" | |
118 | i18n-labelText labelText="Signup requires email verification" | |
119 | ></my-peertube-checkbox> | |
63347a0f | 120 | </div> |
63347a0f | 121 | |
3866f1a0 C |
122 | <div *ngIf="isSignupEnabled()" class="form-group"> |
123 | <label i18n for="signupLimit">Signup limit</label> | |
124 | <input | |
125 | type="text" id="signupLimit" | |
126 | formControlName="limit" [ngClass]="{ 'input-error': formErrors['signup.limit'] }" | |
127 | > | |
128 | <div *ngIf="formErrors.signup.limit" class="form-error">{{ formErrors.signup.limit }}</div> | |
129 | </div> | |
130 | </ng-container> | |
63347a0f | 131 | |
0dc64777 | 132 | |
3866f1a0 | 133 | <div i18n class="inner-form-title">Users</div> |
63347a0f | 134 | |
3866f1a0 C |
135 | <ng-container formGroupName="user"> |
136 | <div class="form-group"> | |
137 | <label i18n for="userVideoQuota">User default video quota</label> | |
138 | <div class="peertube-select-container"> | |
139 | <select id="userVideoQuota" formControlName="videoQuota"> | |
140 | <option *ngFor="let videoQuotaOption of videoQuotaOptions" [value]="videoQuotaOption.value"> | |
141 | {{ videoQuotaOption.label }} | |
142 | </option> | |
143 | </select> | |
144 | </div> | |
145 | <div *ngIf="formErrors.user.videoQuota" class="form-error">{{ formErrors.user.videoQuota }}</div> | |
146 | </div> | |
d9eaee39 | 147 | |
3866f1a0 C |
148 | <div class="form-group"> |
149 | <label i18n for="userVideoQuotaDaily">User default daily upload limit</label> | |
150 | <div class="peertube-select-container"> | |
151 | <select id="userVideoQuotaDaily" formControlName="videoQuotaDaily"> | |
152 | <option *ngFor="let videoQuotaDailyOption of videoQuotaDailyOptions" [value]="videoQuotaDailyOption.value"> | |
153 | {{ videoQuotaDailyOption.label }} | |
154 | </option> | |
155 | </select> | |
156 | </div> | |
157 | <div *ngIf="formErrors.user.videoQuotaDaily" class="form-error">{{ formErrors.user.videoQuotaDaily }}</div> | |
63347a0f | 158 | </div> |
3866f1a0 | 159 | </ng-container> |
8be1afa1 | 160 | |
0dc64777 | 161 | |
63347a0f C |
162 | <div i18n class="inner-form-title">Import</div> |
163 | ||
3866f1a0 C |
164 | <ng-container formGroupName="import"> |
165 | <ng-container formGroupName="videos"> | |
8be1afa1 | 166 | |
3866f1a0 C |
167 | <div class="form-group" formGroupName="http"> |
168 | <my-peertube-checkbox | |
169 | inputName="importVideosHttpEnabled" formControlName="enabled" | |
170 | i18n-labelText labelText="Video import with HTTP URL (i.e. YouTube) enabled" | |
171 | ></my-peertube-checkbox> | |
172 | </div> | |
173 | ||
174 | <div class="form-group" formGroupName="torrent"> | |
175 | <my-peertube-checkbox | |
176 | inputName="importVideosTorrentEnabled" formControlName="enabled" | |
177 | i18n-labelText labelText="Video import with a torrent file or a magnet URI enabled" | |
178 | ></my-peertube-checkbox> | |
179 | </div> | |
180 | ||
181 | </ng-container> | |
182 | </ng-container> | |
8be1afa1 | 183 | |
0dc64777 | 184 | |
7ccddd7b JM |
185 | <div i18n class="inner-form-title">Auto-blacklist</div> |
186 | ||
187 | <ng-container formGroupName="autoBlacklist"> | |
188 | <ng-container formGroupName="videos"> | |
189 | <ng-container formGroupName="ofUsers"> | |
190 | ||
191 | <div class="form-group"> | |
192 | <my-peertube-checkbox | |
193 | inputName="autoBlacklistVideosOfUsersEnabled" formControlName="enabled" | |
194 | i18n-labelText labelText="New videos of users automatically blacklisted enabled" | |
195 | ></my-peertube-checkbox> | |
196 | </div> | |
197 | ||
198 | </ng-container> | |
199 | </ng-container> | |
200 | </ng-container> | |
201 | ||
0dc64777 C |
202 | |
203 | <div i18n class="inner-form-title">Instance followers</div> | |
204 | ||
205 | <ng-container formGroupName="followers"> | |
206 | <ng-container formGroupName="instance"> | |
207 | ||
208 | <div class="form-group"> | |
209 | <my-peertube-checkbox | |
210 | inputName="followersInstanceEnabled" formControlName="enabled" | |
211 | i18n-labelText labelText="Other instances can follow your instance" | |
212 | ></my-peertube-checkbox> | |
213 | </div> | |
214 | ||
215 | <div class="form-group"> | |
216 | <my-peertube-checkbox | |
217 | inputName="followersInstanceManualApproval" formControlName="manualApproval" | |
218 | i18n-labelText labelText="Manually approve new instance follower" | |
219 | ></my-peertube-checkbox> | |
220 | </div> | |
221 | </ng-container> | |
222 | </ng-container> | |
223 | ||
224 | ||
63347a0f | 225 | <div i18n class="inner-form-title">Administrator</div> |
8be1afa1 | 226 | |
3866f1a0 | 227 | <div class="form-group" formGroupName="admin"> |
63347a0f C |
228 | <label i18n for="adminEmail">Admin email</label> |
229 | <input | |
230 | type="text" id="adminEmail" | |
3866f1a0 | 231 | formControlName="email" [ngClass]="{ 'input-error': formErrors['admin.email'] }" |
63347a0f | 232 | > |
3866f1a0 | 233 | <div *ngIf="formErrors.admin.email" class="form-error">{{ formErrors.admin.email }}</div> |
63347a0f | 234 | </div> |
8be1afa1 | 235 | |
3866f1a0 C |
236 | <div class="form-group" formGroupName="contactForm"> |
237 | <my-peertube-checkbox | |
238 | inputName="enableContactForm" formControlName="enabled" | |
239 | i18n-labelText labelText="Enable contact form" | |
240 | ></my-peertube-checkbox> | |
8be1afa1 | 241 | </div> |
bee0abff | 242 | |
63347a0f C |
243 | </ng-template> |
244 | </ngb-tab> | |
8be1afa1 | 245 | |
63347a0f C |
246 | <ngb-tab i18n-title title="Services"> |
247 | <ng-template ngbTabContent> | |
248 | <div i18n class="inner-form-title">Twitter</div> | |
0f7fedc3 | 249 | |
3866f1a0 C |
250 | <ng-container formGroupName="services"> |
251 | <ng-container formGroupName="twitter"> | |
252 | ||
253 | <div class="form-group"> | |
254 | <label i18n for="signupLimit">Your Twitter username</label> | |
255 | <my-help | |
256 | helpType="custom" i18n-customHtml | |
257 | customHtml="Indicates the Twitter account for the website or platform on which the content was published." | |
258 | ></my-help> | |
259 | <input | |
260 | type="text" id="servicesTwitterUsername" | |
261 | formControlName="username" [ngClass]="{ 'input-error': formErrors['services.twitter.username'] }" | |
262 | > | |
263 | <div *ngIf="formErrors.services.twitter.username" class="form-error">{{ formErrors.services.twitter.username }}</div> | |
264 | </div> | |
265 | ||
266 | <div class="form-group"> | |
267 | <my-peertube-checkbox | |
268 | inputName="servicesTwitterWhitelisted" formControlName="whitelisted" | |
269 | i18n-labelText labelText="Instance whitelisted by Twitter" | |
270 | 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 /> | |
271 | If the instance is not whitelisted, we use an image link card that will redirect on your PeerTube instance.<br /><br /> | |
272 | 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." | |
273 | ></my-peertube-checkbox> | |
274 | </div> | |
275 | ||
276 | </ng-container> | |
277 | </ng-container> | |
8be1afa1 | 278 | |
63347a0f C |
279 | </ng-template> |
280 | </ngb-tab> | |
281 | ||
282 | <ngb-tab i18n-title title="Advanced configuration"> | |
283 | <ng-template ngbTabContent> | |
284 | ||
285 | <div i18n class="inner-form-title">Transcoding</div> | |
286 | ||
3866f1a0 | 287 | <ng-container formGroupName="transcoding"> |
14e2014a C |
288 | <div class="form-group"> |
289 | <my-peertube-checkbox | |
3866f1a0 C |
290 | inputName="transcodingEnabled" formControlName="enabled" |
291 | i18n-labelText labelText="Transcoding enabled" | |
292 | i18n-helpHtml helpHtml="If you disable transcoding, many videos from your users will not work!" | |
14e2014a C |
293 | ></my-peertube-checkbox> |
294 | </div> | |
295 | ||
3866f1a0 C |
296 | <ng-container *ngIf="isTranscodingEnabled()"> |
297 | ||
298 | <div class="form-group"> | |
299 | <my-peertube-checkbox | |
300 | inputName="transcodingAllowAdditionalExtensions" formControlName="allowAdditionalExtensions" | |
301 | i18n-labelText labelText="Allow additional extensions" | |
302 | i18n-helpHtml helpHtml="Allow your users to upload .mkv, .mov, .avi, .flv videos" | |
303 | ></my-peertube-checkbox> | |
63347a0f | 304 | </div> |
3866f1a0 | 305 | |
536598cf C |
306 | <div class="form-group"> |
307 | <my-peertube-checkbox | |
308 | inputName="transcodingAllowAudioFiles" formControlName="allowAudioFiles" | |
309 | i18n-labelText labelText="Allow audio files upload" | |
310 | i18n-helpHtml helpHtml="Allow your users to upload audio files that will be merged with the preview file on upload" | |
311 | ></my-peertube-checkbox> | |
312 | </div> | |
313 | ||
3866f1a0 C |
314 | <div class="form-group"> |
315 | <label i18n for="transcodingThreads">Transcoding threads</label> | |
316 | <div class="peertube-select-container"> | |
317 | <select id="transcodingThreads" formControlName="threads"> | |
318 | <option *ngFor="let transcodingThreadOption of transcodingThreadOptions" [value]="transcodingThreadOption.value"> | |
319 | {{ transcodingThreadOption.label }} | |
320 | </option> | |
321 | </select> | |
322 | </div> | |
323 | <div *ngIf="formErrors.transcoding.threads" class="form-error">{{ formErrors.transcoding.threads }}</div> | |
63347a0f | 324 | </div> |
63347a0f | 325 | |
3866f1a0 C |
326 | <ng-container formGroupName="resolutions"> |
327 | <div class="form-group" *ngFor="let resolution of resolutions"> | |
328 | <my-peertube-checkbox | |
00aa1f0d C |
329 | [inputName]="getResolutionKey(resolution.id)" [formControlName]="resolution.id" |
330 | i18n-labelText labelText="Resolution {{resolution.label}} enabled" | |
3866f1a0 C |
331 | ></my-peertube-checkbox> |
332 | </div> | |
333 | </ng-container> | |
334 | ||
335 | </ng-container> | |
336 | </ng-container> | |
63347a0f C |
337 | |
338 | <div i18n class="inner-form-title"> | |
339 | Cache | |
340 | ||
341 | <my-help | |
342 | helpType="custom" i18n-customHtml | |
343 | customHtml="Some files are not federated (previews, captions). We fetch them directly from the origin instance and cache them." | |
344 | ></my-help> | |
8be1afa1 | 345 | </div> |
63347a0f | 346 | |
3866f1a0 C |
347 | <ng-container formGroupName="cache"> |
348 | <div class="form-group" formGroupName="previews"> | |
349 | <label i18n for="cachePreviewsSize">Previews cache size</label> | |
350 | <input | |
351 | type="text" id="cachePreviewsSize" | |
352 | formControlName="size" [ngClass]="{ 'input-error': formErrors['cache.previews.size'] }" | |
353 | > | |
354 | <div *ngIf="formErrors.cache.previews.size" class="form-error">{{ formErrors.cache.previews.size }}</div> | |
63347a0f | 355 | </div> |
63347a0f | 356 | |
3866f1a0 C |
357 | <div class="form-group" formGroupName="captions"> |
358 | <label i18n for="cacheCaptionsSize">Video captions cache size</label> | |
359 | <input | |
360 | type="text" id="cacheCaptionsSize" | |
361 | formControlName="size" [ngClass]="{ 'input-error': formErrors['cache.captions.size'] }" | |
362 | > | |
363 | <div *ngIf="formErrors.cache.captions.size" class="form-error">{{ formErrors.cache.captions.size }}</div> | |
63347a0f | 364 | </div> |
3866f1a0 | 365 | </ng-container> |
63347a0f C |
366 | |
367 | <div i18n class="inner-form-title">Customizations</div> | |
368 | ||
3866f1a0 C |
369 | <ng-container formGroupName="instance"> |
370 | <ng-container formGroupName="customizations"> | |
371 | <div class="form-group"> | |
372 | <label i18n for="customizationJavascript">JavaScript</label> | |
373 | <my-help | |
374 | helpType="custom" i18n-customHtml | |
375 | customHtml="Write directly JavaScript code.<br />Example: <pre>console.log('my instance is amazing');</pre>" | |
376 | ></my-help> | |
377 | <textarea | |
378 | id="customizationJavascript" formControlName="javascript" | |
379 | [ngClass]="{ 'input-error': formErrors['instance.customizations.javascript'] }" | |
380 | ></textarea> | |
381 | <div *ngIf="formErrors.instance.customizations.javascript" class="form-error">{{ formErrors.instance.customizations.javascript }}</div> | |
382 | </div> | |
383 | ||
384 | <div class="form-group"> | |
385 | <label for="customizationCSS">CSS</label> | |
386 | <my-help | |
387 | helpType="custom" | |
388 | i18n-customHtml | |
389 | customHtml=" | |
7113b5cd | 390 | Write directly CSS code. Example:<br /><br /> |
3866f1a0 | 391 | <pre> |
7113b5cd C |
392 | #custom-css {{ '{' }} |
393 | color: red; | |
394 | {{ '}' }} | |
3866f1a0 C |
395 | </pre> |
396 | ||
7113b5cd | 397 | Prepend with <em>#custom-css</em> to override styles. Example:<br /><br /> |
3866f1a0 | 398 | <pre> |
7113b5cd C |
399 | #custom-css .logged-in-email {{ '{' }} |
400 | color: red; | |
401 | {{ '}' }} | |
3866f1a0 C |
402 | </pre> |
403 | " | |
404 | ></my-help> | |
405 | <textarea | |
406 | id="customizationCSS" formControlName="css" | |
407 | [ngClass]="{ 'input-error': formErrors['instance.customizations.css'] }" | |
408 | ></textarea> | |
409 | <div *ngIf="formErrors.instance.customizations.css" class="form-error">{{ formErrors.instance.customizations.css }}</div> | |
410 | </div> | |
411 | </ng-container> | |
412 | </ng-container> | |
63347a0f | 413 | |
63347a0f C |
414 | </ng-template> |
415 | </ngb-tab> | |
416 | </ngb-tabset> | |
00b5556c | 417 | |
b1d40cff | 418 | <input (click)="formValidated()" type="submit" i18n-value value="Update configuration" [disabled]="!form.valid"> |
d3662c1c | 419 | <span class="form-error" i18n *ngIf="!form.valid">It seems the configuration is invalid. Please search potential errors in the different tabs.</span> |
fd206f0b | 420 | </form> |