diff --git a/detect.gui/Embedded/dist/index.html b/detect.gui/Embedded/dist/index.html index 994b225..1fbd605 100644 --- a/detect.gui/Embedded/dist/index.html +++ b/detect.gui/Embedded/dist/index.html @@ -1 +1,156 @@ -中核集团预埋件检测系统
\ No newline at end of file + + + + + + + + + 中核集团预埋件检测系统 + + + + + + + + +
+ +
+
+
+
+ + + \ No newline at end of file diff --git a/detect.gui/Services/DeviceClientService.cs b/detect.gui/Services/DeviceClientService.cs index f8e4cf7..aa84516 100644 --- a/detect.gui/Services/DeviceClientService.cs +++ b/detect.gui/Services/DeviceClientService.cs @@ -75,7 +75,7 @@ public class DeviceClientService /// /// /// - public IDeviceClient? RefreshDeviceClient(long deviceId) + public IDeviceClient? RefreshDeviceClientById(long deviceId) { _deviceClients.TryGetValue(deviceId, out var deviceClient); deviceClient?.DisConnectAsync(); diff --git a/detect.gui/Views/WebBrowserWindow.axaml b/detect.gui/Views/WebBrowserWindow.axaml index e34af28..ed900f8 100644 --- a/detect.gui/Views/WebBrowserWindow.axaml +++ b/detect.gui/Views/WebBrowserWindow.axaml @@ -13,6 +13,6 @@ IsHistoryDisabled="True" IgnoreCertificateErrors="True" DisableBuiltinContextMenus="True" - AllowDeveloperTools="False" + AllowDeveloperTools="True" Address="{Binding Address}"/> diff --git a/detect.gui/Views/WebBrowserWindow.axaml.cs b/detect.gui/Views/WebBrowserWindow.axaml.cs index 31b7b8d..ea387f6 100644 --- a/detect.gui/Views/WebBrowserWindow.axaml.cs +++ b/detect.gui/Views/WebBrowserWindow.axaml.cs @@ -6,6 +6,7 @@ using detect.gui.Services; using detect.gui.ViewModels; using Serilog; using Splat; +using WebViewControl; namespace detect.gui.Views; @@ -26,21 +27,11 @@ public partial class WebBrowserWindow : Window ShowInTaskbar = false; Topmost = true; CanResize = false; - - } - protected override void OnOpened(EventArgs e) - { - base.OnOpened(e); + var webview = this.Get("WebView"); var service = Locator.Current.GetService(); - if (WebView != null) - { - WebView.RegisterJavascriptObject("DeviceClientService", service); - } - else - { - Log.Warning("WebView is null!"); - } + webview.RegisterJavascriptObject("DeviceClientService", service); + Log.Information("WebView Initialized."); } private void InitializeComponent()