Skip to content

Commit bd306d0

Browse files
authored
Merge pull request #21 from compgeniuses/UI
2 parents de443e6 + bc445f9 commit bd306d0

File tree

3 files changed

+48
-128
lines changed

3 files changed

+48
-128
lines changed

ui/public/metadata.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "paperless",
33
"description": {
4-
"en": "PAperless ngx"
4+
"en": "Paperless ngx"
55
},
6-
"categories": [],
6+
"categories": ["collaboration"],
77
"authors": [
88
{
9-
"name": "MArtin Bhuong",
9+
"name": "Martin Bhuong",
1010
"email": "martin@genius.ke"
1111
}
1212
],

ui/src/views/Settings.vue

Lines changed: 20 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -20,66 +20,25 @@
2020
<cv-tile :light="true">
2121
<cv-form @submit.prevent="configureModule">
2222
<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"
2526
class="mg-bottom"
26-
:invalid-message="$t(error.paperless_name)"
27+
:invalid-message="$t(error.host)"
2728
:disabled="loading.getConfiguration || loading.configureModule"
28-
ref="paperless"
29+
ref="host"
2930
>
3031
</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"
7736
class="mg-bottom"
7837
:invalid-message="$t(error.host)"
7938
:disabled="loading.getConfiguration || loading.configureModule"
80-
ref="host"
39+
ref="PAPERLESS_ADMIN_PASSWORD"
8140
>
82-
</cv-text-input> -->
41+
</cv-password-input>
8342
<cv-toggle
8443
value="letsEncrypt"
8544
:label="$t('settings.lets_encrypt')"
@@ -154,11 +113,6 @@ export default {
154113
page: "settings",
155114
},
156115
urlCheckInterval: null,
157-
paperless: "",
158-
username: "",
159-
password: "",
160-
email: "",
161-
userFullName: "",
162116
host: "",
163117
isLetsEncryptEnabled: false,
164118
isHttpToHttpsEnabled: false,
@@ -169,12 +123,8 @@ export default {
169123
error: {
170124
getConfiguration: "",
171125
configureModule: "",
172-
paperless: "",
173-
username: "",
174-
password: "",
175-
user_full_name: "",
176-
email: "",
177126
host: "",
127+
PAPERLESS_ADMIN_PASSWORD: "",
178128
lets_encrypt: "",
179129
http2https: "",
180130
},
@@ -241,81 +191,31 @@ export default {
241191
},
242192
getConfigurationCompleted(taskContext, taskResult) {
243193
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;
249194
this.host = config.host;
195+
this.PAPERLESS_ADMIN_PASSWORD = config.PAPERLESS_ADMIN_PASSWORD;
250196
this.isLetsEncryptEnabled = config.lets_encrypt;
251197
this.isHttpToHttpsEnabled = config.http2https;
252198
this.loading.getConfiguration = false;
253-
this.focusElement("paperlessName");
199+
this.focusElement("host");
254200
},
255201
validateConfigureModule() {
256202
this.clearErrors(this);
257203
258204
let isValidationOk = true;
259205
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";
307208
308209
if (isValidationOk) {
309-
this.focusElement("userFullName");
210+
this.focusElement("host");
310211
}
311212
isValidationOk = false;
312213
}
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";
316216
317217
if (isValidationOk) {
318-
this.focusElement("host");
218+
this.focusElement("PAPERLESS_ADMIN_PASSWORD");
319219
}
320220
isValidationOk = false;
321221
}
@@ -371,11 +271,6 @@ export default {
371271
this.createModuleTaskForApp(this.instanceName, {
372272
action: taskAction,
373273
data: {
374-
paperless_name: this.paperlessName,
375-
username: this.username,
376-
password: this.password,
377-
user_full_name: this.userFullName,
378-
email: this.email,
379274
host: this.host,
380275
lets_encrypt: this.isLetsEncryptEnabled,
381276
http2https: this.isHttpToHttpsEnabled,

ui/src/views/Status.vue

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,27 @@
4040
</cv-column>
4141
</cv-row>
4242
<cv-row>
43+
<template v-if="host">
44+
<cv-column :md="4" :max="4">
45+
<NsInfoCard
46+
light
47+
:title="$t('status.paperless_url')"
48+
:icon="Settings32"
49+
:loading="loading.getStatus"
50+
class="min-height-card"
51+
>
52+
<template slot="content">
53+
<div class="card-rows">
54+
<div class="card-row">
55+
<NsButton kind="ghost" :icon="Launch20" @click="goToPaperless">
56+
{{ $t("status.open_paperless_page") }}
57+
</NsButton>
58+
</div>
59+
</div>
60+
</template>
61+
</NsInfoCard>
62+
</cv-column>
63+
</template>
4364
<cv-column :md="4" :max="4">
4465
<NsInfoCard
4566
light
@@ -346,6 +367,10 @@ export default {
346367
this.getStatus();
347368
this.listBackupRepositories();
348369
},
370+
methods: {
371+
goToMattermost() {
372+
window.open('http://' + this.host);
373+
},
349374
methods: {
350375
async getStatus() {
351376
this.loading.getStatus = true;

0 commit comments

Comments
 (0)