1
0
mirror of https://github.com/akpaevj/onecmonitor.git synced 2026-06-19 22:59:58 +02:00
Files
onecmonitor/onecmonitor-server/ViewModels/TechLogSeances/TechLogListItemViewModel.cs
T
2025-07-02 10:32:56 +03:00

36 lines
1.3 KiB
C#

using OneSwiss.Common.Models;
namespace OnecMonitor.Server.ViewModels.TechLogSeances
{
public class TechLogListItemViewModel
{
public TjEvent TjEvent { get; set; }
public string AdditionalCss { get; set; } = string.Empty;
public List<TjEventAction> AvailableActions { get; } = [];
public TechLogListItemViewModel(TjEvent tjEvent)
{
TjEvent = tjEvent;
switch (TjEvent.EventName)
{
case "TLOCK" when tjEvent.WaitConnections.Length > 0:
AdditionalCss = "om-warning";
AvailableActions.Add(TjEventAction.ShowLockWaitingTimeline);
AvailableActions.Add(TjEventAction.ShowLockWaitingGraph);
break;
case "TTIMEOUT":
case "TDEADLOCK":
AdditionalCss = "om-danger";
AvailableActions.Add(TjEventAction.ShowLockWaitingTimeline);
AvailableActions.Add(TjEventAction.ShowLockWaitingGraph);
break;
case "CALL":
case "SCALL":
AvailableActions.Add(TjEventAction.CallTimeline);
break;
}
}
}
}