feat: 连接配置支持「启动时自动连接」

- ConnectionConfig 新增 auto_connect 字段(serde default,旧数据兼容)
- 连接表单「认证与心跳」区新增开关,随保存持久化
- 应用启动时对勾选的连接逐个拉起(遗嘱模板注入后 connect)
This commit is contained in:
2026-09-29 17:02:25 +08:00
parent 0bfb887c01
commit 7de886410d
3 changed files with 21 additions and 1 deletions
+4
View File
@@ -168,6 +168,9 @@ pub struct ConnectionConfig {
/// 断线自动重连
#[serde(default = "default_true")]
pub auto_reconnect: bool,
/// 应用启动时自动连接该连接
#[serde(default)]
pub auto_connect: bool,
#[serde(default)]
pub last_will: Option<LastWill>,
@@ -227,6 +230,7 @@ impl ConnectionConfig {
topic_alias_maximum: None,
auto_resubscribe: true,
auto_reconnect: true,
auto_connect: false,
last_will: None,
created_at: chrono::Local::now().timestamp(),
group: None,