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

36 lines
1.3 KiB
C#
Raw Normal View History

2025-07-02 10:32:56 +03:00
using OneSwiss.Common.Models;
2023-01-27 20:58:44 +03:00
namespace OnecMonitor.Server.ViewModels.TechLogSeances
{
public class TechLogListItemViewModel
{
public TjEvent TjEvent { get; set; }
public string AdditionalCss { get; set; } = string.Empty;
2025-03-29 01:33:55 +03:00
public List<TjEventAction> AvailableActions { get; } = [];
2023-01-27 20:58:44 +03:00
public TechLogListItemViewModel(TjEvent tjEvent)
{
TjEvent = tjEvent;
2025-03-29 01:33:55 +03:00
switch (TjEvent.EventName)
2023-01-27 20:58:44 +03:00
{
2025-03-29 01:33:55 +03:00
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;
2023-01-27 20:58:44 +03:00
}
}
}
}