修改场站策略解析及网关指令下发

This commit is contained in:
lixiaoyuan
2025-09-14 16:00:30 +08:00
parent d1a8fb0665
commit 6418335d9d
14 changed files with 252 additions and 68 deletions

View File

@@ -79,6 +79,12 @@ MainWeb::MainWeb()
void MainWeb::initWebview()
{
labelWebErr.setParent(this);
labelWebErr.setGeometry(180, 100, 800, 50);
labelWebErr.setText("WEB服务异常");
labelWebErr.setStyleSheet("font: bold 20px;");
labelWebErr.hide();
qputenv("QTWEBENGINE_REMOTE_DEBUGGING", "9222"); // 即使内置视图,有时也需要开启调试端口
//this->setCentralWidget(&webView);
webView.setParent(this);
@@ -104,11 +110,13 @@ void MainWeb::initWebview()
if (ok)
{
webView.show();
labelWebErr.hide();
}
else
{
spdlog::error("[web] webview load failed, url={}", Config::option.webSrvUrl);
webView.hide();
labelWebErr.show();
}
});
}
@@ -186,8 +194,13 @@ bool MainWeb::event(QEvent* e)
void MainWeb::keyPressEvent(QKeyEvent* e)
{
if (e->key() == Qt::Key_F12)
auto key = e->key();
if (key == Qt::Key_F12)
{
this->showDevTools();
}
else if (key == Qt::Key_F5)
{
webView.load(QUrl(Config::option.webSrvUrl.c_str()));
}
}