mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-07-05 20:56:57 +00:00
Still working on translating....
This commit is contained in:
parent
94bf1c2484
commit
8534e8cf5b
@ -966,19 +966,19 @@ class Peer:
|
||||
list(filter(lambda k: k.id != self.id, self.configuration.getPeersList()))))) for item in row]
|
||||
|
||||
if allowed_ip in existingAllowedIps:
|
||||
return ResponseObject(False, "Allowed IP already taken by another peer.")
|
||||
return ResponseObject(False, "Allowed IP already taken by another peer")
|
||||
if not _checkIPWithRange(endpoint_allowed_ip):
|
||||
return ResponseObject(False, f"Endpoint Allowed IPs format is incorrect.")
|
||||
return ResponseObject(False, f"Endpoint Allowed IPs format is incorrect")
|
||||
if len(dns_addresses) > 0 and not _checkDNS(dns_addresses):
|
||||
return ResponseObject(False, f"DNS format is incorrect.")
|
||||
return ResponseObject(False, f"DNS format is incorrect")
|
||||
if mtu < 0 or mtu > 1460:
|
||||
return ResponseObject(False, "MTU format is not correct.")
|
||||
return ResponseObject(False, "MTU format is not correct")
|
||||
if keepalive < 0:
|
||||
return ResponseObject(False, "Persistent Keepalive format is not correct.")
|
||||
return ResponseObject(False, "Persistent Keepalive format is not correct")
|
||||
if len(private_key) > 0:
|
||||
pubKey = _generatePublicKey(private_key)
|
||||
if not pubKey[0] or pubKey[1] != self.id:
|
||||
return ResponseObject(False, "Private key does not match with the public key.")
|
||||
return ResponseObject(False, "Private key does not match with the public key")
|
||||
try:
|
||||
if len(preshared_key) > 0:
|
||||
rd = random.Random()
|
||||
@ -1805,7 +1805,7 @@ def API_addPeers(configName):
|
||||
if configName in WireguardConfigurations.keys():
|
||||
config = WireguardConfigurations.get(configName)
|
||||
if (not bulkAdd and (len(public_key) == 0 or len(allowed_ips) == 0)) or len(endpoint_allowed_ip) == 0:
|
||||
return ResponseObject(False, "Please fill in all required box.")
|
||||
return ResponseObject(False, "Please fill in all required box")
|
||||
if not config.getStatus():
|
||||
config.toggleConfiguration()
|
||||
|
||||
@ -1814,7 +1814,6 @@ def API_addPeers(configName):
|
||||
if bulkAdd:
|
||||
if bulkAddAmount < 1:
|
||||
return ResponseObject(False, "Please specify amount of peers you want to add")
|
||||
|
||||
if not availableIps[0]:
|
||||
return ResponseObject(False, "No more available IP can assign")
|
||||
if bulkAddAmount > len(availableIps[1]):
|
||||
@ -1845,7 +1844,7 @@ def API_addPeers(configName):
|
||||
|
||||
else:
|
||||
if config.searchPeer(public_key)[0] is True:
|
||||
return ResponseObject(False, f"This peer already exist.")
|
||||
return ResponseObject(False, f"This peer already exist")
|
||||
name = data['name']
|
||||
private_key = data['private_key']
|
||||
|
||||
|
@ -62,7 +62,7 @@ export default {
|
||||
fetchPost("/api/addPeers/" + this.$route.params.id, this.data, (res) => {
|
||||
if (res.status){
|
||||
this.$router.push(`/configuration/${this.$route.params.id}/peers`)
|
||||
this.dashboardStore.newMessage("Server", "Peer create successfully", "success")
|
||||
this.dashboardStore.newMessage("Server", "Peer created successfully", "success")
|
||||
}else{
|
||||
this.dashboardStore.newMessage("Server", res.message, "danger")
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ export default {
|
||||
fetchPost(`/api/updatePeerSettings/${this.$route.params.id}`, this.data, (res) => {
|
||||
this.saving = false;
|
||||
if (res.status){
|
||||
this.dashboardConfigurationStore.newMessage("Server", "Peer Updated!", "success")
|
||||
this.dashboardConfigurationStore.newMessage("Server", "Peer saved", "success")
|
||||
}else{
|
||||
this.dashboardConfigurationStore.newMessage("Server", res.message, "danger")
|
||||
}
|
||||
|
@ -176,5 +176,19 @@
|
||||
"FROM ": "来自 ",
|
||||
"(.*) is on": "$1 已启用",
|
||||
"(.*) is off": "$1 已停用",
|
||||
"Allowed IPs is invalid": "允许的 IP 地址错误"
|
||||
"Allowed IPs is invalid": "允许的 IP 地址错误",
|
||||
"Peer created successfully": "成功创建端点",
|
||||
"Please fill in all required box": "请填写所有必填项",
|
||||
"Please specify amount of peers you want to add": "请提供批量添加端点的数量",
|
||||
"No more available IP can assign": "没有更多可用的 IP 可以分配了",
|
||||
"The maximum number of peers can add is (.*)": "最多只能添加$1个端点",
|
||||
"Generating key pairs by bulk failed": "生成公钥秘钥失败了",
|
||||
"Failed to add peers in bulk": "批量创建端点失败",
|
||||
"This peer already exist": "此端点已存在",
|
||||
"This IP is not available: (.*)": "此 IP 地址不可用:$1",
|
||||
"Configuration does not exist": "此配置不存在",
|
||||
"Please provide a valid configuration name": "请提供一个正确的配置名称",
|
||||
"Peer saved": "端点保存成功",
|
||||
"Allowed IP already taken by another peer": "允许的 IP 地址已被其他端点使用",
|
||||
"Endpoint Allowed IPs format is incorrect": ""
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user