Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions TarkovMonitor/Blazor/AppLayout.razor
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
<div class="window-drag-region" @onmousedown="BeginWindowDrag">
<span class="window-product-title">@LocalizationService.GetString("TarkovMonitor")</span>
</div>
<div class="window-controls" aria-label="Window controls">
<MudIconButton Class="window-control" Icon="@Icons.Material.Filled.Remove" Color="Color.Inherit" Size="Size.Small" OnClick="MinimizeWindow" aria-label="Minimize" />
<MudIconButton Class="window-control" Icon="@(isWindowMaximized ? Icons.Material.Filled.FilterNone : Icons.Material.Filled.CropSquare)" Color="Color.Inherit" Size="Size.Small" OnClick="ToggleMaximizeWindow" aria-label="@(isWindowMaximized ? "Restore" : "Maximize")" />
<MudIconButton Class="window-control window-control-close" Icon="@Icons.Material.Filled.Close" Color="Color.Inherit" Size="Size.Small" OnClick="CloseWindow" aria-label="Close" />
<div class="window-controls" aria-label="@LocalizationService.GetString("WindowControls")">
<MudIconButton Class="window-control" Icon="@Icons.Material.Filled.Remove" Color="Color.Inherit" Size="Size.Small" OnClick="MinimizeWindow" aria-label="@LocalizationService.GetString("Minimize")" />
<MudIconButton Class="window-control" Icon="@(isWindowMaximized ? Icons.Material.Filled.FilterNone : Icons.Material.Filled.CropSquare)" Color="Color.Inherit" Size="Size.Small" OnClick="ToggleMaximizeWindow" aria-label="@(isWindowMaximized ? LocalizationService.GetString("Restore") : LocalizationService.GetString("Maximize"))" />
<MudIconButton Class="window-control window-control-close" Icon="@Icons.Material.Filled.Close" Color="Color.Inherit" Size="Size.Small" OnClick="CloseWindow" aria-label="@LocalizationService.GetString("Close")" />
</div>
</MudAppBar>
<MudDrawer Class="navigation-drawer" @bind-Open="@drawerOpen" Elevation="1" Anchor="Anchor.Left" Variant="@DrawerVariant.Responsive" Breakpoint="Breakpoint.None">
<MudDrawerHeader Class="navigation-drawer-header">
<button class="navigation-brand" type="button" @onclick="@ToggleDrawer" aria-label="Collapse navigation">
<button class="navigation-brand" type="button" @onclick="@ToggleDrawer" aria-label="@LocalizationService.GetString("CollapseNavigation")">
<div class="navigation-brand-copy">
<img class="navigation-brand-logo" src="tarkov-dev-logo.svg" alt="Tarkov.dev" />
</div>
Expand Down Expand Up @@ -60,13 +60,13 @@
}
else
{
<MudText Typo="Typo.subtitle2">Raid timers</MudText>
<MudText Typo="Typo.subtitle2">@LocalizationService.GetString("RaidTimers")</MudText>
<MudIconButton Icon="@Icons.Material.Filled.Restore" Size="Size.Small" Color="Color.Inherit"
Title="Reset timer position" OnClick="ResetFloatingTimerPosition" />
Title="@LocalizationService.GetString("ResetTimerPosition")" OnClick="ResetFloatingTimerPosition" />
}
<MudIconButton Icon="@(floatingTimerPanelCollapsed ? Icons.Material.Filled.ExpandLess : Icons.Material.Filled.ExpandMore)"
Size="Size.Small" Color="Color.Inherit"
Title="@(floatingTimerPanelCollapsed ? "Expand the timer panel" : "Collapse the timer panel")"
Title="@(floatingTimerPanelCollapsed ? LocalizationService.GetString("ExpandTimerPanel") : LocalizationService.GetString("CollapseTimerPanel"))"
OnClick="ToggleFloatingTimerPanel" />
</div>
@if (!floatingTimerPanelCollapsed)
Expand All @@ -75,7 +75,7 @@
@if (TimersManager.FloatingPanelShowTimeInRaid)
{
<div class="floating-timer-panel__timer">
<MudText Typo="Typo.caption">Elapsed raid time</MudText>
<MudText Typo="Typo.caption">@LocalizationService.GetString("ElapsedRaidTime")</MudText>
<MudText Typo="Typo.h5" Class="floating-timer-panel__value">@FormatTimer(timeInRaid)</MudText>
</div>
}
Expand Down Expand Up @@ -127,8 +127,8 @@
private string FloatingTimerPanelClass => $"floating-timer-panel{(floatingTimerPanelCollapsed ? " floating-timer-panel--collapsed" : string.Empty)}";
private string CompactTimerValues => string.Join(" | ", new[]
{
TimersManager.FloatingPanelShowTimeInRaid ? $"ERT {FormatTimer(timeInRaid)}" : null,
TimersManager.FloatingPanelShowRunThrough ? $"RT {FormatTimer(runThroughRemaining)}" : null
TimersManager.FloatingPanelShowTimeInRaid ? $"{LocalizationService.GetString("CompactTimerElapsed")} {FormatTimer(timeInRaid)}" : null,
TimersManager.FloatingPanelShowRunThrough ? $"{LocalizationService.GetString("CompactTimerRemaining")} {FormatTimer(runThroughRemaining)}" : null
}.Where(value => value is not null));

protected override void OnInitialized()
Expand Down
3 changes: 2 additions & 1 deletion TarkovMonitor/Blazor/Components/LogBoard.razor
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
@using Humanizer
@implements IDisposable
@inject LogRepository logRepository
@inject LocalizationService LocalizationService
<MudStack Justify="Justify.FlexStart" AlignItems="AlignItems.Stretch" Class="ma-2" Style="min-width: 0;">
@if (logRepository.Logs.Count == 0)
{
<MudAlert Severity="Severity.Info">No new log entries since Tarkov Monitor started.</MudAlert>
<MudAlert Severity="Severity.Info">@LocalizationService.GetString("NoNewLogEntries")</MudAlert>
}else{
@foreach (LogLine line in logRepository.Logs)
{
Expand Down
6 changes: 3 additions & 3 deletions TarkovMonitor/Blazor/Components/MessageBoard.razor
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
<span class="dashboard-message__protected-label">@protectedValue.Label</span>
<span class="dashboard-message__protected-value"
tabindex="0"
aria-label="@($"{protectedValue.Label}: {protectedValue.Value}. Protected value revealed on focus.")">
<span class="dashboard-message__protected-mask" aria-hidden="true">Hidden - hover to reveal</span>
aria-label="@($"{protectedValue.Label}: {protectedValue.Value}{LocalizationService.GetString("ProtectedValueAriaSuffix")}")">
<span class="dashboard-message__protected-mask" aria-hidden="true">@LocalizationService.GetString("ProtectedValueHidden")</span>
<span class="dashboard-message__protected-reveal" aria-hidden="true">@protectedValue.Value</span>
</span>
</span>
Expand Down Expand Up @@ -213,7 +213,7 @@
case "quest":
return LocalizationService.GetString("Quest");
default:
return "Info";
return LocalizationService.GetString("InfoTitle");
}
}

Expand Down
4 changes: 2 additions & 2 deletions TarkovMonitor/Blazor/Pages/RawLogs/CustomLogDialog.razor
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

<MudDialog>
<DialogContent>
<MudSelect @bind-Value="gameLogType" Label="Log type" RelativeWidth="DropdownWidth.Adaptive" HelperText="Choose which GameWatcher monitor should process this log" OpenIcon="@Icons.Material.Filled.TextSnippet" AdornmentColor="Color.Secondary" PopoverFixed="false" Modal="false" MaxHeight="280" Margin="Margin.Dense" Dense="true" Class="tm-select tm-select--dialog" PopoverClass="tm-select-popover" ListClass="tm-select-list">
<MudSelect @bind-Value="gameLogType" Label="@LocalizationService.GetString("LogType")" RelativeWidth="DropdownWidth.Adaptive" HelperText="@LocalizationService.GetString("LogTypeHelper")" OpenIcon="@Icons.Material.Filled.TextSnippet" AdornmentColor="Color.Secondary" PopoverFixed="false" Modal="false" MaxHeight="280" Margin="Margin.Dense" Dense="true" Class="tm-select tm-select--dialog" PopoverClass="tm-select-popover" ListClass="tm-select-list">
@foreach (GameLogType item in Enum.GetValues(typeof(GameLogType)))
{
<MudSelectItem Value="@item">@item</MudSelectItem>
}
</MudSelect>
<MudTextField Immediate="true" @bind-Value="@sampleText" T="string" Label="Log data" Variant="Variant.Outlined" Lines="5" Class="mt-4"/>
<MudTextField Immediate="true" @bind-Value="@sampleText" T="string" Label="@LocalizationService.GetString("LogData")" Variant="Variant.Outlined" Lines="5" Class="mt-4"/>
</DialogContent>
<DialogActions>
<MudButton OnClick="Cancel">@LocalizationService.GetString("Cancel")</MudButton>
Expand Down
32 changes: 19 additions & 13 deletions TarkovMonitor/Blazor/Pages/RawLogs/ForceReadDialog.razor
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
else
{
<span>No EFT profile loaded.</span>
<span>@LocalizationService.GetString("NoEftProfileLoaded")</span>
}
</MudText>
<MudText>
Expand All @@ -24,7 +24,7 @@
@if (eft.IsGameRunning)
{
<MudAlert Severity="Severity.Warning" Dense="true" Class="mt-2">
Read Past Logs is unavailable while Escape from Tarkov is running. Close EFT before importing historical task updates.
@LocalizationService.GetString("ReadPastLogsUnavailableWhileRunning")
</MudAlert>
}
@if (customWatcher.LogsPath != "")
Expand Down Expand Up @@ -157,28 +157,28 @@
if (eft.IsGameRunning)
{
messageLog.AddMessage(
"Read Past Logs was not started because Escape from Tarkov is running. Close EFT before importing historical task updates.",
LocalizationService.GetString("ReadPastLogsNotStartedRunning"),
"warning");
return;
}
if (!breakpoint.Profile.HasIdentity || !breakpoint.Profile.SupportsTarkovTrackerWrites)
{
messageLog.AddMessage(
$"Tarkov Tracker does not support {breakpoint.Profile.DisplayName} historical task updates. No updates were sent.",
LocalizationService.GetString("TrackerUnsupportedModeHistory", breakpoint.Profile.DisplayName),
"warning");
return;
}
if (TarkovTracker.IsLegacyService)
{
messageLog.AddMessage(
"Read Past Logs requires TarkovTracker.org. Switch the Tarkov Tracker service in Settings and try again.",
LocalizationService.GetString("ReadPastLogsRequiresOrg"),
"warning");
return;
}
if (string.IsNullOrWhiteSpace(TarkovTracker.GetTokenForProfile(breakpoint.Profile)))
{
messageLog.AddMessage(
$"A verified {breakpoint.Profile.DisplayName} TarkovTracker.org API token assigned to this exact EFT profile is required to read past logs.",
LocalizationService.GetString("ReadPastLogsRequiresToken", breakpoint.Profile.DisplayName),
"warning");
return;
}
Expand All @@ -205,7 +205,7 @@
if (eft.IsGameRunning)
{
messageLog.AddMessage(
"Read Past Logs was cancelled because Escape from Tarkov started before historical processing began.",
LocalizationService.GetString("ReadPastLogsCancelledStarted"),
"warning");
return;
}
Expand Down Expand Up @@ -268,23 +268,29 @@
continue;
}
updateTasks.Add(kvp.Key, kvp.Value);
var taskMessageKey = kvp.Value switch
{
TarkovMonitor.TaskStatus.Finished => "TaskCompleted",
TarkovMonitor.TaskStatus.Failed => "TaskFailed",
_ => "TaskStarted",
};
taskMessages.Add(new MonitorMessage(
$"{kvp.Value} task: {task.name}.",
LocalizationService.GetString(taskMessageKey, task.name),
"quest",
$"https://tarkov.dev/task/{task.normalizedName}"));
}

if (eft.IsGameRunning)
{
messageLog.AddMessage(
"Read Past Logs was cancelled because Escape from Tarkov started before task updates were sent.",
LocalizationService.GetString("ReadPastLogsCancelledBeforeSend"),
"warning");
return;
}
}
catch (Exception ex)
{
messageLog.AddException("Past-log task updates could not be compiled.", "TM-LOG-001", "CompileTaskUpdates", ex, "LogParser", "PastLogs", durationMilliseconds: DiagnosticsService.ElapsedMilliseconds(startedUtc));
messageLog.AddException(LocalizationService.GetString("PastLogUpdatesCompileFailed"), "TM-LOG-001", "CompileTaskUpdates", ex, "LogParser", "PastLogs", durationMilliseconds: DiagnosticsService.ElapsedMilliseconds(startedUtc));
return;
}

Expand All @@ -306,20 +312,20 @@
await TarkovTracker.SetTaskStatuses(updateTasks, trackerLease);
messageLog.AddMessages(taskMessages, preserveDisplayOrder: true);
messageLog.AddMessage(
$"Updated {updateTasks.Count} of {totalTasks} tasks found in the selected logs.",
LocalizationService.GetString("PastLogUpdatedTasks", updateTasks.Count, totalTasks),
"info");
}
else
{
messageLog.AddMessage(
$"Checked {totalTasks} tasks in the selected logs. Tarkov Tracker was already up to date.",
LocalizationService.GetString("PastLogCheckedTasks", totalTasks),
"info");
}
MudDialog.Close(DialogResult.Ok(true));
}
catch (Exception ex)
{
messageLog.AddException("Past-log task updates could not be sent.", "TM-API-TRACKER-007", "UpdatePastLogTasks", ex, "TarkovTracker", "PastLogs", $"https://{Properties.Settings.Default.tarkovTrackerDomain}", DiagnosticsService.ElapsedMilliseconds(updateStartedUtc));
messageLog.AddException(LocalizationService.GetString("PastLogUpdatesSendFailed"), "TM-API-TRACKER-007", "UpdatePastLogTasks", ex, "TarkovTracker", "PastLogs", $"https://{Properties.Settings.Default.tarkovTrackerDomain}", DiagnosticsService.ElapsedMilliseconds(updateStartedUtc));
}
}
finally
Expand Down
6 changes: 3 additions & 3 deletions TarkovMonitor/Blazor/Pages/RawLogs/RawLogs.razor
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<div class="tm-menu-host">
<MudMenu AnchorOrigin="Origin.TopRight" TransformOrigin="Origin.BottomRight" RelativeWidth="DropdownWidth.Adaptive" PopoverFixed="false" Modal="false" Dense="true" MaxHeight="280" Class="tm-menu" PopoverClass="tm-menu-popover" ListClass="tm-menu-list">
<ActivatorContent>
<MudFab Color="Color.Secondary" StartIcon="@Icons.Material.Filled.Add" Size="Size.Small" Class="tm-menu-activator" aria-label="Log actions" />
<MudFab Color="Color.Secondary" StartIcon="@Icons.Material.Filled.Add" Size="Size.Small" Class="tm-menu-activator" aria-label="@LocalizationService.GetString("LogActions")" />
</ActivatorContent>
<ChildContent>
@if(DebugMode())
Expand All @@ -46,13 +46,13 @@
private void OpenCustomDialog()
{
var options = new DialogOptions { CloseOnEscapeKey = true, MaxWidth = MaxWidth.ExtraLarge, FullWidth = true };
DialogService.ShowAsync<CustomLogDialog>("Process custom log data", options);
DialogService.ShowAsync<CustomLogDialog>(LocalizationService.GetString("ProcessCustomLogData"), options);
}

private void OpenForceReadDialog()
{
var options = new DialogOptions { CloseOnEscapeKey = false, BackdropClick = false, MaxWidth = MaxWidth.ExtraLarge, FullWidth = true };
DialogService.ShowAsync<ForceReadDialog>("Read past log files", options);
DialogService.ShowAsync<ForceReadDialog>(LocalizationService.GetString("ReadPastLogsTitle"), options);
}

private void OpenLogsFolder()
Expand Down
Loading