diff --git a/StartServerWPF.Modules.Main/Models/LogMessageModel.cs b/StartServerWPF.Modules.Main/Models/LogMessageModel.cs index 704f59c..9ee4643 100644 --- a/StartServerWPF.Modules.Main/Models/LogMessageModel.cs +++ b/StartServerWPF.Modules.Main/Models/LogMessageModel.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Runtime.CompilerServices; using System.Text; using System.Threading.Tasks; @@ -8,7 +9,10 @@ namespace StartServerWPF.Modules.Main.Models { public class LogMessageModel { + public int LogType { get; set; } + public string AppName { get; set; } + public string State { get; set; } public DateTime OriginTime { get; set; } - public string message { get; set; } + public string Message { get; set; } } } diff --git a/StartServerWPF.Modules.Main/ViewModels/LogManagementViewModel.cs b/StartServerWPF.Modules.Main/ViewModels/LogManagementViewModel.cs index fbc7fa9..c3750a6 100644 --- a/StartServerWPF.Modules.Main/ViewModels/LogManagementViewModel.cs +++ b/StartServerWPF.Modules.Main/ViewModels/LogManagementViewModel.cs @@ -5,6 +5,7 @@ using Prism.Events; using Prism.Mvvm; using Prism.Regions; using Prism.Services.Dialogs; +using StartServerWPF.Modules.Main.Models; using System; using System.Collections.Generic; using System.IO; @@ -22,7 +23,6 @@ namespace StartServerWPF.Modules.Main.ViewModels private readonly IDialogService _dialogService; public LogManagementViewModel( - IRegionManager regionManager, IEventAggregator ea, IDialogService dialogService) { @@ -53,16 +53,23 @@ namespace StartServerWPF.Modules.Main.ViewModels public void QueryData() { - + DataList = new List(); + string fileName = ""; + // File.Exists(""); Task.Run(() => { - //this.ShowLoading(); - //var logsDTO = _systemLogBLL.Query(StartTime, EndTime); - //int index = logsDTO.Count; - //MaxCountPage = (index % countPerPage == 0 ? index / countPerPage : index / countPerPage + 1); - //_totalDataList = logsDTO; - //DataList = _totalDataList.Take(countPerPage).ToList(); - //this.HideLoading(); + // var lines= File.ReadAllLines(fileName); + for (int i = 0; i < 10; i++) + { + DataList.Add(new LogMessageModel() + { + AppName = "app"+i, + LogType = 1, + Message = "start", + OriginTime = DateTime.Now.AddMinutes(i), + State = "启动中" + }); + } }); } private void HFWarning() @@ -70,8 +77,6 @@ namespace StartServerWPF.Modules.Main.ViewModels DialogParameters param = new DialogParameters(); param.Add("type", 0); - // param.Add("menu", currentMenu); - ShowEditDialog(param); } private void ShowEditDialog(DialogParameters param) @@ -125,13 +130,13 @@ namespace StartServerWPF.Modules.Main.ViewModels get => _EndTime; set => SetProperty(ref _EndTime, value); } - //private List _DataList; + private List _DataList; - //public List DataList - //{ - // get { return _DataList; } - // set { SetProperty(ref _DataList, value); } - //} + public List DataList + { + get { return _DataList; } + set { SetProperty(ref _DataList, value); } + } ///// ///// 所有数据 ///// diff --git a/StartServerWPF.Modules.Main/ViewModels/MainViewModel.cs b/StartServerWPF.Modules.Main/ViewModels/MainViewModel.cs index f239952..d9f1f44 100644 --- a/StartServerWPF.Modules.Main/ViewModels/MainViewModel.cs +++ b/StartServerWPF.Modules.Main/ViewModels/MainViewModel.cs @@ -318,21 +318,6 @@ namespace StartServerWPF.Modules.Main.ViewModels private void GetVPNStatus() { - string str = "2022-10-23T18:34:48.828289 4031435.23810 38398062.54545 451.0909 ML -2.71 0.016 7 6 B"; - var ms = new MsEventModel(str) { CurrentTime = DateTime.Now }; - var data = ApmsEventSource.Where(f => f.OriginTime == ms.OriginTime).FirstOrDefault(); - if (data == null) - { - AddItems(ApmsEventSource, ms); - CSDevicePublish cSDevicePublish = new CSDevicePublish() - { - type = CSMessage.publish, - message = str, - }; - string jsonStr = JsonSerializer.Serialize(cSDevicePublish); - _websocket.SendMes(jsonStr); - } - if (vpn.CheckVpnStatus(sc.vpnInfo.VpnName)) { MessageBox.Show("VPN已经连接!"); diff --git a/StartServerWPF.Modules.Main/Views/LogManagementView.xaml b/StartServerWPF.Modules.Main/Views/LogManagementView.xaml index dd49ba2..5cf8c09 100644 --- a/StartServerWPF.Modules.Main/Views/LogManagementView.xaml +++ b/StartServerWPF.Modules.Main/Views/LogManagementView.xaml @@ -6,68 +6,81 @@ xmlns:prism="http://prismlibrary.com/" prism:ViewModelLocator.AutoWireViewModel="True" xmlns:hc="https://handyorg.github.io/handycontrol" - mc:Ignorable="d" + mc:Ignorable="d" Background="Gray" d:DesignHeight="450" d:DesignWidth="800"> - - - + - - + + - - - - - - - - - - - - - - X轴间隔: - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + 时间间隔: + + + + + + + + + + + + + + + + + + + + + + + + + + + + 时间间隔: + + + + + + + + + + +