From 745d663c4a19d9fc573e2fc3cd1d5c48a653c4fe Mon Sep 17 00:00:00 2001 From: mzhifa Date: Mon, 15 May 2023 19:38:18 +0800 Subject: [PATCH] =?UTF-8?q?1=E4=BF=AE=E6=94=B9=E6=97=A5=E5=BF=97=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E7=9B=AE=E5=BD=95=E8=87=AA=E5=8A=A8=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=EF=BC=9B=202=E4=BF=AE=E6=94=B9=E6=97=B6=E9=97=B4=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- StartServerWPF.Modules.Main/ViewModels/MainViewModel.cs | 5 +++++ .../ViewModels/SetParamDialogViewModel.cs | 7 +++++++ StartServerWPF.Modules.Main/Views/SetParamDialog.xaml | 2 +- StartServerWPF/StartServerWPF.csproj | 3 --- StartServerWPF/SystemConfig.json | 6 +++--- StartServerWPF/Systemlog/SerLog_20230513.txt | 8 -------- 6 files changed, 16 insertions(+), 15 deletions(-) delete mode 100644 StartServerWPF/Systemlog/SerLog_20230513.txt diff --git a/StartServerWPF.Modules.Main/ViewModels/MainViewModel.cs b/StartServerWPF.Modules.Main/ViewModels/MainViewModel.cs index 9bc8c1b..e21c894 100644 --- a/StartServerWPF.Modules.Main/ViewModels/MainViewModel.cs +++ b/StartServerWPF.Modules.Main/ViewModels/MainViewModel.cs @@ -217,6 +217,7 @@ namespace StartServerWPF.Modules.Main.ViewModels DialogParameters param = new DialogParameters(); param.Add("type", 1);// 编辑 param.Add("model", sc.vpnInfo); + param.Add("moniTime", MoniStartTime); _dialogService.ShowDialog( "SetParamDialog", @@ -683,6 +684,10 @@ namespace StartServerWPF.Modules.Main.ViewModels public void WriteSerLog(string fn, string logstr) { + if(!File.Exists(fn)) + { + Directory.CreateDirectory(Path.GetDirectoryName(fn)); + } StreamWriter sw = new StreamWriter(fn, true, Encoding.Default); sw.WriteLine(logstr); sw.Close(); diff --git a/StartServerWPF.Modules.Main/ViewModels/SetParamDialogViewModel.cs b/StartServerWPF.Modules.Main/ViewModels/SetParamDialogViewModel.cs index 245a167..6c54b69 100644 --- a/StartServerWPF.Modules.Main/ViewModels/SetParamDialogViewModel.cs +++ b/StartServerWPF.Modules.Main/ViewModels/SetParamDialogViewModel.cs @@ -35,6 +35,7 @@ namespace StartServerWPF.Modules.Main.ViewModels var _type = parameters.GetValue("type"); // _title = (_type == 0 ? "新增" : "修改") + _title; MainModel = parameters.GetValue("model"); + MoniTime= parameters.GetValue("moniTime"); } private VpnInfo _mainModel = new VpnInfo(); @@ -43,6 +44,12 @@ namespace StartServerWPF.Modules.Main.ViewModels get => _mainModel; set { SetProperty(ref _mainModel, value); } } + private DateTime _moniTime ; + public DateTime MoniTime + { + get => _moniTime; + set { SetProperty(ref _moniTime, value); } + } public DelegateCommand FilePathSaveCommand=> new(()=> { diff --git a/StartServerWPF.Modules.Main/Views/SetParamDialog.xaml b/StartServerWPF.Modules.Main/Views/SetParamDialog.xaml index e605eaf..282dc40 100644 --- a/StartServerWPF.Modules.Main/Views/SetParamDialog.xaml +++ b/StartServerWPF.Modules.Main/Views/SetParamDialog.xaml @@ -68,7 +68,7 @@ - +