20
20
<cv-tile :light =" true" >
21
21
<cv-form @submit.prevent =" configureModule" >
22
22
<cv-text-input
23
- :label =" $t('settings.paperless_name')"
24
- v-model.trim =" paperless"
23
+ :label =" $t('settings.host')"
24
+ placeholder =" paperless.example.org"
25
+ v-model.trim =" host"
25
26
class =" mg-bottom"
26
- :invalid-message =" $t(error.paperless_name )"
27
+ :invalid-message =" $t(error.host )"
27
28
:disabled =" loading.getConfiguration || loading.configureModule"
28
- ref =" paperless "
29
+ ref =" host "
29
30
>
30
31
</cv-text-input >
31
- <!-- <cv-text-input
32
- :label="$t('settings.admin_username')"
33
- v-model.trim="username"
34
- class="mg-bottom"
35
- :invalid-message="$t(error.username)"
36
- :disabled="loading.getConfiguration || loading.configureModule"
37
- ref="username"
38
- >
39
- </cv-text-input> -->
40
- <!-- <cv-text-input
41
- :label="$t('settings.PAPERLESS_SECRET_KEY')"
42
- v-model.trim="password"
43
- type="password"
44
- :password-show-label="$t('settings.show_password')"
45
- :password-hide-label="$t('settings.hide_password')"
46
- class="mg-bottom"
47
- :invalid-message="$t(error.password)"
48
- :disabled="loading.getConfiguration || loading.configureModule"
49
- ref="password"
50
- >
51
- </cv-text-input> -->
52
-
53
- <!-- <cv-text-input
54
- :label="$t('settings.admin_email')"
55
- placeholder="admin@example.com"
56
- v-model.trim="email"
57
- class="mg-bottom"
58
- :invalid-message="$t(error.email)"
59
- :disabled="loading.getConfiguration || loading.configureModule"
60
- ref="email"
61
- >
62
- </cv-text-input> -->
63
-
64
- <!-- <cv-text-input
65
- :label="$t('settings.admin_full_name')"
66
- v-model.trim="userFullName"
67
- class="mg-bottom"
68
- :invalid-message="$t(error.user_full_name)"
69
- :disabled="loading.getConfiguration || loading.configureModule"
70
- ref="userFullName"
71
- >
72
- </cv-text-input> -->
73
- <!-- <cv-text-input
74
- :label="$t('settings.PAPERLESS_UR')"
75
- placeholder="paperless.example.org"
76
- v-model.trim="host"
32
+ <cv-password-input
33
+ :label =" $t('settings.PAPERLESS_ADMIN_PASSWORD')"
34
+ placeholder =" ***************"
35
+ v-model.trim =" PAPERLESS_ADMIN_PASSWORD"
77
36
class =" mg-bottom"
78
37
:invalid-message =" $t(error.host)"
79
38
:disabled =" loading.getConfiguration || loading.configureModule"
80
- ref="host "
39
+ ref =" PAPERLESS_ADMIN_PASSWORD "
81
40
>
82
- </cv-text -input> -- >
41
+ </cv-password -input >
83
42
<cv-toggle
84
43
value =" letsEncrypt"
85
44
:label =" $t('settings.lets_encrypt')"
@@ -154,11 +113,6 @@ export default {
154
113
page: " settings" ,
155
114
},
156
115
urlCheckInterval: null ,
157
- paperless: " " ,
158
- username: " " ,
159
- password: " " ,
160
- email: " " ,
161
- userFullName: " " ,
162
116
host: " " ,
163
117
isLetsEncryptEnabled: false ,
164
118
isHttpToHttpsEnabled: false ,
@@ -169,12 +123,8 @@ export default {
169
123
error: {
170
124
getConfiguration: " " ,
171
125
configureModule: " " ,
172
- paperless: " " ,
173
- username: " " ,
174
- password: " " ,
175
- user_full_name: " " ,
176
- email: " " ,
177
126
host: " " ,
127
+ PAPERLESS_ADMIN_PASSWORD : " " ,
178
128
lets_encrypt: " " ,
179
129
http2https: " " ,
180
130
},
@@ -241,81 +191,31 @@ export default {
241
191
},
242
192
getConfigurationCompleted (taskContext , taskResult ) {
243
193
const config = taskResult .output ;
244
- this .paperlessName = config .paperless_name ;
245
- this .username = config .PAPERLESS_ADMIN_USER ;
246
- this .password = config .PAPERLESS_ADMIN_PASSWORD ;
247
- this .userFullName = config .user_full_name ;
248
- this .email = config .PAPERLESS_ADMIN_MAIL ;
249
194
this .host = config .host ;
195
+ this .PAPERLESS_ADMIN_PASSWORD = config .PAPERLESS_ADMIN_PASSWORD ;
250
196
this .isLetsEncryptEnabled = config .lets_encrypt ;
251
197
this .isHttpToHttpsEnabled = config .http2https ;
252
198
this .loading .getConfiguration = false ;
253
- this .focusElement (" paperlessName " );
199
+ this .focusElement (" host " );
254
200
},
255
201
validateConfigureModule () {
256
202
this .clearErrors (this );
257
203
258
204
let isValidationOk = true ;
259
205
260
- if (! this .wikiName ) {
261
- this .error .wiki_name = " common.required" ;
262
-
263
- if (isValidationOk) {
264
- this .focusElement (" paperlessName" );
265
- }
266
- isValidationOk = false ;
267
- }
268
-
269
- if (! this .username ) {
270
- this .error .username = " common.required" ;
271
-
272
- if (isValidationOk) {
273
- this .focusElement (" username" );
274
- }
275
- isValidationOk = false ;
276
- }
277
-
278
- if (! this .password ) {
279
- this .error .password = " common.required" ;
280
-
281
- if (isValidationOk) {
282
- this .focusElement (" password" );
283
- }
284
- isValidationOk = false ;
285
- }
286
-
287
- if (! this .email ) {
288
- this .error .email = " common.required" ;
289
-
290
- if (isValidationOk) {
291
- this .focusElement (" email" );
292
- }
293
- isValidationOk = false ;
294
- }
295
-
296
- if (this .email && ! / ^ \S + @\S + $ / .test (this .email )) {
297
- this .error .email = " settings.email_format" ;
298
-
299
- if (isValidationOk) {
300
- this .focusElement (" email" );
301
- }
302
- isValidationOk = false ;
303
- }
304
-
305
- if (! this .userFullName ) {
306
- this .error .user_full_name = " common.required" ;
206
+ if (! this .host ) {
207
+ this .error .host = " common.required" ;
307
208
308
209
if (isValidationOk) {
309
- this .focusElement (" userFullName " );
210
+ this .focusElement (" host " );
310
211
}
311
212
isValidationOk = false ;
312
213
}
313
-
314
- if (! this .host ) {
315
- this .error .host = " common.required" ;
214
+ if (! this .PAPERLESS_ADMIN_PASSWORD ) {
215
+ this .error .PAPERLESS_ADMIN_PASSWORD = " common.required" ;
316
216
317
217
if (isValidationOk) {
318
- this .focusElement (" host " );
218
+ this .focusElement (" PAPERLESS_ADMIN_PASSWORD " );
319
219
}
320
220
isValidationOk = false ;
321
221
}
@@ -371,11 +271,6 @@ export default {
371
271
this .createModuleTaskForApp (this .instanceName , {
372
272
action: taskAction,
373
273
data: {
374
- paperless_name: this .paperlessName ,
375
- username: this .username ,
376
- password: this .password ,
377
- user_full_name: this .userFullName ,
378
- email: this .email ,
379
274
host: this .host ,
380
275
lets_encrypt: this .isLetsEncryptEnabled ,
381
276
http2https: this .isHttpToHttpsEnabled ,
0 commit comments