This commit is contained in:
snltty
2025-04-25 16:08:46 +08:00
parent 2b00ea5f36
commit 0c0cd39492
5 changed files with 29 additions and 21 deletions

View File

@@ -1,6 +1,4 @@
using linker.libs.extends;
namespace linker.app
namespace linker.app
{
public partial class App : Application
{
@@ -23,18 +21,11 @@ namespace linker.app
private void TaskScheduler_UnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs e)
{
HandleException(e.Exception);
e.SetObserved();
}
private void HandleException(Exception ex)
{
//System.Diagnostics.Debug.WriteLine($"全局异常: {ex}");
/*
MainThread.BeginInvokeOnMainThread(async () =>
{
await Application.Current.MainPage.DisplayAlert("错误", $"{ex}", "确定");
});
*/
System.Diagnostics.Debug.WriteLine($"全局异常: {ex}");
}
}
}

View File

@@ -2,7 +2,14 @@
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:linker.app"
x:Class="linker.app.MainPage" BackgroundColor="{DynamicResource PageBackgroundColor}">
x:Class="linker.app.MainPage" BackgroundColor="#f4f4f4">
<FlexLayout BackgroundColor="#f4f4f4" VerticalOptions="Fill" HorizontalOptions="Fill">
<WebView x:Name="webview" BackgroundColor="#f4f4f4" VerticalOptions="Fill" HorizontalOptions="Fill" FlexLayout.Grow="1"></WebView>
<AbsoluteLayout BackgroundColor="#f4f4f4" x:Name="LoadingOverlay" HorizontalOptions="Center" VerticalOptions="Center" FlexLayout.Grow="1">
<ActivityIndicator Color="#008000" IsRunning="True" HorizontalOptions="Center" VerticalOptions="Center" />
<Label Text="启动中" TextColor="#008000" HorizontalOptions="Center" VerticalOptions="Center" Margin="0,60,0,0" />
</AbsoluteLayout >
</FlexLayout>
<WebView x:Name="webview" BackgroundColor="#f4f4f4" VerticalOptions="Fill" HorizontalOptions="Fill"></WebView>
</ContentPage>

View File

@@ -1,6 +1,5 @@

using linker.app.Services;
using Microsoft.Maui.Controls.PlatformConfiguration;
namespace linker.app
{
@@ -10,9 +9,17 @@ namespace linker.app
{
InitializeComponent();
LoadingOverlay.IsVisible = true;
webview.IsVisible = false;
IPlatformApplication.Current.Services.GetService<InitializeService>().OnInitialized += () =>
{
webview.Source = new Uri($"http://127.0.0.1:1804?t={DateTime.Now.Ticks}");
MainThread.BeginInvokeOnMainThread(() =>
{
LoadingOverlay.IsVisible = false;
webview.IsVisible = true;
webview.Source = new Uri($"http://127.0.0.1:1804?t={DateTime.Now.Ticks}");
});
};
}
}

View File

@@ -169,12 +169,15 @@ export default {
state.loading = true;
saveConfig(json).then((res)=>{
state.loading = false;
state.show = false;
ElMessage.success(t('common.oper'));
state.saveContent = res;
state.showSave = true;
if(res){
state.show = false;
ElMessage.success(t('common.oper'));
state.saveContent = res;
state.showSave = true;
}else{
ElMessage.error(t('common.operFail'));
}
}).catch(()=>{
ElMessage.error(t('common.operFail'));
state.loading = false;

View File

@@ -1,5 +1,5 @@
v1.7.4
2025-04-25 10:39:50
2025-04-25 16:08:46
1. 一些优化
2. 内置应用层SNAT用于无法使用系统NetNat的windows系统
3. 如果你设备很多,请尝试升级其中一个成功重启后再升级其它