генератор фронта завершен

This commit is contained in:
2025-01-14 17:42:38 +03:00
parent 25a3b11ba8
commit 5a94f9a4fd
7 changed files with 310 additions and 269 deletions

View File

@@ -1,55 +1,3 @@
settingsSubmitNetwork() {
if (this.submitStatus.network) { return }
let query = {
"network.managementIp": this.param.network.managementIp,
"network.managementGateway": this.param.network.managementGateway,
"network.mode": this.param.network.mode,
"network.dataIp": this.param.network.dataIp,
"network.dataMtu": this.param.network.dataMtu
}
if (confirm('Вы уверены, что хотите сохранить настройки сети? После этого модем может стать недоступным.')) {
this.submitStatus.network = true
fetch('/api/set/network', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(query)
}).then(async (resp) => {
this.submitStatus.network = false
this.updateNetworkSettings(await resp.json())
}).catch((reason) => {
this.submitStatus.network = false
alert(`Ошибка при применении настроек: ${reason}`)
})
}
},
settingsSubmitDebugSend() {
if (this.submitStatus.debugSend) { return }
let query = {
"debugSend.en": this.param.debugSend.en,
"debugSend.receiverIp": this.param.debugSend.receiverIp,
"debugSend.portCinC": this.param.debugSend.portCinC,
"debugSend.portData": this.param.debugSend.portData,
"debugSend.timeout": this.param.debugSend.timeout
}
this.submitStatus.debugSend = true
fetch('/api/set/debugSend', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(query)
}).then(async (resp) => {
this.submitStatus.debugSend = false
this.updateNetworkSettings(await resp.json())
}).catch((reason) => {
this.submitStatus.debugSend = false
alert(`Ошибка при применении настроек: ${reason}`)
})
},
async settingsUploadUpdate() {
if (!this.uploadFw.filename) {
alert('Выберите файл для загрузки');
@@ -105,24 +53,6 @@
this.submitStatus.firmwareUpgrade = false
},
updateNetworkSettings(vals) {
this.submitStatus.network = false
this.param.network.managementIp = vals["settings"]["network.managementIp"]
this.param.network.managementGateway = vals["settings"]["network.managementGateway"]
this.param.network.mode = vals["settings"]["network.mode"]
this.param.network.dataIp = vals["settings"]["network.dataIp"]
this.param.network.dataMtu = vals["settings"]["network.dataMtu"]
},
updateDebugSendSettings(vals) {
this.submitStatus.debugSend = false
this.param.debugSend.en = vals["settings"]["debugSend.en"]
this.param.debugSend.receiverIp = vals["settings"]["debugSend.receiverIp"]
this.param.debugSend.portCinC = vals["settings"]["debugSend.portCinC"]
this.param.debugSend.portData = vals["settings"]["debugSend.portData"]
this.param.debugSend.timeout = vals["settings"]["debugSend.timeout"]
},
doModemReboot() {
if (this.submitStatus.modemReboot !== null) {
return