Skip to content

Commit

Permalink
implement UI elements
Browse files Browse the repository at this point in the history
  • Loading branch information
compgeniuses committed Feb 2, 2024
1 parent 47eef0e commit 6e0ab94
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 60 deletions.
5 changes: 2 additions & 3 deletions ui/public/i18n/de/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
"validation_error": "Überprüfungsfehler"
},
"settings": {
"paperless_fqdn": "Paperless FQDN",
"paperless_admin": "Paperless Admin",
"paperless_admin_password": "Paperless admin password",
"vaultwarden": "Paperless FQDN",
"admin_token": "Paperless admin password",
"test_field": "Testfeld",
"configure_instance": "Konfiguriere {instance}",
"lets_encrypt": "Lets Encrypt",
Expand Down
9 changes: 4 additions & 5 deletions ui/public/i18n/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@
"no_services": "No services",
"no_images": "No images",
"no_volumes": "No volumes",
"paperless_url": "Paperless URL",
"open_paperless_page": "Go to Paperless"
"vaultwarden_url": "vaultwarden URL",
"open_vaultwarden_page": "Go to vaultwarden"
},
"settings": {
"title": "Settings",
"paperless_fqdn": "Paperless FQDN",
"paperless_admin": "Paperless Admin",
"paperless_admin_password": "Paperless admin password",
"vaultwarden_fqdn": "vaultwarden FQDN",
"admin_token": "vaultwarden admin token",
"configure_instance": "Configure {instance}",
"lets_encrypt": "Lets Encrypt",
"disabled": "Disabled",
Expand Down
9 changes: 4 additions & 5 deletions ui/public/i18n/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
"validation_error": "Error de validación"
},
"settings": {
"settings.paperless_fqdn": "Paperless FQDN",
"settings.paperless_admin": "Paperless Admin",
"settings.paperless_admin_password": "Paperless admin password",
"settings.vaultwarden_fqdn": "vaultwarden FQDN",
"settings.admin_token": "vaultwarden admin toekn",
"test_field": "Campo de prueba",
"configure_instance": "Configurar {instance}",
"lets_encrypt": "Lets Encrypt",
Expand Down Expand Up @@ -44,8 +43,8 @@
"installation_node": "Nodo de instalación",
"node": "Nodo",
"no_volumes": "Sin volúmenes",
"status.paperless_url": "Paperless URL",
"status.open_paperless_page": "Go to Paperless"
"status.vaultwarden_url": "vaultwarden URL",
"status.open_vaultwarden_page": "Go to vaultwarden"
},
"about": {
"title": "Acerca de"
Expand Down
9 changes: 4 additions & 5 deletions ui/public/i18n/eu/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@
"no_services": "No services",
"no_images": "No images",
"no_volumes": "No volumes",
"paperless_url": "Paperless URL",
"open_paperless_page": "Go to Paperless"
"vaultwarden_url": "vaultwarden URL",
"open_vaultwarden_page": "Go to vaultwarden"
},
"settings": {
"title": "Settings",
"paperless_fqdn": "Paperless FQDN",
"paperless_admin": "Paperless Admin",
"paperless_admin_password": "Paperless admin password",
"vaultwarden_fqdn": "vaultwarden FQDN",
"admin_token": "vaultwarden admin password",
"configure_instance": "Configure {instance}",
"lets_encrypt": "Lets Encrypt",
"disabled": "Disabled",
Expand Down
9 changes: 4 additions & 5 deletions ui/public/i18n/it/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@
"app_volumes": "Volume app|Volumi app",
"installation_node": "Nodo",
"mount": "Percorso di mount",
"paperless_url": "Paperless URL",
"open_paperless_page": "Go to Paperless"
"vaultwarden_url": "vaultwarden URL",
"open_vaultwarden_page": "Go to vaultwarden"
},
"settings": {
"paperless_fqdn": "Paperless FQDN",
"paperless_admin": "Paperless Admin",
"paperless_admin_password": "Paperless admin password",
"vaultwarden_fqdn": "vaultwarden FQDN",
"admin_token": "vaultwarden admin password",
"save": "Salva",
"title": "Impostazioni",
"configure_instance": "Configura {instance}",
Expand Down
47 changes: 14 additions & 33 deletions ui/src/views/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,34 +20,26 @@
<cv-tile :light="true">
<cv-form @submit.prevent="configureModule">
<cv-text-input
:label="$t('settings.paperless_fqdn')"
placeholder="paperless.example.org"
:label="$t('settings.vaultwarden_fqdn')"
placeholder="vaultwarden.example.org"
v-model.trim="host"
class="mg-bottom"
:invalid-message="$t(error.host)"
:disabled="loading.getConfiguration || loading.configureModule"
ref="host"
>
</cv-text-input>
<cv-text-input
:label="$t('settings.paperless_admin')"
placeholder="paperlessadmin"
v-model="PAPERLESS_ADMIN_USER"
class="mg-bottom"
:invalid-message="$t(error.PAPERLESS_ADMIN_USER)"
:disabled="loading.getConfiguration || loading.configureModule"
ref="PAPERLESS_ADMIN_USER"
>

</cv-text-input>
<cv-text-input
:label="$t('settings.paperless_admin_password')"
:label="$t('settings.admin_token')"
placeholder="P@perle5$"
v-model="PAPERLESS_ADMIN_PASSWORD"
v-model="ADMIN_TOKEN"
class="mg-bottom"
:invalid-message="$t(error.PAPERLESS_ADMIN_PASSWORD)"
:invalid-message="$t(error.ADMIN_TOKEN)"
:disabled="loading.getConfiguration || loading.configureModule"
type="password"
ref="PAPERLESS_ADMIN_PASSWORD"
ref="ADMIN_TOKEN"
>
</cv-text-input>
<cv-toggle
Expand Down Expand Up @@ -125,8 +117,7 @@ export default {
},
urlCheckInterval: null,
host: "",
PAPERLESS_ADMIN_USER: "",
PAPERLESS_ADMIN_PASSWORD: "",
ADMIN_TOKEN: "",
isLetsEncryptEnabled: false,
isHttpToHttpsEnabled: false,
loading: {
Expand All @@ -137,8 +128,7 @@ export default {
getConfiguration: "",
configureModule: "",
host: "",
PAPERLESS_ADMIN_USER: "",
PAPERLESS_ADMIN_PASSWORD: "",
ADMIN_TOKEN: "",
lets_encrypt: "",
http2https: "",
},
Expand Down Expand Up @@ -206,8 +196,7 @@ export default {
getConfigurationCompleted(taskContext, taskResult) {
const config = taskResult.output;
this.host = config.host;
this.PAPERLESS_ADMIN_USER = config.PAPERLESS_ADMIN_USER;
this.PAPERLESS_ADMIN_PASSWORD = config.PAPERLESS_ADMIN_PASSWORD;
this.ADMIN_TOKEN = config.ADMIN_TOKEN;
this.isLetsEncryptEnabled = config.lets_encrypt;
this.isHttpToHttpsEnabled = config.http2https;
this.loading.getConfiguration = false;
Expand All @@ -226,19 +215,12 @@ export default {
}
isValidationOk = false;
}
if (!this.PAPERLESS_ADMIN_USER) {
this.error.PAPERLESS_ADMIN_USER = "common.required";
if (isValidationOk) {
this.focusElement("PAPERLESS_ADMIN_USER");
}
isValidationOk = false;
}
if (!this.PAPERLESS_ADMIN_PASSWORD) {
this.error.PAPERLESS_ADMIN_PASSWORD = "common.required";
if (!this.ADMIN_TOKEN) {
this.error.ADMIN_TOKEN = "common.required";
if (isValidationOk) {
this.focusElement("PAPERLESS_ADMIN_PASSWORD");
this.focusElement("ADMIN_TOKEN");
}
isValidationOk = false;
}
Expand Down Expand Up @@ -295,8 +277,7 @@ export default {
action: taskAction,
data: {
host: this.host,
PAPERLESS_ADMIN_USER: this.PAPERLESS_ADMIN_USER,
PAPERLESS_ADMIN_PASSWORD: this.PAPERLESS_ADMIN_PASSWORD,
ADMIN_TOKEN: this.ADMIN_TOKEND,
lets_encrypt: this.isLetsEncryptEnabled,
http2https: this.isHttpToHttpsEnabled,
},
Expand Down
8 changes: 4 additions & 4 deletions ui/src/views/Status.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@
<cv-column :md="4" :max="4">
<NsInfoCard
light
:title="$t('status.paperless_url')"
:title="$t('status.vaultwarden_url')"
:icon="Settings32"
:loading="loading.getStatus"
class="min-height-card"
>
<template slot="content">
<div class="card-rows">
<div class="card-row">
<NsButton kind="ghost" :icon="Launch20" @click="goToPaperless">
{{ $t("status.open_paperless_page") }}
<NsButton kind="ghost" :icon="Launch20" @click="goToVaultwarden">
{{ $t("status.open_vaultwarden_page") }}
</NsButton>
</div>
</div>
Expand Down Expand Up @@ -360,7 +360,7 @@ export default {
this.getConfiguration();
},
methods: {
goToPaperless() {
goToVaultwarden() {
window.open('http://' + this.host);
},
async getConfiguration() {
Expand Down

0 comments on commit 6e0ab94

Please sign in to comment.