Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions src/components/standalone/ssh/SshConfig.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type SshConfigResponse = {
PasswordAuth: string
RootPasswordAuth: string
GatewayPorts: string
'.name': string
}
]
}
Expand All @@ -58,7 +59,7 @@ function submit() {
submitting.value = true
ubusCall('uci', 'set', {
config: 'dropbear',
section: '@dropbear[0]',
section: 'dropbear.main',
values: {
Port: port.value,
PasswordAuth: passwordAuth.value ? 'on' : 'off',
Expand Down Expand Up @@ -96,10 +97,15 @@ function load() {
loading.value = true
getUciConfig('dropbear')
.then((response: SshConfigResponse) => {
port.value = response.dropbear[0].Port
passwordAuth.value = response.dropbear[0].PasswordAuth == 'on'
rootPasswordAuth.value = response.dropbear[0].RootPasswordAuth == 'on'
gatewayPorts.value = response.dropbear[0].GatewayPorts == 'on'
const mainConfig = response.dropbear.find((config) => config['.name'] === 'main')
if (mainConfig) {
port.value = mainConfig.Port
passwordAuth.value = mainConfig.PasswordAuth == 'on'
rootPasswordAuth.value = mainConfig.RootPasswordAuth == 'on'
gatewayPorts.value = mainConfig.GatewayPorts == 'on'
} else {
error.value = new Error(t('standalone.ssh.ssh_access.main_config_not_found'))
}
})
.catch((exception: AxiosError) => {
error.value = new Error(getAxiosErrorMessage(exception))
Expand Down
3 changes: 2 additions & 1 deletion src/i18n/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,8 @@
"allow_remote_host_connection": "Allow remote hosts to connect to local SSH forwarded ports",
"tcp_port_too_low": "TCP port must be greater than 1",
"tcp_port_too_high": "TCP port must be less than 65535",
"tcp_port_invalid": "TCP port is invalid"
"tcp_port_invalid": "TCP port is invalid",
"ssh_access.main_config_not_found": "Default SSH configuration not found"
},
"ssh_keys": {
"description": "Public keys allow for passwordless SSH logins with a higher security compared to the use of plain passwords",
Expand Down
Loading