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