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