Files
HTCloud/HT.Cloud.Web/Areas/DevicesManage/Controllers/DeviceMonitoringController.cs
dell c15babafd3
Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
可视化修改
2025-10-17 09:15:31 +08:00

78 lines
2.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*******************************************************************************
* 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.DevicesManage;
using Quartz;
namespace HT.Cloud.Web.Areas.DevicesManage.Controllers
{
[Area("DevicesManage")]
[HandlerLogin(needLogin: false)]
[HandlerAuthorize(needAuth: false)]
public class DeviceMonitoringController : BaseController
{
public RealTimeDeviceStateService _realTimeDeviceState { get; set; }
/// <summary>
/// 绑定数据仓库的数据库ID
/// </summary>
private string systemDescription = GlobalContext.SystemConfig.SystemDescription;
[HttpGet]
public async Task<ActionResult> GetServerDataJson()
{
return await Task.Run(() =>
{
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<ActionResult> GetRealIOGroup()
//{
// var listgroup = _realTimeIOState.GetIOGroup(systemDescription);
// return Content(listgroup.ToJson());
//}
//[HttpGet]
//public async Task<ActionResult> GetRealIOInfo()
//{
// var listinfo = _realTimeIOState.GetIOInfo(systemDescription);
// return Content(listinfo.ToJson());
//}
[HttpGet]
public async Task<ActionResult> GetRealDeviceTag()
{
var data = _realTimeDeviceState.GetRealDeviceTag(systemDescription);
return Content(data.Result);
}
[HttpPost]
public async Task<ActionResult> GetRealTableData(string[] grouptype)
{
var data = _realTimeDeviceState.GetRealTableData(grouptype[0]);
return Content(data.Result);
}
}
}