2024-02-20 15:53:27 +08:00
|
|
|
|
/*******************************************************************************
|
|
|
|
|
* 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;
|
|
|
|
|
using Quartz;
|
|
|
|
|
|
|
|
|
|
namespace HT.Cloud.Web.Areas.SystemSecurity.Controllers
|
|
|
|
|
{
|
|
|
|
|
[Area("PenMeiReportManage")]
|
|
|
|
|
[HandlerLogin(needLogin: false)]
|
|
|
|
|
[HandlerAuthorize(needAuth: false)]
|
|
|
|
|
public class PenMeiNetWorkStateNewController : BaseController
|
|
|
|
|
{
|
|
|
|
|
public ServerStateService _serverStateService { get; set; }
|
|
|
|
|
|
2024-07-10 16:08:09 +08:00
|
|
|
|
public RealTimeIOStateService _realTimeIOState { get; set; }
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 绑定数据仓库的数据库ID
|
|
|
|
|
/// </summary>
|
|
|
|
|
private string systemDescription = GlobalContext.SystemConfig.SystemDescription;
|
2024-02-20 15:53:27 +08:00
|
|
|
|
|
2024-07-10 16:08:09 +08:00
|
|
|
|
[HttpGet]
|
2024-02-20 15:53:27 +08:00
|
|
|
|
public async Task<ActionResult> GetServerDataJson()
|
|
|
|
|
{
|
|
|
|
|
return await Task.Run(() =>
|
|
|
|
|
{
|
2024-09-03 14:16:18 +08:00
|
|
|
|
|
2024-02-20 15:53:27 +08:00
|
|
|
|
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> GetServerData()
|
|
|
|
|
{
|
|
|
|
|
var data = (await _serverStateService.GetList(2)).OrderBy(a => a.F_Date).ToList();
|
|
|
|
|
return Content(data.ToJson());
|
|
|
|
|
}
|
|
|
|
|
[HttpGet]
|
|
|
|
|
public async Task<ActionResult> GetRealIOGroup()
|
|
|
|
|
{
|
2024-07-10 16:08:09 +08:00
|
|
|
|
var listgroup = _realTimeIOState.GetIOGroup(systemDescription);
|
2024-02-20 15:53:27 +08:00
|
|
|
|
|
|
|
|
|
return Content(listgroup.ToJson());
|
|
|
|
|
}
|
2024-09-03 14:16:18 +08:00
|
|
|
|
[HttpPost]
|
|
|
|
|
public async Task<ActionResult> GetRealIOGroupForId(string[] IOGroupid)
|
|
|
|
|
{
|
|
|
|
|
var listgroup = _realTimeIOState.GetIOGroup(systemDescription, IOGroupid[0]);
|
|
|
|
|
|
|
|
|
|
return Content(listgroup.ToJson());
|
|
|
|
|
}
|
2024-02-20 15:53:27 +08:00
|
|
|
|
[HttpGet]
|
|
|
|
|
public async Task<ActionResult> GetRealIOInfo()
|
|
|
|
|
{
|
|
|
|
|
|
2024-07-10 16:08:09 +08:00
|
|
|
|
var listinfo = _realTimeIOState.GetIOInfo(systemDescription);
|
2024-02-20 15:53:27 +08:00
|
|
|
|
|
|
|
|
|
return Content(listinfo.ToJson());
|
|
|
|
|
}
|
2024-09-03 14:16:18 +08:00
|
|
|
|
[HttpPost]
|
|
|
|
|
public async Task<ActionResult> GetRealIOInfoForId(string[] IOGroupid)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var listinfo = _realTimeIOState.GetIOInfo(systemDescription, IOGroupid[0]);
|
|
|
|
|
|
|
|
|
|
return Content(listinfo.ToJson());
|
|
|
|
|
}
|
|
|
|
|
[HttpGet]
|
|
|
|
|
public async Task<ActionResult> GetRealDevNetWork()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var listinfo = _realTimeIOState.GetRealDevNetWork(systemDescription);
|
|
|
|
|
|
|
|
|
|
return Content(listinfo.ToJson());
|
|
|
|
|
}
|
|
|
|
|
[HttpGet]
|
|
|
|
|
public async Task<ActionResult> GetDevNetWork()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var listinfo = _realTimeIOState.GetDevNetWork(systemDescription);
|
|
|
|
|
|
|
|
|
|
return Content(listinfo.ToJson());
|
|
|
|
|
}
|
2024-02-20 15:53:27 +08:00
|
|
|
|
[HttpGet]
|
|
|
|
|
public async Task<ActionResult> GetRealIOState()
|
|
|
|
|
{
|
2024-09-03 14:16:18 +08:00
|
|
|
|
//var listgroup = _realTimeIOState.GetIOGroup(systemDescription);
|
|
|
|
|
//var listinfo = _realTimeIOState.GetIOInfo(systemDescription);
|
|
|
|
|
var data = _realTimeIOState.GetRtData(systemDescription);
|
2024-02-20 15:53:27 +08:00
|
|
|
|
return Content(data.Result);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|