Skip to content

Commit

Permalink
feat: improve password information, add advanced according (#28)
Browse files Browse the repository at this point in the history
Password change behavior is now more explicit and should help users.

Co-authored-by: Giacomo Sanchietti <[email protected]>
  • Loading branch information
stephdl and gsanchietti authored Jun 19, 2024
1 parent 62622a7 commit 5d9b800
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 25 deletions.
7 changes: 5 additions & 2 deletions ui/public/i18n/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
},
"settings": {
"title": "Settings",
"advanced": "Advanced",
"configure_instance": "Configure {instance}",
"save": "Save",
"host": "Controller Fully Qualified Domain Name",
Expand All @@ -42,14 +43,16 @@
"network_helper": "The VPN network used to connect the units to the controller.",
"user_helper": "This is the only user that can create and manage other users inside the controller",
"user_tooltip": "The username grants access to the controller user interface and also to Grafana. Once configured, it cannot be changed",
"password_helper": "The administrator password can be set only if first configuration",
"password_helper": "The administrator password can be set only during first configuration",
"password_tooltip": "The password grants access both to the controller user interface and also to Grafana. For security reasons, you should change it after first login",
"host_helper": "The FQDN of the controller, it must be reachable from the units",
"cn_tooltip": "The field will be read-only after the first configuration",
"network_tooltip": "Make sure this network does not overlap with the units' networks. The field will be read-only after the first configuration",
"netmask_tooltip": "Do not change this value unless you know what you are doing. The field will be read-only after the first configuration",
"netmask_helper": "The netmask determines the size of the VPN network. Use only class C networks",
"password_placeholder": "Password already set, enter a new one to change it"
"password_placeholder": "Password can be modified from the controller webapp",
"password_information_title": "Default password",
"password_information_description": "The default administrator password is displayed only once, please store it in a safe place",
},
"about": {
"title": "About"
Expand Down
69 changes: 46 additions & 23 deletions ui/src/views/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@
<cv-column>
<cv-tile light>
<cv-form @submit.prevent="configureModule">
<NsTextInput :label="$t('settings.cn')" v-model="cn" :placeholder="$t('settings.cn')" :disabled="loading.getConfiguration ||
loading.configureModule ||
!firstConfig" :helper-text="$t('settings.cn_helper')" tooltipAlignment="end" tooltipDirection="right">
<template #tooltip>{{
$t("settings.cn_tooltip")
}}</template>
</NsTextInput>
<NsTextInput :label="$t('settings.network')" v-model="network" :placeholder="$t('settings.network')"
:disabled="loading.getConfiguration ||
loading.configureModule ||
Expand All @@ -40,35 +33,34 @@
$t("settings.netmask_tooltip")
}}</template>
</NsTextInput>

<div class="mg-top-xxlg">
<NsTextInput :label="$t('settings.user')" v-model="user" :placeholder="$t('settings.user')"
:disabled="loading.getConfiguration || loading.configureModule || !firstConfig" :invalid-message="error.user" ref="user"
:helper-text="$t('settings.user_helper')">
<template #tooltip>{{$t("settings.user_tooltip")}}</template>
</NsTextInput>
<cv-row v-if="firstConfig">
<cv-column>
<NsInlineNotification
class="mg-bottom-xlg"
kind="info"
:title="$t('settings.password_information_title')"
:description="
$t('settings.password_information_description')
"
:showCloseButton="false"
>
<NsButton></NsButton>
</NsInlineNotification>
</cv-column>
</cv-row>
<NsTextInput :label="$t('settings.password')" v-model="password"
:disabled="loading.getConfiguration || loading.configureModule || !firstConfig" :invalid-message="error.password"
:placeholder="passwordPlaceholder" ref="password" class="mg-bottom-xlg"
:helper-text="$t('settings.password_helper')">
<template #tooltip>{{$t("settings.password_tooltip")}}</template>
</NsTextInput>
</div>
<div class="mg-top-xxlg">
<NsTextInput v-model.trim="loki_retention" ref="loki_retention"
:invalid-message="$t(error.loki_retention)" type="number" :label="$t('settings.loki_retention')"
:helper-text="$t('settings.loki_retention_helper')
" :disabled="loading.configureModule
">
</NsTextInput>
<NsTextInput v-model.trim="prometheus_retention" ref="prometheus_retention"
:invalid-message="$t(error.prometheus_retention)" type="number"
:label="$t('settings.prometheus_retention')" :helper-text="$t('settings.prometheus_retention_helper')
" :disabled="loading.configureModule
">
</NsTextInput>
</div>

<div class="mg-top-xxlg">
<NsTextInput :label="$t('settings.host')" v-model="host" placeholder="controller.mydomain.org"
:disabled="loading.getConfiguration || loading.configureModule" :invalid-message="error.host" ref="host"
Expand All @@ -83,6 +75,34 @@
}}</template>
</cv-toggle>
</div>
<!-- advanced options -->
<cv-accordion ref="accordion" class="maxwidth mg-bottom">
<cv-accordion-item :open="toggleAccordion[0]">
<template slot="title">{{ $t("settings.advanced") }}</template>
<template slot="content">
<div class="mg-top-xxlg">
<NsTextInput :label="$t('settings.cn')" v-model="cn" :placeholder="$t('settings.cn')" :disabled="loading.getConfiguration ||
loading.configureModule ||
!firstConfig" :helper-text="$t('settings.cn_helper')" tooltipAlignment="end" tooltipDirection="right">
<template #tooltip>{{
$t("settings.cn_tooltip")
}}</template>
</NsTextInput>
<NsTextInput v-model.trim="loki_retention" ref="loki_retention"
:invalid-message="$t(error.loki_retention)" type="number" :label="$t('settings.loki_retention')"
:helper-text="$t('settings.loki_retention_helper')"
:disabled="loading.configureModule">
</NsTextInput>
<NsTextInput v-model.trim="prometheus_retention" ref="prometheus_retention"
:invalid-message="$t(error.prometheus_retention)" type="number"
:label="$t('settings.prometheus_retention')" :helper-text="$t('settings.prometheus_retention_helper')"
:disabled="loading.configureModule">
</NsTextInput>
</div>
</template>
</cv-accordion-item>
</cv-accordion>
<!-- end advanced options -->

<cv-row v-if="error.configureModule">
<cv-column>
Expand Down Expand Up @@ -408,4 +428,7 @@ export default {

<style scoped lang="scss">
@import "../styles/carbon-utils";
.mg-bottom {
margin-bottom: 2rem;
}
</style>

0 comments on commit 5d9b800

Please sign in to comment.