Info_API 제작

This commit is contained in:
jmaniuvc
2025-05-22 16:12:56 +09:00
parent ba196b626a
commit c99b61e031
17 changed files with 8969 additions and 1502 deletions

View File

@@ -0,0 +1,75 @@
using Studio;
using Studio.Setting.Connect;
using Studio.UI;
using TMPro;
using UnityEngine;
using XRLib.UI;
namespace XED.UI
{
public class Panel_Repository : PanelBase
{
public RectTransform BaseDataList;
RectTransform Info_API;
RectTransform Info_BaseInfo;
public UI_BaseDataButton baseDataButtonPrefab;
TextMeshProUGUI TotalRequestPacketSize;
TextMeshProUGUI AverageRequestPacketSize;
TextMeshProUGUI TotalResponsePacketSize;
TextMeshProUGUI AverageResponsePacketSize;
TextMeshProUGUI MaximumResponseTime;
TextMeshProUGUI AverageResponseTime;
TextMeshProUGUI MaximumRequestPacketAPI;
TextMeshProUGUI MaximumResponsePacketAPI;
TextMeshProUGUI MaximumResponseTimeAPI;
public override void AfterAwake()
{
UI_ProtocolLabel[] protocolLabels = GetComponentsInChildren<UI_ProtocolLabel>();
foreach (UI_ProtocolLabel label in protocolLabels)
{
label.panel_Repository = this;
}
StudioService.Instance.onDataLoaded += CreateAPIListButton;
baseDataButtonPrefab = Resources.Load<UI_BaseDataButton>("Prefabs/UI/Button/UI_BaseDataButton");
}
void CreateAPIListButton(string name, StudioEntityWithState<object> value)
{
var button = Instantiate(baseDataButtonPrefab, BaseDataList.transform);
button.panel_Repository = this;
button.SetButtonName(name);
}
public void ShowInformation_API()
{
APITotalBoardEntity info = StudioService.Instance.GetAPIStatusBoarder();
TotalRequestPacketSize.text = info.TotalRequestPacketSize.ToString();
AverageRequestPacketSize.text = info.AverageRequestPacketSize.ToString();
TotalResponsePacketSize.text = info.TotalResponsePacketSize.ToString();
AverageResponsePacketSize.text = info.AverageResponsePacketSize.ToString();
MaximumResponseTime.text = info.MaximumResponseTime.ToString();
AverageResponseTime.text = info.AverageResponseTime.ToString();
MaximumRequestPacketAPI.text = info.MaximumRequestPacketAPI;
MaximumResponsePacketAPI.text = info.MaximumResponsePacketAPI;
MaximumResponseTimeAPI.text = info.MaximumResponseTimeAPI;
Info_API.gameObject.SetActive(true);
Info_BaseInfo.gameObject.SetActive(false);
}
public void ShowInformation_BaseInfo()
{
Info_API.gameObject.SetActive(false);
Info_BaseInfo.gameObject.SetActive(true);
}
}
}