diff --git a/src/dashboard.py b/src/dashboard.py index 47b832e..cedfd05 100644 --- a/src/dashboard.py +++ b/src/dashboard.py @@ -1514,8 +1514,7 @@ def API_addPeers(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.") if not config.getStatus(): - return ResponseObject(False, - f"{configName} is not running, please turn on the configuration before adding peers.") + config.toggleConfiguration() if bulkAdd: if bulkAddAmount < 1: return ResponseObject(False, "Please specify amount of peers you want to add") diff --git a/src/static/app/src/components/configurationComponents/newPeersComponents/allowedIPsInput.vue b/src/static/app/src/components/configurationComponents/newPeersComponents/allowedIPsInput.vue index fdbca4b..a075414 100644 --- a/src/static/app/src/components/configurationComponents/newPeersComponents/allowedIPsInput.vue +++ b/src/static/app/src/components/configurationComponents/newPeersComponents/allowedIPsInput.vue @@ -14,7 +14,6 @@ export default { data(){ return { allowedIp: [], - availableIpSearchString: "", customAvailableIp: "", allowedIpFormatError: false @@ -45,7 +44,15 @@ export default { watch: { customAvailableIp(){ this.allowedIpFormatError = false; + }, + availableIp(){ + if (this.availableIp !== undefined && this.availableIp.length > 0){ + this.addAllowedIp(this.availableIp[0]) + } } + }, + mounted() { + } } @@ -57,11 +64,11 @@ export default {