]>
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 | |
63347a0f | 164 | <div i18n class="inner-form-title">Administrator</div> |
8be1afa1 | 165 | |
3866f1a0 | 166 | <div class="form-group" formGroupName="admin"> |
63347a0f C |
167 | <label i18n for="adminEmail">Admin email</label> |
168 | <input | |
169 | type="text" id="adminEmail" | |
3866f1a0 | 170 | formControlName="email" [ngClass]="{ 'input-error': formErrors['admin.email'] }" |
63347a0f | 171 | > |
3866f1a0 | 172 | <div *ngIf="formErrors.admin.email" class="form-error">{{ formErrors.admin.email }}</div> |
63347a0f | 173 | </div> |
8be1afa1 | 174 | |
3866f1a0 C |
175 | <div class="form-group" formGroupName="contactForm"> |
176 | <my-peertube-checkbox | |
177 | inputName="enableContactForm" formControlName="enabled" | |
178 | i18n-labelText labelText="Enable contact form" | |
179 | ></my-peertube-checkbox> | |
8be1afa1 | 180 | </div> |
bee0abff | 181 | |
63347a0f C |
182 | </ng-template> |
183 | </ngb-tab> | |
8be1afa1 | 184 | |
63347a0f C |
185 | <ngb-tab i18n-title title="Services"> |
186 | <ng-template ngbTabContent> | |
187 | <div i18n class="inner-form-title">Twitter</div> | |
0f7fedc3 | 188 | |
3866f1a0 C |
189 | <ng-container formGroupName="services"> |
190 | <ng-container formGroupName="twitter"> | |
191 | ||
192 | <div class="form-group"> | |
193 | <label i18n for="signupLimit">Your Twitter username</label> | |
194 | <my-help | |
195 | helpType="custom" i18n-customHtml | |
196 | customHtml="Indicates the Twitter account for the website or platform on which the content was published." | |
197 | ></my-help> | |
198 | <input | |
199 | type="text" id="servicesTwitterUsername" | |
200 | formControlName="username" [ngClass]="{ 'input-error': formErrors['services.twitter.username'] }" | |
201 | > | |
202 | <div *ngIf="formErrors.services.twitter.username" class="form-error">{{ formErrors.services.twitter.username }}</div> | |
203 | </div> | |
204 | ||
205 | <div class="form-group"> | |
206 | <my-peertube-checkbox | |
207 | inputName="servicesTwitterWhitelisted" formControlName="whitelisted" | |
208 | i18n-labelText labelText="Instance whitelisted by Twitter" | |
209 | 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 /> | |
210 | If the instance is not whitelisted, we use an image link card that will redirect on your PeerTube instance.<br /><br /> | |
211 | 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." | |
212 | ></my-peertube-checkbox> | |
213 | </div> | |
214 | ||
215 | </ng-container> | |
216 | </ng-container> | |
8be1afa1 | 217 | |
63347a0f C |
218 | </ng-template> |
219 | </ngb-tab> | |
220 | ||
221 | <ngb-tab i18n-title title="Advanced configuration"> | |
222 | <ng-template ngbTabContent> | |
223 | ||
224 | <div i18n class="inner-form-title">Transcoding</div> | |
225 | ||
3866f1a0 | 226 | <ng-container formGroupName="transcoding"> |
14e2014a C |
227 | <div class="form-group"> |
228 | <my-peertube-checkbox | |
3866f1a0 C |
229 | inputName="transcodingEnabled" formControlName="enabled" |
230 | i18n-labelText labelText="Transcoding enabled" | |
231 | i18n-helpHtml helpHtml="If you disable transcoding, many videos from your users will not work!" | |
14e2014a C |
232 | ></my-peertube-checkbox> |
233 | </div> | |
234 | ||
3866f1a0 C |
235 | <ng-container *ngIf="isTranscodingEnabled()"> |
236 | ||
237 | <div class="form-group"> | |
238 | <my-peertube-checkbox | |
239 | inputName="transcodingAllowAdditionalExtensions" formControlName="allowAdditionalExtensions" | |
240 | i18n-labelText labelText="Allow additional extensions" | |
241 | i18n-helpHtml helpHtml="Allow your users to upload .mkv, .mov, .avi, .flv videos" | |
242 | ></my-peertube-checkbox> | |
63347a0f | 243 | </div> |
3866f1a0 C |
244 | |
245 | <div class="form-group"> | |
246 | <label i18n for="transcodingThreads">Transcoding threads</label> | |
247 | <div class="peertube-select-container"> | |
248 | <select id="transcodingThreads" formControlName="threads"> | |
249 | <option *ngFor="let transcodingThreadOption of transcodingThreadOptions" [value]="transcodingThreadOption.value"> | |
250 | {{ transcodingThreadOption.label }} | |
251 | </option> | |
252 | </select> | |
253 | </div> | |
254 | <div *ngIf="formErrors.transcoding.threads" class="form-error">{{ formErrors.transcoding.threads }}</div> | |
63347a0f | 255 | </div> |
63347a0f | 256 | |
3866f1a0 C |
257 | <ng-container formGroupName="resolutions"> |
258 | <div class="form-group" *ngFor="let resolution of resolutions"> | |
259 | <my-peertube-checkbox | |
260 | [inputName]="getResolutionKey(resolution)" [formControlName]="resolution" | |
261 | i18n-labelText labelText="Resolution {{resolution}} enabled" | |
262 | ></my-peertube-checkbox> | |
263 | </div> | |
264 | </ng-container> | |
265 | ||
266 | </ng-container> | |
267 | </ng-container> | |
63347a0f C |
268 | |
269 | <div i18n class="inner-form-title"> | |
270 | Cache | |
271 | ||
272 | <my-help | |
273 | helpType="custom" i18n-customHtml | |
274 | customHtml="Some files are not federated (previews, captions). We fetch them directly from the origin instance and cache them." | |
275 | ></my-help> | |
8be1afa1 | 276 | </div> |
63347a0f | 277 | |
3866f1a0 C |
278 | <ng-container formGroupName="cache"> |
279 | <div class="form-group" formGroupName="previews"> | |
280 | <label i18n for="cachePreviewsSize">Previews cache size</label> | |
281 | <input | |
282 | type="text" id="cachePreviewsSize" | |
283 | formControlName="size" [ngClass]="{ 'input-error': formErrors['cache.previews.size'] }" | |
284 | > | |
285 | <div *ngIf="formErrors.cache.previews.size" class="form-error">{{ formErrors.cache.previews.size }}</div> | |
63347a0f | 286 | </div> |
63347a0f | 287 | |
3866f1a0 C |
288 | <div class="form-group" formGroupName="captions"> |
289 | <label i18n for="cacheCaptionsSize">Video captions cache size</label> | |
290 | <input | |
291 | type="text" id="cacheCaptionsSize" | |
292 | formControlName="size" [ngClass]="{ 'input-error': formErrors['cache.captions.size'] }" | |
293 | > | |
294 | <div *ngIf="formErrors.cache.captions.size" class="form-error">{{ formErrors.cache.captions.size }}</div> | |
63347a0f | 295 | </div> |
3866f1a0 | 296 | </ng-container> |
63347a0f C |
297 | |
298 | <div i18n class="inner-form-title">Customizations</div> | |
299 | ||
3866f1a0 C |
300 | <ng-container formGroupName="instance"> |
301 | <ng-container formGroupName="customizations"> | |
302 | <div class="form-group"> | |
303 | <label i18n for="customizationJavascript">JavaScript</label> | |
304 | <my-help | |
305 | helpType="custom" i18n-customHtml | |
306 | customHtml="Write directly JavaScript code.<br />Example: <pre>console.log('my instance is amazing');</pre>" | |
307 | ></my-help> | |
308 | <textarea | |
309 | id="customizationJavascript" formControlName="javascript" | |
310 | [ngClass]="{ 'input-error': formErrors['instance.customizations.javascript'] }" | |
311 | ></textarea> | |
312 | <div *ngIf="formErrors.instance.customizations.javascript" class="form-error">{{ formErrors.instance.customizations.javascript }}</div> | |
313 | </div> | |
314 | ||
315 | <div class="form-group"> | |
316 | <label for="customizationCSS">CSS</label> | |
317 | <my-help | |
318 | helpType="custom" | |
319 | i18n-customHtml | |
320 | customHtml=" | |
321 | Write directly CSS code. Example:<br /> | |
322 | <pre> | |
323 | body {{ '{' }} | |
324 | background-color: red; | |
325 | {{ '}' }} | |
326 | </pre> | |
327 | ||
328 | Prepend with <em>#custom-css</em> to override styles. Example: | |
329 | <pre> | |
330 | #custom-css .logged-in-email {{ '{' }} | |
331 | color: red; | |
332 | {{ '}' }} | |
333 | </pre> | |
334 | " | |
335 | ></my-help> | |
336 | <textarea | |
337 | id="customizationCSS" formControlName="css" | |
338 | [ngClass]="{ 'input-error': formErrors['instance.customizations.css'] }" | |
339 | ></textarea> | |
340 | <div *ngIf="formErrors.instance.customizations.css" class="form-error">{{ formErrors.instance.customizations.css }}</div> | |
341 | </div> | |
342 | </ng-container> | |
343 | </ng-container> | |
63347a0f | 344 | |
63347a0f C |
345 | </ng-template> |
346 | </ngb-tab> | |
347 | </ngb-tabset> | |
00b5556c | 348 | |
b1d40cff | 349 | <input (click)="formValidated()" type="submit" i18n-value value="Update configuration" [disabled]="!form.valid"> |
d3662c1c | 350 | <span class="form-error" i18n *ngIf="!form.valid">It seems the configuration is invalid. Please search potential errors in the different tabs.</span> |
fd206f0b | 351 | </form> |