компилируемая версия веб-сервера, находится на стадии отладки
This commit is contained in:
@@ -71,10 +71,10 @@ nlohmann::json api_driver::ApiDriver::loadSettings() const {
|
||||
|
||||
nlohmann::json res = daemon->getSettingsRxTx().asJson();
|
||||
#ifdef API_OBJECT_QOS_SETTINGS_ENABLE
|
||||
res.update(daemon->getQosSettings().asJson());
|
||||
res["qos"] = (daemon->getQosSettings().asJson());
|
||||
#endif
|
||||
#ifdef API_OBJECT_NETWORK_SETTINGS_ENABLE
|
||||
res.update(daemon->getNetworkSettings().asJson());
|
||||
res["network"] = (daemon->getNetworkSettings().asJson());
|
||||
#endif
|
||||
return res;
|
||||
}
|
||||
@@ -116,17 +116,53 @@ void api_driver::ApiDriver::setDpdiSettings(const nlohmann::json& data) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef API_OBJECT_BUCLNB_SETTINGS_ENABLE
|
||||
void api_driver::ApiDriver::setBucLnbSettings(const nlohmann::json& data) {
|
||||
// TODO
|
||||
}
|
||||
auto rxtx = daemon->getSettingsRxTx();
|
||||
rxtx.updateBuclnbSettings(data);
|
||||
|
||||
std::lock_guard _lapi(this->daemon->cpApiMutex);
|
||||
this->daemon->cp.setDmaDebug("begin_save_config", "");
|
||||
rxtx.storeBuclnbSettings(this->daemon->cp);
|
||||
this->daemon->cp.setDmaDebug("save_config", "");
|
||||
rxtx.updateCallback(this->daemon->cp);
|
||||
{
|
||||
daemon->setSettingsRxTx(rxtx);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef API_OBJECT_QOS_SETTINGS_ENABLE
|
||||
void api_driver::ApiDriver::setQosSettings(const nlohmann::json& data) {
|
||||
// TODO
|
||||
}
|
||||
auto qos = daemon->getQosSettings();
|
||||
qos.updateFromJson(data);
|
||||
|
||||
void api_driver::ApiDriver::setNetworkSettings(const nlohmann::json& data) {
|
||||
// TODO
|
||||
std::lock_guard _lapi(this->daemon->cpApiMutex);
|
||||
this->daemon->cp.setDmaDebug("begin_save_config", "");
|
||||
qos.store(this->daemon->cp);
|
||||
this->daemon->cp.setDmaDebug("save_config", "");
|
||||
qos.updateCallback(this->daemon->cp);
|
||||
{
|
||||
daemon->setQosSettings(qos);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef API_OBJECT_NETWORK_SETTINGS_ENABLE
|
||||
void api_driver::ApiDriver::setNetworkSettings(const nlohmann::json& data) {
|
||||
auto net = daemon->getNetworkSettings();
|
||||
net.updateFromJson(data);
|
||||
|
||||
std::lock_guard _lapi(this->daemon->cpApiMutex);
|
||||
this->daemon->cp.setDmaDebug("begin_save_config", "");
|
||||
net.store(this->daemon->cp);
|
||||
this->daemon->cp.setDmaDebug("save_config", "");
|
||||
net.updateCallback(this->daemon->cp);
|
||||
{
|
||||
daemon->setNetworkSettings(net);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void api_driver::ApiDriver::resetDefaultSettings() {
|
||||
daemon->resetDefaultSettings();
|
||||
|
Reference in New Issue
Block a user