public async Task <JsonResult> DeleteGuid(Guid guid) { if (!await YummyOnlineManager.DeleteGuid(guid)) { return(Json(new JsonError())); } SystemTcpClient.SendSystemCommand(SystemCommandType.RefreshNewDineClients); await YummyOnlineManager.RecordLog(Log.LogProgram.System, Log.LogLevel.Warning, $"Guid {guid} Removed"); return(Json(new JsonSuccess())); }
public async Task <JsonResult> AddGuid(Guid guid, string description) { if (!await YummyOnlineManager.AddGuid(new NewDineInformClientGuid { Guid = guid, Description = description })) { return(Json(new JsonError())); } SystemTcpClient.SendSystemCommand(SystemCommandType.RefreshNewDineClients); await YummyOnlineManager.RecordLog(Log.LogProgram.System, Log.LogLevel.Success, $"Guid {guid} ({description}) Added"); return(Json(new JsonSuccess())); }
public static dynamic GetTcpServerInfo() { Process process = getTcpServerProcess(); if (process == null) { return(new { IsStarted = false, }); } TcpServerStatusProtocol status = SystemTcpClient.GetTcpServerStatus(); return(new { IsStarted = true, ProcessName = process.ProcessName, StartTime = process.StartTime, Memory = curpcp.NextValue() / (1024 * 1024), Cpu = curtime.NextValue() / Environment.ProcessorCount, Status = status }); }