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