Skip to content

Commit

Permalink
Merge pull request #48 from NethServer/fixPlaceholder
Browse files Browse the repository at this point in the history
Update Settings.vue with NsTextInput component NethServer/dev#6788
  • Loading branch information
stephdl authored Dec 6, 2023
2 parents 776f6e4 + aa8c7c6 commit 5a69139
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion imageroot/actions/configure-module/validate-input.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"path": {
"type": "string",
"description": "web path for the web application, like '/sftpgo'",
"pattern": "^/?[a-zA-Z0-9_-]+/?$"
"pattern": "^/[a-zA-Z0-9_-]+"
},
"http2https": {
"type": "boolean",
Expand Down
2 changes: 1 addition & 1 deletion imageroot/actions/get-configuration/20read
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ configuration["hostname"] = agent.get_hostname()

# Read current configuration
configuration["sftp_tcp_port"] = int(os.environ.get("SFTP_TCP_PORT",3092))
configuration["path"] = os.environ.get("TRAEFIK_PATH",'/sftpgo')
configuration["path"] = os.environ.get("TRAEFIK_PATH",'')
configuration["http2https"] = os.environ.get("TRAEFIK_HTTP2HTTPS","False") == "True"
# test if sftpgo port is externally enabled
configuration["sftpgo_service"] = os.environ.get('SFTPGO_SERVICE', False) == "True"
Expand Down
2 changes: 1 addition & 1 deletion imageroot/actions/get-configuration/validate-output.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"path": {
"type": "string",
"description": "web path for the web application, like '/sftpgo'",
"pattern": "^/?[a-zA-Z0-9_-]+/?$"
"pattern": "^$|^/[a-zA-Z0-9_-]+"
},
"hostname": {
"description": "Host name of the node, like 'foo.domain.com'",
Expand Down
3 changes: 2 additions & 1 deletion ui/public/i18n/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@
"sftp_tcp_port_invalid_type": "The TCP port is not valid, it must be an integer in the range 1024-65535",
"tcp_port_already_used": "The TCP port is already used by another service",
"sftpgo_restrict_port_access": "SFTPGo external access",
"sftpgo_explanation_tooltips": "SFTPGo provides a user interface and a SFTP service for uploading your websites"
"sftpgo_explanation_tooltips": "SFTPGo provides a user interface and a SFTP service for uploading your websites",
"sftpgo_path_tips": "Enter a unique HTTP path, for example '/sftpgo'"
},
"about": {
"title": "About"
Expand Down
15 changes: 12 additions & 3 deletions ui/src/views/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,25 @@
<cv-tile :light="true">
<cv-form @submit.prevent="configureModule">
<template>
<cv-text-input
<NsTextInput
:label="$t('settings.sftpgo_path')"
placeholder="/sftpgo"
:placeholder="$t('common.eg_value', {value: '/sftpgo'})"
v-model.trim="path"
class="mg-bottom"
:invalid-message="$t(error.path)"
:disabled="loading.getConfiguration || loading.configureModule"
ref="path"
tooltipAlignment="center"
tooltipDirection="right"
>
</cv-text-input>
<template slot="tooltip">
<div
v-html="
$t('settings.sftpgo_path_tips')
"
></div>
</template>
</NsTextInput>
<NsTextInput
:label="$t('settings.sftp_tcp_port')"
:placeholder="$t('common.eg_value', {value: '3092'})"
Expand Down

0 comments on commit 5a69139

Please sign in to comment.