diff --git a/HT.Cloud.Service/ReportManage/RtReportService.cs b/HT.Cloud.Service/ReportManage/RtReportService.cs index 346c8c3..f05df79 100644 --- a/HT.Cloud.Service/ReportManage/RtReportService.cs +++ b/HT.Cloud.Service/ReportManage/RtReportService.cs @@ -84,10 +84,14 @@ namespace HT.Cloud.Service.ReportManage srcTagRtValues.Add(new SrcTagRtValue() {TagName = TagName, Description = Description, Value = Value }); } var dt = new Dictionary(); - foreach (var src in srcTagRtValues) + try { - dt.Add(src.TagName, src.Value); + foreach (var src in srcTagRtValues) + { + dt.Add(src.TagName, src.Value); + } } + catch(Exception ex) { Console.Write(ex.ToString()); } dt.Add("RtTime",DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss")); return dt.ToJson(); diff --git a/HT.Cloud.Web/Areas/SystemSecurity/Controllers/DeviceIOEditorController.cs b/HT.Cloud.Web/Areas/SystemSecurity/Controllers/DeviceIOEditorController.cs new file mode 100644 index 0000000..ac207d2 --- /dev/null +++ b/HT.Cloud.Web/Areas/SystemSecurity/Controllers/DeviceIOEditorController.cs @@ -0,0 +1,46 @@ +/******************************************************************************* + * Copyright © 2020 HT.Cloud.Framework 版权所有 + * Author: HT.Cloud + * Description: WaterCloud快速开发平台 + * Website: +*********************************************************************************/ + +using Microsoft.AspNetCore.Mvc; +using System.Linq; +using System.Threading.Tasks; +using HT.Cloud.Code; +using HT.Cloud.Service.SystemSecurity; + +namespace HT.Cloud.Web.Areas.SystemSecurity.Controllers +{ + [Area("SystemSecurity")] + public class DeviceIOEditorController : BaseController + { + public ServerStateService _serverStateService { get; set; } + + [HttpGet] + public async Task GetServerDataJson() + { + return await Task.Run(() => + { + //windows环境 + var computer = ComputerHelper.GetComputerInfo(); + var arm = computer.RAMRate; + var cpu = computer.CPURate; + var iis = computer.RunTime; + var TotalRAM = computer.TotalRAM; + string ip = WebHelper.GetWanIp(); + string ipLocation = WebHelper.GetIpLocation(ip); + var IP = string.Format("{0} ({1})", ip, ipLocation); + return Content(new { ARM = arm, CPU = cpu, IIS = iis, TotalRAM = TotalRAM, IP = IP }.ToJson()); + }); + } + + [HttpGet] + public async Task GetServerData() + { + var data = (await _serverStateService.GetList(2)).OrderBy(a => a.F_Date).ToList(); + return Content(data.ToJson()); + } + } +} \ No newline at end of file diff --git a/HT.Cloud.Web/Areas/SystemSecurity/Controllers/DeviceIOStatusController.cs b/HT.Cloud.Web/Areas/SystemSecurity/Controllers/DeviceIOStatusController.cs new file mode 100644 index 0000000..a2a355a --- /dev/null +++ b/HT.Cloud.Web/Areas/SystemSecurity/Controllers/DeviceIOStatusController.cs @@ -0,0 +1,46 @@ +/******************************************************************************* + * Copyright © 2020 HT.Cloud.Framework 版权所有 + * Author: HT.Cloud + * Description: WaterCloud快速开发平台 + * Website: +*********************************************************************************/ + +using Microsoft.AspNetCore.Mvc; +using System.Linq; +using System.Threading.Tasks; +using HT.Cloud.Code; +using HT.Cloud.Service.SystemSecurity; + +namespace HT.Cloud.Web.Areas.SystemSecurity.Controllers +{ + [Area("SystemSecurity")] + public class DeviceIOStatusController : BaseController + { + public ServerStateService _serverStateService { get; set; } + + [HttpGet] + public async Task GetServerDataJson() + { + return await Task.Run(() => + { + //windows环境 + var computer = ComputerHelper.GetComputerInfo(); + var arm = computer.RAMRate; + var cpu = computer.CPURate; + var iis = computer.RunTime; + var TotalRAM = computer.TotalRAM; + string ip = WebHelper.GetWanIp(); + string ipLocation = WebHelper.GetIpLocation(ip); + var IP = string.Format("{0} ({1})", ip, ipLocation); + return Content(new { ARM = arm, CPU = cpu, IIS = iis, TotalRAM = TotalRAM, IP = IP }.ToJson()); + }); + } + + [HttpGet] + public async Task GetServerData() + { + var data = (await _serverStateService.GetList(2)).OrderBy(a => a.F_Date).ToList(); + return Content(data.ToJson()); + } + } +} \ No newline at end of file diff --git a/HT.Cloud.Web/Areas/SystemSecurity/Views/DeviceIOEditor/Index.cshtml b/HT.Cloud.Web/Areas/SystemSecurity/Views/DeviceIOEditor/Index.cshtml new file mode 100644 index 0000000..ea25a6e --- /dev/null +++ b/HT.Cloud.Web/Areas/SystemSecurity/Views/DeviceIOEditor/Index.cshtml @@ -0,0 +1,280 @@ +@{ + ViewBag.Title = "Index"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +@inject Microsoft.AspNetCore.Hosting.IWebHostEnvironment env + + + + + +
+
+
+
+
+ +
+
+
+
+
diff --git a/HT.Cloud.Web/Areas/SystemSecurity/Views/DeviceIOStatus/Index.cshtml b/HT.Cloud.Web/Areas/SystemSecurity/Views/DeviceIOStatus/Index.cshtml new file mode 100644 index 0000000..a5aa081 --- /dev/null +++ b/HT.Cloud.Web/Areas/SystemSecurity/Views/DeviceIOStatus/Index.cshtml @@ -0,0 +1,280 @@ +@{ + ViewBag.Title = "Index"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +@inject Microsoft.AspNetCore.Hosting.IWebHostEnvironment env + + + + + +
+
+
+
+
+ +
+
+
+
+
diff --git a/HT.Cloud.Web/HT.Cloud.Web.csproj b/HT.Cloud.Web/HT.Cloud.Web.csproj index 56c8a7d..566716c 100644 --- a/HT.Cloud.Web/HT.Cloud.Web.csproj +++ b/HT.Cloud.Web/HT.Cloud.Web.csproj @@ -14,7 +14,7 @@ AnyCPU en - + diff --git a/HT.Cloud.Web/appsettings.json b/HT.Cloud.Web/appsettings.json index 05af286..437da0b 100644 --- a/HT.Cloud.Web/appsettings.json +++ b/HT.Cloud.Web/appsettings.json @@ -1,5 +1,5 @@ { - "urls": "http://*:5000", + "urls": "http://*:8058", "Logging": { "LogLevel": { "Default": "Information", @@ -10,9 +10,9 @@ "SystemConfig": { "Demo": false, // 是否是演示模式 账号admin 密码0000 "LoginMultiple": false, // 是否允许一个账户在多处登录 - "AllowCorsSite": "http://localhost:5000", // 允许的其他站点访问Api + "AllowCorsSite": "http://localhost:8058", // 允许的其他站点访问Api "DBProvider": "SqlServer", //SqlServer //Oracle - "DBConnectionString": "Data Source=192.168.110.32;Initial Catalog=SCADA;User Id= sa;Password= Sa1qaz;Integrated Security=False;Encrypt=True;TrustServerCertificate=True;", + "DBConnectionString": "Data Source=192.168.110.36;Initial Catalog=HTSCADA;User Id= sa;Password= Sa1qaz;Integrated Security=False;Encrypt=True;TrustServerCertificate=True;", "DBCommandTimeout": 180, // 数据库超时时间,单位秒 "CacheProvider": "Memory", // 缓存使用方式 Redis/Memory "RedisConnectionString": "127.0.0.1:6379", //docker部署 172.17.0.1 diff --git a/HT.Cloud.Web/wwwroot/report/Report20230331085834.xlsx b/HT.Cloud.Web/wwwroot/report/Report20230331085834.xlsx deleted file mode 100644 index 7d8cdd5..0000000 Binary files a/HT.Cloud.Web/wwwroot/report/Report20230331085834.xlsx and /dev/null differ