]>
Commit | Line | Data |
---|---|---|
1 | <form role="form" [formGroup]="form"> | |
2 | ||
3 | <ngb-tabset class="root-tabset bootstrap"> | |
4 | ||
5 | <ngb-tab i18n-title title="Basic configuration"> | |
6 | <ng-template ngbTabContent> | |
7 | ||
8 | <div i18n class="inner-form-title">Instance</div> | |
9 | ||
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> | |
18 | </div> | |
19 | ||
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> | |
27 | </div> | |
28 | ||
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> | |
36 | </div> | |
37 | ||
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> | |
45 | </div> | |
46 | ||
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> | |
58 | </div> | |
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> | |
75 | </div> | |
76 | </ng-container> | |
77 | ||
78 | <div i18n class="inner-form-title">Signup</div> | |
79 | ||
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> | |
86 | </div> | |
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> | |
93 | </div> | |
94 | ||
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> | |
104 | ||
105 | <div i18n class="inner-form-title">Users</div> | |
106 | ||
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> | |
119 | ||
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> | |
130 | </div> | |
131 | </ng-container> | |
132 | ||
133 | <div i18n class="inner-form-title">Import</div> | |
134 | ||
135 | <ng-container formGroupName="import"> | |
136 | <ng-container formGroupName="videos"> | |
137 | ||
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> | |
154 | ||
155 | <div i18n class="inner-form-title">Administrator</div> | |
156 | ||
157 | <div class="form-group" formGroupName="admin"> | |
158 | <label i18n for="adminEmail">Admin email</label> | |
159 | <input | |
160 | type="text" id="adminEmail" | |
161 | formControlName="email" [ngClass]="{ 'input-error': formErrors['admin.email'] }" | |
162 | > | |
163 | <div *ngIf="formErrors.admin.email" class="form-error">{{ formErrors.admin.email }}</div> | |
164 | </div> | |
165 | ||
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> | |
171 | </div> | |
172 | ||
173 | </ng-template> | |
174 | </ngb-tab> | |
175 | ||
176 | <ngb-tab i18n-title title="Services"> | |
177 | <ng-template ngbTabContent> | |
178 | <div i18n class="inner-form-title">Twitter</div> | |
179 | ||
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> | |
208 | ||
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 | ||
217 | <ng-container formGroupName="transcoding"> | |
218 | <div class="form-group"> | |
219 | <my-peertube-checkbox | |
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!" | |
223 | ></my-peertube-checkbox> | |
224 | </div> | |
225 | ||
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> | |
234 | </div> | |
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> | |
246 | </div> | |
247 | ||
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> | |
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> | |
267 | </div> | |
268 | ||
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> | |
277 | </div> | |
278 | ||
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> | |
286 | </div> | |
287 | </ng-container> | |
288 | ||
289 | <div i18n class="inner-form-title">Customizations</div> | |
290 | ||
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> | |
335 | ||
336 | </ng-template> | |
337 | </ngb-tab> | |
338 | </ngb-tabset> | |
339 | ||
340 | <input (click)="formValidated()" type="submit" i18n-value value="Update configuration" [disabled]="!form.valid"> | |
341 | <span class="form-error" i18n *ngIf="!form.valid">It seems the configuration is invalid. Please search potential errors in the different tabs.</span> | |
342 | </form> |