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 @@ - +