optimize code

Signed-off-by: xiaohui.xie <xiexiaohui15@h-partners.com>
This commit is contained in:
xiaohui.xie 2024-08-06 20:50:53 +08:00
parent f689ae0e77
commit 1756f88550
20 changed files with 37 additions and 38 deletions

View File

@ -274,15 +274,6 @@ export default struct IpsecVpnEdit {
this.onNonNullableParamChange();
}
})
TextWithInput({
title: $r('app.string.vpn_edit_ipsecidentifier'),
inputPlaceholder: $r('app.string.vpn_edit_unuse'),
inputText: this.vpnConfig.ipsecIdentifier,
onChange: (value: string) => {
this.vpnConfig.ipsecIdentifier = value.trim();
this.onNonNullableParamChange();
}
}).visibility(this.ipsecIdentifierVisibility)
TextWithInput({
title: $r('app.string.vpn_edit_l2tpsecret'),
inputPlaceholder: $r('app.string.vpn_edit_unuse'),
@ -294,8 +285,16 @@ export default struct IpsecVpnEdit {
}
}).visibility(this.l2tpSecretVisibility)
TextWithInput({
title: $r('app.string.vpn_edit_ipsecsecret'),
title: $r('app.string.vpn_edit_ipsecidentifier'),
inputPlaceholder: $r('app.string.vpn_edit_unuse'),
inputText: this.vpnConfig.ipsecIdentifier,
onChange: (value: string) => {
this.vpnConfig.ipsecIdentifier = value.trim();
this.onNonNullableParamChange();
}
}).visibility(this.ipsecIdentifierVisibility)
TextWithInput({
title: $r('app.string.vpn_edit_ipsecsecret'),
inputText: this.vpnConfig.ipsecPreSharedKey,
inputType: INPUT_TYPE_PWD,
onChange: (value: string) => {

View File

@ -1609,7 +1609,7 @@
},
{
"name": "vpn_edit_usercert",
"value": "IPSec 用户证书公钥"
"value": "IPSec 用户证书"
},
{
"name": "vpn_edit_user_private_cert",
@ -1621,15 +1621,15 @@
},
{
"name": "vpn_edit_servercert",
"value": "IPSec 服务器证书公钥"
"value": "IPSec 服务器证书"
},
{
"name": "vpn_edit_server_private_cert",
"value": "IPSec 服务器秘钥证书私钥"
"value": "IPSec 服务器证书私钥"
},
{
"name": "vpn_edit_unuse",
"value": "未使用"
"value": "(未使用)"
},
{
"name": "vpn_edit_advanced",

View File

@ -1595,23 +1595,23 @@
},
{
"name": "vpn_edit_usercert",
"value": "IPSec User Certificate Public Key"
"value": "IPSec user certificate"
},
{
"name": "vpn_edit_user_private_cert",
"value": "IPSec User Certificate Private Key"
"value": "IPSec user certificate private key"
},
{
"name": "vpn_edit_cacert",
"value": "IPSec CA Certificate"
"value": "IPSec CA certificate"
},
{
"name": "vpn_edit_servercert",
"value": "IPSec Server Certificate Public Key"
"value": "IPSec server certificate"
},
{
"name": "vpn_edit_server_private_cert",
"value": "IPSec Server Certificate Private Key"
"value": "IPSec server certificate private key"
},
{
"name": "vpn_edit_unuse",

View File

@ -13,7 +13,7 @@ charon {
filelog {
charon {
# path to the log file, specify this as section name in versions prior to 5.7.0
path = /data/service/el1/public/netmanager/charon.log
path = /data/service/el1/public/vpn/charon.log
# add a timestamp prefix
time_format = %b %e %T
# prepend connection name, simplifies grepping

View File

@ -17,7 +17,7 @@ charon {
filelog {
charon {
# path to the log file, specify this as section name in versions prior to 5.7.0
path = /data/service/el1/public/netmanager/charon.log
path = /data/service/el1/public/vpn/charon.log
# add a timestamp prefix
time_format = %b %e %T
# prepend connection name, simplifies grepping

View File

@ -13,7 +13,7 @@ charon {
filelog {
charon {
# path to the log file, specify this as section name in versions prior to 5.7.0
path = /data/service/el1/public/netmanager/charon.log
path = /data/service/el1/public/vpn/charon.log
# add a timestamp prefix
time_format = %b %e %T
# prepend connection name, simplifies grepping

View File

@ -4,7 +4,7 @@ connections {
vips = 0.0.0.0
local {
auth = pubkey
certs = /data/service/el1/public/netmanager/client.cert.pem
certs = /data/service/el1/public/vpn/client.cert.pem
id = vpn_ipsec_identifier_value
}
remote {

View File

@ -13,7 +13,7 @@ charon {
filelog {
charon {
# path to the log file, specify this as section name in versions prior to 5.7.0
path = /data/service/el1/public/netmanager/charon.log
path = /data/service/el1/public/vpn/charon.log
# add a timestamp prefix
time_format = %b %e %T
# prepend connection name, simplifies grepping

View File

@ -21,7 +21,7 @@ install_routes_xfrmi = yes
filelog {
charon {
# path to the log file, specify this as section name in versions prior to 5.7.0
path = /data/service/el1/public/netmanager/charon.log
path = /data/service/el1/public/vpn/charon.log
# add a timestamp prefix
time_format = %b %e %T
# prepend connection name, simplifies grepping

View File

@ -15,7 +15,7 @@ i_dont_care_about_security_and_use_aggressive_mode_psk = yes
filelog {
charon {
# path to the log file, specify this as section name in versions prior to 5.7.0
path = /data/service/el1/public/netmanager/charon.log
path = /data/service/el1/public/vpn/charon.log
# add a timestamp prefix
time_format = %b %e %T
# prepend connection name, simplifies grepping

View File

@ -4,7 +4,7 @@ connections {
vips = 0.0.0.0
local {
auth = pubkey
certs = /data/service/el1/public/netmanager/client.cert.pem
certs = /data/service/el1/public/vpn/client.cert.pem
id = vpn_username_value
}
local-xauth {

View File

@ -4,7 +4,7 @@ refuse-eap
require-mschap-v2
noccp
noauth
logfile /data/service/el1/public/netmanager/xl2tpd.log
logfile /data/service/el1/public/vpn/xl2tpd.log
idle 1800
mtu 1410
mru 1410

View File

@ -15,7 +15,7 @@ charon {
filelog {
charon {
# path to the log file, specify this as section name in versions prior to 5.7.0
path = /data/service/el1/public/netmanager/charon.log
path = /data/service/el1/public/vpn/charon.log
# add a timestamp prefix
time_format = %b %e %T
# prepend connection name, simplifies grepping

View File

@ -2,5 +2,5 @@
; set this to the ip address of your vpn server
lns = vpn_address_value
ppp debug = yes
pppoptfile = /data/service/el1/public/netmanager/options.l2tpd.client.conf
pppoptfile = /data/service/el1/public/vpn/options.l2tpd.client.conf
length bit = yes

View File

@ -21,7 +21,7 @@ conn home
esp = aes256-sha2_384
keyexchange=ikev1
authby=pubkey
leftcert=/data/service/el1/public/netmanager/client.cert.pem
leftcert=/data/service/el1/public/vpn/client.cert.pem
leftid=192.168.1.11
leftprotoport=udp/l2tp
keyingtries=1

View File

@ -1,2 +1,2 @@
# ipsec.secrets - strongSwan IPsec secrets file
: RSA /data/service/el1/public/netmanager/client.key.pem
: RSA /data/service/el1/public/vpn/client.key.pem

View File

@ -4,7 +4,7 @@ refuse-eap
require-mschap-v2
noccp
noauth
logfile /data/service/el1/public/netmanager/xl2tpd.log
logfile /data/service/el1/public/vpn/xl2tpd.log
idle 1800
mtu 1410
mru 1410

View File

@ -16,7 +16,7 @@ charon {
filelog {
charon {
# path to the log file, specify this as section name in versions prior to 5.7.0
path = /data/service/el1/public/netmanager/charon.log
path = /data/service/el1/public/vpn/charon.log
# add a timestamp prefix
time_format = %b %e %T
# prepend connection name, simplifies grepping

View File

@ -2,5 +2,5 @@
; set this to the ip address of your vpn server
lns = vpn_address_value
ppp debug = yes
pppoptfile = /data/service/el1/public/netmanager/options.l2tpd.client.conf
pppoptfile = /data/service/el1/public/vpn/options.l2tpd.client.conf
length bit = yes

View File

@ -1598,7 +1598,7 @@
},
{
"name": "vpn_edit_usercert",
"value": "IPSec 用户证书公钥"
"value": "IPSec 用户证书"
},
{
"name": "vpn_edit_user_private_cert",
@ -1610,7 +1610,7 @@
},
{
"name": "vpn_edit_servercert",
"value": "IPSec 服务器证书公钥"
"value": "IPSec 服务器证书"
},
{
"name": "vpn_edit_server_private_cert",
@ -1618,7 +1618,7 @@
},
{
"name": "vpn_edit_unuse",
"value": "未使用"
"value": "(未使用)"
},
{
"name": "vpn_edit_advanced",