From b544d5cccd76735e034c8055918a50927b437474 Mon Sep 17 00:00:00 2001
From: wenxiangchao <wenxiangchao@ihengxin.com.cn>
Date: 星期二, 10 十一月 2026 08:29:04 +0800
Subject: [PATCH] fix: 维护模式重复进入失败与按钮灰死 + Broker 并发验证用例
---
Plugin.DeviceConfig/DeviceConfig.xaml.cs | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/Plugin.DeviceConfig/DeviceConfig.xaml.cs b/Plugin.DeviceConfig/DeviceConfig.xaml.cs
index e4d3357..b03763c 100644
--- a/Plugin.DeviceConfig/DeviceConfig.xaml.cs
+++ b/Plugin.DeviceConfig/DeviceConfig.xaml.cs
@@ -221,6 +221,13 @@
var chList = _model.GetChannelsByDevice(dev.DeviceId);
Channels = new ObservableCollection<DeviceChannel>(chList);
+
+ // V3.0 鎵ц浣嶇疆灞曠ず
+ tbExecutionMode.Text = dev.ExecutionMode == ExecutionModeKind.Broker
+ ? "Broker 鍏变韩" : "Local 鐩磋繛";
+ tbAuthorityInfo.Text = dev.ExecutionMode == ExecutionModeKind.Broker
+ ? $"{dev.AuthorityId} 路 {dev.PhysicalSessionKey}"
+ : (string.IsNullOrWhiteSpace(dev.AuthorityId) ? V3AuthorityCatalog.LocalAuthorityId : dev.AuthorityId);
}
catch (Exception ex)
{
@@ -326,6 +333,11 @@
DriverType = SelectedDevice.DriverType,
Transport = SelectedDevice.Transport,
Endpoint = SelectedDevice.Endpoint,
+ ExecutionMode = SelectedDevice.ExecutionMode,
+ AuthorityId = SelectedDevice.AuthorityId,
+ BrokerId = SelectedDevice.BrokerId,
+ OwnerProcessId = SelectedDevice.OwnerProcessId,
+ PhysicalSessionKey = SelectedDevice.PhysicalSessionKey,
EffectiveVersion = SelectedDevice.EffectiveVersion,
CreatedAt = SelectedDevice.CreatedAt,
UpdatedAt = SelectedDevice.UpdatedAt
@@ -408,6 +420,8 @@
tbTransport.Text = string.Empty;
tbEndpoint.Text = string.Empty;
tbEffectiveVersion.Text = string.Empty;
+ tbExecutionMode.Text = string.Empty;
+ tbAuthorityInfo.Text = string.Empty;
Channels = new ObservableCollection<DeviceChannel>();
}
@@ -494,6 +508,21 @@
ToastHelper.Warning("娌℃湁鍙彂甯冪殑鑽夌鐗堟湰");
return;
}
+
+ // V3.0 搂05 鍙戝竷闂ㄧ锛氭墽琛屼綅缃粦瀹氭牎楠屼笉閫氳繃鍒欓樆姝㈠彂甯�
+ var gateErrors = _model.ValidatePublishGate();
+ if (gateErrors.Count > 0)
+ {
+ var detail = string.Join("\n", gateErrors.Take(8));
+ if (gateErrors.Count > 8)
+ {
+ detail += $"\n鈥� 鍏� {gateErrors.Count} 椤归敊璇�";
+ }
+ log.Warn($"鍙戝竷闂ㄧ鎷︽埅: {string.Join("; ", gateErrors)}");
+ MsgBoxHelper.Error(Window.GetWindow(this), $"鍙戝竷闂ㄧ鏍¢獙鏈�氳繃锛歕n{detail}");
+ return;
+ }
+
var hash = _model.ComputeConfigHash();
draft.Hash = hash;
draft.Status = VersionStatus.Published;
--
Gitblit v1.9.1