работающая генерация настроек

This commit is contained in:
2025-01-10 18:10:14 +03:00
parent 44aec3a114
commit a7242c186d
12 changed files with 570 additions and 450 deletions

View File

@@ -1,3 +1,26 @@
{% if 'tcpaccel' in params.paramGroupsList %}
submitTcpaccelSettings() {
if (this.submitStatus.tcpAccel) { return }
this.submitStatus.tcpAccel = true
fetch('/api/set/tcpAccel', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
"tcpAccel.en": this.param.tcpAccel.en,
"tcpAccel.maxConnections": this.param.tcpAccel.maxConnections
})
}).then(async (resp) => {
this.submitStatus.tcpAccel = false
this.updateNetworkSettings(await resp.json())
}).catch((reason) => {
this.submitStatus.tcpAccel = false
alert(`Ошибка при применении настроек: ${reason}`)
})
},
updateTcpaccelSettings(vals) { console.log('tcp accel setting update function has no impl! update backend and write this function') }
{% endif %}
settingsSubmitQoS() {
if (this.submitStatus.qos) { return }
this.submitStatus.qos = true
@@ -70,29 +93,6 @@
})
},
{% if 'tcpaccel' in params.groupsList %}
settingsSubmitTcpAccel() {
if (this.submitStatus.tcpAccel) { return }
this.submitStatus.tcpAccel = true
fetch('/api/set/tcpAccel', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
"tcpAccel.en": this.param.tcpAccel.en,
"tcpAccel.maxConnections": this.param.tcpAccel.maxConnections
})
}).then(async (resp) => {
this.submitStatus.tcpAccel = false
this.updateNetworkSettings(await resp.json())
}).catch((reason) => {
this.submitStatus.tcpAccel = false
alert(`Ошибка при применении настроек: ${reason}`)
})
},
{% endif %}
updateQosSettings(vals) {
this.submitStatus.qos = false
this.paramsQos.en = vals["settings"]["qos.enabled"]
@@ -240,4 +240,5 @@
}
return result
},
},