]>
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 | ||
b1d40cff | 104 | <div i18n class="inner-form-title">Administrator</div> |
8be1afa1 C |
105 | |
106 | <div class="form-group"> | |
b1d40cff | 107 | <label i18n for="adminEmail">Admin email</label> |
8be1afa1 | 108 | <input |
b1d40cff C |
109 | type="text" id="adminEmail" |
110 | formControlName="adminEmail" [ngClass]="{ 'input-error': formErrors['adminEmail'] }" | |
8be1afa1 C |
111 | > |
112 | <div *ngIf="formErrors.adminEmail" class="form-error"> | |
113 | {{ formErrors.adminEmail }} | |
114 | </div> | |
115 | </div> | |
116 | ||
b1d40cff | 117 | <div i18n class="inner-form-title">Users</div> |
8be1afa1 C |
118 | |
119 | <div class="form-group"> | |
b1d40cff | 120 | <label i18n for="userVideoQuota">User default video quota</label> |
8be1afa1 C |
121 | <div class="peertube-select-container"> |
122 | <select id="userVideoQuota" formControlName="userVideoQuota"> | |
123 | <option *ngFor="let videoQuotaOption of videoQuotaOptions" [value]="videoQuotaOption.value"> | |
124 | {{ videoQuotaOption.label }} | |
125 | </option> | |
126 | </select> | |
127 | </div> | |
128 | <div *ngIf="formErrors.userVideoQuota" class="form-error"> | |
129 | {{ formErrors.userVideoQuota }} | |
130 | </div> | |
131 | </div> | |
132 | </tab> | |
133 | ||
0975cd5c | 134 | <tab i18n-heading heading="Services"> |
8be1afa1 | 135 | |
b1d40cff | 136 | <div i18n class="inner-form-title">Twitter</div> |
8be1afa1 C |
137 | |
138 | <div class="form-group"> | |
b1d40cff C |
139 | <label i18n for="signupLimit">Your Twitter username</label> |
140 | <my-help | |
141 | helpType="custom" i18n-customHtml | |
142 | customHtml="Indicates the Twitter account for the website or platform on which the content was published." | |
143 | ></my-help> | |
8be1afa1 | 144 | <input |
b1d40cff C |
145 | type="text" id="servicesTwitterUsername" |
146 | formControlName="servicesTwitterUsername" [ngClass]="{ 'input-error': formErrors['servicesTwitterUsername'] }" | |
8be1afa1 C |
147 | > |
148 | <div *ngIf="formErrors.servicesTwitterUsername" class="form-error"> | |
149 | {{ formErrors.servicesTwitterUsername }} | |
150 | </div> | |
151 | </div> | |
152 | ||
0f7fedc3 C |
153 | <my-peertube-checkbox |
154 | inputName="servicesTwitterWhitelisted" formControlName="servicesTwitterWhitelisted" | |
155 | i18n-labelText labelText="Instance whitelisted by Twitter" | |
156 | 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 | 157 | If the instance is not whitelisted, we use an image link card that will redirect on your PeerTube instance.<br /><br /> |
b1d40cff | 158 | 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 | 159 | ></my-peertube-checkbox> |
8be1afa1 C |
160 | </tab> |
161 | ||
0975cd5c | 162 | <tab i18n-heading heading="Advanced configuration"> |
8be1afa1 | 163 | |
b1d40cff | 164 | <div i18n class="inner-form-title">Transcoding</div> |
8be1afa1 | 165 | |
0f7fedc3 C |
166 | <my-peertube-checkbox |
167 | inputName="transcodingEnabled" formControlName="transcodingEnabled" | |
168 | i18n-labelText labelText="Transcoding enabled" | |
169 | i18n-helpHtml helpHtml="If you disable transcoding, many videos from your users will not work!" | |
170 | ></my-peertube-checkbox> | |
8be1afa1 C |
171 | |
172 | <ng-template [ngIf]="isTranscodingEnabled()"> | |
173 | ||
174 | <div class="form-group"> | |
b1d40cff | 175 | <label i18n for="transcodingThreads">Transcoding threads</label> |
8be1afa1 C |
176 | <div class="peertube-select-container"> |
177 | <select id="transcodingThreads" formControlName="transcodingThreads"> | |
178 | <option *ngFor="let transcodingThreadOption of transcodingThreadOptions" [value]="transcodingThreadOption.value"> | |
179 | {{ transcodingThreadOption.label }} | |
180 | </option> | |
181 | </select> | |
182 | </div> | |
183 | <div *ngIf="formErrors.transcodingThreads" class="form-error"> | |
184 | {{ formErrors.transcodingThreads }} | |
185 | </div> | |
186 | </div> | |
187 | ||
188 | <div class="form-group" *ngFor="let resolution of resolutions"> | |
0f7fedc3 C |
189 | <my-peertube-checkbox |
190 | [inputName]="getResolutionKey(resolution)" [formControlName]="getResolutionKey(resolution)" | |
191 | i18n-labelText labelText="Resolution {{resolution}} enabled" | |
192 | ></my-peertube-checkbox> | |
193 | ||
8be1afa1 C |
194 | </div> |
195 | </ng-template> | |
196 | ||
40e87e9e C |
197 | <div i18n class="inner-form-title"> |
198 | Cache | |
8be1afa1 | 199 | |
b1d40cff C |
200 | <my-help |
201 | helpType="custom" i18n-customHtml | |
40e87e9e | 202 | customHtml="Some files are not federated (previews, captions). We fetch them directly from the origin instance and cache them." |
b1d40cff | 203 | ></my-help> |
40e87e9e | 204 | </div> |
8be1afa1 | 205 | |
40e87e9e C |
206 | <div class="form-group"> |
207 | <label i18n for="cachePreviewsSize">Previews cache size</label> | |
8be1afa1 | 208 | <input |
b1d40cff C |
209 | type="text" id="cachePreviewsSize" |
210 | formControlName="cachePreviewsSize" [ngClass]="{ 'input-error': formErrors['cachePreviewsSize'] }" | |
8be1afa1 C |
211 | > |
212 | <div *ngIf="formErrors.cachePreviewsSize" class="form-error"> | |
213 | {{ formErrors.cachePreviewsSize }} | |
214 | </div> | |
215 | </div> | |
216 | ||
40e87e9e C |
217 | <div class="form-group"> |
218 | <label i18n for="cachePreviewsSize">Video captions cache size</label> | |
219 | <input | |
220 | type="text" id="cacheCaptionsSize" | |
221 | formControlName="cacheCaptionsSize" [ngClass]="{ 'input-error': formErrors['cacheCaptionsSize'] }" | |
222 | > | |
223 | <div *ngIf="formErrors.cacheCaptionsSize" class="form-error"> | |
224 | {{ formErrors.cacheCaptionsSize }} | |
225 | </div> | |
226 | </div> | |
227 | ||
b1d40cff | 228 | <div i18n class="inner-form-title">Customizations</div> |
8be1afa1 C |
229 | |
230 | <div class="form-group"> | |
b1d40cff C |
231 | <label i18n for="customizationJavascript">JavaScript</label> |
232 | <my-help | |
233 | helpType="custom" i18n-customHtml | |
234 | customHtml="Write directly JavaScript code.<br />Example: <pre>console.log('my instance is amazing');</pre>" | |
235 | ></my-help> | |
8be1afa1 | 236 | <textarea |
b1d40cff C |
237 | id="customizationJavascript" formControlName="customizationJavascript" |
238 | [ngClass]="{ 'input-error': formErrors['customizationJavascript'] }" | |
8be1afa1 C |
239 | ></textarea> |
240 | <div *ngIf="formErrors.customizationJavascript" class="form-error"> | |
241 | {{ formErrors.customizationJavascript }} | |
242 | </div> | |
243 | </div> | |
244 | ||
245 | <div class="form-group"> | |
246 | <label for="customizationCSS">CSS</label> | |
247 | <my-help | |
248 | helpType="custom" | |
b1d40cff | 249 | i18n-customHtml |
8be1afa1 C |
250 | customHtml=" |
251 | Write directly CSS code. Example:<br /> | |
252 | <pre> | |
b1d40cff | 253 | body {{ '{' }} |
8be1afa1 | 254 | background-color: red; |
b1d40cff | 255 | {{ '}' }} |
8be1afa1 C |
256 | </pre> |
257 | ||
258 | Prepend with <em>#custom-css</em> to override styles. Example: | |
259 | <pre> | |
b1d40cff | 260 | #custom-css .logged-in-email {{ '{' }} |
8be1afa1 | 261 | color: red; |
b1d40cff | 262 | {{ '}' }} |
8be1afa1 C |
263 | </pre> |
264 | " | |
265 | ></my-help> | |
266 | <textarea | |
b1d40cff C |
267 | id="customizationCSS" formControlName="customizationCSS" |
268 | [ngClass]="{ 'input-error': formErrors['customizationCSS'] }" | |
8be1afa1 C |
269 | ></textarea> |
270 | <div *ngIf="formErrors.customizationCSS" class="form-error"> | |
271 | {{ formErrors.customizationCSS }} | |
272 | </div> | |
273 | </div> | |
274 | </tab> | |
275 | </tabset> | |
00b5556c | 276 | |
b1d40cff | 277 | <input (click)="formValidated()" type="submit" i18n-value value="Update configuration" [disabled]="!form.valid"> |
d3662c1c | 278 | <span class="form-error" i18n *ngIf="!form.valid">It seems the configuration is invalid. Please search potential errors in the different tabs.</span> |
fd206f0b | 279 | </form> |