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,6 +868,8 @@
"serviceSettings.refClk10M": this.param.serviceSettings.refClk10M, "serviceSettings.refClk10M": this.param.serviceSettings.refClk10M,
"serviceSettings.autoStart": this.param.serviceSettings.autoStart "serviceSettings.autoStart": this.param.serviceSettings.autoStart
} }
if (confirm('Вы уверены, что хотите сохранить настройки BUC и LNB?')) {
this.submitStatus.bucLnb = true
fetch('/api/set/bucLnb', { fetch('/api/set/bucLnb', {
method: 'POST', method: 'POST',
headers: { headers: {
@@ -878,7 +879,11 @@
}).then(async (resp) => { }).then(async (resp) => {
this.submitStatus.bucLnb = false this.submitStatus.bucLnb = false
this.updateBucLnbSettings(await resp.json()) 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}`)
}) })
}, },