Skip to content

Commit

Permalink
ui. added nethvoice password env
Browse files Browse the repository at this point in the history
  • Loading branch information
edospadoni committed Nov 21, 2023
1 parent 126eeb8 commit d7243c3
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 1 deletion.
1 change: 1 addition & 0 deletions imageroot/actions/configure-module/20setenvs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def getFromRequest(request, var_name, env_name, default = ""):
# NETHVOICE_HOST_LOCAL_NETWORKS should be a jason containing local networks [{"network":"192.168.5.0","netmask":"255.255.255.0","gateway":"192.168.5.1"}]
getFromRequest(request, 'nethvoice_host_local_networks', 'NETHVOICE_HOST_LOCAL_NETWORKS', '{[]}')
getFromRequest(request, 'nethvoice_host', 'NETHVOICE_HOST', '')
getFromRequest(request, 'nethvoice_admin_password', 'NETHVOICE_ADMIN_PASSWORD', '')
getFromRequest(request, 'subscription_systemid', 'SUBSCRIPTION_SYSTEMID', '')
getFromRequest(request, 'subscription_secret', 'SUBSCRIPTION_SECRET', '')
getFromRequest(request, 'nethcti_prefix', 'NETHCTI_PREFIX', '')
Expand Down
4 changes: 4 additions & 0 deletions imageroot/actions/configure-module/validate-input.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@
"type": "string",
"format": "hostname"
},
"nethvoice_admin_password": {
"description": "NethVoice admin password to access user interface",
"type": "string"
},
"nethcti_prefix": {
"description": "NethCTI Prefix",
"type": "string"
Expand Down
1 change: 1 addition & 0 deletions imageroot/actions/get-configuration/20read
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import agent

config = {
'nethvoice_host': os.getenv('NETHVOICE_HOST', ''),
'nethvoice_admin_password': os.getenv('NETHVOICE_ADMIN_PASSWORD', ''),
'nethcti_ui_host': os.getenv('NETHCTI_UI_HOST', ''),
'lets_encrypt': os.getenv('TRAEFIK_LETS_ENCRYPT') == 'True',
'user_domain': os.getenv('USER_DOMAIN', ''),
Expand Down
4 changes: 4 additions & 0 deletions imageroot/actions/get-configuration/validate-output.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
"description": "Host where nethvoice instance should be exposed to",
"type": "string"
},
"nethvoice_admin_password": {
"description": "NethVoice admin password to access user interface",
"type": "string"
},
"nethcti_ui_host": {
"description": "CTI host, must be different than nethvoice_host",
"type": "string"
Expand Down
1 change: 1 addition & 0 deletions imageroot/actions/restore-module/70configure_module
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ old_envs = request['environment']
# call configure module
response = agent.tasks.run(agent_id=os.environ['AGENT_ID'], action='configure-module', data={
"nethvoice_host": old_envs["NETHVOICE_HOST"],
"nethvoice_admin_password": old_envs["NETHVOICE_ADMIN_PASSWORD"],
"nethcti_ui_host": old_envs["NETHCTI_UI_HOST"],
"lets_encrypt": old_envs["TRAEFIK_LETS_ENCRYPT"] == 'true',
"reports_international_prefix": old_envs["REPORTS_INTERNATIONAL_PREFIX"],
Expand Down
1 change: 1 addition & 0 deletions ui/public/i18n/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"lets_encrypt": "Request Let's Encrypt certificate",
"nethcti_ui_host": "NethCTI UI base host",
"nethvoice_host": "NethVoice base host",
"nethvoice_admin_password": "NethVoice admin password to access user interface",
"save": "Save",
"title": "Settings",
"user_domain": "User Domain",
Expand Down
1 change: 1 addition & 0 deletions ui/public/i18n/it/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"lets_encrypt": "Richiedi certificato Let's Encrypt",
"nethcti_ui_host": "Host base di NethCTI",
"nethvoice_host": "Host base di NethVoice",
"nethvoice_admin_password": "Password di admin di NethVoice per accedere all'interfaccia",
"save": "Salva",
"title": "Impostazioni",
"user_domain": "Host Dominio Utenti",
Expand Down
2 changes: 1 addition & 1 deletion ui/public/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
],
"docs": {
"documentation_url": "https://github.com/nethesis/ns8-nethvoice",
"bug_url": "https://github.com/NethServer/dev",
"bug_url": "https://github.com/nethesis/dev",
"code_url": "https://github.com/nethesis/ns8-nethvoice"
},
"source": "ghcr.io/nethesis/nethvoice"
Expand Down
17 changes: 17 additions & 0 deletions ui/src/views/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@
:invalid-message="error.nethcti_ui_host"
ref="nethcti_ui_host"
/>
<cv-text-input
:label="$t('settings.nethvoice_admin_password')"
v-model="form.nethvoice_admin_password"
placeholder="Nethesis,1234"
:disabled="loadingState"
:invalid-message="error.nethvoice_admin_password"
ref="nethvoice_admin_password"
/>
<cv-toggle
:label="$t('settings.lets_encrypt')"
value="lets_encrypt"
Expand Down Expand Up @@ -122,6 +130,7 @@ export default {
urlCheckInterval: null,
form: {
nethvoice_host: "",
nethvoice_admin_password: "",
nethcti_ui_host: "",
lets_encrypt: false,
user_domain: "",
Expand All @@ -137,6 +146,7 @@ export default {
getConfiguration: "",
configureModule: "",
nethvoice_host: "",
nethvoice_admin_password: "",
nethcti_ui_host: "",
lets_encrypt: "",
user_domain: "",
Expand Down Expand Up @@ -213,6 +223,7 @@ export default {
const config = taskResult.output;

this.form.nethvoice_host = config.nethvoice_host;
this.form.nethvoice_admin_password = config.nethvoice_admin_password;
this.form.nethcti_ui_host = config.nethcti_ui_host;
this.form.lets_encrypt = config.lets_encrypt;
this.form.user_domain = config.user_domain;
Expand All @@ -232,6 +243,11 @@ export default {
isValidationOk = false;
}

if (!this.form.nethvoice_admin_password) {
this.error.nethvoice_admin_password = this.$t("error.required");
isValidationOk = false;
}

if (!this.form.nethcti_ui_host) {
this.error.nethcti_ui_host = this.$t("error.required");
isValidationOk = false;
Expand Down Expand Up @@ -299,6 +315,7 @@ export default {
action: taskAction,
data: {
nethvoice_host: this.form.nethvoice_host,
nethvoice_admin_password: this.form.nethvoice_admin_password,
nethcti_ui_host: this.form.nethcti_ui_host,
lets_encrypt: this.form.lets_encrypt,
user_domain: this.form.user_domain,
Expand Down

0 comments on commit d7243c3

Please sign in to comment.