修改网关参数设置接口

This commit is contained in:
lixiaoyuan
2025-10-11 19:30:15 +08:00
parent b12aca76c4
commit 567966d4f1
12 changed files with 408 additions and 956 deletions

View File

@@ -7,31 +7,34 @@
#include "app/Station.h"
#include "protocol/MqttEntity.h"
#include "qt/QWSwitch.h"
QWHome::QWHome(QWidget* parent) : MyWidget(parent)
{
this->setObjectName("home");
this->setStyleSheet("#home { background-color:rgba(100,100,100,50); }");
int x = 10, y = 0;
{
this->groupSys = MyQUI::GroupBox(this, x, y, 1190, 120, "系统");
auto pw = groupSys.get();
//this->groupSys = MyQUI::GroupBox(this, x, y, 1190, 120, "系统");
//auto pw = groupSys.get();
}
{
x = 10, y += 130;
this->groupHttp = MyQUI::GroupBox(this, x, y, 390, 120, "HTTP");
x = 10;
this->groupHttp = MyQUI::GroupBox(this, x, y, 390, 200, "HTTP");
auto pw = groupHttp.get();
this->addPair("http-t", pw, 20, 20, "服务类型: ", "服务端");
this->addPair("http-p", pw, 20, 50, "服务端口: ", Utils::toStr(Config::option.http.port));
this->addPair("http-s", pw, 20, 80, "服务状态: ", "运行");
QWSwitch* switchBtn = new QWSwitch(this);
switchBtn->setGeometry(30, 110, 50, 20);
}
{
x += 400;
this->groupMqtt = MyQUI::GroupBox(this, x, y, 390, 120, "MQTT");
this->groupMqtt = MyQUI::GroupBox(this, x, y, 390, 200, "MQTT");
auto pw = groupMqtt.get();
this->addPair("mqtt-t", pw, 20, 20, "服务类型: ", "客户端");
this->addPair("mqtt-h", pw, 20, 50, "服务地址: ", Config::option.mqtt.host);
@@ -39,7 +42,7 @@ QWHome::QWHome(QWidget* parent) : MyWidget(parent)
}
{
x += 400;
this->groupDB = MyQUI::GroupBox(this, x, y, 390, 120, "数据库");
this->groupDB = MyQUI::GroupBox(this, x, y, 390, 200, "数据库");
auto pw = groupDB.get();
this->addPair("db-n", pw, 20, 20, "数据库名: ", Config::option.database.dbname);
this->addPair("db-h", pw, 20, 50, "主机地址: ", Config::option.database.host);
@@ -51,7 +54,7 @@ QWHome::QWHome(QWidget* parent) : MyWidget(parent)
<< "日充电\n费用" << "日放电\n费用" << "总充电\n费用" << "总放电\n费用"
<< "日收益" << "总收益" << "--";
table = MyQUI::TableWidget(this, 10, y += 130, 1190, 265);
table = MyQUI::TableWidget(this, 10, y += 210, 1190, 265);
// 设置为水平表头
table->setColumnCount(headerTextList.size());
table->setHorizontalHeaderLabels(headerTextList);
@@ -70,6 +73,7 @@ QWHome::QWHome(QWidget* parent) : MyWidget(parent)
texteditLog->setGeometry(10, y += 30, 1190, 280);
texteditLog->setStyleSheet("background-color: transparent; border: 1px solid gray; font-weight: 400;");
texteditLog->setReadOnly(true);
texteditLog->document()->setMaximumBlockCount(1000);
{
////////////////////////////////////////////////////////////////////////////////////////