Merge branch 'main' into development
# Conflicts: # LANCommander.Launcher.Services/AuthenticationService.cs # LANCommander.Launcher/UI/App.Chat.razor # LANCommander.Launcher/UI/App.Main.razor # LANCommander.Launcher/UI/Pages/Settings/Index.razor
This commit is contained in:
commit
5fa665f5ed
35 changed files with 76 additions and 48 deletions
|
|
@ -1,6 +1,9 @@
|
|||
name: LANCommander Development
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- development
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
|
|
|
|||
|
|
@ -7,8 +7,6 @@ using LANCommander.SDK.Providers;
|
|||
using LANCommander.SDK.Services;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Settings = LANCommander.Launcher.Models.Settings;
|
||||
|
||||
namespace LANCommander.Launcher.Services;
|
||||
|
||||
|
|
@ -37,6 +35,7 @@ public class AuthenticationService(
|
|||
}
|
||||
catch
|
||||
{
|
||||
logger.LogDebug("Server could not be reached");
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ using LANCommander.SDK;
|
|||
using LANCommander.SDK.Extensions;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Collections.ObjectModel;
|
||||
using LANCommander.SDK.Services;
|
||||
|
||||
namespace LANCommander.Launcher.Services
|
||||
{
|
||||
|
|
@ -18,13 +19,13 @@ namespace LANCommander.Launcher.Services
|
|||
public delegate Task OnItemsFilteredHandler(IEnumerable<ListItem> items);
|
||||
public event OnItemsFilteredHandler OnItemsFiltered;
|
||||
|
||||
private SDK.Client _client;
|
||||
private DepotClient _depotClient;
|
||||
|
||||
public DepotService(
|
||||
Client client,
|
||||
DepotClient depotClient,
|
||||
ILogger<DepotService> logger) : base(logger)
|
||||
{
|
||||
_client = client;
|
||||
_depotClient = depotClient;
|
||||
Filter.OnChanged += Filter_OnChanged;
|
||||
}
|
||||
|
||||
|
|
@ -62,7 +63,7 @@ namespace LANCommander.Launcher.Services
|
|||
|
||||
using (var op = Logger.BeginDebugOperation("Loading depot items from host"))
|
||||
{
|
||||
var results = await _client.Depot.GetAsync();
|
||||
var results = await _depotClient.GetAsync();
|
||||
|
||||
Filter.Populate(results);
|
||||
|
||||
|
|
|
|||
|
|
@ -21,4 +21,4 @@
|
|||
if (currentUri.LocalPath == "/")
|
||||
NavigationManager.NavigateTo("/Chat", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
@page "/Authenticate"
|
||||
|
||||
<AuthenticationForm />
|
||||
|
||||
@code {
|
||||
|
||||
}
|
||||
|
|
@ -1,4 +1,3 @@
|
|||
@using LANCommander.Launcher.UI.Authenticate.Components
|
||||
@using LANCommander.SDK.Services
|
||||
@namespace LANCommander.Launcher.UI
|
||||
@inject IMessageService MessageService
|
||||
|
|
|
|||
|
|
@ -7,6 +7,6 @@
|
|||
var currentUri = new Uri(NavigationManager.Uri);
|
||||
|
||||
if (String.IsNullOrEmpty(Client.Settings.CurrentValue.Authentication.AccessToken) && currentUri.LocalPath != "/Authenticate")
|
||||
NavigationManager.NavigateTo("/Authenticate");
|
||||
NavigationManager.NavigateTo("/Authenticate", true);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
12
LANCommander.Launcher/UI/Layouts/AuthenticatedLayout.razor
Normal file
12
LANCommander.Launcher/UI/Layouts/AuthenticatedLayout.razor
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
@using LANCommander.Launcher.UI.Windows
|
||||
@inherits LayoutComponentBase
|
||||
@layout MainWindow
|
||||
|
||||
<AuthenticatedView NoAutoValidate="false">
|
||||
<Authenticated>
|
||||
@Body
|
||||
</Authenticated>
|
||||
<NotAuthenticated>
|
||||
<RedirectToLogin/>
|
||||
</NotAuthenticated>
|
||||
</AuthenticatedView>
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
namespace LANCommander.Launcher.UI.Authenticate.Components;
|
||||
namespace LANCommander.Launcher.UI.Components;
|
||||
|
||||
public class AuthenticationFormState
|
||||
{
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
namespace LANCommander.Launcher.UI.Authenticate.Components;
|
||||
namespace LANCommander.Launcher.UI.Components;
|
||||
|
||||
public enum AuthenticationStage
|
||||
{
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
@using LANCommander.SDK.Exceptions
|
||||
@using LANCommander.SDK.Models
|
||||
@using LANCommander.SDK.Services
|
||||
@namespace LANCommander.Launcher.UI.Components
|
||||
@inject AuthenticationService AuthenticationService
|
||||
@inject SDK.Client Client
|
||||
@inject IConnectionClient ConnectionClient
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
@using LANCommander.SDK.Exceptions
|
||||
@using LANCommander.SDK.Models
|
||||
@namespace LANCommander.Launcher.UI.Components
|
||||
@inject AuthenticationService AuthenticationService
|
||||
@inject SDK.Client Client
|
||||
@inject NavigationManager NavigationManager
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
@using LANCommander.Launcher.Models
|
||||
@using LANCommander.SDK.Models
|
||||
@using ListItem = AntDesign.ListItem
|
||||
@namespace LANCommander.Launcher.UI.Components
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject SDK.Client Client
|
||||
@inject AuthenticationService AuthenticationService
|
||||
11
LANCommander.Launcher/UI/Pages/Authenticate/Index.razor
Normal file
11
LANCommander.Launcher/UI/Pages/Authenticate/Index.razor
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
@page "/Authenticate"
|
||||
|
||||
<AuthenticationForm />
|
||||
|
||||
@code {
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
@using LANCommander.Launcher.Models.Enums
|
||||
@using LANCommander.SDK.Models
|
||||
@namespace LANCommander.Launcher.UI.Components
|
||||
@inject DepotService DepotService
|
||||
@inject LocalizationService LocalizationService
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
@using LANCommander.Launcher.Data.Models
|
||||
@using LANCommander.Launcher.Models
|
||||
@using LANCommander.SDK.Extensions
|
||||
@inject DepotService DepotService
|
||||
@namespace LANCommander.Launcher.UI.Components
|
||||
@inject LibraryService LibraryService
|
||||
@inject GameService GameService
|
||||
@inject InstallService InstallService
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
@using LANCommander.SDK.Models
|
||||
@inject SDK.Client Client
|
||||
@inject DepotService DepotService
|
||||
@namespace LANCommander.Launcher.UI.Components
|
||||
@inject LibraryService LibraryService
|
||||
@inject ImportService ImportService
|
||||
@inject IMessageService MessageService
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
@inject SDK.Client Client
|
||||
@namespace LANCommander.Launcher.UI.Components
|
||||
@inject DepotService DepotService
|
||||
@inject LocalizationService LocalizationService
|
||||
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
@page "/Depot"
|
||||
@page "/Depot/{id:guid}"
|
||||
@using LANCommander.Launcher.Models
|
||||
@using LANCommander.Launcher.UI.Depot.Components
|
||||
@using LANCommander.SDK.Exceptions
|
||||
@implements IDisposable
|
||||
@layout AuthenticatedLayout
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject DepotService DepotService
|
||||
@inject LibraryService LibraryService
|
||||
|
|
@ -4,6 +4,7 @@
|
|||
@using Button = AntDesign.Button
|
||||
@using ButtonType = AntDesign.ButtonType
|
||||
@using Tooltip = AntDesign.Tooltip
|
||||
@namespace LANCommander.Launcher.UI.Components
|
||||
@inject LocalizationService LocalizationService
|
||||
@inject InstallService InstallService
|
||||
@inject GameClient GameClient
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
@using LANCommander.Launcher.Data.Models
|
||||
@using LANCommander.SDK.Services
|
||||
@namespace LANCommander.Launcher.UI.Components
|
||||
@inject GameClient GameClient
|
||||
|
||||
<CascadingValue Value="CurrentGame">
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
@namespace LANCommander.Launcher.UI.Components
|
||||
@inject LocalizationService LocalizationService
|
||||
|
||||
<div class="game-metadata">
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
@namespace LANCommander.Launcher.UI.Components
|
||||
@using ListItem = LANCommander.Launcher.Models.ListItem
|
||||
|
||||
@if (CurrentItem?.DataItem is Data.Models.Game)
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
@using LANCommander.SDK.Extensions
|
||||
@namespace LANCommander.Launcher.UI.Components
|
||||
@inject LibraryService LibraryService
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject LocalizationService LocalizationService
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
@using LANCommander.Launcher.Models
|
||||
@namespace LANCommander.Launcher.UI.Components
|
||||
|
||||
<Dropdown Trigger="new Trigger[] { Trigger.ContextMenu }" Style="display: block; width: 100%;">
|
||||
<Overlay>
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
@page "/Library/{id:guid}"
|
||||
@using LANCommander.Launcher.Data.Models
|
||||
@using LANCommander.Launcher.Models
|
||||
@using LANCommander.Launcher.UI.Library.Components
|
||||
@layout AuthenticatedLayout
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject LibraryService LibraryService
|
||||
@inject InstallService InstallService
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
@page "/Settings"
|
||||
@using System.Globalization
|
||||
@using LANCommander.Launcher.Models
|
||||
@using LANCommander.SDK.Providers
|
||||
@layout AuthenticatedLayout
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject UpdateService UpdateService
|
||||
|
|
@ -68,22 +68,9 @@
|
|||
<WindowContent>
|
||||
<ErrorHandler Title="@LocalizationService.GetString("LauncherCrashed")">
|
||||
<Body>
|
||||
<AuthenticatedView NoAutoValidate="false">
|
||||
<Authenticated>
|
||||
@Body
|
||||
@Body
|
||||
|
||||
@if (Client.Settings.CurrentValue.Debug.EnableScriptDebugging)
|
||||
{
|
||||
<PowerShellConsole/>
|
||||
}
|
||||
|
||||
</Authenticated>
|
||||
<NotAuthenticated>
|
||||
<RedirectToLogin />
|
||||
</NotAuthenticated>
|
||||
</AuthenticatedView>
|
||||
|
||||
<ImportHandler @ref="ImportHandler" Progress="OnImportProcess" />
|
||||
<ImportHandler @ref="ImportHandler" Progress="OnImportProcess"/>
|
||||
<UpdateChecker/>
|
||||
<AntContainer/>
|
||||
<KeepAliveContainer/>
|
||||
|
|
@ -7,5 +7,6 @@
|
|||
@using Microsoft.JSInterop
|
||||
@using LANCommander.Launcher
|
||||
@using LANCommander.Launcher.UI.Components
|
||||
@using LANCommander.Launcher.UI.Layouts
|
||||
@using LANCommander.Launcher.Services
|
||||
@using AntDesign
|
||||
|
|
@ -19,6 +19,7 @@ public class AuthenticationClient(
|
|||
ILogger<AuthenticationClient> logger,
|
||||
ITokenProvider tokenProvider,
|
||||
IServerConfigurationRefresher configRefresher,
|
||||
ISettingsProvider settingsProvider,
|
||||
ApiRequestFactory apiRequestFactory,
|
||||
IConnectionClient connectionClient)
|
||||
{
|
||||
|
|
@ -88,7 +89,7 @@ public class AuthenticationClient(
|
|||
{
|
||||
try
|
||||
{
|
||||
apiRequestFactory
|
||||
await apiRequestFactory
|
||||
.Create()
|
||||
.UseRoute("/api/Auth/Logout")
|
||||
.UseAuthenticationToken()
|
||||
|
|
@ -102,6 +103,12 @@ public class AuthenticationClient(
|
|||
}
|
||||
|
||||
tokenProvider.SetToken(null);
|
||||
settingsProvider.Update(s =>
|
||||
{
|
||||
s.Authentication.AccessToken = null;
|
||||
s.Authentication.RefreshToken = null;
|
||||
s.Authentication.OfflineModeEnabled = false;
|
||||
});
|
||||
}
|
||||
|
||||
public async Task RegisterAsync(string username, string password, string passwordConfirmation)
|
||||
|
|
|
|||
|
|
@ -77,9 +77,21 @@ namespace LANCommander.Server.Controllers.Api
|
|||
|
||||
var results = await Cache.GetOrSetAsync("Depot/Results", async _ =>
|
||||
{
|
||||
var games = await GameService
|
||||
.AsNoTracking()
|
||||
.Include(g => g.Media)
|
||||
.Include(g => g.Collections)
|
||||
.Include(g => g.Platforms)
|
||||
.Include(g => g.Tags)
|
||||
.Include(g => g.Developers)
|
||||
.Include(g => g.Genres)
|
||||
.Include(g => g.Publishers)
|
||||
.Include(g => g.Engine)
|
||||
.GetAsync();
|
||||
|
||||
var results = new SDK.Models.DepotResults()
|
||||
{
|
||||
Games = Mapper.Map<ICollection<DepotGame>>(await GameService.AsNoTracking().GetAsync()),
|
||||
Games = Mapper.Map<ICollection<DepotGame>>(games),
|
||||
Collections = Mapper.Map<ICollection<SDK.Models.Collection>>(await CollectionService.AsNoTracking().GetAsync()),
|
||||
Companies = Mapper.Map<ICollection<SDK.Models.Company>>(await CompanyService.AsNoTracking().GetAsync()),
|
||||
Engines = Mapper.Map<ICollection<SDK.Models.Engine>>(await EngineService.AsNoTracking().GetAsync()),
|
||||
|
|
|
|||
|
|
@ -12,13 +12,6 @@ services:
|
|||
# - WINE=1
|
||||
volumes:
|
||||
- /path/to/appdata/config:/app/config
|
||||
- /path/to/appdata/Backups:/app/Backups
|
||||
- /path/to/appdata/Launcher:/app/Launcher
|
||||
- /path/to/appdata/Media:/app/Media
|
||||
- /path/to/appdata/Saves:/app/Saves
|
||||
- /path/to/appdata/Servers:/app/Servers
|
||||
- /path/to/appdata/Uploads:/app/Uploads
|
||||
- /path/to/appdata/Updates:/app/Updates
|
||||
ports:
|
||||
- 1337:1337/tcp # Webinterface
|
||||
- 35891:35891/udp # Beacon Broadcast
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue