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