Make it possible to set the WebGUI port from the openspace.cfg file (closes #2279)

This commit is contained in:
Alexander Bock
2023-01-23 19:41:16 +01:00
parent dd34a0b9b4
commit 2aff70b8ad
2 changed files with 5 additions and 10 deletions
+3 -8
View File
@@ -98,10 +98,10 @@ namespace {
struct [[codegen::Dictionary(WebGuiModule)]] Parameters {
// [[codegen::verbatim(PortInfo.description)]]
std::optional<int> port;
std::optional<int> port [[codegen::key("HttpPort")]];
// [[codegen::verbatim(AddressInfo.description)]]
std::optional<std::string> address;
std::string address;
// [[codegen::verbatim(WebSocketInterfaceInfo.description)]]
std::optional<std::string> webSocketInterface;
@@ -163,12 +163,7 @@ void WebGuiModule::internalInitialize(const ghoul::Dictionary& configuration) {
const Parameters p = codegen::bake<Parameters>(configuration);
_port = p.port.value_or(_port);
if (p.address.has_value()) {
_address = p.address.value();
}
else {
_address = "192.168.1.8"; //global::windowDelegate
}
_address = p.address;
_webSocketInterface = p.webSocketInterface.value_or(_webSocketInterface);
auto startOrStop = [this]() {