Compare commits

...

2 Commits

2 changed files with 23 additions and 12 deletions

View File

@@ -252,6 +252,9 @@ namespace http::server {
return good; return good;
} }
contentLenghtHeader = std::stol(content_len); contentLenghtHeader = std::stol(content_len);
if (contentLenghtHeader == 0) {
return good;
}
state_ = expecting_payload; state_ = expecting_payload;
if (contentLenghtHeader > HTTP_MAX_PAYLOAD) { if (contentLenghtHeader > HTTP_MAX_PAYLOAD) {
return bad; return bad;

View File

@@ -859,8 +859,7 @@
}, },
settingsSubmitBucLnb() { settingsSubmitBucLnb() {
this.submitStatus.bucLnb = true if (this.submitStatus.bucLnb) { return }
// TODO сделать всплывающее окно с подтверждением того, что настройки действительно нужно применить
let query = { let query = {
"buc.refClk10M": this.param.buc.refClk10M, "buc.refClk10M": this.param.buc.refClk10M,
"buc.powering": parseInt(this.param.buc.powering), "buc.powering": parseInt(this.param.buc.powering),
@@ -869,16 +868,22 @@
"serviceSettings.refClk10M": this.param.serviceSettings.refClk10M, "serviceSettings.refClk10M": this.param.serviceSettings.refClk10M,
"serviceSettings.autoStart": this.param.serviceSettings.autoStart "serviceSettings.autoStart": this.param.serviceSettings.autoStart
} }
fetch('/api/set/bucLnb', { if (confirm('Вы уверены, что хотите сохранить настройки BUC и LNB?')) {
method: 'POST', this.submitStatus.bucLnb = true
headers: { fetch('/api/set/bucLnb', {
'Content-Type': 'application/json' method: 'POST',
}, headers: {
body: JSON.stringify(query) 'Content-Type': 'application/json'
}).then(async (resp) => { },
this.submitStatus.bucLnb = false body: JSON.stringify(query)
this.updateBucLnbSettings(await resp.json()) }).then(async (resp) => {
}) this.submitStatus.bucLnb = false
this.updateBucLnbSettings(await resp.json())
}).catch((reason) => {
this.submitStatus.bucLnb = false
alert(`Ошибка при применении настроек: ${reason}`)
})
}
}, },
settingsSubmitQoS() { settingsSubmitQoS() {
@@ -936,6 +941,9 @@
}).then(async (resp) => { }).then(async (resp) => {
this.submitStatus.qos = false this.submitStatus.qos = false
this.updateQosSettings(await resp.json()) this.updateQosSettings(await resp.json())
}).catch((reason) => {
this.submitStatus.qos = false
alert(`Ошибка при применении настроек: ${reason}`)
}) })
}, },