heave API to v3, fix some stuff in making connections

This commit is contained in:
Stanley Dimant
2022-07-06 12:35:37 +02:00
parent 145dc50f8a
commit 0b194b3632
3 changed files with 75 additions and 40 deletions

View File

@@ -96,7 +96,11 @@ namespace MareSynchronos.UI
ImGui.SameLine();
ImGui.TextColored(ImGuiColors.ParsedGreen, _apiController.OnlineUsers.ToString());
ImGui.SameLine();
ImGui.Text("Users Online" + (!isIntroUi ? " (server-wide)" : string.Empty));
ImGui.Text("Users Online,");
ImGui.SameLine();
ColorText(_apiController.SystemInfoDto.CpuUsage.ToString("0.00") + "%", GetCpuLoadColor(_apiController.SystemInfoDto.CpuUsage));
ImGui.SameLine();
ImGui.Text("Load");
ImGui.SameLine();
ImGui.Text(")");
}
@@ -123,6 +127,9 @@ namespace MareSynchronos.UI
ImGui.PopTextWrapPos();
}
public static Vector4 GetCpuLoadColor(double input) => input < 50 ? ImGuiColors.ParsedGreen :
input < 90 ? ImGuiColors.DalamudYellow : ImGuiColors.DalamudRed;
public static Vector4 GetBoolColor(bool input) => input ? ImGuiColors.ParsedGreen : ImGuiColors.DalamudRed;
public static Vector4 UploadColor((long, long) data) => data.Item1 == 0 ? ImGuiColors.DalamudGrey :