mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 19:21:10 +00:00
Adds initial ASP.NET Core MVC replacement for Blazor WASM
This commit is contained in:
1 parent
5409200c7a
commit
193861c9c5
56 files changed
+505
-4139
No files matched your search
@@ -0,0 +1,27 @@
|
|||||||
|
#region ========================================================================= USING =====================================================================================
|
||||||
|
using Lumina.Contracts.Responses.FileManagement;
|
||||||
|
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.ValueObjects;
|
||||||
|
using Mapster;
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
namespace Lumina.Application.Common.Mapping.FileManagement;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Mapping configuration for file system thumbnails between the domain object and the presentation object.
|
||||||
|
/// </summary>
|
||||||
|
public class ThumbnailMappingConfig : IRegister
|
||||||
|
{
|
||||||
|
#region ===================================================================== METHODS ===================================================================================
|
||||||
|
/// <summary>
|
||||||
|
/// Registers the mapping configuration.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="config">The type adapter configuration.</param>
|
||||||
|
public void Register(TypeAdapterConfig config)
|
||||||
|
{
|
||||||
|
config.NewConfig<Thumbnail, ThumbnailResponse>()
|
||||||
|
.Map(dest => dest.Type, src => src.Type)
|
||||||
|
.Map(dest => dest.Bytes, src => src.Bytes)
|
||||||
|
.MapToConstructor(true);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
#region ========================================================================= USING =====================================================================================
|
||||||
|
using ErrorOr;
|
||||||
|
using Lumina.Contracts.Responses.FileManagement;
|
||||||
|
using Mediator;
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
namespace Lumina.Application.Core.FileManagement.Thumbnails.Queries.GetThumbnail;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Query for retrieving the thumbnail of a file at a path.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Path">The file path of the image to generate the thumbnail from.</param>
|
||||||
|
/// <param name="Quality">The desired quality of the thumbnail image (e.g., resolution or compression level).</param>
|
||||||
|
public record GetThumbnailQuery(string Path, int Quality) : IRequest<ErrorOr<ThumbnailResponse>>;
|
||||||
+47
@@ -0,0 +1,47 @@
|
|||||||
|
#region ========================================================================= USING =====================================================================================
|
||||||
|
using ErrorOr;
|
||||||
|
using Lumina.Contracts.Responses.FileManagement;
|
||||||
|
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Services;
|
||||||
|
using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.ValueObjects;
|
||||||
|
using Mapster;
|
||||||
|
using Mediator;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
namespace Lumina.Application.Core.FileManagement.Thumbnails.Queries.GetThumbnail;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Handler for the query to get the file thumbnail.
|
||||||
|
/// </summary>
|
||||||
|
public class GetThumbnailQueryHandler : IRequestHandler<GetThumbnailQuery, ErrorOr<ThumbnailResponse>>
|
||||||
|
{
|
||||||
|
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||||
|
private readonly IThumbnailService _thumbnailsService;
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region ====================================================================== CTOR =====================================================================================
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="GetThumbnailQueryHandler"/> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="thumbnailsService">Injected service for handling thumbnails.</param>
|
||||||
|
public GetThumbnailQueryHandler(IThumbnailService thumbnailsService)
|
||||||
|
{
|
||||||
|
_thumbnailsService = thumbnailsService;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region ===================================================================== METHODS ===================================================================================
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the thumbnail for a file located at the specified path, with the specified quality.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request">The query to be handled.</param>
|
||||||
|
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||||
|
/// <returns>An <see cref="ErrorOr{T}"/> containing either a thumbnail, or an error.</returns>
|
||||||
|
public async ValueTask<ErrorOr<ThumbnailResponse>> Handle(GetThumbnailQuery request, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
ErrorOr<Thumbnail> result = await _thumbnailsService.GetThumbnailAsync(request.Path, request.Quality, cancellationToken);
|
||||||
|
return await ValueTask.FromResult(result.Match(values => ErrorOrFactory.From(result.Value.Adapt<ThumbnailResponse>()), errors => errors));
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
#region ========================================================================= USING =====================================================================================
|
||||||
|
using Lumina.Contracts.Enums.PhotoLibrary;
|
||||||
|
using System.Diagnostics;
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
namespace Lumina.Contracts.Responses.FileManagement;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data transfer object for thumbnails.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Type">The type of the thumbnail image.</param>
|
||||||
|
/// <param name="Bytes">The bytes representing the thumbail.</param>
|
||||||
|
[DebuggerDisplay("{Type}")]
|
||||||
|
public record ThumbnailResponse(ImageType Type, byte[] Bytes);
|
||||||
+4
-4
@@ -17,8 +17,8 @@ namespace Lumina.Domain.Core.Aggregates.WrittenContentLibrary.BookLibraryAggrega
|
|||||||
public sealed class Isbn : ValueObject
|
public sealed class Isbn : ValueObject
|
||||||
{
|
{
|
||||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||||
private static readonly Regex _isbn10Regex = new(@"^(?:ISBN(?:-10)?:? )?(?=[0-9X]{10}$|(?=(?:[0-9]+[-\ ]){3})[-\ 0-9X]{13}$)[0-9]{1,5}[-\ ]?[0-9]+[-\ ]?[0-9]+[-\ ]?[0-9X]$", RegexOptions.Compiled);
|
private static readonly Regex s_isbn10Regex = new(@"^(?:ISBN(?:-10)?:? )?(?=[0-9X]{10}$|(?=(?:[0-9]+[-\ ]){3})[-\ 0-9X]{13}$)[0-9]{1,5}[-\ ]?[0-9]+[-\ ]?[0-9]+[-\ ]?[0-9X]$", RegexOptions.Compiled);
|
||||||
private static readonly Regex _isbn13Regex = new(@"^(?:ISBN(?:-13)?:? )?(?=[0-9]{13}$|(?=(?:[0-9]+[-\ ]){4})[-\ 0-9]{17}$)97[89][-\ ]?[0-9]{1,5}[-\ ]?[0-9]+[-\ ]?[0-9]+[-\ ]?[0-9]$", RegexOptions.Compiled);
|
private static readonly Regex s_isbn13Regex = new(@"^(?:ISBN(?:-13)?:? )?(?=[0-9]{13}$|(?=(?:[0-9]+[-\ ]){4})[-\ 0-9]{17}$)97[89][-\ ]?[0-9]{1,5}[-\ ]?[0-9]+[-\ ]?[0-9]+[-\ ]?[0-9]$", RegexOptions.Compiled);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region ==================================================================== PROPERTIES =================================================================================
|
#region ==================================================================== PROPERTIES =================================================================================
|
||||||
@@ -83,7 +83,7 @@ public sealed class Isbn : ValueObject
|
|||||||
/// <returns><see langword="true"/> if the ISBN-10 is valid, <see langword="false"/> otherwise.</returns>
|
/// <returns><see langword="true"/> if the ISBN-10 is valid, <see langword="false"/> otherwise.</returns>
|
||||||
public static bool IsValidIsbn10(string isbn)
|
public static bool IsValidIsbn10(string isbn)
|
||||||
{
|
{
|
||||||
if (!_isbn10Regex.IsMatch(isbn))
|
if (!s_isbn10Regex.IsMatch(isbn))
|
||||||
return false;
|
return false;
|
||||||
// remove any hyphens or spaces
|
// remove any hyphens or spaces
|
||||||
isbn = isbn.Replace("-", "").Replace(" ", "").ToUpper();
|
isbn = isbn.Replace("-", "").Replace(" ", "").ToUpper();
|
||||||
@@ -105,7 +105,7 @@ public sealed class Isbn : ValueObject
|
|||||||
/// <returns><see langword="true"/> if the ISBN-13 is valid, <see langword="false"/> otherwise.</returns>
|
/// <returns><see langword="true"/> if the ISBN-13 is valid, <see langword="false"/> otherwise.</returns>
|
||||||
public static bool IsValidIsbn13(string isbn)
|
public static bool IsValidIsbn13(string isbn)
|
||||||
{
|
{
|
||||||
if (!_isbn13Regex.IsMatch(isbn))
|
if (!s_isbn13Regex.IsMatch(isbn))
|
||||||
return false;
|
return false;
|
||||||
// remove any hyphens or spaces
|
// remove any hyphens or spaces
|
||||||
isbn = isbn.Replace("-", "").Replace(" ", "");
|
isbn = isbn.Replace("-", "").Replace(" ", "");
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
#region ========================================================================= USING =====================================================================================
|
||||||
|
using Lumina.Contracts.Enums.PhotoLibrary;
|
||||||
|
using System.Collections.Frozen;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
namespace Lumina.Presentation.Api.Common.Utilities;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Utility class for converting from domain image types to known image mime types.
|
||||||
|
/// </summary>
|
||||||
|
public static class MimeTypes
|
||||||
|
{
|
||||||
|
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||||
|
private static readonly FrozenDictionary<ImageType, string> s_imageTypeToMimeType = new Dictionary<ImageType, string>
|
||||||
|
{
|
||||||
|
{ ImageType.BMP, "image/bmp" },
|
||||||
|
{ ImageType.GIF, "image/gif" },
|
||||||
|
{ ImageType.PNG, "image/png" },
|
||||||
|
{ ImageType.TIFF, "image/tiff" },
|
||||||
|
{ ImageType.JPEG, "image/jpeg" },
|
||||||
|
{ ImageType.JPEG_CANON, "image/jpeg" },
|
||||||
|
{ ImageType.JPEG_UNKNOWN, "image/jpeg" },
|
||||||
|
{ ImageType.PICT, "image/x-pict" },
|
||||||
|
{ ImageType.ICO, "image/x-icon" },
|
||||||
|
{ ImageType.PSD, "image/vnd.adobe.photoshop" },
|
||||||
|
{ ImageType.JPEG2000, "image/jp2" },
|
||||||
|
{ ImageType.AVIF, "image/avif" },
|
||||||
|
{ ImageType.WEBP, "image/webp" },
|
||||||
|
{ ImageType.TGA, "image/x-tga" },
|
||||||
|
{ ImageType.SVG, "image/svg+xml" }
|
||||||
|
}.ToFrozenDictionary();
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region ===================================================================== METHODS ===================================================================================
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the mime type of <paramref name="type"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="type">The domain image type for which to get the mime type.</param>
|
||||||
|
/// <returns>The mime type for <paramref name="type"/>.</returns>
|
||||||
|
public static string GetMimeType(ImageType type)
|
||||||
|
{
|
||||||
|
return s_imageTypeToMimeType.TryGetValue(type, out string? mimeType) ? mimeType : "application/octet-stream";
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
#region ========================================================================= USING =====================================================================================
|
||||||
|
using ErrorOr;
|
||||||
|
using Lumina.Application.Core.FileManagement.Thumbnails.Queries.GetThumbnail;
|
||||||
|
using Lumina.Contracts.Responses.FileManagement;
|
||||||
|
using Lumina.Presentation.Api.Common.ModelBinders;
|
||||||
|
using Lumina.Presentation.Api.Common.Utilities;
|
||||||
|
using Lumina.Presentation.Api.Core.Controllers.Common;
|
||||||
|
using Mediator;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
namespace Lumina.Presentation.Api.Core.Controllers.FileManagement;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Controller for managing file system items thumbnails.
|
||||||
|
/// </summary>
|
||||||
|
[ApiVersion("1.0")]
|
||||||
|
[Route("api/v{version:apiVersion}/[controller]")]
|
||||||
|
public class ThumbnailsController : ApiController
|
||||||
|
{
|
||||||
|
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||||
|
private readonly ISender _mediator;
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region ====================================================================== CTOR =====================================================================================
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="ThumbnailsController"/> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="mediator">Injected service for mediating commands and queries.</param>
|
||||||
|
public ThumbnailsController(ISender mediator)
|
||||||
|
{
|
||||||
|
_mediator = mediator;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region ===================================================================== METHODS ===================================================================================
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the thumbnail of a file identified by of <paramref name="path"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path">The path of the file for which to get the thumbnail.</param>
|
||||||
|
/// <param name="quality">The quality to use for the thumbnail.</param>
|
||||||
|
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||||
|
[HttpGet("get-thumbnail")]
|
||||||
|
public async Task<IActionResult> GetThumbnail([FromQuery, ModelBinder(typeof(UrlStringBinder))] string path, [FromQuery] int quality, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
ErrorOr<ThumbnailResponse> getResult = await _mediator.Send(new GetThumbnailQuery(path, quality), cancellationToken);
|
||||||
|
return getResult.Match(result => File(result.Bytes, MimeTypes.GetMimeType(result.Type)), errors => Problem(errors));
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
<Router AppAssembly="@typeof(App).Assembly">
|
|
||||||
<Found Context="routeData">
|
|
||||||
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
|
|
||||||
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
|
|
||||||
</Found>
|
|
||||||
<NotFound>
|
|
||||||
<PageTitle>Not found</PageTitle>
|
|
||||||
<LayoutView Layout="@typeof(MainLayout)">
|
|
||||||
<p role="alert">Sorry, there's nothing at this address.</p>
|
|
||||||
</LayoutView>
|
|
||||||
</NotFound>
|
|
||||||
</Router>
|
|
||||||
@@ -3,7 +3,6 @@ using Lumina.Presentation.Web.Common.Exceptions;
|
|||||||
using Lumina.Presentation.Web.Common.Models.Common;
|
using Lumina.Presentation.Web.Common.Models.Common;
|
||||||
using Lumina.Presentation.Web.Common.Models.Configuration;
|
using Lumina.Presentation.Web.Common.Models.Configuration;
|
||||||
using Lumina.Presentation.Web.Common.Models.FileManagement;
|
using Lumina.Presentation.Web.Common.Models.FileManagement;
|
||||||
using Microsoft.AspNetCore.Components.WebAssembly.Http;
|
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -79,13 +78,7 @@ public class ApiHttpClient : IApiHttpClient
|
|||||||
/// <returns>An <see cref="IAsyncEnumerable{T}"/> object, which allows for asynchronous iteration over the deserialized items.</returns>
|
/// <returns>An <see cref="IAsyncEnumerable{T}"/> object, which allows for asynchronous iteration over the deserialized items.</returns>
|
||||||
public async IAsyncEnumerable<TResponse?> GetAsyncEnumerable<TResponse>(string endpoint, string? token = null, [EnumeratorCancellation] CancellationToken cancellationToken = default)
|
public async IAsyncEnumerable<TResponse?> GetAsyncEnumerable<TResponse>(string endpoint, string? token = null, [EnumeratorCancellation] CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
using HttpRequestMessage request = new(HttpMethod.Get, endpoint);
|
using HttpRequestMessage request = new(HttpMethod.Get, endpoint);
|
||||||
// HttpClient is implemented differently in Blazor WASM, because there are no sockets in the browser, so its BrowserHttpHandler is implemented on top of Fetch API,
|
|
||||||
// which can provide response content in one of two forms: BrowserHttpContent, which is based on arrayBuffer method (this means that it will always read the response stream to its completion,
|
|
||||||
// before making the content available), and StreamContent that is wrapping WasmHttpReadStream, which is based on readable streams (this one allows for reading response as it comes).
|
|
||||||
// WasmHttpReadStream can only work when WebAssemblyEnableStreamingResponse is enabled on request, and only on browsers that support it
|
|
||||||
request.SetBrowserResponseStreamingEnabled(true);
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(token))
|
if (!string.IsNullOrEmpty(token))
|
||||||
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", token);
|
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", token);
|
||||||
// send the request and expect only headers initially - this prevents the client from buffering the entire response
|
// send the request and expect only headers initially - this prevents the client from buffering the entire response
|
||||||
|
|||||||
+6
-19
@@ -1,6 +1,5 @@
|
|||||||
using Lumina.Presentation.Web.Common.Models.Configuration;
|
using Lumina.Presentation.Web.Common.Models.Configuration;
|
||||||
using Lumina.Presentation.Web.Common.Utilities;
|
using Lumina.Presentation.Web.Common.Utilities;
|
||||||
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
|
||||||
@@ -12,30 +11,18 @@ namespace Lumina.Presentation.Web.Common.DependencyInjection;
|
|||||||
internal static class PresentationWebLayerConfiguration
|
internal static class PresentationWebLayerConfiguration
|
||||||
{
|
{
|
||||||
#region ===================================================================== METHODS ===================================================================================
|
#region ===================================================================== METHODS ===================================================================================
|
||||||
/// <summary>
|
|
||||||
/// Extension method for adding the Lumina.Presentation.Web configuration to the <see cref="WebAssemblyHostBuilder"/>.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="builder">The <see cref="WebAssemblyHostBuilder"/> to add the configuration to.</param>
|
|
||||||
/// <returns>The updated <see cref="WebAssemblyHostBuilder"/>.</returns>
|
|
||||||
public static WebAssemblyHostBuilder AddConfiguration(this WebAssemblyHostBuilder builder)
|
|
||||||
{
|
|
||||||
// add the configuration sources to the configuration builder
|
|
||||||
builder.Configuration.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true);
|
|
||||||
builder.Configuration.AddJsonFile("appsettings.Development.json", optional: true, reloadOnChange: true);
|
|
||||||
|
|
||||||
builder.Services.BindConfiguration(builder.Configuration);
|
|
||||||
|
|
||||||
return builder;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Extension method for registering the configuration options of the Lumina.Presentation.Web project into the Dependency Injection container.
|
/// Extension method for registering the configuration options of the Lumina.Presentation.Web project into the Dependency Injection container.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="serviceCollection">The <see cref="IServiceCollection"/> to bind the configuration options to.</param>
|
/// <param name="serviceCollection">The <see cref="IServiceCollection"/> to bind the configuration options to.</param>
|
||||||
/// <param name="configuration">The configuration to be bound.</param>
|
/// <param name="configuration">The configuration to be bound.</param>
|
||||||
/// <returns>The updated <see cref="IServiceCollection"/>.</returns>
|
/// <returns>The updated <see cref="IServiceCollection"/>.</returns>
|
||||||
internal static IServiceCollection BindConfiguration(this IServiceCollection serviceCollection, IConfiguration configuration)
|
internal static IServiceCollection BindConfiguration(this IServiceCollection serviceCollection, IConfigurationManager configuration)
|
||||||
{
|
{
|
||||||
|
// add the configuration sources to the configuration builder
|
||||||
|
configuration.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true);
|
||||||
|
configuration.AddJsonFile("appsettings.Development.json", optional: true, reloadOnChange: true);
|
||||||
|
|
||||||
serviceCollection.AddOptions<ServerConfigurationModel>()
|
serviceCollection.AddOptions<ServerConfigurationModel>()
|
||||||
.Bind(configuration.GetRequiredSection(ServerConfigurationModel.SECTION_NAME))
|
.Bind(configuration.GetRequiredSection(ServerConfigurationModel.SECTION_NAME))
|
||||||
.ValidateFluently()
|
.ValidateFluently()
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ public static class PresentationWebLayerServices
|
|||||||
/// <returns>The updated <see cref="IServiceCollection"/>.</returns>
|
/// <returns>The updated <see cref="IServiceCollection"/>.</returns>
|
||||||
public static IServiceCollection AddPresentationWebLayerServices(this IServiceCollection services)
|
public static IServiceCollection AddPresentationWebLayerServices(this IServiceCollection services)
|
||||||
{
|
{
|
||||||
|
services.AddControllersWithViews();
|
||||||
|
|
||||||
// scan the current assembly for validators and register them to the DI container
|
// scan the current assembly for validators and register them to the DI container
|
||||||
services.AddValidatorsFromAssemblyContaining<Program>(ServiceLifetime.Singleton);
|
services.AddValidatorsFromAssemblyContaining<Program>(ServiceLifetime.Singleton);
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
<button type="submit"
|
|
||||||
style="width: @($"{Width}{(UsesPercentForWidth ? "%" : "px")}"); height: @($"{Height}{(UsesPercentForHeight ? "%" : "px")}");"
|
|
||||||
class="@(IsConfirmButton ? "confirm" : "abort")-button f-16 @CssClass" @onclick="OnClick"
|
|
||||||
disabled="@IsDisabled">
|
|
||||||
@ChildContent
|
|
||||||
</button>
|
|
||||||
|
|
||||||
@code {
|
|
||||||
[Parameter] public RenderFragment? ChildContent { get; set; }
|
|
||||||
[Parameter] public EventCallback OnClick { get; set; }
|
|
||||||
[Parameter] public bool IsDisabled { get; set; }
|
|
||||||
[Parameter] public bool IsConfirmButton { get; set; } = true;
|
|
||||||
[Parameter] public bool UsesPercentForHeight { get; set; }
|
|
||||||
[Parameter] public bool UsesPercentForWidth { get; set; }
|
|
||||||
[Parameter] public int Width { get; set; } = 100;
|
|
||||||
[Parameter] public int Height { get; set; } = 22;
|
|
||||||
[Parameter] public string? CssClass { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,161 +0,0 @@
|
|||||||
.abort-button {
|
|
||||||
text-decoration: none;
|
|
||||||
border-radius: 4px;
|
|
||||||
border: solid 1px;
|
|
||||||
border-color: #006666 #004030 #003020 #006666;
|
|
||||||
background: linear-gradient(to bottom, #90AEA6 0%, #336659 50%, #004030 50%, #004030 100%);
|
|
||||||
color: #999999;
|
|
||||||
position: relative;
|
|
||||||
overflow: hidden;
|
|
||||||
transition: all 0.3s;
|
|
||||||
cursor: pointer;
|
|
||||||
outline: none;
|
|
||||||
box-shadow: 0 4px 4px rgba(0, 0, 0, 0.5);
|
|
||||||
z-index: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.abort-button:before {
|
|
||||||
content: "";
|
|
||||||
position: absolute;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
height: 50%;
|
|
||||||
background: radial-gradient(circle at center, #00FF00, transparent);
|
|
||||||
background-size: 120% 100%;
|
|
||||||
transform: translateY(100%);
|
|
||||||
background-position: center;
|
|
||||||
transition: transform 0.3s, opacity 0.8s;
|
|
||||||
pointer-events: none;
|
|
||||||
opacity: 0;
|
|
||||||
filter: blur(8px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.abort-button:hover {
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.abort-button:hover:before {
|
|
||||||
transform: translateY(50%);
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.abort-button:active {
|
|
||||||
background: #CC009F58;
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
|
|
||||||
.abort-button:disabled {
|
|
||||||
background: #333333;
|
|
||||||
border-color: #333333;
|
|
||||||
color: #777;
|
|
||||||
cursor: not-allowed;
|
|
||||||
}
|
|
||||||
|
|
||||||
.abort-button:disabled:hover:before {
|
|
||||||
transform: translateY(100%);
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.abort-button:disabled:active {
|
|
||||||
font-style: normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
.abort-button[disabled] {
|
|
||||||
background: #333333;
|
|
||||||
border-color: #333333;
|
|
||||||
color: #777;
|
|
||||||
cursor: not-allowed;
|
|
||||||
pointer-events: none;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.abort-button[disabled]:hover:before {
|
|
||||||
transform: translateY(100%);
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.abort-button[disabled]:active {
|
|
||||||
font-style: normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
.confirm-button {
|
|
||||||
text-decoration: none;
|
|
||||||
border-radius: 4px;
|
|
||||||
border: solid 1px;
|
|
||||||
border-color: #363636 #000 #000 #363636;
|
|
||||||
background: linear-gradient(to bottom, #AAAAAA 0%, #363636 50%, #000 50%, #000 100%);
|
|
||||||
color: #AAAAAA;
|
|
||||||
position: relative;
|
|
||||||
overflow: hidden;
|
|
||||||
transition: all 0.3s;
|
|
||||||
cursor: pointer;
|
|
||||||
outline: none;
|
|
||||||
box-shadow: 0 4px 4px rgba(0, 0, 0, 0.5);
|
|
||||||
z-index: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.confirm-button:before {
|
|
||||||
content: "";
|
|
||||||
position: absolute;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
height: 50%;
|
|
||||||
background: radial-gradient(circle at center, #00FF8B, transparent);
|
|
||||||
background-size: 120% 100%;
|
|
||||||
transform: translateY(100%);
|
|
||||||
background-position: center;
|
|
||||||
transition: transform 0.3s, opacity 0.8s;
|
|
||||||
pointer-events: none;
|
|
||||||
opacity: 0;
|
|
||||||
filter: blur(8px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.confirm-button:hover {
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.confirm-button:hover:before {
|
|
||||||
transform: translateY(50%);
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.confirm-button:active {
|
|
||||||
background: #CC000000;
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
|
|
||||||
.confirm-button:disabled {
|
|
||||||
background: #333333;
|
|
||||||
border-color: #333333;
|
|
||||||
color: #777;
|
|
||||||
cursor: not-allowed;
|
|
||||||
}
|
|
||||||
|
|
||||||
.confirm-button:disabled:hover:before {
|
|
||||||
transform: translateY(100%);
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.confirm-button:disabled:active {
|
|
||||||
font-style: normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
confirm-button[disabled] {
|
|
||||||
background: #333333;
|
|
||||||
border-color: #333333;
|
|
||||||
color: #777;
|
|
||||||
cursor: not-allowed;
|
|
||||||
pointer-events: none;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.confirm-button[disabled]:hover:before {
|
|
||||||
transform: translateY(100%);
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.confirm-button[disabled]:active {
|
|
||||||
font-style: normal;
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
<label class="enlightenment-checkbox-label @CssClass">
|
|
||||||
<input type="checkbox"
|
|
||||||
class="enlightenment-checkbox-hidden"
|
|
||||||
checked="@Checked"
|
|
||||||
@onchange="OnChangeHandler"
|
|
||||||
disabled="@Disabled" />
|
|
||||||
<span class="enlightenment-checkbox"></span>
|
|
||||||
@Label
|
|
||||||
</label>
|
|
||||||
|
|
||||||
@code {
|
|
||||||
[Parameter] public bool Checked { get; set; }
|
|
||||||
[Parameter] public EventCallback<bool> CheckedChanged { get; set; }
|
|
||||||
[Parameter] public string? Label { get; set; }
|
|
||||||
[Parameter] public bool Disabled { get; set; }
|
|
||||||
[Parameter] public string CssClass { get; set; } = "";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Handles the change event.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="e">The event arguments.</param>
|
|
||||||
private async Task OnChangeHandler(ChangeEventArgs e)
|
|
||||||
{
|
|
||||||
Checked = e?.Value != null ? (bool)e.Value : false;
|
|
||||||
await CheckedChanged.InvokeAsync(Checked).ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
.enlightenment-checkbox-label {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 14px;
|
|
||||||
color: #6DCBFE;
|
|
||||||
user-select: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.enlightenment-checkbox-hidden {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.enlightenment-checkbox {
|
|
||||||
width: 14px;
|
|
||||||
height: 14px;
|
|
||||||
border-top: #000000 1px solid;
|
|
||||||
border-bottom: #333333 1px solid;
|
|
||||||
border-left: #000000 1px solid;
|
|
||||||
border-right: #333333 1px solid;
|
|
||||||
border-radius: 0;
|
|
||||||
margin-right: 10px;
|
|
||||||
position: relative;
|
|
||||||
background: linear-gradient(to bottom, #111, #222 50%, #333);
|
|
||||||
}
|
|
||||||
|
|
||||||
.enlightenment-checkbox-hidden:checked + .enlightenment-checkbox {
|
|
||||||
background-image: linear-gradient(180deg, #5E5D5D, #505050, #424343);
|
|
||||||
border-top: #888888 1px solid;
|
|
||||||
border-bottom: #333333 1px solid;
|
|
||||||
border-left: #666666 1px solid;
|
|
||||||
border-right: #444444 1px solid;
|
|
||||||
}
|
|
||||||
@@ -1,91 +0,0 @@
|
|||||||
@using Lumina.Presentation.Web.Common.Models.UI
|
|
||||||
@using Lumina.Presentation.Web.Core.Services.UI
|
|
||||||
|
|
||||||
@typeparam TValue
|
|
||||||
|
|
||||||
@implements IDisposable
|
|
||||||
|
|
||||||
@inject ComboboxService _comboboxService
|
|
||||||
@inject IJSRuntime JSRuntime
|
|
||||||
|
|
||||||
<div id="combobox_@Id" class="enlightenment-combobox inline-block w-100 @(IsOpen ? "open" : string.Empty) @CssClass">
|
|
||||||
<div class="shine-effect"></div>
|
|
||||||
<input type="checkbox" class="enlightenment-toggle-checkbox" @bind="IsOpen" id="combobox_checkbox_@Id" @onclick="ToggleDropdownAsync">
|
|
||||||
<label class="enlightenment-toggle" for="combobox_checkbox_@Id">
|
|
||||||
<span class="enlightenment-selected-text">@(SelectedItem?.Text ?? "No item selected")</span>
|
|
||||||
</label>
|
|
||||||
<div class="enlightenment-dropdown">
|
|
||||||
<div class="shine-effect"></div>
|
|
||||||
<div class="enlightenment-item first-item disabled italic" @onclick="() => SelectItem(null)">No item selected</div>
|
|
||||||
|
|
||||||
@for (int i = 0; i < Items?.Count; i++)
|
|
||||||
{
|
|
||||||
var item = Items[i];
|
|
||||||
var cssClass = $"enlightenment-item {(i == Items.Count - 1 ? "last-item" : string.Empty)} {(item.IsEnabled ? string.Empty : "disabled")}";
|
|
||||||
<div class="@cssClass" @onclick="() => SelectItem(item)">@item.Text</div>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@code {
|
|
||||||
[Parameter] public List<ComboboxItem<TValue>> Items { get; set; } = [];
|
|
||||||
[Parameter] public ComboboxItem<TValue>? SelectedItem { get; set; }
|
|
||||||
[Parameter] public EventCallback<ComboboxItem<TValue>> SelectedItemChanged { get; set; }
|
|
||||||
[Parameter] public string? CssClass { get; set; }
|
|
||||||
|
|
||||||
private bool IsOpen { get; set; }
|
|
||||||
private Guid Id { get; set; } = Guid.NewGuid();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Initializes the component.
|
|
||||||
/// </summary>
|
|
||||||
protected override void OnInitialized()
|
|
||||||
{
|
|
||||||
_comboboxService.ComboboxOpened += CloseIfNotThisAsync;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Toggles the dropdown state.
|
|
||||||
/// </summary>
|
|
||||||
private async Task ToggleDropdownAsync()
|
|
||||||
{
|
|
||||||
IsOpen = !IsOpen;
|
|
||||||
if (IsOpen)
|
|
||||||
{
|
|
||||||
_comboboxService.NotifyComboboxOpened("combobox_checkbox_" + Id);
|
|
||||||
await JSRuntime.InvokeVoidAsync("adjustDropdownHeight", "combobox_" + Id).ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Closes the dropdown if the provided <paramref name="openedId"/> is not the current <see cref="Id"/>, or if it's <see langword="null"/>.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="openedId">The optional id of the combobox that initiated the dropdown state change.</param>
|
|
||||||
private async Task CloseIfNotThisAsync(string? openedId)
|
|
||||||
{
|
|
||||||
if (openedId != "combobox_checkbox_" + Id && IsOpen)
|
|
||||||
{
|
|
||||||
IsOpen = false;
|
|
||||||
await InvokeAsync(StateHasChanged);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Selects the provided <paramref name="item"/>.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="item">The item to select.</param>
|
|
||||||
private async Task SelectItem(ComboboxItem<TValue>? item)
|
|
||||||
{
|
|
||||||
SelectedItem = item;
|
|
||||||
IsOpen = false;
|
|
||||||
await SelectedItemChanged.InvokeAsync(item).ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Disposes the component.
|
|
||||||
/// </summary>
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
_comboboxService.ComboboxOpened -= CloseIfNotThisAsync;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,154 +0,0 @@
|
|||||||
.enlightenment-combobox {
|
|
||||||
position: relative;
|
|
||||||
font-family: Arial, sans-serif;
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
.enlightenment-toggle-checkbox {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.enlightenment-toggle {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
cursor: pointer;
|
|
||||||
font-family: Arial, sans-serif;
|
|
||||||
font-size: 14px;
|
|
||||||
border-radius: 3px;
|
|
||||||
box-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
|
|
||||||
color: #6DCBFE;
|
|
||||||
padding: 3px 24px 3px 18px;
|
|
||||||
width: 100%;
|
|
||||||
border: none;
|
|
||||||
outline: none;
|
|
||||||
appearance: none;
|
|
||||||
border-top: #989898 1px solid;
|
|
||||||
border-bottom: #151515 1px solid;
|
|
||||||
border-left: #878787 1px solid;
|
|
||||||
border-right: #202020 1px solid;
|
|
||||||
background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%225%22%3E%3Cpath%20fill%3D%22none%22%20stroke%3D%22%23fff%22%20stroke-width%3D%222%22%20d%3D%22M2%2C0L6%2C4L10%2C0%22%2F%3E%3C%2Fsvg%3E'), url('../images/ui/scrollbar_dots_v.png'), linear-gradient(180deg, #606060, #555555, #4C4C4C, #414141);
|
|
||||||
background-repeat: no-repeat, no-repeat, repeat;
|
|
||||||
background-position: right 10px top 50%, left 7px top 50%, 0 0;
|
|
||||||
background-size: 12px 6px, 3px auto, 100%;
|
|
||||||
user-select: none;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
.enlightenment-toggle:hover {
|
|
||||||
background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%225%22%3E%3Cpath%20fill%3D%22none%22%20stroke%3D%22%23fff%22%20stroke-width%3D%222%22%20d%3D%22M2%2C0L6%2C4L10%2C0%22%2F%3E%3C%2Fsvg%3E'), url('../images/ui/scrollbar_dots_lit_v.png'), linear-gradient(180deg, #606060, #555555, #4C4C4C, #414141);
|
|
||||||
background-repeat: no-repeat, no-repeat, repeat;
|
|
||||||
background-position: right 10px top 50%, left 7px top 50%, 0 0;
|
|
||||||
background-size: 12px 6px, 3px auto, 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.enlightenment-selected-text {
|
|
||||||
flex: 1;
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.enlightenment-dropdown {
|
|
||||||
display: none;
|
|
||||||
position: absolute;
|
|
||||||
top: 100%;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
box-sizing: border-box;
|
|
||||||
background-image: url('../images/ui/metal-plate.png'), linear-gradient(180deg, #505050, #464646, #404040, #363636);
|
|
||||||
background-repeat: repeat, no-repeat;
|
|
||||||
background-position: 3px 3px, 0 0; /* offset the metal-plate image by 3 pixels from the top and left */
|
|
||||||
background-clip: content-box, border-box; /* clip the metal-plate image to the content box */
|
|
||||||
border-top: #989898 1px solid;
|
|
||||||
border-bottom: #151515 1px solid;
|
|
||||||
border-left: #878787 1px solid;
|
|
||||||
border-right: #202020 1px solid;
|
|
||||||
padding: 3px;
|
|
||||||
z-index: 999;
|
|
||||||
max-height: none;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.enlightenment-dropdown > .shine-effect:first-child {
|
|
||||||
top: -4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.enlightenment-item {
|
|
||||||
display: block;
|
|
||||||
border-left: 1px solid #232323;
|
|
||||||
border-right: 1px solid #777777;
|
|
||||||
border-top: 1px solid #232323;
|
|
||||||
border-bottom: 1px solid #777777;
|
|
||||||
color: #FFFFFF;
|
|
||||||
padding: 5px 10px;
|
|
||||||
width: 100%;
|
|
||||||
box-sizing: border-box;
|
|
||||||
user-select: none;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.enlightenment-item.first-item {
|
|
||||||
border-top: 1px solid #232323;
|
|
||||||
margin-top: -1px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.enlightenment-item.last-item {
|
|
||||||
border-bottom: 1px solid #777777;
|
|
||||||
}
|
|
||||||
|
|
||||||
.enlightenment-item.disabled {
|
|
||||||
color: #AAAAAA;
|
|
||||||
}
|
|
||||||
|
|
||||||
.enlightenment-item:hover {
|
|
||||||
background-image: none;
|
|
||||||
background: linear-gradient(to bottom, #505050, #464646, #404040, #363636);
|
|
||||||
color: #1D8AF9;
|
|
||||||
box-shadow: inset 1px 0 0 0 #777777, inset -1px 0 0 0 #232323, inset 0 1px 0 0 #989898, inset 0 -1px 0 0 #151515;
|
|
||||||
}
|
|
||||||
|
|
||||||
.enlightenment-combobox.open .enlightenment-dropdown {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.enlightenment-combobox > .shine-effect:first-child {
|
|
||||||
top: 1px;
|
|
||||||
opacity: 0;
|
|
||||||
transition: opacity 0.5s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.enlightenment-combobox:hover > .shine-effect:first-child {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.enlightenment-combobox > .shine-effect::before,
|
|
||||||
.enlightenment-combobox > .shine-effect::after {
|
|
||||||
content: "";
|
|
||||||
position: absolute;
|
|
||||||
top: -1px;
|
|
||||||
left: 50%;
|
|
||||||
transform: translateX(-50%);
|
|
||||||
opacity: 0;
|
|
||||||
transition: opacity 0.5s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.enlightenment-combobox > .shine-effect::before {
|
|
||||||
width: 3px;
|
|
||||||
height: 2px;
|
|
||||||
border-radius: 5px 5px 0 0;
|
|
||||||
background-color: #FFFFFF;
|
|
||||||
}
|
|
||||||
|
|
||||||
.enlightenment-combobox > .shine-effect::after {
|
|
||||||
width: 10px;
|
|
||||||
height: 3px;
|
|
||||||
border-radius: 5px 5px 0 0;
|
|
||||||
background-color: #FFFFFF;
|
|
||||||
filter: blur(3px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.enlightenment-combobox:hover > .shine-effect::before,
|
|
||||||
.enlightenment-combobox:hover > .shine-effect::after {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
@inject IJSRuntime JSRuntime
|
|
||||||
|
|
||||||
<input type="@Type"
|
|
||||||
@ref="inputElement"
|
|
||||||
style="width: @($"{Width}{(UsesPercentForWidth ? "%" : "px")}"); height: @($"{Height}{(UsesPercentForHeight ? "%" : "px")}");"
|
|
||||||
class="enlightenment-input @CssClass"
|
|
||||||
name="@Name"
|
|
||||||
autocomplete="@(AutoComplete ? "on" : "off")"
|
|
||||||
value="@Value"
|
|
||||||
@oninput="OnInputHandlerAsync"
|
|
||||||
@onkeydown="OnKeyDownAsync"
|
|
||||||
placeholder="@Placeholder"
|
|
||||||
disabled="@IsDisabled"
|
|
||||||
readonly="@IsReadOnly"
|
|
||||||
data-has-error="@HasError"
|
|
||||||
id="@Id" />
|
|
||||||
|
|
||||||
@code {
|
|
||||||
[Parameter] public string? Id { get; set; }
|
|
||||||
[Parameter] public string Type { get; set; } = "text";
|
|
||||||
[Parameter] public bool UsesPercentForHeight { get; set; }
|
|
||||||
[Parameter] public bool UsesPercentForWidth { get; set; } = true;
|
|
||||||
[Parameter] public int Width { get; set; } = 100;
|
|
||||||
[Parameter] public int Height { get; set; } = 28;
|
|
||||||
[Parameter] public string? CssClass { get; set; }
|
|
||||||
[Parameter] public string? Name { get; set; }
|
|
||||||
[Parameter] public bool AutoComplete { get; set; } = true;
|
|
||||||
[Parameter] public string? Value { get; set; }
|
|
||||||
[Parameter] public EventCallback<string> ValueChanged { get; set; }
|
|
||||||
[Parameter] public EventCallback OnEnterPressed { get; set; }
|
|
||||||
[Parameter] public EventCallback OnEscapePressed { get; set; }
|
|
||||||
[Parameter] public string? Placeholder { get; set; }
|
|
||||||
[Parameter] public bool IsDisabled { get; set; }
|
|
||||||
[Parameter] public bool IsReadOnly { get; set; }
|
|
||||||
[Parameter] public bool HasError { get; set; }
|
|
||||||
|
|
||||||
private ElementReference inputElement;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Handles the event risen after the component was rendered.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="firstRender">Indicates whether this is the first render or not.</param>
|
|
||||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
|
||||||
{
|
|
||||||
if (firstRender)
|
|
||||||
await JSRuntime.InvokeVoidAsync("windowKeyDownHandler", inputElement, DotNetObjectReference.Create(this)).ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Handles the input change event.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="e">The event arguments.</param>
|
|
||||||
private async Task OnInputHandlerAsync(ChangeEventArgs e)
|
|
||||||
{
|
|
||||||
Value = e.Value?.ToString();
|
|
||||||
await ValueChanged.InvokeAsync(Value).ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Handles the key down event.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="e">The event arguments.</param>
|
|
||||||
private async Task OnKeyDownAsync(KeyboardEventArgs e)
|
|
||||||
{
|
|
||||||
if (e.Key == "Enter" || e.Code == "NumpadEnter")
|
|
||||||
await OnEnterPressed.InvokeAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Handles the Escape key pressed.
|
|
||||||
/// </summary>
|
|
||||||
[JSInvokable]
|
|
||||||
public void EscapePressed()
|
|
||||||
{
|
|
||||||
OnEscapePressed.InvokeAsync(Value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
.enlightenment-input {
|
|
||||||
font-size: 14px;
|
|
||||||
padding: 5px;
|
|
||||||
border: 1px solid;
|
|
||||||
border-color: var(--border-color-dark) var(--border-color-light) var(--border-color-light) var(--border-color-dark);
|
|
||||||
border-radius: 3px;
|
|
||||||
background: linear-gradient(0deg, #90c247, #509c00);
|
|
||||||
transition: background 0.3s, color 0.3s;
|
|
||||||
color: #000;
|
|
||||||
outline: none;
|
|
||||||
position: relative;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
.enlightenment-input:hover {
|
|
||||||
background: var(--window-button-over-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.enlightenment-input:not(:focus) {
|
|
||||||
background: linear-gradient(0deg, #6b7579, #576b65);
|
|
||||||
color: #000;
|
|
||||||
}
|
|
||||||
|
|
||||||
.enlightenment-input:focus {
|
|
||||||
font-style: italic;
|
|
||||||
color: #333;
|
|
||||||
background: linear-gradient(0deg, #6AAFF8, #82E9F7);
|
|
||||||
box-shadow: inset 4px 6px 8px rgba(0,0,0,0.6);
|
|
||||||
border-color: var(--border-color-dark) var(--border-color-light) var(--border-color-light) var(--border-color-dark);
|
|
||||||
outline: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.enlightenment-input::placeholder {
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
|
|
||||||
.enlightenment-input:disabled {
|
|
||||||
color: #999;
|
|
||||||
background: var(--container-background);
|
|
||||||
}
|
|
||||||
|
|
||||||
.enlightenment-input[readonly] {
|
|
||||||
color: #999;
|
|
||||||
background: var(--container-background);
|
|
||||||
border-color: var(--border-color-light) var(--border-color-dark) var(--border-color-dark) var(--border-color-light);
|
|
||||||
}
|
|
||||||
|
|
||||||
.enlightenment-input[data-has-error="true"] {
|
|
||||||
border-color: #f00;
|
|
||||||
color: #FFF;
|
|
||||||
background: #700;
|
|
||||||
}
|
|
||||||
|
|
||||||
textarea {
|
|
||||||
resize: none;
|
|
||||||
}
|
|
||||||
@@ -1,921 +0,0 @@
|
|||||||
@using Lumina.Presentation.Web.Common.Models.Common
|
|
||||||
@using Lumina.Presentation.Web.Common.Api
|
|
||||||
@using Lumina.Presentation.Web.Common.Enums.FileSystem
|
|
||||||
@using Lumina.Presentation.Web.Common.Enums.Notifications
|
|
||||||
@using Lumina.Presentation.Web.Common.Exceptions
|
|
||||||
@using Lumina.Presentation.Web.Common.Models.FileManagement
|
|
||||||
@using Lumina.Presentation.Web.Common.Models.UI
|
|
||||||
@using Lumina.Presentation.Web.Common.Services
|
|
||||||
@using Microsoft.AspNetCore.Components
|
|
||||||
@using System.Text.Json
|
|
||||||
@using System.Text
|
|
||||||
|
|
||||||
@implements IDisposable
|
|
||||||
|
|
||||||
@inject IJSRuntime JSRuntime
|
|
||||||
@inject IApiHttpClient _apiHttpClient
|
|
||||||
@inject INotificationService _notificationService
|
|
||||||
|
|
||||||
<div id="file-system-browser-dialog" class="container-background above-modal">
|
|
||||||
<div id="file-system-browser-content">
|
|
||||||
<div id="file-system-browser-header">
|
|
||||||
<div id="file-system-browser-shine-spark"></div>
|
|
||||||
<div id="file-system-browser-shine-effect"></div>
|
|
||||||
<div id="file-system-browser-header-navigation-container">
|
|
||||||
<!--File System Navigator-->
|
|
||||||
<div id="navigator-view-mode-container">
|
|
||||||
<img src="images/ui/list.png" id="navigator-list-view" alt="List View" title="List View" @onclick="@(() => ChangeViewModeAsync(FileSystemViewMode.List))" />
|
|
||||||
<img src="images/ui/details.png" id="navigator-details-view" alt="Details View" title="Details View" @onclick="@(() => ChangeViewModeAsync(FileSystemViewMode.Details))" />
|
|
||||||
<img src="images/ui/small-icons.png" id="navigator-small-icons-view" alt="Small Icons View" title="Small Icons View" @onclick="@(() => ChangeIconSizeAsync(FileSystemIconSize.Small))" />
|
|
||||||
<img src="images/ui/medium-icons.png" id="navigator-medium-icons-view" alt="Medium Icons View" title="Medium Icons View" @onclick="@(() => ChangeIconSizeAsync(FileSystemIconSize.Medium))" />
|
|
||||||
<img src="images/ui/large-icons.png" id="navigator-large-icons-view" alt="Large Icons View" title="Large Icons View" @onclick="@(() => ChangeIconSizeAsync(FileSystemIconSize.Large))" />
|
|
||||||
<img src="images/ui/extra-large-icons.png" id="navigator-extra-large-icons-view" alt="Extra Large Icons View" title="Extra Large Icons View" @onclick="@(() => ChangeIconSizeAsync(FileSystemIconSize.ExtraLarge))" />
|
|
||||||
</div>
|
|
||||||
<div id="navigator-navigation-controls-container">
|
|
||||||
<div id="navigator-history">
|
|
||||||
<img src="images/ui/back.svg" class="navigation-icon" alt="Back" title="Back" @onclick="NavigateBackAsync" />
|
|
||||||
<img src="images/ui/forward.svg" class="navigation-icon" alt="Forward" title="Forward" @onclick="NavigateForwardAsync" />
|
|
||||||
<img src="images/ui/up.svg" class="navigation-icon" alt="Up One Level" title="Up One Level" @onclick="NavigateUpAsync" />
|
|
||||||
</div>
|
|
||||||
<svg @onclick="ToggleFileSystemTreeViewAsync" id="navigator-toggle-tree-view-button" class="navigator-icon" width="30" height="30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
||||||
<title>Toggle Tree View</title>
|
|
||||||
<defs>
|
|
||||||
<filter id="glow" x="-50%" y="-50%" width="200%" height="200%">
|
|
||||||
<feComponentTransfer in="SourceAlpha" result="adjustedAlpha">
|
|
||||||
<feFuncA type="table" tableValues="0 0.5 1" />
|
|
||||||
</feComponentTransfer>
|
|
||||||
<feGaussianBlur in="adjustedAlpha" stdDeviation="2" result="blur" />
|
|
||||||
<feFlood flood-color="#039bfc" result="color" />
|
|
||||||
<feComposite in="color" in2="blur" operator="in" result="softGlowColored" />
|
|
||||||
<feMerge>
|
|
||||||
<feMergeNode in="softGlowColored" />
|
|
||||||
<feMergeNode in="SourceGraphic" />
|
|
||||||
</feMerge>
|
|
||||||
</filter>
|
|
||||||
|
|
||||||
<linearGradient id="linearGradient" x1="5" x2="195" y1="174.76" y2="174.76" gradientTransform="matrix(.32632 0 0 .095367 -.63187 42.834)" gradientUnits="userSpaceOnUse">
|
|
||||||
<stop stop-color="#039bfc" stop-opacity="0" offset="0" />
|
|
||||||
<stop stop-color="#039bfc" offset=".225" />
|
|
||||||
<stop stop-color="#039bfc" offset=".5" />
|
|
||||||
<stop stop-color="#039bfc" offset=".775" />
|
|
||||||
<stop stop-color="#039bfc" stop-opacity="0" offset="1" />
|
|
||||||
</linearGradient>
|
|
||||||
</defs>
|
|
||||||
|
|
||||||
<g transform="translate(0,-0.5) scale(0.475)">
|
|
||||||
<rect x=".99971" y="59" width="62.001" height="1" ry="0" fill="url(#linearGradient)" stroke-width="3.7796" style="mix-blend-mode:normal;paint-order:stroke fill markers" filter="url(#glow)" />
|
|
||||||
</g>
|
|
||||||
<g stroke-linecap="round" stroke-linejoin="round" stroke-width="0.5">
|
|
||||||
<rect x="4.5" y="4.5" width="21" height="21" ry="2.5" fill="none" stroke="#039bfc" style="paint-order:stroke fill markers" filter="url(#glow)" />
|
|
||||||
</g>
|
|
||||||
<g transform="translate(6,6) scale(0.55)">
|
|
||||||
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill @(showFileSystemTreeView ? " enabled" : string.Empty)" filter="url(#glow)" d="M 4 4 L 4 14 L 9 14 L 9 23 L 18 23 L 18 28 L 28 28 L 28 18 L 18 18 L 18 22 L 10 22 L 10 14 L 14 14 L 14 9 L 18 9 L 18 14 L 28 14 L 28 4 L 18 4 L 18 8 L 14 8 L 14 4 L 4 4 z M 5 5 L 13 5 L 13 13 L 5 13 L 5 5 z M 19 5 L 27 5 L 27 13 L 19 13 L 19 5 z" />
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
<img src="images/ui/toggle-thumbnails.svg" id="navigator-toggle-thumbnails-button" alt="Toggle Thumbnails" title="Toggle Thumbanils" class="navigator-icon" />
|
|
||||||
<svg @onclick="ToggleHiddenElementsModeAsync" id="navigator-toggle-hidden-button" class="navigator-icon" width="30" height="30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
||||||
<title>Toggle Hidden Files</title>
|
|
||||||
<defs>
|
|
||||||
<filter id="glow" x="-50%" y="-50%" width="200%" height="200%">
|
|
||||||
<feComponentTransfer in="SourceAlpha" result="adjustedAlpha">
|
|
||||||
<feFuncA type="table" tableValues="0 0.5 1" />
|
|
||||||
</feComponentTransfer>
|
|
||||||
<feGaussianBlur in="adjustedAlpha" stdDeviation="2" result="blur" />
|
|
||||||
<feFlood flood-color="#039bfc" result="color" />
|
|
||||||
<feComposite in="color" in2="blur" operator="in" result="softGlowColored" />
|
|
||||||
<feMerge>
|
|
||||||
<feMergeNode in="softGlowColored" />
|
|
||||||
<feMergeNode in="SourceGraphic" />
|
|
||||||
</feMerge>
|
|
||||||
</filter>
|
|
||||||
|
|
||||||
<linearGradient id="linearGradient" x1="5" x2="195" y1="174.76" y2="174.76" gradientTransform="matrix(.32632 0 0 .095367 -.63187 42.834)" gradientUnits="userSpaceOnUse">
|
|
||||||
<stop stop-color="#039bfc" stop-opacity="0" offset="0" />
|
|
||||||
<stop stop-color="#039bfc" offset=".225" />
|
|
||||||
<stop stop-color="#039bfc" offset=".5" />
|
|
||||||
<stop stop-color="#039bfc" offset=".775" />
|
|
||||||
<stop stop-color="#039bfc" stop-opacity="0" offset="1" />
|
|
||||||
</linearGradient>
|
|
||||||
</defs>
|
|
||||||
|
|
||||||
<g transform="translate(0,-0.5) scale(0.475)">
|
|
||||||
<rect x=".99971" y="59" width="62.001" height="1" ry="0" fill="url(#linearGradient)" stroke-width="3.7796" style="mix-blend-mode:normal;paint-order:stroke fill markers" filter="url(#glow)" />
|
|
||||||
</g>
|
|
||||||
<g stroke-linecap="round" stroke-linejoin="round" stroke-width="0.5">
|
|
||||||
<rect x="4.5" y="4.5" width="21" height="21" ry="2.5" fill="none" stroke="#039bfc" style="paint-order:stroke fill markers" filter="url(#glow)" />
|
|
||||||
</g>
|
|
||||||
<g transform="translate(5,5) scale(0.85)">
|
|
||||||
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill @(showHiddenElements ? " enabled" : string.Empty)" filter="url(#glow)" d="M14.3307 7.16929C13.5873 7.05887 12.806 7 12 7C7.02944 7 3 9.23858 3 12C3 13.4401 4.09589 14.738 5.84963 15.6504L8.21192 13.2881C8.07452 12.8839 8 12.4506 8 12C8 9.79086 9.79086 8 12 8C12.4506 8 12.8839 8.07452 13.2881 8.21192L14.3307 7.16929Z" />
|
|
||||||
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill @(showHiddenElements ? " enabled" : string.Empty)" filter="url(#glow)" d="M11.2308 15.9261C11.4797 15.9746 11.7369 16 12 16C14.2091 16 16 14.2091 16 12C16 11.7369 15.9746 11.4797 15.9261 11.2308L18.5726 8.58427C20.0782 9.47809 21 10.6792 21 12C21 14.7614 16.9706 17 12 17C11.4016 17 10.8169 16.9676 10.2512 16.9057L11.2308 15.9261Z" />
|
|
||||||
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill @(showHiddenElements ? " enabled" : string.Empty)" filter="url(#glow)" d="M17.7929 5.20711C18.1834 4.81658 18.8166 4.81658 19.2071 5.20711C19.5976 5.59763 19.5976 6.2308 19.2071 6.62132L6.47919 19.3492C6.08866 19.7398 5.4555 19.7398 5.06497 19.3492C4.67445 18.9587 4.67445 18.3256 5.06497 17.935L17.7929 5.20711Z" />
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
<svg @onclick="ToggleSelectionModeAsync" id="navigator-toggle-selection-button" class="navigator-icon" width="30" height="30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
||||||
<title>Toggle Selection Mode</title>
|
|
||||||
<defs>
|
|
||||||
<filter id="glow" x="-50%" y="-50%" width="200%" height="200%">
|
|
||||||
<feComponentTransfer in="SourceAlpha" result="adjustedAlpha">
|
|
||||||
<feFuncA type="table" tableValues="0 0.5 1" />
|
|
||||||
</feComponentTransfer>
|
|
||||||
<feGaussianBlur in="adjustedAlpha" stdDeviation="2" result="blur" />
|
|
||||||
<feFlood flood-color="#039bfc" result="color" />
|
|
||||||
<feComposite in="color" in2="blur" operator="in" result="softGlowColored" />
|
|
||||||
<feMerge>
|
|
||||||
<feMergeNode in="softGlowColored" />
|
|
||||||
<feMergeNode in="SourceGraphic" />
|
|
||||||
</feMerge>
|
|
||||||
</filter>
|
|
||||||
<linearGradient id="linearGradient1" x1="5" x2="195" y1="174.76" y2="174.76" gradientTransform="matrix(.32632 0 0 .095367 -.63187 42.834)" gradientUnits="userSpaceOnUse">
|
|
||||||
<stop stop-color="#039bfc" stop-opacity="0" offset="0" />
|
|
||||||
<stop stop-color="#039bfc" offset=".225" />
|
|
||||||
<stop stop-color="#039bfc" offset=".5" />
|
|
||||||
<stop stop-color="#039bfc" offset=".775" />
|
|
||||||
<stop stop-color="#039bfc" stop-opacity="0" offset="1" />
|
|
||||||
</linearGradient>
|
|
||||||
</defs>
|
|
||||||
|
|
||||||
<g transform="translate(0,-0.5) scale(0.475)">
|
|
||||||
<rect x=".99971" y="59" width="62.001" height="1" ry="0" fill="url(#linearGradient)" stroke-width="3.7796" style="mix-blend-mode:normal;paint-order:stroke fill markers" filter="url(#glow)" />
|
|
||||||
</g>
|
|
||||||
<g stroke-linecap="round" stroke-linejoin="round" stroke-width="0.5">
|
|
||||||
<rect x="4.5" y="4.5" width="21" height="21" ry="2.5" fill="none" stroke="#039bfc" style="paint-order:stroke fill markers" filter="url(#glow)" />
|
|
||||||
</g>
|
|
||||||
<g transform="translate(8,8) scale(0.030)">
|
|
||||||
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill @(isSelectionMode ? " enabled" : string.Empty)" filter="url(#glow)" d="M161.9,21.9v21.9h131.2V0H161.9v43.7V21.9v21.9h131.2V0H161.9v43.7V21.9z M406.6,425.9L393,408.7l-52.4,41.6l-79.4-102.1 l-53,61.8l-38.9-217.9l198.1,99.1l-78.6,26.2l100.9,122.4L406.6,425.9L393,408.7L406.6,425.9l16.9-13.9l-60.4-73.2l118.3-39.4 L110.8,114l70.4,394.5l78.2-91.2l73.7,94.7l104.5-82.9l-14.2-17.2L406.6,425.9z M424.3,87.5V0h-87.5v43.7l43.7,0l0,43.7H424.3 L424.3,87.5z M118.1,0H30.7v87.5h43.7l0-43.7l43.7,0V0L118.1,0z M30.7,306.2v87.5h87.5v-43.7l-43.7,0l0-43.7H30.7z M402.5,131.2 h-21.9v87.5h43.7v-87.5h-43.7H402.5h-21.9v87.5h43.7v-87.5h-43.7H402.5z M52.5,262.4h21.9V131.2H30.7v131.2h43.7H52.5h21.9V131.2 H30.7v131.2h43.7H52.5z" />
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
|
||||||
@* <img src="images/ui/toggle-selection.svg" @onclick="ToggleColor"
|
|
||||||
style="@($"--text-color: {_currentTextColor}; --stroke-color: {_currentStrokeColor};")" id="navigator-toggle-selection-button" alt="Toggle Selection Mode" title="Toggle Selection Mode" class="navigator-icon" /> *@
|
|
||||||
@* <object data="images/ui/toggle-selection.svg" type="image/svg+xml" id="navigator-toggle-selection-button" alt="Toggle Selection Mode" title="Toggle Selection Mode" class="navigator-icon ColorScheme-Text" /> *@
|
|
||||||
</div>
|
|
||||||
<div id="navigator-address-bar-container">
|
|
||||||
<div id="navigator-address-bar-group">
|
|
||||||
@if (isNavigationPathEditMode)
|
|
||||||
{
|
|
||||||
<EnlightenmentInput CssClass="navigator-address-bar-input" Type="text" @bind-Value="@Path" Name="navigator-address-bar-input"
|
|
||||||
AutoComplete="true" OnEnterPressed="ExitNavigationPathEditModeAsync" OnEscapePressed="HandleNavigatorInputEscapePressedAsync" Id="navigator-address-bar-input" />
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
<div id="navigator-address-bar">
|
|
||||||
<ul id="navigator-path-segments" @onclick="EnterNavigationPathEditModeAsync">
|
|
||||||
@if (pathSegments?.Length > 0)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < pathSegments.Length; i++)
|
|
||||||
{
|
|
||||||
var localIndex = i; // capture the current index in a local variable, otherwise it would be evaluated when the loop ends
|
|
||||||
var pathSegment = pathSegments[i];
|
|
||||||
<li id="path-segment-@i">
|
|
||||||
<div class="navigator-combobox inline-block">
|
|
||||||
<div class="shine-effect" style="top: 1px;"></div>
|
|
||||||
<input type="checkbox" class="navigator-toggle-checkbox" id="segment-toggle-@i" checked="@(expandedPathSegmentIndex == localIndex)"
|
|
||||||
@onchange="@(e => ToggleNavigatorPathSegment(e, localIndex))" @onclick:stopPropagation />
|
|
||||||
<label class="navigator-toggle" for="segment-toggle-@i" @onclick:stopPropagation>
|
|
||||||
<span class="navigator-selected-text" @onclick:stopPropagation>@pathSegment.Path</span>
|
|
||||||
<span class="navigator-arrow" @onclick:stopPropagation></span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
<EnlightenmentButton CssClass="navigator-edit-path-button" IsConfirmButton="false" Height="28" Width="35" OnClick="EnterNavigationPathEditModeAsync">
|
|
||||||
<img src="images/ui/edit.svg" id="navigator-edit-icon" alt="Edit Path" title="Edit Path" />
|
|
||||||
</EnlightenmentButton>
|
|
||||||
<EnlightenmentButton CssClass="navigator-navigate-button" Height="28" Width="35" OnClick="ExitNavigationPathEditModeAsync">
|
|
||||||
<img src="images/ui/check.svg" id="navigator-navigate-icon" alt="Navigate" title="Navigate" />
|
|
||||||
</EnlightenmentButton>
|
|
||||||
<EnlightenmentButton CssClass="file-system-browser-content-new-directory" IsConfirmButton="false" Width="35" Height="28">
|
|
||||||
<img src="images/ui/new-directory.svg" id="navigator-new-directory-icon" alt="New Directory" title="New Directory" />
|
|
||||||
</EnlightenmentButton>
|
|
||||||
<EnlightenmentButton CssClass="file-system-browser-content-favorite-directory" IsConfirmButton="false" Width="35" Height="28">
|
|
||||||
<img src="images/ui/favorite-star.svg" class="navigation-icon favorite-unselected" alt="Favorite directory" title="Favorite directory" />
|
|
||||||
</EnlightenmentButton>
|
|
||||||
</div>
|
|
||||||
<!--End File System Navigator-->
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="file-system-browser-file-system-container">
|
|
||||||
<!--File System Tree View-->
|
|
||||||
<div id="file-system-browser-file-system-treeview-container" class="@(showFileSystemTreeView ? string.Empty: "collapsed")">
|
|
||||||
<div id="file-system-browser-file-system-treeview">
|
|
||||||
<div class="treeview">
|
|
||||||
@foreach (FileSystemTreeNodeModel node in treeViewRootNodes)
|
|
||||||
{
|
|
||||||
<FileSystemTreeViewNode Node="node" OnExpandToggle="ToggleTreeViewNode" OnNodeSelected="HandleFileSystemTreeViewNodeSelectedAsync" SelectedNodePath="@selectedNodePath" />
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<EnlightenmentCombobox CssClass="file-system-browser-file-system-sources" Items="null" @bind-SelectedItem="selectedValue" />
|
|
||||||
</div>
|
|
||||||
<!--End File System Tree View-->
|
|
||||||
<div id="file-system-browser-file-system-directories-container">
|
|
||||||
<div id="file-system-browser-file-system-directories">
|
|
||||||
<div id="file-system-browser-file-system-explorer-container" class="scroll-@(viewMode is FileSystemViewMode.List ? "horizontal" : "vertical")">
|
|
||||||
<div id="file-system-browser-file-system-explorer-details-header" style="height: @(viewMode is FileSystemViewMode.Details ? 20 : 0)px;">
|
|
||||||
<span>Name</span>
|
|
||||||
</div>
|
|
||||||
<div id="file-system-browser-file-system-explorer" class="@viewMode.ToString().ToLower()" style="flex-direction: @(viewMode is FileSystemViewMode.List or FileSystemViewMode.Details ? "column" : "row");">
|
|
||||||
@foreach (FileSystemItemModel fileSystemItem in fileSystemItems)
|
|
||||||
{
|
|
||||||
string iconSizeClass = "list-icons";
|
|
||||||
if (viewMode == FileSystemViewMode.Details)
|
|
||||||
iconSizeClass = "details-icons";
|
|
||||||
else if (viewMode == FileSystemViewMode.Icons)
|
|
||||||
{
|
|
||||||
if (iconSize == FileSystemIconSize.Small)
|
|
||||||
iconSizeClass = "small-icons";
|
|
||||||
else if (iconSize == FileSystemIconSize.Medium)
|
|
||||||
iconSizeClass = "medium-icons";
|
|
||||||
else if (iconSize == FileSystemIconSize.Large)
|
|
||||||
iconSizeClass = "large-icons";
|
|
||||||
else if (iconSize == FileSystemIconSize.ExtraLarge)
|
|
||||||
iconSizeClass = "extra-large-icons";
|
|
||||||
}
|
|
||||||
string itemType = fileSystemItem is FileModel ? "file" : "directory";
|
|
||||||
<div class="e @iconSizeClass" data-path="@fileSystemItem.Path" data-type="@itemType" onmouseup="handleFileSystemEntityMouseUp(event)" onmousedown="handleFileSystemEntityMouseDown(event)">
|
|
||||||
<div class="icon"><img src="/images/icons/Lyra/@(itemType).svg"></div>
|
|
||||||
<div class="text"><span class="@(itemType == "directory" ? "d" : "f") t">@fileSystemItem.Name</span></div>
|
|
||||||
<div class="date-modified @(itemType == "directory" ? "d" : "f")" style="display: none;">@fileSystemItem.DateModified</div>
|
|
||||||
<div class="size @(itemType == "directory" ? "d" : "f")" style="display: none;"> @(itemType == "file" ? (fileSystemItem as FileModel)!.Size : 0)</div>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="file-system-browser-actions-container">
|
|
||||||
<div id="file-system-browser-actions-path-container">
|
|
||||||
<label class="text-light-one">Directory</label>
|
|
||||||
<EnlightenmentInput Type="text" Name="selected-directory" IsReadOnly="true" AutoComplete="true" />
|
|
||||||
</div>
|
|
||||||
<div id="file-system-browser-actions">
|
|
||||||
<EnlightenmentButton IsConfirmButton="false">Cancel</EnlightenmentButton>
|
|
||||||
<EnlightenmentButton>Open</EnlightenmentButton>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@* <div id="divModal"></div>
|
|
||||||
<label class="text-light-one">Enter new directory name:</label>
|
|
||||||
<EnlightenmentInput Type="text" Name="newDirectoryName" AutoComplete="true" />
|
|
||||||
<EnlightenmentButton IsConfirmButton="false">Cancel</EnlightenmentButton>
|
|
||||||
<EnlightenmentButton>Confirm</EnlightenmentButton> *@
|
|
||||||
</div>
|
|
||||||
<div id="visible-selection-rectangle"></div>
|
|
||||||
<div id="selection-rectangle"></div>
|
|
||||||
|
|
||||||
<!--The drop down for the navigator path segments needs to be absolute, such that it is not affected by the parent clipping-->
|
|
||||||
@if (showPathSegmentDowpDown && expandedPathSegmentIndex.HasValue && pathSegmentsSubdirectoriesCache.ContainsKey(expandedPathSegmentIndex.Value))
|
|
||||||
{
|
|
||||||
<div class="navigator-dropdown opened" id="navigatorDropdown" data-path-segment-id="path-segment-@expandedPathSegmentIndex">
|
|
||||||
@foreach (var directory in pathSegmentsSubdirectoriesCache[expandedPathSegmentIndex.Value])
|
|
||||||
{
|
|
||||||
<div class="navigator-option" data-path="@directory.Path" @onclick="@(() => NavigateToPathAsync(directory.Path, isForwardNavigation: false, isBackwardNavigation: false))">@directory.Name</div>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
@code {
|
|
||||||
[Parameter] public string? Path { get; set; }
|
|
||||||
[Parameter] public bool IncludeFiles { get; set; }
|
|
||||||
|
|
||||||
public EventCallback<string> OnNodeSelected { get; set; }
|
|
||||||
|
|
||||||
private List<FileSystemTreeNodeModel> treeViewRootNodes = [];
|
|
||||||
private List<FileSystemItemModel> fileSystemItems = [];
|
|
||||||
private FileSystemTypeModel fileSystemType = null!;
|
|
||||||
private ComboboxItem<string>? selectedValue;
|
|
||||||
private PathSegmentModel[]? pathSegments;
|
|
||||||
private string pathSeparator = "/";
|
|
||||||
private string? selectedNodePath;
|
|
||||||
private string? _path;
|
|
||||||
private bool isSelectionMode;
|
|
||||||
private bool showHiddenElements; // TODO: take from config
|
|
||||||
private bool showFileSystemTreeView = true; // TODO: take from config
|
|
||||||
private bool showPathSegmentDowpDown;
|
|
||||||
private bool isNavigationPathEditMode;
|
|
||||||
private int? expandedPathSegmentIndex;
|
|
||||||
private FileSystemViewMode viewMode = FileSystemViewMode.List; // TODO: take from config
|
|
||||||
private FileSystemIconSize iconSize;
|
|
||||||
private Dictionary<int, List<FileSystemTreeNodeModel>> pathSegmentsSubdirectoriesCache = [];
|
|
||||||
private DotNetObjectReference<FileSystemBrowser>? reference;
|
|
||||||
private readonly Stack<string> undoStack = [];
|
|
||||||
private readonly Stack<string> redoStack = [];
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Initializes the component.
|
|
||||||
/// </summary>
|
|
||||||
protected override async Task OnInitializedAsync()
|
|
||||||
{
|
|
||||||
await GetFileSystemPropertiesAsync().ConfigureAwait(false);
|
|
||||||
if (Path is not null)
|
|
||||||
{
|
|
||||||
if (!Path.EndsWith(pathSeparator))
|
|
||||||
Path += pathSeparator;
|
|
||||||
await NavigateToPathAsync(Path, isForwardNavigation: false, isBackwardNavigation: false).ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
await ChangeViewModeAsync(viewMode).ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Handles the event risen after the component was rendered.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="firstRender">Indicates whether this is the first render or not.</param>
|
|
||||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
|
||||||
{
|
|
||||||
// on first render, subscribe this component to the javascript function that handles window clicks
|
|
||||||
if (firstRender)
|
|
||||||
{
|
|
||||||
reference = DotNetObjectReference.Create(this);
|
|
||||||
// assign the elements of this component instance to javascript variables, for memoization
|
|
||||||
await JSRuntime.InvokeVoidAsync("initializeFileSystemBrowser", reference).ConfigureAwait(false);
|
|
||||||
// make the navigator path segments horizontally scrollable
|
|
||||||
await JSRuntime.InvokeVoidAsync("addHorizontalScrolling", "navigator-address-bar").ConfigureAwait(false);
|
|
||||||
// subscribe to window clicks
|
|
||||||
await JSRuntime.InvokeVoidAsync("windowClickHandler", reference).ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
await base.OnAfterRenderAsync(firstRender);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Handles the window click event.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="e">The event arguments.</param>
|
|
||||||
[JSInvokable]
|
|
||||||
public async Task OnWindowClickAsync(dynamic e)
|
|
||||||
{
|
|
||||||
// parse the event args and get the initiator of the event
|
|
||||||
var jsonElement = (JsonElement)e;
|
|
||||||
string? sender = jsonElement.GetProperty("sender").GetString();
|
|
||||||
// ignore the event if it was initiated by a path segment (don't collapse an element that was just expanded)
|
|
||||||
if (showPathSegmentDowpDown && sender is not null && !sender.Contains("segment-toggle-"))
|
|
||||||
{
|
|
||||||
// otherwise, collapse all path segments
|
|
||||||
showPathSegmentDowpDown = false;
|
|
||||||
expandedPathSegmentIndex = null;
|
|
||||||
}
|
|
||||||
// exit navigator path edit mode when clicking anywhere outside of it, or on elements that should not exit it
|
|
||||||
if (sender is null || (sender is not null && !sender.Contains("navigator-path-segments") && !sender.Contains("navigator-edit-icon") && !sender.Contains("navigator-address-bar-input")))
|
|
||||||
isNavigationPathEditMode = false;
|
|
||||||
await InvokeAsync(StateHasChanged);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Expands or collapses a node in the tree view.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="node">The node to expand or collapse.</param>
|
|
||||||
private async Task ToggleTreeViewNode(FileSystemTreeNodeModel node)
|
|
||||||
{
|
|
||||||
if (!node.IsExpanded && !node.ChildrenLoaded)
|
|
||||||
{
|
|
||||||
node.Children = new List<FileSystemTreeNodeModel>();
|
|
||||||
node.IsExpanded = true;
|
|
||||||
await InvokeAsync(StateHasChanged);
|
|
||||||
if (await CheckPathAsync(node.Path).ConfigureAwait(false))
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await foreach (FileSystemTreeNodeModel? childNode in _apiHttpClient.GetAsyncEnumerable<FileSystemTreeNodeModel>($"directories/get-tree-directories?path={Uri.EscapeDataString(node.Path)}&includeHiddenElements={showHiddenElements}").ConfigureAwait(false))
|
|
||||||
{
|
|
||||||
if (childNode is not null)
|
|
||||||
{
|
|
||||||
node.Children.Add(childNode);
|
|
||||||
await InvokeAsync(StateHasChanged);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (IncludeFiles)
|
|
||||||
{
|
|
||||||
await foreach (FileSystemTreeNodeModel? childNode in _apiHttpClient.GetAsyncEnumerable<FileSystemTreeNodeModel>($"files/get-tree-files?path={Uri.EscapeDataString(node.Path)}&includeHiddenElements={showHiddenElements}").ConfigureAwait(false))
|
|
||||||
{
|
|
||||||
if (childNode is not null)
|
|
||||||
{
|
|
||||||
node.Children.Add(childNode);
|
|
||||||
await InvokeAsync(StateHasChanged);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (ApiException ex)
|
|
||||||
{
|
|
||||||
HandleApiException(ex);
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
node.ChildrenLoaded = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
node.IsExpanded = !node.IsExpanded;
|
|
||||||
await InvokeAsync(StateHasChanged);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Handles the change event.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="e">The event arguments.</param>
|
|
||||||
private async Task ToggleNavigatorPathSegment(ChangeEventArgs e, int toggledIndex)
|
|
||||||
{
|
|
||||||
// uncheck all other path segment checkboxes
|
|
||||||
await JSRuntime.InvokeVoidAsync("uncheckAllExcept", $"segment-toggle-{toggledIndex}").ConfigureAwait(false);
|
|
||||||
// check if the checkbox is checked
|
|
||||||
bool isChecked = (bool)e.Value!;
|
|
||||||
// if it's checked, get the subdirectories for the toggled path segment
|
|
||||||
if (isChecked && pathSegments?.Length > 0)
|
|
||||||
{
|
|
||||||
// initialize the path with the first segment
|
|
||||||
string concatenatedPath = pathSegments[0].Path;
|
|
||||||
// concatenate only up to the toggled index
|
|
||||||
for (int i = 1; i <= toggledIndex; i++)
|
|
||||||
concatenatedPath = $"{(concatenatedPath != pathSeparator ? concatenatedPath : string.Empty)}{pathSeparator}{pathSegments[i].Path}";
|
|
||||||
string parentConcatenatedPath = concatenatedPath;
|
|
||||||
// fetch directories for the expanded path segment
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (concatenatedPath != pathSeparator) // on UNIX, dont get the parent, if we are at root path
|
|
||||||
{
|
|
||||||
PathSegmentModel[] parentLocationResponse = await _apiHttpClient.GetAsync<PathSegmentModel[]>($"path/get-path-parent?path={Uri.EscapeDataString(concatenatedPath)}").ConfigureAwait(false);
|
|
||||||
parentConcatenatedPath = parentLocationResponse[0].Path;
|
|
||||||
for (int i = 1; i < parentLocationResponse.Length; i++)
|
|
||||||
parentConcatenatedPath = $"{(parentConcatenatedPath != pathSeparator ? parentConcatenatedPath : string.Empty)}{pathSeparator}{pathSegments[i].Path}";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (ApiException ex)
|
|
||||||
{
|
|
||||||
HandleApiException(ex);
|
|
||||||
}
|
|
||||||
if (!concatenatedPath.EndsWith(pathSeparator))
|
|
||||||
concatenatedPath += pathSeparator;
|
|
||||||
// add current and parent directories too
|
|
||||||
List<FileSystemTreeNodeModel> directories = [new() { Path = concatenatedPath, Name = ".", }, new() { Path = parentConcatenatedPath, Name = ".." }];
|
|
||||||
// add the rest of the subdirectories of the expanded path node
|
|
||||||
await foreach (FileSystemTreeNodeModel? directory in _apiHttpClient.GetAsyncEnumerable<FileSystemTreeNodeModel>($"directories/get-tree-directories?path={Uri.EscapeDataString(concatenatedPath)}&includeHiddenElements={showHiddenElements}").ConfigureAwait(false))
|
|
||||||
if (directory is not null)
|
|
||||||
directories.Add(directory);
|
|
||||||
// store the directories for this segment
|
|
||||||
pathSegmentsSubdirectoriesCache[toggledIndex] = directories;
|
|
||||||
expandedPathSegmentIndex = toggledIndex;
|
|
||||||
showPathSegmentDowpDown = true;
|
|
||||||
await InvokeAsync(StateHasChanged);
|
|
||||||
// invoke the javascript function that positions the dropdown underneath the toggled path segment
|
|
||||||
await JSRuntime.InvokeVoidAsync("updateDropdownPosition", $"path-segment-{toggledIndex}").ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
expandedPathSegmentIndex = null;
|
|
||||||
showPathSegmentDowpDown = false;
|
|
||||||
await InvokeAsync(StateHasChanged);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Handles the selection of a node in the tree view.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="path">The path of the selected node.</param>
|
|
||||||
/// <param name="isForwardNavigation">Indicates whether the navigation is towards a location in the redo stack or not.</param>
|
|
||||||
/// <param name="isBackwardNavigation">Indicates whether the navigation is towards a location in the undo stack or not.</param>
|
|
||||||
private async Task NavigateToPathAsync(string path, bool isForwardNavigation, bool isBackwardNavigation)
|
|
||||||
{
|
|
||||||
if (await CheckPathAsync(path).ConfigureAwait(false))
|
|
||||||
{
|
|
||||||
// check if backward navigation is possible
|
|
||||||
if (isBackwardNavigation)
|
|
||||||
{
|
|
||||||
if (undoStack.Count > 0)
|
|
||||||
{
|
|
||||||
// get the first path in the backward navigation list
|
|
||||||
string backwardPath = undoStack.Pop();
|
|
||||||
// put the current path in the forward navigationlist, before navigating to the backward path
|
|
||||||
if (Path is not null)
|
|
||||||
{
|
|
||||||
if (!Path.EndsWith(pathSeparator))
|
|
||||||
Path += pathSeparator;
|
|
||||||
redoStack.Push(Path);
|
|
||||||
}
|
|
||||||
path = backwardPath;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else if (isForwardNavigation) // check if forward navigation is possible
|
|
||||||
{
|
|
||||||
if (redoStack.Count > 0)
|
|
||||||
{
|
|
||||||
// get the first path in the forward navigation list
|
|
||||||
string forwardPath = redoStack.Pop();
|
|
||||||
// put the current path in the backward navigation list, before navigating to the forward path
|
|
||||||
if (Path is not null)
|
|
||||||
{
|
|
||||||
if (!Path.EndsWith(pathSeparator))
|
|
||||||
Path += pathSeparator;
|
|
||||||
if (undoStack.Count == 0 || (undoStack.Count > 0 && undoStack.Peek() != Path))
|
|
||||||
undoStack.Push(Path);
|
|
||||||
}
|
|
||||||
path = forwardPath;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else // navigation to a brand new location (up, directory browse, manual path edit, etc)
|
|
||||||
{
|
|
||||||
redoStack.Clear();
|
|
||||||
if (Path is not null && Path != path) // when navigating up, Path will be set after navigation
|
|
||||||
{
|
|
||||||
if (undoStack.Count == 0 || (undoStack.Count > 0 && undoStack.Peek() != Path))
|
|
||||||
undoStack.Push(Path);
|
|
||||||
}
|
|
||||||
else if (_path is not null && _path != path) // when editing the address, Path already comes set, check against control value
|
|
||||||
{
|
|
||||||
if (undoStack.Count == 0 || (undoStack.Count > 0 && undoStack.Peek() != _path))
|
|
||||||
undoStack.Push(_path);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_path = path; // we are about to navigate to the new path, store its value in the control variable
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await GetNavigatorPathAsync(path).ConfigureAwait(false);
|
|
||||||
if (showFileSystemTreeView)
|
|
||||||
await GetFileSystemTreeAsync(path).ConfigureAwait(false);
|
|
||||||
await GetFileSystemItemsAsync(path).ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
catch (ApiException ex)
|
|
||||||
{
|
|
||||||
HandleApiException(ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
selectedNodePath = _path;
|
|
||||||
Path = _path; // also update the navigation input address
|
|
||||||
if (Path is not null && !Path.EndsWith(pathSeparator))
|
|
||||||
Path += pathSeparator;
|
|
||||||
await OnNodeSelected.InvokeAsync(path).ConfigureAwait(false);
|
|
||||||
await InvokeAsync(StateHasChanged);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Provides backwards navigation.
|
|
||||||
/// </summary>
|
|
||||||
private async Task NavigateBackAsync()
|
|
||||||
{
|
|
||||||
if (Path is not null)
|
|
||||||
await NavigateToPathAsync(Path, isForwardNavigation: false, isBackwardNavigation: true).ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Provides forwards navigation.
|
|
||||||
/// </summary>
|
|
||||||
private async Task NavigateForwardAsync()
|
|
||||||
{
|
|
||||||
if (Path is not null)
|
|
||||||
await NavigateToPathAsync(Path, isForwardNavigation: true, isBackwardNavigation: false).ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Provides upwards navigation.
|
|
||||||
/// </summary>
|
|
||||||
private async Task NavigateUpAsync()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (Path is not null)
|
|
||||||
{
|
|
||||||
// ask the API for the parent path
|
|
||||||
PathSegmentModel[] parentLocationResponse = await _apiHttpClient.GetAsync<PathSegmentModel[]>($"path/get-path-parent?path={Uri.EscapeDataString(Path)}").ConfigureAwait(false);
|
|
||||||
// if the answer was valid, and we can navigate up, reconstruct the provided path from its segments, and navigate to it
|
|
||||||
if (parentLocationResponse is not null)
|
|
||||||
{
|
|
||||||
string parentConcatenatedPath = parentLocationResponse[0].Path;
|
|
||||||
for (int i = 1; i < parentLocationResponse.Length; i++)
|
|
||||||
parentConcatenatedPath = $"{(parentConcatenatedPath != pathSeparator ? parentConcatenatedPath : string.Empty)}{pathSeparator}{parentLocationResponse[i].Path}";
|
|
||||||
if (!parentConcatenatedPath.EndsWith(pathSeparator))
|
|
||||||
parentConcatenatedPath += pathSeparator;
|
|
||||||
await NavigateToPathAsync(parentConcatenatedPath, isForwardNavigation: false, isBackwardNavigation: false).ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (ApiException ex)
|
|
||||||
{
|
|
||||||
HandleApiException(ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Handles the file system directories double click event.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="path">The path of the double clicked directory.</param>
|
|
||||||
[JSInvokable()]
|
|
||||||
public async Task OnDirectoryDoubleClickAsync(string path)
|
|
||||||
{
|
|
||||||
await NavigateToPathAsync(path, isForwardNavigation: false, isBackwardNavigation: false).ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the properties of the file system.
|
|
||||||
/// </summary>
|
|
||||||
private async Task GetFileSystemPropertiesAsync()
|
|
||||||
{
|
|
||||||
fileSystemType = await _apiHttpClient.GetAsync<FileSystemTypeModel>("file-system/get-type").ConfigureAwait(false);
|
|
||||||
// ask the API server for the system path separator
|
|
||||||
PathSeparatorModel apiPathSeparator = await _apiHttpClient.GetAsync<PathSeparatorModel>("path/get-path-separator").ConfigureAwait(false);
|
|
||||||
pathSeparator = apiPathSeparator.Separator; // TODO: handle error
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Checks if the specified path is a valid file system path.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="path">The path to check.</param>
|
|
||||||
/// <returns><see langword="true"/> if the specified path is valid, <see langword="false"/> otherwise.</returns>
|
|
||||||
private async Task<bool> CheckPathAsync(string path)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var isPathValidResponse = await _apiHttpClient.GetAsync<PathValidModel>($"path/validate?path={Uri.EscapeDataString(path)}").ConfigureAwait(false);
|
|
||||||
if (!isPathValidResponse.IsValid)
|
|
||||||
{
|
|
||||||
_notificationService.Show("Specified path is not valid!", NotificationType.Error); // TODO: should ask error message from server when translation is implemented
|
|
||||||
Path = _path;
|
|
||||||
if (Path is not null && !Path.EndsWith(pathSeparator))
|
|
||||||
Path += pathSeparator;
|
|
||||||
}
|
|
||||||
PathExistsModel pathExistsResponse = await _apiHttpClient.GetAsync<PathExistsModel>($"path/check-path-exists?path={Uri.EscapeDataString(path)}").ConfigureAwait(false);
|
|
||||||
if (!pathExistsResponse.Exists)
|
|
||||||
{
|
|
||||||
_notificationService.Show("Specified path does not exist!", NotificationType.Error); // TODO: should ask error message from server when translation is implemented
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return isPathValidResponse.IsValid;
|
|
||||||
}
|
|
||||||
catch (ApiException ex)
|
|
||||||
{
|
|
||||||
HandleApiException(ex);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the navigator path segments.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="path">The path for which to get the navigator path segments.</param>
|
|
||||||
private async Task GetNavigatorPathAsync(string path)
|
|
||||||
{
|
|
||||||
pathSegments = await _apiHttpClient.GetAsync<PathSegmentModel[]>($"path/split?path={Uri.EscapeDataString(path!)}").ConfigureAwait(false);
|
|
||||||
await InvokeAsync(StateHasChanged);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the file system items that are displayed in the file system tree view pane.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="path">The path for which to get the file system items.</param>
|
|
||||||
private async Task GetFileSystemTreeAsync(string path)
|
|
||||||
{
|
|
||||||
treeViewRootNodes = [];
|
|
||||||
// on Windows, ask the list of drives
|
|
||||||
if (fileSystemType?.PlatformType == PlatformType.Windows)
|
|
||||||
{
|
|
||||||
List<FileSystemTreeNodeModel> drives = await _apiHttpClient.GetAsync<List<FileSystemTreeNodeModel>>("drives/get-drives").ConfigureAwait(false);
|
|
||||||
treeViewRootNodes.AddRange(drives);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// on UNIX, just add the root "/"
|
|
||||||
treeViewRootNodes.Add(new FileSystemTreeNodeModel()
|
|
||||||
{
|
|
||||||
Path = pathSeparator!,
|
|
||||||
IsExpanded = true,
|
|
||||||
ItemType = FileSystemItemType.Root,
|
|
||||||
Name = pathSeparator!
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// if there was an initial path saved from a previous session, load the full tree up to that initial path
|
|
||||||
List<FileSystemTreeNodeModel> initialTree = await _apiHttpClient.GetAsync<List<FileSystemTreeNodeModel>>($"directories/get-directory-tree?path={Uri.EscapeDataString(path!)}&includeFiles={IncludeFiles}&includeHiddenElements={showHiddenElements}").ConfigureAwait(false);
|
|
||||||
if (initialTree is not null && initialTree.Count > 0)
|
|
||||||
{
|
|
||||||
// take the root of the retrieved tree, and try to match it against a drive in the retrieved list of drives, on Windows; on Unix, add it as the unique root path
|
|
||||||
PathSegmentModel pathRoot = await _apiHttpClient.GetAsync<PathSegmentModel>($"path/get-path-root?path={Uri.EscapeDataString(path!)}").ConfigureAwait(false);
|
|
||||||
if (fileSystemType?.PlatformType == PlatformType.Windows)
|
|
||||||
{
|
|
||||||
FileSystemTreeNodeModel? driveNode = treeViewRootNodes.FirstOrDefault(drive => drive.Path.Equals(pathRoot.Path, StringComparison.OrdinalIgnoreCase));
|
|
||||||
// if a drive was matched, make the retrieved tree a child of it
|
|
||||||
if (driveNode is not null)
|
|
||||||
{
|
|
||||||
int index = treeViewRootNodes.IndexOf(driveNode);
|
|
||||||
treeViewRootNodes[index] = initialTree[0];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
treeViewRootNodes[0] = initialTree[0];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Retrieves the files and directories for the specified path.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="path">The path for which to get the files and directories.</param>
|
|
||||||
private async Task GetFileSystemItemsAsync(string path)
|
|
||||||
{
|
|
||||||
fileSystemItems.Clear();
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await foreach (DirectoryModel? directory in _apiHttpClient.GetAsyncEnumerable<DirectoryModel>($"directories/get-directories?path={Uri.EscapeDataString(path)}&includeHiddenElements={showHiddenElements}").ConfigureAwait(false))
|
|
||||||
{
|
|
||||||
if (directory is not null)
|
|
||||||
{
|
|
||||||
fileSystemItems.Add(directory);
|
|
||||||
await InvokeAsync(StateHasChanged);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (IncludeFiles)
|
|
||||||
{
|
|
||||||
await foreach (FileModel? file in _apiHttpClient.GetAsyncEnumerable<FileModel>($"files/get-files?path={Uri.EscapeDataString(path)}&includeHiddenElements={showHiddenElements}").ConfigureAwait(false))
|
|
||||||
{
|
|
||||||
if (file is not null)
|
|
||||||
{
|
|
||||||
fileSystemItems.Add(file);
|
|
||||||
await InvokeAsync(StateHasChanged);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (ApiException ex)
|
|
||||||
{
|
|
||||||
HandleApiException(ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Changes the current file system explorer view.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="newViewMode">The new explorer view to change to.</param>
|
|
||||||
private async Task ChangeViewModeAsync(FileSystemViewMode newViewMode)
|
|
||||||
{
|
|
||||||
viewMode = newViewMode;
|
|
||||||
if (viewMode == FileSystemViewMode.List)
|
|
||||||
await JSRuntime.InvokeVoidAsync("addHorizontalScrolling", "file-system-browser-file-system-explorer").ConfigureAwait(false);
|
|
||||||
else
|
|
||||||
await JSRuntime.InvokeVoidAsync("removeHorizontalScrolling", "file-system-browser-file-system-explorer").ConfigureAwait(false);
|
|
||||||
await InvokeAsync(StateHasChanged);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Changes the icon size for the file system items.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="newIconSize">Thew new icon size to change to.</param>
|
|
||||||
private async Task ChangeIconSizeAsync(FileSystemIconSize newIconSize)
|
|
||||||
{
|
|
||||||
viewMode = FileSystemViewMode.Icons;
|
|
||||||
iconSize = newIconSize;
|
|
||||||
await InvokeAsync(StateHasChanged);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Enters the edit mode where the navigator path can be edited freely.
|
|
||||||
/// </summary>
|
|
||||||
private async Task EnterNavigationPathEditModeAsync()
|
|
||||||
{
|
|
||||||
isNavigationPathEditMode = true;
|
|
||||||
await InvokeAsync(StateHasChanged);
|
|
||||||
await InvokeAsync(async () =>
|
|
||||||
{
|
|
||||||
await Task.Delay(50); // a small delay is necessary to ensure the DOM has updated
|
|
||||||
await SetFocusOnNavigatorAddressInputAsync().ConfigureAwait(false);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Exits the edit mode where the navigator path can be edited freely.
|
|
||||||
/// </summary>
|
|
||||||
private async Task ExitNavigationPathEditModeAsync()
|
|
||||||
{
|
|
||||||
isNavigationPathEditMode = false;
|
|
||||||
await InvokeAsync(StateHasChanged);
|
|
||||||
if (Path is not null)
|
|
||||||
{
|
|
||||||
if (!Path.EndsWith(pathSeparator))
|
|
||||||
Path += pathSeparator;
|
|
||||||
await NavigateToPathAsync(Path, isForwardNavigation: false, isBackwardNavigation: false).ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Handles the selection of a node in the file system tree view.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="path">The path of the newly selected node.</param>
|
|
||||||
private async Task HandleFileSystemTreeViewNodeSelectedAsync(string path)
|
|
||||||
{
|
|
||||||
await InvokeAsync(StateHasChanged);
|
|
||||||
if (selectedNodePath is not null)
|
|
||||||
{
|
|
||||||
Path = path;
|
|
||||||
if (!Path.EndsWith(pathSeparator))
|
|
||||||
Path += pathSeparator;
|
|
||||||
await NavigateToPathAsync(Path, isForwardNavigation: false, isBackwardNavigation: false).ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Handles the Escape key being pressed in the navigator address input.
|
|
||||||
/// </summary>
|
|
||||||
private async Task HandleNavigatorInputEscapePressedAsync()
|
|
||||||
{
|
|
||||||
Path = _path;
|
|
||||||
isNavigationPathEditMode = false;
|
|
||||||
await InvokeAsync(StateHasChanged);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Sets the focus to the navigator address input.
|
|
||||||
/// </summary>
|
|
||||||
public async Task SetFocusOnNavigatorAddressInputAsync()
|
|
||||||
{
|
|
||||||
await JSRuntime.InvokeVoidAsync("focusNavigatorInputElement").ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Enables or disables selection mode.
|
|
||||||
/// </summary>
|
|
||||||
private async Task ToggleSelectionModeAsync()
|
|
||||||
{
|
|
||||||
isSelectionMode = !isSelectionMode;
|
|
||||||
await JSRuntime.InvokeVoidAsync("toggleSelectionMode").ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Enables or disables the display of the file system tree view.
|
|
||||||
/// </summary>
|
|
||||||
private async Task ToggleFileSystemTreeViewAsync()
|
|
||||||
{
|
|
||||||
showFileSystemTreeView = !showFileSystemTreeView;
|
|
||||||
// if file system treeview needs to be displayed, get its file system tree structure from the API
|
|
||||||
if (showFileSystemTreeView && Path is not null)
|
|
||||||
{
|
|
||||||
if (!Path.EndsWith(pathSeparator))
|
|
||||||
Path += pathSeparator;
|
|
||||||
await NavigateToPathAsync(Path, isForwardNavigation: false, isBackwardNavigation: false).ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Enables or disables the display of hidden file system files and directories.
|
|
||||||
/// </summary>
|
|
||||||
private async Task ToggleHiddenElementsModeAsync()
|
|
||||||
{
|
|
||||||
showHiddenElements = !showHiddenElements;
|
|
||||||
if (Path is not null)
|
|
||||||
{
|
|
||||||
if (!Path.EndsWith(pathSeparator))
|
|
||||||
Path += pathSeparator;
|
|
||||||
await NavigateToPathAsync(Path, isForwardNavigation: false, isBackwardNavigation: false).ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Handles API exceptions, presenting standard problem details in a user friendly way.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="ex">The exception to handle</param>
|
|
||||||
private void HandleApiException(ApiException ex)
|
|
||||||
{
|
|
||||||
StringBuilder errorMessage = new StringBuilder();
|
|
||||||
if (ex.ProblemDetails is not null)
|
|
||||||
{
|
|
||||||
errorMessage.AppendLine($"HTTP {ex.ProblemDetails.Status} {ex.HttpStatusCode}<br>");
|
|
||||||
if (!string.IsNullOrEmpty(ex.ProblemDetails.Detail))
|
|
||||||
errorMessage.AppendLine($"<b>{ex.ProblemDetails.Detail}<b>");
|
|
||||||
if (ex.ProblemDetails.Extensions is not null && ex.ProblemDetails.Extensions.TryGetValue("errors", out var errorsObj))
|
|
||||||
{
|
|
||||||
if (errorsObj is JsonElement jsonElement && jsonElement.ValueKind == JsonValueKind.Object)
|
|
||||||
{
|
|
||||||
errorMessage.AppendLine("Validation Errors:");
|
|
||||||
foreach (var error in jsonElement.EnumerateObject())
|
|
||||||
{
|
|
||||||
string fieldName = error.Name;
|
|
||||||
if (error.Value.ValueKind == JsonValueKind.Array)
|
|
||||||
foreach (var errorValue in error.Value.EnumerateArray())
|
|
||||||
errorMessage.AppendLine($"- {fieldName}: {errorValue}<br>");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (ex.ProblemDetails.Extensions is not null)
|
|
||||||
foreach (var extension in ex.ProblemDetails.Extensions)
|
|
||||||
if (extension.Key != "errors")
|
|
||||||
errorMessage.AppendLine($"{extension.Key}: {extension.Value}<br>");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
errorMessage.AppendLine($"HTTP {ex.HttpStatusCode}<br>");
|
|
||||||
errorMessage.AppendLine($"{ex.Message}<br>");
|
|
||||||
}
|
|
||||||
_notificationService.Show(errorMessage.ToString(), NotificationType.Error);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Disposes this component.
|
|
||||||
/// </summary>
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
reference?.Dispose();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -1,67 +0,0 @@
|
|||||||
@using Lumina.Presentation.Web.Common.Enums.FileSystem
|
|
||||||
@using Lumina.Presentation.Web.Common.Models.FileManagement
|
|
||||||
|
|
||||||
<div class="tree-node">
|
|
||||||
<span class="node-content @(IsSelected ? "selected" : string.Empty)" @onclick="HandleNodeClick">
|
|
||||||
@if (Node.ItemType == FileSystemItemType.Directory || Node.ItemType == FileSystemItemType.Root)
|
|
||||||
{
|
|
||||||
<span class="expand-button @(Node.IsExpanded ? "expanded" : string.Empty)" @onclick:stopPropagation="true" @onclick="ToggleExpand"></span>
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
<span class="spacer"></span>
|
|
||||||
}
|
|
||||||
<span class="node-icon">@GetNodeIcon()</span>
|
|
||||||
<span class="node-name">@Node.Name</span>
|
|
||||||
</span>
|
|
||||||
@if (Node.IsExpanded && Node.Children is not null)
|
|
||||||
{
|
|
||||||
<div class="child-nodes">
|
|
||||||
@foreach (var childNode in Node.Children)
|
|
||||||
{
|
|
||||||
<FileSystemTreeViewNode Node="childNode" OnExpandToggle="OnExpandToggle" OnNodeSelected="OnNodeSelected" SelectedNodePath="@SelectedNodePath" />
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@code {
|
|
||||||
[Parameter] public FileSystemTreeNodeModel Node { get; set; } = null!;
|
|
||||||
[Parameter] public EventCallback<FileSystemTreeNodeModel> OnExpandToggle { get; set; }
|
|
||||||
[Parameter] public EventCallback<string> OnNodeSelected { get; set; }
|
|
||||||
[Parameter] public string? SelectedNodePath { get; set; }
|
|
||||||
|
|
||||||
private bool IsSelected => Node.Path == SelectedNodePath;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Toggles the expanded state of the node.
|
|
||||||
/// </summary>
|
|
||||||
private async Task ToggleExpand()
|
|
||||||
{
|
|
||||||
await OnExpandToggle.InvokeAsync(Node).ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Handles the click event on the node.
|
|
||||||
/// </summary>
|
|
||||||
private async Task HandleNodeClick()
|
|
||||||
{
|
|
||||||
await OnNodeSelected.InvokeAsync(Node.Path).ConfigureAwait(false);
|
|
||||||
await InvokeAsync(StateHasChanged);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the icon of the node, based on it type.
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>The icon on the node</returns>
|
|
||||||
private string GetNodeIcon()
|
|
||||||
{
|
|
||||||
return Node.ItemType switch
|
|
||||||
{
|
|
||||||
FileSystemItemType.Root => "💿",
|
|
||||||
FileSystemItemType.Directory => Node.IsExpanded ? "📂" : "📁",
|
|
||||||
FileSystemItemType.File => "📄",
|
|
||||||
_ => "❓"
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,89 +0,0 @@
|
|||||||
.treeview {
|
|
||||||
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
||||||
font-size: 14px;
|
|
||||||
color: #333;
|
|
||||||
padding: 10px;
|
|
||||||
background-color: #f0f0f0;
|
|
||||||
border: 1px solid #ddd;
|
|
||||||
height: 100%;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tree-node {
|
|
||||||
padding: 2px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.node-content {
|
|
||||||
display: flex;
|
|
||||||
align-items: flex-start;
|
|
||||||
cursor: pointer;
|
|
||||||
padding: 0px;
|
|
||||||
border-radius: 2px;
|
|
||||||
border: 1px solid transparent;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
min-width: 100%;
|
|
||||||
display: inline-block;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.node-content:hover {
|
|
||||||
background-color: #131313;
|
|
||||||
border-top: 1px solid var(--border-color-light);
|
|
||||||
border-left: 1px solid var(--border-color-light);
|
|
||||||
border-right: 1px solid var(--border-color-dark);
|
|
||||||
background-color: var(--container-background);
|
|
||||||
}
|
|
||||||
|
|
||||||
.node-content.selected {
|
|
||||||
background-color: #131313;
|
|
||||||
border-bottom: 1px solid var(--border-color-light);
|
|
||||||
border-right: 1px solid var(--border-color-light);
|
|
||||||
border-left: 1px solid var(--border-color-dark);
|
|
||||||
background-color: var(--container-background);
|
|
||||||
}
|
|
||||||
|
|
||||||
.node-icon {
|
|
||||||
margin-right: 5px;
|
|
||||||
width: 16px;
|
|
||||||
text-align: center;
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.node-icon, .expand-button {
|
|
||||||
flex-shrink: 0;
|
|
||||||
align-self: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.child-nodes {
|
|
||||||
padding-left: 20px;
|
|
||||||
border-left: 1px dotted #ccc;
|
|
||||||
margin-left: 7px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.expand-button {
|
|
||||||
display: inline-flex;
|
|
||||||
width: 10px;
|
|
||||||
height: 10px;
|
|
||||||
margin-right: 5px;
|
|
||||||
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='%231E90FF' d='M6 4l4 4-4 4z'/></svg>");
|
|
||||||
background-size: contain;
|
|
||||||
transition: transform 0.2s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.expand-button.expanded {
|
|
||||||
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='%23f00' d='M6 4l4 4-4 4z'/></svg>");
|
|
||||||
transform: rotate(90deg);
|
|
||||||
}
|
|
||||||
|
|
||||||
.spacer {
|
|
||||||
display: inline-block;
|
|
||||||
width: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.node-name {
|
|
||||||
margin-left: 3px;
|
|
||||||
overflow-wrap: break-word;
|
|
||||||
word-break: break-all;
|
|
||||||
flex: 1;
|
|
||||||
align-self: end;
|
|
||||||
}
|
|
||||||
@@ -1,95 +0,0 @@
|
|||||||
@using Lumina.Presentation.Web.Common.Enums.Notifications
|
|
||||||
@using Lumina.Presentation.Web.Common.Models.Common
|
|
||||||
@using Lumina.Presentation.Web.Common.Services
|
|
||||||
|
|
||||||
@inject INotificationService NotificationService
|
|
||||||
|
|
||||||
@implements IDisposable
|
|
||||||
|
|
||||||
<div class="notification-container">
|
|
||||||
@foreach (var notification in _notifications)
|
|
||||||
{
|
|
||||||
<div class="notification @GetNotificationClass(notification.Type)" @key="notification.Id">
|
|
||||||
<div class="shine-effect"></div>
|
|
||||||
<div class="notification-body">
|
|
||||||
<span class="notification-message">@((MarkupString)notification.Message)</span>
|
|
||||||
<button class="close-button" @onclick="() => RemoveNotification(notification.Id)">×</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@code {
|
|
||||||
private List<NotificationModel> _notifications = [];
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Initializes the component.
|
|
||||||
/// </summary>
|
|
||||||
protected override void OnInitialized()
|
|
||||||
{
|
|
||||||
NotificationService.OnNotification += AddNotification;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Adds a notification to the list of notifications and updates the UI.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="notification">The notification to be added.</param>
|
|
||||||
private void AddNotification(NotificationModel notification)
|
|
||||||
{
|
|
||||||
string logMessage = $"{notification.Type}: {notification.Message}";
|
|
||||||
|
|
||||||
if (notification.Type == NotificationType.Error)
|
|
||||||
Console.WriteLine($"Error: {notification.Message}");
|
|
||||||
else if (notification.Type == NotificationType.Warning)
|
|
||||||
Console.WriteLine($"Warning: {notification.Message}");
|
|
||||||
else if (notification.Type == NotificationType.Info)
|
|
||||||
Console.WriteLine($"Info: {notification.Message}");
|
|
||||||
else if (notification.Type == NotificationType.Success)
|
|
||||||
Console.WriteLine($"Success: {notification.Message}");
|
|
||||||
_notifications.Add(notification);
|
|
||||||
InvokeAsync(StateHasChanged);
|
|
||||||
_ = RemoveNotificationAfterDelay(notification.Id);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Removes a notification from the list of notifications after a delay of 5 seconds.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="id">The Id of the notification to be removed.</param>
|
|
||||||
private async Task RemoveNotificationAfterDelay(Guid id)
|
|
||||||
{
|
|
||||||
await Task.Delay(5000); // 5 seconds delay
|
|
||||||
RemoveNotification(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Removes a notification from the list of notifications and updates the UI.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="id">The Id of the notification to be removed.</param>
|
|
||||||
private void RemoveNotification(Guid id)
|
|
||||||
{
|
|
||||||
_notifications.RemoveAll(notification => notification.Id == id);
|
|
||||||
InvokeAsync(StateHasChanged);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the CSS class for a notification based on its type.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="type">The type of the notification.</param>
|
|
||||||
/// <returns>The CSS class for the notification.</returns>
|
|
||||||
private string GetNotificationClass(NotificationType type) => type switch
|
|
||||||
{
|
|
||||||
NotificationType.Info => "info",
|
|
||||||
NotificationType.Success => "success",
|
|
||||||
NotificationType.Warning => "warning",
|
|
||||||
NotificationType.Error => "error",
|
|
||||||
_ => string.Empty
|
|
||||||
};
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Disposes the component.
|
|
||||||
/// </summary>
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
NotificationService.OnNotification -= AddNotification;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,107 +0,0 @@
|
|||||||
.notification-container {
|
|
||||||
position: fixed;
|
|
||||||
bottom: 10px;
|
|
||||||
left: 20px;
|
|
||||||
z-index: 1000;
|
|
||||||
width: 300px;
|
|
||||||
max-height: calc(100vh - 40px); /* full viewport height minus 40px */
|
|
||||||
overflow-y: auto; /* add vertical scrollbar if content exceeds max-height */
|
|
||||||
}
|
|
||||||
|
|
||||||
.notification {
|
|
||||||
border-radius: 4px;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
margin-right: 10px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row; /* stack content horizontally */
|
|
||||||
align-items: flex-start; /* align items to the top */
|
|
||||||
background: linear-gradient(135deg, #404040, #232323) !important;
|
|
||||||
border-top: 1px solid #505050 !important;
|
|
||||||
border-left: 1px solid #505050 !important;
|
|
||||||
border-right: 1px solid #000 !important;
|
|
||||||
border-bottom: 1px solid #000 !important;
|
|
||||||
box-shadow: 5px 5px 5px var(--shadow-color);
|
|
||||||
animation: fadeIn 0.3s, fadeOut 0.3s 4.7s;
|
|
||||||
|
|
||||||
flex-direction: column;
|
|
||||||
flex-wrap: nowrap;
|
|
||||||
align-items: stretch;
|
|
||||||
justify-content: flex-start;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.notification-body {
|
|
||||||
padding: 15px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row; /* stack content horizontally */
|
|
||||||
align-items: flex-start; /* align items to the top */
|
|
||||||
word-wrap: break-word; /* allow long words to break and wrap */
|
|
||||||
overflow-wrap: break-word; /* modern browsers */
|
|
||||||
word-break: break-word; /* for very long words or URLs */
|
|
||||||
}
|
|
||||||
|
|
||||||
.notification-message {
|
|
||||||
flex-grow: 1; /* allow message to take up available space */
|
|
||||||
margin-right: 3px; /* add some space between message and close button */
|
|
||||||
overflow-wrap: break-word; /* modern browsers */
|
|
||||||
word-break: break-word; /* for very long words or URLs */
|
|
||||||
hyphens: auto; /* enable automatic hyphenation */
|
|
||||||
white-space: pre-wrap; /* preserve line breaks */
|
|
||||||
font-family: monospace;
|
|
||||||
}
|
|
||||||
|
|
||||||
.close-button {
|
|
||||||
background: none;
|
|
||||||
color: var(--text-foreground);
|
|
||||||
border: none;
|
|
||||||
font-size: 20px;
|
|
||||||
cursor: pointer;
|
|
||||||
padding: 0;
|
|
||||||
line-height: 1;
|
|
||||||
flex-shrink: 0; /* prevent button from shrinking */
|
|
||||||
}
|
|
||||||
|
|
||||||
.shine-effect {
|
|
||||||
background: linear-gradient(to right, transparent, #fff, transparent);
|
|
||||||
width: 100%;
|
|
||||||
top: -1px;
|
|
||||||
height: 1px;
|
|
||||||
flex-shrink: 0;
|
|
||||||
pointer-events: none; /* ensure it doesn't interfere with interactions */
|
|
||||||
}
|
|
||||||
|
|
||||||
.info {
|
|
||||||
color: #2196F3;
|
|
||||||
}
|
|
||||||
|
|
||||||
.success {
|
|
||||||
color: #4CAF50;
|
|
||||||
}
|
|
||||||
|
|
||||||
.warning {
|
|
||||||
color: #FFC107;
|
|
||||||
}
|
|
||||||
|
|
||||||
.error {
|
|
||||||
color: #F44336;
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes fadeIn {
|
|
||||||
from {
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
to {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes fadeOut {
|
|
||||||
from {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
to {
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
using Lumina.Presentation.Web.Models;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using System.Diagnostics;
|
||||||
|
|
||||||
|
namespace Lumina.Presentation.Web.Controllers;
|
||||||
|
public class HomeController : Controller
|
||||||
|
{
|
||||||
|
private readonly ILogger<HomeController> _logger;
|
||||||
|
|
||||||
|
public HomeController(ILogger<HomeController> logger)
|
||||||
|
{
|
||||||
|
_logger = logger;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IActionResult Index()
|
||||||
|
{
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
|
||||||
|
public IActionResult Privacy()
|
||||||
|
{
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
|
||||||
|
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
||||||
|
public IActionResult Error()
|
||||||
|
{
|
||||||
|
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
@using Lumina.Presentation.Web.Components
|
|
||||||
|
|
||||||
@inherits LayoutComponentBase
|
|
||||||
|
|
||||||
<div id="page">
|
|
||||||
<NavMenu />
|
|
||||||
<main>
|
|
||||||
<article>
|
|
||||||
@Body
|
|
||||||
</article>
|
|
||||||
</main>
|
|
||||||
</div>
|
|
||||||
<Notifications />
|
|
||||||
Whitespace-only changes.
@@ -1,118 +0,0 @@
|
|||||||
<input type="checkbox" id="hamburger-input" class="burger-shower" />
|
|
||||||
<label id="hamburger-menu" for="hamburger-input">
|
|
||||||
<span></span>
|
|
||||||
<span></span>
|
|
||||||
<span></span>
|
|
||||||
<nav id="mobile-menu">
|
|
||||||
<div id="mobile-menu-content">
|
|
||||||
<div class="mobile-menu-heading">
|
|
||||||
Account
|
|
||||||
</div>
|
|
||||||
<ul>
|
|
||||||
<li><a href="account/login"><span>Login</span></a></li>
|
|
||||||
<li><a href="account/logout"><span>Logout</span></a></li>
|
|
||||||
<li><a href="account/register"><span>Register</span></a></li>
|
|
||||||
<li><a href="account"><span>My Account</span></a></li>
|
|
||||||
</ul>
|
|
||||||
<div class="mobile-menu-heading">
|
|
||||||
Tools
|
|
||||||
</div>
|
|
||||||
<ul>
|
|
||||||
<li><a href="tools/options"><span>Options</span></a></li>
|
|
||||||
</ul>
|
|
||||||
<div class="mobile-menu-heading">
|
|
||||||
Library
|
|
||||||
</div>
|
|
||||||
<ul>
|
|
||||||
<li><a href="library/manage"><span>Manage libraries</span></a></li>
|
|
||||||
<li><a href="library/manage/item"><span>Add media library</span></a></li>
|
|
||||||
</ul>
|
|
||||||
<div class="mobile-menu-heading">
|
|
||||||
Written Content
|
|
||||||
</div>
|
|
||||||
<ul>
|
|
||||||
<li><a href="library/written-content/books"><span>Books</span></a></li>
|
|
||||||
<li><a href="library/written-content/magazines"><span>Magazines</span></a></li>
|
|
||||||
</ul>
|
|
||||||
<div class="mobile-menu-heading">
|
|
||||||
Audio
|
|
||||||
</div>
|
|
||||||
<ul>
|
|
||||||
<li><a href="library/audio/music"><span>Music</span></a></li>
|
|
||||||
<li><a href="library/audio/interviews"><span>Interviews</span></a></li>
|
|
||||||
</ul>
|
|
||||||
<div class="mobile-menu-heading">
|
|
||||||
Video
|
|
||||||
</div>
|
|
||||||
<ul>
|
|
||||||
<li><a href="library/video/movies"><span>Movies</span></a></li>
|
|
||||||
<li><a href="library/video/tvshows"><span>TV Shows</span></a></li>
|
|
||||||
</ul>
|
|
||||||
<div class="mobile-menu-heading">
|
|
||||||
Help
|
|
||||||
</div>
|
|
||||||
<ul>
|
|
||||||
<li><a href="help/documentation"><span>Documentation</span></a></li>
|
|
||||||
<li><a href="help/about"><span>About</span></a></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
</label>
|
|
||||||
<nav class="menubar">
|
|
||||||
<ul>
|
|
||||||
<li tabindex="0">
|
|
||||||
<input type="radio" id="account-menu" name="menu">
|
|
||||||
<label for="account-menu">Account</label>
|
|
||||||
<ul>
|
|
||||||
<li><a href="account/login">Login</a></li>
|
|
||||||
<li><a href="account/logout">Logout</a></li>
|
|
||||||
<li><a href="account/register">Register</a></li>
|
|
||||||
<li><a href="account">My Account</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li tabindex="0">
|
|
||||||
<input type="radio" id="tools-menu" name="menu">
|
|
||||||
<label for="tools-menu">Tools</label>
|
|
||||||
<ul>
|
|
||||||
<li><a href="tools/options">Options</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li tabindex="0">
|
|
||||||
<input type="radio" id="library-menu" name="menu">
|
|
||||||
<label for="library-menu">Library</label>
|
|
||||||
<ul>
|
|
||||||
<li tabindex="0"><a href="library/manage">Manage libraries</a></li>
|
|
||||||
<li tabindex="0"><a href="library/manage/item">Add new library</a></li>
|
|
||||||
<li class="has-submenu" tabindex="0">
|
|
||||||
<label>Written Content</label>
|
|
||||||
<ul>
|
|
||||||
<li><a href="library/written-content/books">Books</a></li>
|
|
||||||
<li><a href="library/written-content/magazines">Magazines</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="has-submenu" tabindex="0">
|
|
||||||
<label>Audio</label>
|
|
||||||
<ul>
|
|
||||||
<li><a href="library/audio/music">Music</a></li>
|
|
||||||
<li><a href="library/audio/interviews">Interviews</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li class="has-submenu" tabindex="0">
|
|
||||||
<label>Video</label>
|
|
||||||
<ul>
|
|
||||||
<li><a href="library/video/movies">Movies</a></li>
|
|
||||||
<li><a href="library/video/tvshows">TV Shows</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li tabindex="0">
|
|
||||||
<input type="radio" id="help-menu" name="menu">
|
|
||||||
<label for="help-menu">Help</label>
|
|
||||||
<ul>
|
|
||||||
<li><a href="help/documentation">Documentation</a></li>
|
|
||||||
<li><a href="help/about">About</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
@@ -1,343 +0,0 @@
|
|||||||
.overlay {
|
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
opacity: 0;
|
|
||||||
visibility: hidden;
|
|
||||||
transition: opacity 0.50s, visibility 0.50s, height 0.50s;
|
|
||||||
-webkit-transition: opacity 0.50s, visibility 0.50s, height 0.50s;
|
|
||||||
overflow: hidden;
|
|
||||||
background: black;
|
|
||||||
z-index: -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#hamburger-input {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
#hamburger-menu {
|
|
||||||
cursor: pointer;
|
|
||||||
position: fixed;
|
|
||||||
border-radius: 4px;
|
|
||||||
border: 1px solid #777777;
|
|
||||||
border-bottom-color: #000000;
|
|
||||||
border-right-color: #000000;
|
|
||||||
top: 10px;
|
|
||||||
left: 10px;
|
|
||||||
width: 46px;
|
|
||||||
height: 46px;
|
|
||||||
display: none;
|
|
||||||
z-index: 2;
|
|
||||||
padding: 5px 0;
|
|
||||||
margin: 0px;
|
|
||||||
font-family: 'Cabin', Sans-serif;
|
|
||||||
background: linear-gradient(to top, #424343 0%, #505050 50%, #5E5D5D 100%);
|
|
||||||
}
|
|
||||||
|
|
||||||
#hamburger-menu > span {
|
|
||||||
display: block;
|
|
||||||
width: 30px;
|
|
||||||
height: 4px;
|
|
||||||
margin: 6px auto;
|
|
||||||
background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.4));
|
|
||||||
border-radius: 2px;
|
|
||||||
box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.2), 0 1px 0 rgba(255, 255, 255, 0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
#hamburger-menu:hover {
|
|
||||||
background: linear-gradient(to top, #505050 0%, #5E5D5D 50%, #6A6969 100%);
|
|
||||||
}
|
|
||||||
|
|
||||||
#hamburger-menu:hover > span {
|
|
||||||
background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.5));
|
|
||||||
box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.3);
|
|
||||||
}
|
|
||||||
|
|
||||||
#hamburger-menu #mobile-menu {
|
|
||||||
visibility: hidden;
|
|
||||||
position: fixed;
|
|
||||||
margin: 0px;
|
|
||||||
top: 0;
|
|
||||||
left: -100%;
|
|
||||||
width: 100%;
|
|
||||||
border: 1px solid #777777;
|
|
||||||
border-bottom-color: #000000;
|
|
||||||
border-right-color: #000000;
|
|
||||||
overflow: auto;
|
|
||||||
color: #6DCBFE;
|
|
||||||
text-align: center;
|
|
||||||
background: #4F4F4F;
|
|
||||||
transition: 0.50s;
|
|
||||||
-webkit-transition: 0.50s;
|
|
||||||
padding: 0px 10px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
#mobile-menu-content {
|
|
||||||
border: 1px solid #777777;
|
|
||||||
border-top-color: #000000;
|
|
||||||
border-left-color: #000000;
|
|
||||||
margin-top: 4px;
|
|
||||||
margin-left: -6px;
|
|
||||||
margin-right: -5px;
|
|
||||||
margin-bottom: 3px;
|
|
||||||
color: #6DCBFE;
|
|
||||||
text-align: center;
|
|
||||||
font-size: 18px;
|
|
||||||
font-family: 'Trebuchet MS', 'Lucida Grande', Verdana, Arial, Sans-Serif;
|
|
||||||
font-weight: bold;
|
|
||||||
text-shadow: 0px 0px 2px rgba(0,0,0,1);
|
|
||||||
/*background: #000 url(../images/metal-plate.png);*/
|
|
||||||
}
|
|
||||||
|
|
||||||
.mobile-menu-heading {
|
|
||||||
height: 35px;
|
|
||||||
font-size: 28px;
|
|
||||||
background: rgb(10, 11, 11);
|
|
||||||
border: 1px solid #777777;
|
|
||||||
border-bottom-color: #000000;
|
|
||||||
border-right-color: #000000;
|
|
||||||
width: 100%;
|
|
||||||
background-image: linear-gradient(180deg, #505050, #464646, #404040, #363636);
|
|
||||||
}
|
|
||||||
|
|
||||||
#hamburger-menu ul {
|
|
||||||
margin-left: 0px;
|
|
||||||
margin-top: 0px;
|
|
||||||
margin-bottom: 0px;
|
|
||||||
padding: 0px;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
#hamburger-menu li {
|
|
||||||
width: 100%;
|
|
||||||
list-style-type: none;
|
|
||||||
line-height: 2rem;
|
|
||||||
display: flex;
|
|
||||||
font-weight: normal;
|
|
||||||
font-size: 10px;
|
|
||||||
text-shadow: none;
|
|
||||||
text-align: left;
|
|
||||||
border: 1px solid #333333;
|
|
||||||
border-bottom-color: #000000;
|
|
||||||
border-right-color: #000000;
|
|
||||||
}
|
|
||||||
|
|
||||||
#hamburger-menu li:nth-child(even) {
|
|
||||||
background-color: #191E21;
|
|
||||||
}
|
|
||||||
|
|
||||||
#hamburger-menu li:nth-child(odd) {
|
|
||||||
background-color: #28292B;
|
|
||||||
}
|
|
||||||
|
|
||||||
#hamburger-menu a {
|
|
||||||
padding-left: 5px;
|
|
||||||
width: 100%;
|
|
||||||
color: #6DCBFE;
|
|
||||||
font-weight: normal;
|
|
||||||
font-size: 18px;
|
|
||||||
font-family: 'Arial';
|
|
||||||
text-decoration: none;
|
|
||||||
display: inline-block;
|
|
||||||
margin-left: 0.3em;
|
|
||||||
}
|
|
||||||
#hamburger-menu a:focus,
|
|
||||||
#hamburger-menu a:active {
|
|
||||||
color: #7CACF8;
|
|
||||||
}
|
|
||||||
|
|
||||||
#hamburger-menu a:hover {
|
|
||||||
color: #FFFFFF;
|
|
||||||
background: rgb(10, 11, 11);
|
|
||||||
background-image: linear-gradient(180deg, #505050, #464646, #404040, #363636);
|
|
||||||
}
|
|
||||||
|
|
||||||
#hamburger-input:checked + #hamburger-menu {
|
|
||||||
background: linear-gradient(to bottom, #424343 0%, #505050 50%, #5E5D5D 100%);
|
|
||||||
border: 1px solid #777777;
|
|
||||||
border-top: 1px solid #000000;
|
|
||||||
border-left: 1px solid #000000;
|
|
||||||
}
|
|
||||||
|
|
||||||
#hamburger-input:checked + #hamburger-menu #mobile-menu {
|
|
||||||
visibility: visible;
|
|
||||||
left: 0;
|
|
||||||
top: 71px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#hamburger-input:checked + #hamburger-menu {
|
|
||||||
z-index: 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
#hamburger-input:checked ~ .overlay {
|
|
||||||
visibility: visible;
|
|
||||||
opacity: 0.5;
|
|
||||||
z-index: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menubar {
|
|
||||||
background: linear-gradient( to bottom, #505050 0%, #464646 35%, #404040 55%, #363636 100% );
|
|
||||||
padding: 0;
|
|
||||||
position: fixed;
|
|
||||||
top: 0px;
|
|
||||||
left: 0px;
|
|
||||||
width: 100%;
|
|
||||||
z-index: 900;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menubar ul {
|
|
||||||
list-style-type: none;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menubar > ul > li {
|
|
||||||
display: inline-block;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menubar label,
|
|
||||||
.menubar a {
|
|
||||||
display: block;
|
|
||||||
padding: 2px 10px;
|
|
||||||
text-decoration: none;
|
|
||||||
cursor: default;
|
|
||||||
color: #6DCBFE;
|
|
||||||
position: relative;
|
|
||||||
user-select: none;
|
|
||||||
border: 1px solid transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menubar > ul > li > label:hover,
|
|
||||||
.menubar > ul > li > a:hover {
|
|
||||||
background: linear-gradient( to bottom, #505050 0%, #464646 35%, #404040 55%, #363636 100% );
|
|
||||||
border-left: 1px solid #777777;
|
|
||||||
border-right: 1px solid #000000;
|
|
||||||
border-top: 1px solid #505050;
|
|
||||||
border-bottom: 1px solid #222222;
|
|
||||||
color: #FFFFFF;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menubar input[type="radio"] {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menubar ul ul {
|
|
||||||
display: none;
|
|
||||||
position: absolute;
|
|
||||||
top: 100%;
|
|
||||||
left: 0;
|
|
||||||
min-width: 150px;
|
|
||||||
background: #4F4F4F;
|
|
||||||
border: 1px solid #777777;
|
|
||||||
border-bottom-color: #000000;
|
|
||||||
border-right-color: #000000;
|
|
||||||
padding-top: 4px;
|
|
||||||
padding-left: 4px;
|
|
||||||
padding-bottom: 4px;
|
|
||||||
padding-right: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menubar ul ul li {
|
|
||||||
background: #232323;
|
|
||||||
border-left: 1px solid #000000;
|
|
||||||
border-right: 1px solid #777777;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menubar ul ul li:first-child {
|
|
||||||
border-top: 1px solid #000000;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menubar ul ul li:last-child {
|
|
||||||
border-bottom: 1px solid #777777;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menubar ul ul li > label:hover,
|
|
||||||
.menubar ul ul li > a:hover {
|
|
||||||
background: linear-gradient( to bottom, #505050 0%, #464646 35%, #404040 55%, #363636 100% );
|
|
||||||
border: 1px solid #777777;
|
|
||||||
border-right-color: #000000;
|
|
||||||
border-bottom-color: #000000;
|
|
||||||
color: #FFFFFF;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menubar ul ul ul {
|
|
||||||
left: 100%;
|
|
||||||
top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menubar li:focus-within > ul {
|
|
||||||
display: block;
|
|
||||||
outline: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menubar > ul > li:focus-within > label,
|
|
||||||
.menubar > ul > li:focus-within > a {
|
|
||||||
background-color: #28292B;
|
|
||||||
background: radial-gradient( 115% 115% at 68% 70%, #30303088 0%, #20202044 50%, #101010 100% );
|
|
||||||
border: 1px solid #777777;
|
|
||||||
border-top: 1px solid #000000;
|
|
||||||
border-left: 1px solid #000000;
|
|
||||||
color: #FFFFFF;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menubar .has-submenu > label::after,
|
|
||||||
.menubar .has-submenu > a::after {
|
|
||||||
content: " ▶";
|
|
||||||
font-size: 0.6em;
|
|
||||||
position: absolute;
|
|
||||||
right: 5px;
|
|
||||||
top: 50%;
|
|
||||||
transform: translateY(-50%);
|
|
||||||
transition: transform 0.3s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menubar .has-submenu:focus-within > label,
|
|
||||||
.menubar .has-submenu:focus-within > a {
|
|
||||||
background: linear-gradient( to bottom, #505050 0%, #464646 35%, #404040 55%, #363636 100% );
|
|
||||||
border: 1px solid #777777;
|
|
||||||
border-right-color: #000000;
|
|
||||||
border-bottom-color: #000000;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menubar .has-submenu:focus-within > label::after,
|
|
||||||
.menubar .has-submenu:focus-within > a::after {
|
|
||||||
content: " ▼";
|
|
||||||
color: #FF0000;
|
|
||||||
transform: translateY(-50%) rotate(0deg);
|
|
||||||
}
|
|
||||||
|
|
||||||
.menubar .has-submenu:focus-within > label,
|
|
||||||
.menubar .has-submenu:focus-within > a {
|
|
||||||
color: #7CACF8;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* For phones */
|
|
||||||
@media only screen and (max-width: 768px) {
|
|
||||||
.menubar {
|
|
||||||
visibility: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
#hamburger-menu {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
#mobile-menu {
|
|
||||||
height: calc(100% - 70px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* For desktop: */
|
|
||||||
@media only screen and (min-width: 768px) {
|
|
||||||
.menubar {
|
|
||||||
visibility: visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
.overlay {
|
|
||||||
visibility: hidden !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
@@ -6,21 +6,19 @@
|
|||||||
<BaseOutputPath>$(SolutionDir)..\bin\client\</BaseOutputPath>
|
<BaseOutputPath>$(SolutionDir)..\bin\client\</BaseOutputPath>
|
||||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="..\AssemblyInfo_Shared.cs" Link="Properties\AssemblyInfo_Shared.cs" />
|
<Compile Include="..\AssemblyInfo_Shared.cs" Link="Properties\AssemblyInfo_Shared.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="FluentValidation" Version="11.9.2" />
|
<PackageReference Include="FluentValidation" Version="11.9.2" />
|
||||||
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.9.2" />
|
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.9.2" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.7" />
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.7" PrivateAssets="all" />
|
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="8.0.8" />
|
||||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="8.0.8" />
|
<PackageReference Include="Polly" Version="8.4.1" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
|
|
||||||
<PackageReference Include="Polly" Version="8.4.1" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<!--disable warnings generated by Mediator source generator-->
|
<!--disable warnings generated by Mediator source generator-->
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
namespace Lumina.Presentation.Web.Models;
|
||||||
|
|
||||||
|
public class ErrorViewModel
|
||||||
|
{
|
||||||
|
public string? RequestId { get; set; }
|
||||||
|
|
||||||
|
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
||||||
|
}
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
@page "/"
|
|
||||||
|
|
||||||
@using Lumina.Presentation.Web.Components
|
|
||||||
|
|
||||||
<PageTitle>Lumina - Home</PageTitle>
|
|
||||||
|
|
||||||
<FileSystemBrowser IncludeFiles="false" Path="C:\"/>
|
|
||||||
@@ -1,90 +0,0 @@
|
|||||||
@page "/library/manage"
|
|
||||||
|
|
||||||
<h3 class="text-light-two f-22 mb-10 mt-0 pt-10 text-center">Manage Libraries</h3>
|
|
||||||
|
|
||||||
<div class="enlightenment-panel shadow-effect pl-0 pr-0 pb-0 mx-auto panel mt-10" style="width: 350px; min-width: 350px;">
|
|
||||||
<div class="shine-effect"></div>
|
|
||||||
<div class="available-file-system-card">
|
|
||||||
<div class="available-file-system-button text-center close-data-source" style="color: #FF0000; top: 0px; right: 10px;">×</div>
|
|
||||||
</div>
|
|
||||||
<table class="w-90 mx-auto" data-unique-id="dataSource.EnvironmentId">
|
|
||||||
<tr>
|
|
||||||
<td colspan="2">
|
|
||||||
<p class="text-light-one f-18 mt-0 mb-5 text-center">LocalFileSystem</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<!-- section Title -->
|
|
||||||
<tr>
|
|
||||||
<td class="w-100">
|
|
||||||
<input type="hidden" name="type" value="local">
|
|
||||||
<label class="text-light-one">Title</label>
|
|
||||||
<input type="text" class="w-100 enlightenment-input" name="title" value="dataSource.Title">
|
|
||||||
<small class="text-disabled" style="margin-left: 25px;">DescriptionTitle</small>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<!-- section URL -->
|
|
||||||
<tr>
|
|
||||||
<td class="w-100">
|
|
||||||
<label class="text-light-one">URL</label>
|
|
||||||
<input type="url" class="w-100 enlightenment-input" name="url" placeholder="example.com" value="dataSource.Url">
|
|
||||||
<small class="text-disabled" style="margin-left: 25px;">DescriptionURL</small>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<!-- section Port -->
|
|
||||||
<tr>
|
|
||||||
<td class="w-100">
|
|
||||||
<label class="text-light-one">Port</label>
|
|
||||||
<input type="number" class="w-100 enlightenment-input" name="port" value="dataSource.Port">
|
|
||||||
<small class="text-disabled" style="margin-left: 25px;">DescriptionPort</small>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<!-- section Username -->
|
|
||||||
<tr>
|
|
||||||
<td class="w-100">
|
|
||||||
<label class="text-light-one">Username</label>
|
|
||||||
<input type="text" class="w-100 enlightenment-input" name="username" autocomplete="on" value="dataSource.Username">
|
|
||||||
<small class="text-disabled" style="margin-left: 25px;">DescriptionUsername</small>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<!-- section Password -->
|
|
||||||
<tr>
|
|
||||||
<td class="w-100">
|
|
||||||
<label class="text-light-one">Password</label>
|
|
||||||
<input type="password" class="w-100 enlightenment-input" name="password" value="dataSource.Password">
|
|
||||||
<small class="text-disabled" style="margin-left: 25px;">DescriptionPassword</small>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="w-100">
|
|
||||||
<label class="text-light-one">Platform</label>
|
|
||||||
<div class="enlightenment-combobox inline-block w-100">
|
|
||||||
<div class="shine-effect" style="top: 1px;"></div>
|
|
||||||
<input type="checkbox" class="enlightenment-toggle-checkbox" />
|
|
||||||
<label class="enlightenment-toggle">
|
|
||||||
<span class="enlightenment-selected-text">dataSource.PlatformType</span>
|
|
||||||
</label>
|
|
||||||
<div class="enlightenment-dropdown">
|
|
||||||
<div class="shine-effect" style="top: -4px;"></div>
|
|
||||||
<div class="enlightenment-option first-option" data-value="Unix">Unix</div>
|
|
||||||
<div class="enlightenment-option last-option" data-value="Windows">Windows</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<small class="text-disabled" style="margin-left: 25px;">DescriptionPlatform</small>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="2" class="w-100 text-center">
|
|
||||||
<button type="submit" class="confirm-button f-16 w-100px">Save</button>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="2">
|
|
||||||
<span class="invalid-feedback hidden"></span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@code {
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,195 +0,0 @@
|
|||||||
@page "/library/manage/item"
|
|
||||||
@page "/library/manage/item/{id:guid}"
|
|
||||||
|
|
||||||
@using Lumina.Presentation.Web.Common.Enums.AudioLibrary
|
|
||||||
@using Lumina.Presentation.Web.Common.Enums.BookLibrary
|
|
||||||
@using Lumina.Presentation.Web.Common.Enums.Library
|
|
||||||
@using Lumina.Presentation.Web.Common.Enums.PhotoLibrary
|
|
||||||
@using Lumina.Presentation.Web.Common.Enums.VideoLibrary
|
|
||||||
@using Lumina.Presentation.Web.Common.Models.Libraries
|
|
||||||
@using Lumina.Presentation.Web.Common.Models.UI
|
|
||||||
@using Lumina.Presentation.Web.Common.Utilities
|
|
||||||
@using Lumina.Presentation.Web.Components
|
|
||||||
|
|
||||||
<h3 class="text-light-two f-22 mb-10 mt-0 pt-10 text-center">@(Id is null ? "Add New Library" : "Edit Library")</h3>
|
|
||||||
|
|
||||||
<div class="enlightenment-panel shadow-effect pl-0 pr-0 pb-0 mx-auto panel mt-10" style="width: 350px; min-width: 350px;">
|
|
||||||
<div class="shine-effect"></div>
|
|
||||||
<table class="w-90 mx-auto">
|
|
||||||
<!-- section Title -->
|
|
||||||
<tr>
|
|
||||||
<td class="w-100">
|
|
||||||
<label class="text-light-one">Title</label>
|
|
||||||
<EnlightenmentInput Type="text" Name="title" AutoComplete="true" @bind-Value="dataSource.Title" />
|
|
||||||
<small class="text-disabled" style="margin-left: 25px;">DescriptionTitle</small>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<!-- section Library Type -->
|
|
||||||
<tr>
|
|
||||||
<td class="w-100">
|
|
||||||
<label class="text-light-one">Library Type</label>
|
|
||||||
<EnlightenmentCombobox Items="@items" @bind-SelectedItem="selectedValue" />
|
|
||||||
<small class="text-disabled" style="margin-left: 25px;">DescriptionLibraryType</small>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<!-- section Directories -->
|
|
||||||
<tr>
|
|
||||||
<td class="w-100">
|
|
||||||
<label class="text-light-one">Directories</label>
|
|
||||||
<table class="table">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>Column 1</th>
|
|
||||||
<th>Column 2</th>
|
|
||||||
<th>Directories</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
@foreach (var item in tableData)
|
|
||||||
{
|
|
||||||
<tr>
|
|
||||||
<td>@item.Column1</td>
|
|
||||||
<td>@item.Column2</td>
|
|
||||||
<td>
|
|
||||||
@* <MultiDirectorySelector /> *@
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<small class="text-disabled" style="margin-left: 25px;">DescriptionURL</small>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<!-- section Port -->
|
|
||||||
<tr>
|
|
||||||
<td class="w-100">
|
|
||||||
<label class="text-light-one">Port</label>
|
|
||||||
<EnlightenmentInput Type="number" Name="port" AutoComplete="true" @bind-Value="dataSource.Title" />
|
|
||||||
<small class="text-disabled" style="margin-left: 25px;">DescriptionPort</small>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<!-- section Username -->
|
|
||||||
<tr>
|
|
||||||
<td class="w-100">
|
|
||||||
<label class="text-light-one">Username</label>
|
|
||||||
<EnlightenmentInput Type="text" Name="username" AutoComplete="true" @bind-Value="dataSource.Title" />
|
|
||||||
<small class="text-disabled" style="margin-left: 25px;">DescriptionUsername</small>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<!-- section Password -->
|
|
||||||
<tr>
|
|
||||||
<td class="w-100">
|
|
||||||
<label class="text-light-one">Password</label>
|
|
||||||
<EnlightenmentInput Type="password" Name="password" AutoComplete="true" @bind-Value="dataSource.Title" />
|
|
||||||
<small class="text-disabled" style="margin-left: 25px;">DescriptionPassword</small>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="w-100">
|
|
||||||
<label class="text-light-one">Platform</label>
|
|
||||||
<EnlightenmentCheckbox Checked="false" Label="Is Platform" />
|
|
||||||
<small class="text-disabled" style="margin-left: 25px;">DescriptionPlatform</small>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="2" class="w-100 text-center">
|
|
||||||
<EnlightenmentButton IsConfirmButton="false" OnClick="@CancelOperation" IsDisabled="@isSaving">Cancel</EnlightenmentButton>
|
|
||||||
<EnlightenmentButton OnClick="@SaveData" IsDisabled="@isSaving">Save</EnlightenmentButton>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="2">
|
|
||||||
<span class="invalid-feedback hidden"></span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@code {
|
|
||||||
[Parameter]
|
|
||||||
public Guid? Id { get; set; }
|
|
||||||
|
|
||||||
private LibraryModel dataSource = new();
|
|
||||||
|
|
||||||
private List<ComboboxItem<string>> items = new()
|
|
||||||
{
|
|
||||||
new ComboboxItem<string>{ Text = nameof(LibraryType.WrittenContent).SplitCamelCase(), IsEnabled = false },
|
|
||||||
new ComboboxItem<string>{ Text = nameof(WrittenContentType.Book).SplitCamelCase(), Value = nameof(WrittenContentType.Book) },
|
|
||||||
new ComboboxItem<string>{ Text = nameof(WrittenContentType.EBook).SplitCamelCase(), Value = nameof(WrittenContentType.EBook) },
|
|
||||||
new ComboboxItem<string>{ Text = nameof(WrittenContentType.BookSeries).SplitCamelCase(), Value = nameof(WrittenContentType.BookSeries) },
|
|
||||||
new ComboboxItem<string>{ Text = nameof(WrittenContentType.ComicBook).SplitCamelCase(), Value = nameof(WrittenContentType.ComicBook) },
|
|
||||||
new ComboboxItem<string>{ Text = nameof(WrittenContentType.ComicSeries).SplitCamelCase(), Value = nameof(WrittenContentType.ComicSeries) },
|
|
||||||
new ComboboxItem<string>{ Text = nameof(WrittenContentType.Magazine).SplitCamelCase(), Value = nameof(WrittenContentType.Magazine) },
|
|
||||||
new ComboboxItem<string>{ Text = nameof(WrittenContentType.Manga).SplitCamelCase(), Value = nameof(WrittenContentType.Manga) },
|
|
||||||
new ComboboxItem<string>{ Text = nameof(WrittenContentType.GraphicNovel).SplitCamelCase(), Value = nameof(WrittenContentType.GraphicNovel) },
|
|
||||||
new ComboboxItem<string>{ Text = nameof(WrittenContentType.AcademicPaper).SplitCamelCase(), Value = nameof(WrittenContentType.AcademicPaper) },
|
|
||||||
new ComboboxItem<string>{ Text = nameof(WrittenContentType.SheetMusic).SplitCamelCase(), Value = nameof(WrittenContentType.SheetMusic) },
|
|
||||||
new ComboboxItem<string>{ Text = nameof(WrittenContentType.Screenplay).SplitCamelCase(), Value = nameof(WrittenContentType.Screenplay) },
|
|
||||||
new ComboboxItem<string>{ Text = nameof(LibraryType.VideoContent).SplitCamelCase(), IsEnabled = false },
|
|
||||||
new ComboboxItem<string>{ Text = nameof(VideoContentType.TvShow).SplitCamelCase(), Value = nameof(VideoContentType.TvShow) },
|
|
||||||
new ComboboxItem<string>{ Text = nameof(VideoContentType.Movie).SplitCamelCase(), Value = nameof(VideoContentType.Movie) },
|
|
||||||
new ComboboxItem<string>{ Text = nameof(VideoContentType.FilmSeries).SplitCamelCase(), Value = nameof(VideoContentType.FilmSeries) },
|
|
||||||
new ComboboxItem<string>{ Text = nameof(VideoContentType.FilmFranchise).SplitCamelCase(), Value = nameof(VideoContentType.FilmFranchise) },
|
|
||||||
new ComboboxItem<string>{ Text = nameof(VideoContentType.Concert).SplitCamelCase(), Value = nameof(VideoContentType.Concert) },
|
|
||||||
new ComboboxItem<string>{ Text = nameof(VideoContentType.Documentary).SplitCamelCase(), Value = nameof(VideoContentType.Documentary) },
|
|
||||||
new ComboboxItem<string>{ Text = nameof(VideoContentType.Tutorial).SplitCamelCase(), Value = nameof(VideoContentType.Tutorial) },
|
|
||||||
new ComboboxItem<string>{ Text = nameof(VideoContentType.Personal).SplitCamelCase(), Value = nameof(VideoContentType.Personal) },
|
|
||||||
new ComboboxItem<string>{ Text = nameof(VideoContentType.Anime).SplitCamelCase(), Value = nameof(VideoContentType.Anime) },
|
|
||||||
new ComboboxItem<string>{ Text = nameof(VideoContentType.Youtube).SplitCamelCase(), Value = nameof(VideoContentType.Youtube) },
|
|
||||||
new ComboboxItem<string>{ Text = nameof(VideoContentType.Videoclip).SplitCamelCase(), Value = nameof(VideoContentType.Videoclip) },
|
|
||||||
new ComboboxItem<string>{ Text = nameof(LibraryType.AudioContent).SplitCamelCase(), IsEnabled = false },
|
|
||||||
new ComboboxItem<string>{ Text = nameof(AudioContentType.Music).SplitCamelCase(), Value = nameof(AudioContentType.Music) },
|
|
||||||
new ComboboxItem<string>{ Text = nameof(AudioContentType.AudioBook).SplitCamelCase(), Value = nameof(AudioContentType.AudioBook) },
|
|
||||||
new ComboboxItem<string>{ Text = nameof(AudioContentType.LivePerformance).SplitCamelCase(), Value = nameof(AudioContentType.LivePerformance) },
|
|
||||||
new ComboboxItem<string>{ Text = nameof(AudioContentType.Interview).SplitCamelCase(), Value = nameof(AudioContentType.Interview) },
|
|
||||||
new ComboboxItem<string>{ Text = nameof(AudioContentType.Cover).SplitCamelCase(), Value = nameof(AudioContentType.Cover) },
|
|
||||||
new ComboboxItem<string>{ Text = nameof(AudioContentType.Remix).SplitCamelCase(), Value = nameof(AudioContentType.Remix) },
|
|
||||||
new ComboboxItem<string>{ Text = nameof(AudioContentType.Soundeffect).SplitCamelCase(), Value = nameof(AudioContentType.Soundeffect) },
|
|
||||||
new ComboboxItem<string>{ Text = nameof(AudioContentType.Podcast).SplitCamelCase(), Value = nameof(AudioContentType.Podcast) },
|
|
||||||
new ComboboxItem<string>{ Text = nameof(AudioContentType.RadioShow).SplitCamelCase(), Value = nameof(AudioContentType.RadioShow) },
|
|
||||||
new ComboboxItem<string>{ Text = nameof(LibraryType.VisualContent).SplitCamelCase(), IsEnabled = false },
|
|
||||||
new ComboboxItem<string>{ Text = nameof(VisualContentType.PhotoAlbum).SplitCamelCase(), Value = nameof(VisualContentType.PhotoAlbum) },
|
|
||||||
new ComboboxItem<string>{ Text = nameof(LibraryType.MiscellaneousContent).SplitCamelCase(), IsEnabled = false },
|
|
||||||
new ComboboxItem<string>{ Text = nameof(MiscellaneousContentType.Other).SplitCamelCase(), Value = nameof(MiscellaneousContentType.Other) },
|
|
||||||
};
|
|
||||||
|
|
||||||
private ComboboxItem<string>? selectedValue;
|
|
||||||
private ComboboxItem<string>? selectedValue2;
|
|
||||||
|
|
||||||
private bool isSaving = false;
|
|
||||||
private bool isCancelling = false;
|
|
||||||
|
|
||||||
private async Task SaveData()
|
|
||||||
{
|
|
||||||
isSaving = true;
|
|
||||||
// Perform save operation
|
|
||||||
isSaving = false;
|
|
||||||
Console.WriteLine("saved");
|
|
||||||
await Task.CompletedTask;
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task CancelOperation()
|
|
||||||
{
|
|
||||||
isCancelling = true;
|
|
||||||
// Perform cancel operation
|
|
||||||
if (!isCancelling)
|
|
||||||
isCancelling = false;
|
|
||||||
selectedValue2 = new ComboboxItem<string>();
|
|
||||||
if (selectedValue2 is not null)
|
|
||||||
Console.WriteLine("cancelled");
|
|
||||||
await Task.CompletedTask;
|
|
||||||
}
|
|
||||||
|
|
||||||
private List<TableItem> tableData = new List<TableItem>
|
|
||||||
{
|
|
||||||
new TableItem { Column1 = "Value 1", Column2 = "Value 2", Directories = new List<string>() },
|
|
||||||
new TableItem { Column1 = "Value 3", Column2 = "Value 4", Directories = new List<string>() }
|
|
||||||
};
|
|
||||||
|
|
||||||
public class TableItem
|
|
||||||
{
|
|
||||||
public string? Column1 { get; set; }
|
|
||||||
public string? Column2 { get; set; }
|
|
||||||
public List<string>? Directories { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-7
@@ -1,7 +0,0 @@
|
|||||||
@page "/library/written-content/books-library/books"
|
|
||||||
|
|
||||||
<h3>Books</h3>
|
|
||||||
|
|
||||||
@code {
|
|
||||||
|
|
||||||
}
|
|
||||||
-146
@@ -1,146 +0,0 @@
|
|||||||
@page "/library/written-content-library/books-library/books/item/{id:guid}"
|
|
||||||
|
|
||||||
@using Lumina.Presentation.Web.Common.Enums.BookLibrary
|
|
||||||
@using Lumina.Presentation.Web.Common.Models.Common
|
|
||||||
@using Lumina.Presentation.Web.Common.Models.MediaContributors
|
|
||||||
@using Lumina.Presentation.Web.Common.Models.WrittenContentLibrary
|
|
||||||
@using Lumina.Presentation.Web.Common.Models.WrittenContentLibrary.BookLibrary
|
|
||||||
@using Lumina.Presentation.Web.Common.Requests.WrittenContentLibrary.BookLibrary
|
|
||||||
|
|
||||||
@inject HttpClient _httpClient
|
|
||||||
|
|
||||||
<h1>@(Id.HasValue ? "Edit" : "Add") Book</h1>
|
|
||||||
|
|
||||||
<EditForm Model="@bookRequest" OnValidSubmit="@HandleValidSubmit">
|
|
||||||
<DataAnnotationsValidator />
|
|
||||||
<ValidationSummary />
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="title">Title<span class="mandatory-field">*</span>:</label>
|
|
||||||
<InputText id="title" @bind-Value="bookRequest.Metadata!.Title" class="form-control" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="originalTitle">Original Title:</label>
|
|
||||||
<InputText id="originalTitle" @bind-Value="bookRequest.Metadata.OriginalTitle" class="form-control" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="description">Description:</label>
|
|
||||||
<InputTextArea id="description" @bind-Value="bookRequest.Metadata.Description" class="form-control" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h3>Release Information</h3>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="originalReleaseDate">Original Release Date:</label>
|
|
||||||
<InputDate id="originalReleaseDate" @bind-Value="bookRequest.Metadata.ReleaseInfo!.OriginalReleaseDate" class="form-control" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="releaseCountry">Release Country:</label>
|
|
||||||
<InputText id="releaseCountry" @bind-Value="bookRequest.Metadata.ReleaseInfo.ReleaseCountry" class="form-control" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h3>Genres</h3>
|
|
||||||
@foreach (var genre in bookRequest.Metadata.Genres!)
|
|
||||||
{
|
|
||||||
<div class="form-group">
|
|
||||||
<InputText @bind-Value="genre.Name" class="form-control" />
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
<button type="button" class="btn btn-secondary" @onclick="AddGenre">Add Genre</button>
|
|
||||||
|
|
||||||
<h3>Language</h3>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="languageCode">Language Code:</label>
|
|
||||||
<InputText id="languageCode" @bind-Value="bookRequest.Metadata.Language!.LanguageCode" class="form-control" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="languageName">Language Name:</label>
|
|
||||||
<InputText id="languageName" @bind-Value="bookRequest.Metadata.Language.LanguageName" class="form-control" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h3>Book Details</h3>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="format">Format:</label>
|
|
||||||
<InputSelect id="format" @bind-Value="bookRequest.Format" class="form-control">
|
|
||||||
@foreach (var format in Enum.GetValues(typeof(BookFormat)))
|
|
||||||
{
|
|
||||||
<option value="@format">@format</option>
|
|
||||||
}
|
|
||||||
</InputSelect>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="edition">Edition:</label>
|
|
||||||
<InputText id="edition" @bind-Value="bookRequest.Edition" class="form-control" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h3>Identifiers</h3>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="isbn">ISBN:</label>
|
|
||||||
<InputText id="isbn" @bind-Value="bookRequest.ISBNs![0].Value" class="form-control" />
|
|
||||||
<InputSelect @bind-Value="bookRequest.ISBNs[0].Format" class="form-control">
|
|
||||||
@foreach (var format in Enum.GetValues(typeof(IsbnFormat)))
|
|
||||||
{
|
|
||||||
<option value="@format">@format</option>
|
|
||||||
}
|
|
||||||
</InputSelect>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h3>Contributors</h3>
|
|
||||||
@foreach (var contributor in bookRequest.Contributors!)
|
|
||||||
{
|
|
||||||
<div class="form-group">
|
|
||||||
@* <InputText @bind-Value="contributor.Name" placeholder="Name" class="form-control" /> *@
|
|
||||||
<InputText @bind-Value="contributor.Role!.Name" placeholder="Role" class="form-control" />
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
<button type="button" class="btn btn-secondary" @onclick="AddContributor">Add Contributor</button>
|
|
||||||
|
|
||||||
<button type="submit" class="btn btn-primary">Submit</button>
|
|
||||||
</EditForm>
|
|
||||||
|
|
||||||
@code {
|
|
||||||
private AddBookRequest bookRequest = new AddBookRequest
|
|
||||||
{
|
|
||||||
Metadata = new WrittenContentMetadataModel
|
|
||||||
{
|
|
||||||
ReleaseInfo = new ReleaseInfoModel(),
|
|
||||||
Genres = new List<GenreModel>(),
|
|
||||||
Language = new LanguageInfoModel()
|
|
||||||
},
|
|
||||||
ISBNs = new List<IsbnModel> { new IsbnModel() },
|
|
||||||
Contributors = new List<MediaContributorModel>()
|
|
||||||
};
|
|
||||||
|
|
||||||
private void AddGenre()
|
|
||||||
{
|
|
||||||
bookRequest.Metadata!.Genres!.Add(new GenreModel());
|
|
||||||
}
|
|
||||||
|
|
||||||
private void AddContributor()
|
|
||||||
{
|
|
||||||
bookRequest.Contributors!.Add(new MediaContributorModel { Role = new MediaContributorRoleModel() });
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task HandleValidSubmit()
|
|
||||||
{
|
|
||||||
// Send the bookRequest to your API
|
|
||||||
var response = await _httpClient.PostAsJsonAsync("api/books", bookRequest).ConfigureAwait(false);
|
|
||||||
if (response.IsSuccessStatusCode)
|
|
||||||
{
|
|
||||||
// Handle successful submission
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Handle error
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@code {
|
|
||||||
[Parameter]
|
|
||||||
public Guid? Id { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,37 +1,52 @@
|
|||||||
#region ========================================================================= USING =====================================================================================
|
#region ========================================================================= USING =====================================================================================
|
||||||
using Lumina.Presentation.Web.Common.DependencyInjection;
|
using Lumina.Presentation.Web.Common.DependencyInjection;
|
||||||
using Microsoft.AspNetCore.Components.Web;
|
using Microsoft.AspNetCore.Builder;
|
||||||
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using System.Threading.Tasks;
|
using Microsoft.Extensions.Hosting;
|
||||||
#endregion
|
using System.Threading.Tasks;
|
||||||
|
#endregion
|
||||||
namespace Lumina.Presentation.Web;
|
|
||||||
|
namespace Lumina.Presentation.Web;
|
||||||
/// <summary>
|
|
||||||
/// Application entry point, contains the composition root module, wires up all dependencies of the application.
|
/// <summary>
|
||||||
/// </summary>
|
/// Application entry point, contains the composition root module, wires up all dependencies of the application.
|
||||||
public class Program
|
/// </summary>
|
||||||
{
|
public class Program
|
||||||
#region ===================================================================== METHODS ===================================================================================
|
{
|
||||||
/// <summary>
|
#region ===================================================================== METHODS ===================================================================================
|
||||||
/// Application entry point.
|
/// <summary>
|
||||||
/// </summary>
|
/// Application entry point.
|
||||||
/// <param name="args">Optional command line arguments.</param>
|
/// </summary>
|
||||||
public static async Task Main(string[] args)
|
/// <param name="args">Optional command line arguments.</param>
|
||||||
{
|
public static async Task Main(string[] args)
|
||||||
WebAssemblyHostBuilder builder = WebAssemblyHostBuilder.CreateDefault(args);
|
{
|
||||||
|
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
|
||||||
builder.RootComponents.Add<App>("#app");
|
|
||||||
builder.RootComponents.Add<HeadOutlet>("head::after");
|
builder.Services.BindConfiguration(builder.Configuration);
|
||||||
|
builder.Services.AddPresentationWebLayerServices();
|
||||||
builder.AddConfiguration();
|
|
||||||
builder.Services.AddPresentationWebLayerServices();
|
WebApplication app = builder.Build();
|
||||||
|
|
||||||
//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
|
// configure the HTTP request pipeline.
|
||||||
|
if (!app.Environment.IsDevelopment())
|
||||||
WebAssemblyHost webAssemblyHost = builder.Build();
|
{
|
||||||
|
app.UseExceptionHandler("/Home/Error");
|
||||||
await webAssemblyHost.RunAsync().ConfigureAwait(false);
|
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
||||||
}
|
app.UseHsts();
|
||||||
#endregion
|
}
|
||||||
}
|
|
||||||
|
app.UseHttpsRedirection();
|
||||||
|
app.UseStaticFiles();
|
||||||
|
|
||||||
|
app.UseRouting();
|
||||||
|
|
||||||
|
app.UseAuthorization();
|
||||||
|
|
||||||
|
app.MapControllerRoute(
|
||||||
|
name: "default",
|
||||||
|
pattern: "{controller=Home}/{action=Index}/{id?}");
|
||||||
|
|
||||||
|
await app.RunAsync();
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
@@ -16,4 +16,4 @@ using System.Runtime.InteropServices;
|
|||||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||||
[assembly: Guid("4E3EEA67-7C92-4588-9183-03140627D564")]
|
[assembly: Guid("4E3EEA67-7C92-4588-9183-03140627D564")]
|
||||||
|
|
||||||
[assembly: InternalsVisibleTo("Lumina.Presentation.Web.UnitTests")]
|
[assembly: InternalsVisibleTo("Lumina.Presentation.Web.UnitTests")]
|
||||||
@@ -1,25 +1,23 @@
|
|||||||
{
|
{
|
||||||
"$schema": "http://json.schemastore.org/launchsettings.json",
|
"$schema": "http://json.schemastore.org/launchsettings.json",
|
||||||
"profiles": {
|
"profiles": {
|
||||||
"http": {
|
"http": {
|
||||||
"commandName": "Project",
|
"commandName": "Project",
|
||||||
"dotnetRunMessages": true,
|
"dotnetRunMessages": true,
|
||||||
//"launchBrowser": true,
|
"launchBrowser": true,
|
||||||
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
|
"applicationUrl": "http://localhost:5012",
|
||||||
"applicationUrl": "http://localhost:5012",
|
"environmentVariables": {
|
||||||
"environmentVariables": {
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
}
|
||||||
}
|
},
|
||||||
},
|
"https": {
|
||||||
"https": {
|
"commandName": "Project",
|
||||||
"commandName": "Project",
|
"dotnetRunMessages": true,
|
||||||
"dotnetRunMessages": true,
|
"launchBrowser": true,
|
||||||
//"launchBrowser": true,
|
"applicationUrl": "https://localhost:7112;http://localhost:5012",
|
||||||
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
|
"environmentVariables": {
|
||||||
"applicationUrl": "https://localhost:7112;http://localhost:5012",
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
"environmentVariables": {
|
}
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
@{
|
||||||
|
ViewData["Title"] = "Home Page";
|
||||||
|
}
|
||||||
|
|
||||||
|
<div class="text-center">
|
||||||
|
<h1 class="display-4">Welcome</h1>
|
||||||
|
<p>Learn about <a href="https://learn.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
@{
|
||||||
|
ViewData["Title"] = "Privacy Policy";
|
||||||
|
}
|
||||||
|
<h1>@ViewData["Title"]</h1>
|
||||||
|
|
||||||
|
<p>Use this page to detail your site's privacy policy.</p>
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
@model ErrorViewModel
|
||||||
|
@{
|
||||||
|
ViewData["Title"] = "Error";
|
||||||
|
}
|
||||||
|
|
||||||
|
<h1 class="text-danger">Error.</h1>
|
||||||
|
<h2 class="text-danger">An error occurred while processing your request.</h2>
|
||||||
|
|
||||||
|
@if (Model.ShowRequestId)
|
||||||
|
{
|
||||||
|
<p>
|
||||||
|
<strong>Request ID:</strong> <code>@Model.RequestId</code>
|
||||||
|
</p>
|
||||||
|
}
|
||||||
|
|
||||||
|
<h3>Development Mode</h3>
|
||||||
|
<p>
|
||||||
|
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
|
||||||
|
It can result in displaying sensitive information from exceptions to end users.
|
||||||
|
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
|
||||||
|
and restarting the app.
|
||||||
|
</p>
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<title>@ViewData["Title"] - Lumina.Presentation.Web</title>
|
||||||
|
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
|
||||||
|
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
|
||||||
|
<link rel="stylesheet" href="~/Lumina.Presentation.Web.styles.css" asp-append-version="true" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<header>
|
||||||
|
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">Lumina.Presentation.Web</a>
|
||||||
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
|
||||||
|
aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
<span class="navbar-toggler-icon"></span>
|
||||||
|
</button>
|
||||||
|
<div class="navbar-collapse collapse d-sm-inline-flex justify-content-between">
|
||||||
|
<ul class="navbar-nav flex-grow-1">
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Home</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
</header>
|
||||||
|
<div class="container">
|
||||||
|
<main role="main" class="pb-3">
|
||||||
|
@RenderBody()
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<footer class="border-top footer text-muted">
|
||||||
|
<div class="container">
|
||||||
|
© 2024 - Lumina.Presentation.Web - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
<script src="~/lib/jquery/dist/jquery.min.js"></script>
|
||||||
|
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
|
<script src="~/js/site.js" asp-append-version="true"></script>
|
||||||
|
@await RenderSectionAsync("Scripts", required: false)
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
/* Please see documentation at https://learn.microsoft.com/aspnet/core/client-side/bundling-and-minification
|
||||||
|
for details on configuring this project to bundle and minify static web assets. */
|
||||||
|
|
||||||
|
a.navbar-brand {
|
||||||
|
white-space: normal;
|
||||||
|
text-align: center;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: #0077cc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-primary {
|
||||||
|
color: #fff;
|
||||||
|
background-color: #1b6ec2;
|
||||||
|
border-color: #1861ac;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
|
||||||
|
color: #fff;
|
||||||
|
background-color: #1b6ec2;
|
||||||
|
border-color: #1861ac;
|
||||||
|
}
|
||||||
|
|
||||||
|
.border-top {
|
||||||
|
border-top: 1px solid #e5e5e5;
|
||||||
|
}
|
||||||
|
.border-bottom {
|
||||||
|
border-bottom: 1px solid #e5e5e5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box-shadow {
|
||||||
|
box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
|
||||||
|
}
|
||||||
|
|
||||||
|
button.accept-policy {
|
||||||
|
font-size: 1rem;
|
||||||
|
line-height: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
width: 100%;
|
||||||
|
white-space: nowrap;
|
||||||
|
line-height: 60px;
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
<script src="~/lib/jquery-validation/dist/jquery.validate.min.js"></script>
|
||||||
|
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
@using Lumina.Presentation.Web
|
||||||
|
@using Lumina.Presentation.Web.Models
|
||||||
|
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
@{
|
||||||
|
Layout = "_Layout";
|
||||||
|
}
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
@using System.Net.Http
|
|
||||||
@using System.Net.Http.Json
|
|
||||||
@using Microsoft.AspNetCore.Components.Forms
|
|
||||||
@using Microsoft.AspNetCore.Components.Routing
|
|
||||||
@using Microsoft.AspNetCore.Components.Web
|
|
||||||
@using Microsoft.AspNetCore.Components.Web.Virtualization
|
|
||||||
@using Microsoft.AspNetCore.Components.WebAssembly.Http
|
|
||||||
@using Microsoft.JSInterop
|
|
||||||
@using Lumina.Presentation.Web
|
|
||||||
@using Lumina.Presentation.Web.Layout
|
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.AspNetCore": "Warning"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AllowedHosts": "*",
|
||||||
|
"ServerConfiguration": {
|
||||||
|
"ApiVersion": 1,
|
||||||
|
"BaseAddress": "http://localhost",
|
||||||
|
"Port": 5214
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"ServerConfiguration": {
|
|
||||||
"ApiVersion": 1,
|
|
||||||
"BaseAddress": "http://localhost",
|
|
||||||
"Port": 5214
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 5.3 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 2.6 KiB |
@@ -1,34 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
<title>Lumina</title>
|
|
||||||
<base href="/" />
|
|
||||||
<link rel="stylesheet" href="css/blazor.css" />
|
|
||||||
<link rel="stylesheet" href="css/site.css" />
|
|
||||||
<link rel="icon" type="image/png" href="favicon.png" />
|
|
||||||
<link href="Lumina.Presentation.Web.styles.css" rel="stylesheet" />
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<div id="app">
|
|
||||||
<svg class="loading-progress">
|
|
||||||
<circle r="40%" cx="50%" cy="50%" />
|
|
||||||
<circle r="40%" cx="50%" cy="50%" />
|
|
||||||
</svg>
|
|
||||||
<div class="loading-progress-text"></div>
|
|
||||||
</div>
|
|
||||||
<!--Modal grid background-->
|
|
||||||
<div id="modal-background" class="block"></div>
|
|
||||||
<div id="blazor-error-ui">
|
|
||||||
An unhandled error has occurred.
|
|
||||||
<a href="" class="reload">Reload</a>
|
|
||||||
<a class="dismiss">🗙</a>
|
|
||||||
</div>
|
|
||||||
<script src="_framework/blazor.webassembly.js"></script>
|
|
||||||
<script src="js/site.js"></script>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
||||||
+7
-7
@@ -13,8 +13,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lumina.Infrastructure", "Lu
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lumina.Presentation.Api", "Lumina.Presentation.Api\Lumina.Presentation.Api.csproj", "{7A49A922-127C-4786-84B7-53E64D816336}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lumina.Presentation.Api", "Lumina.Presentation.Api\Lumina.Presentation.Api.csproj", "{7A49A922-127C-4786-84B7-53E64D816336}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lumina.Presentation.Web", "Lumina.Presentation.Web\Lumina.Presentation.Web.csproj", "{FABC255B-0D21-4A0A-A0E2-7759D929B4D3}"
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lumina.Application.UnitTests", "..\tests\UnitTests\Lumina.Application.UnitTests\Lumina.Application.UnitTests.csproj", "{4DEA94AF-D592-4187-8850-A569C93256C9}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lumina.Application.UnitTests", "..\tests\UnitTests\Lumina.Application.UnitTests\Lumina.Application.UnitTests.csproj", "{4DEA94AF-D592-4187-8850-A569C93256C9}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lumina.Infrastructure.UnitTests", "..\tests\UnitTests\Lumina.Infrastructure.UnitTests\Lumina.Infrastructure.UnitTests.csproj", "{8DB5300A-B38A-4F6D-8FF7-A722DA47667E}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lumina.Infrastructure.UnitTests", "..\tests\UnitTests\Lumina.Infrastructure.UnitTests\Lumina.Infrastructure.UnitTests.csproj", "{8DB5300A-B38A-4F6D-8FF7-A722DA47667E}"
|
||||||
@@ -84,6 +82,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "templates", "templates", "{
|
|||||||
..\docs\technical\templates\PULL_REQUEST_TEMPLATE.md = ..\docs\technical\templates\PULL_REQUEST_TEMPLATE.md
|
..\docs\technical\templates\PULL_REQUEST_TEMPLATE.md = ..\docs\technical\templates\PULL_REQUEST_TEMPLATE.md
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lumina.Presentation.Web", "Lumina.Presentation.Web\Lumina.Presentation.Web.csproj", "{613C74E8-720C-4205-8BA7-85B23D2E7881}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@@ -110,10 +110,6 @@ Global
|
|||||||
{7A49A922-127C-4786-84B7-53E64D816336}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{7A49A922-127C-4786-84B7-53E64D816336}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{7A49A922-127C-4786-84B7-53E64D816336}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{7A49A922-127C-4786-84B7-53E64D816336}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{7A49A922-127C-4786-84B7-53E64D816336}.Release|Any CPU.Build.0 = Release|Any CPU
|
{7A49A922-127C-4786-84B7-53E64D816336}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{FABC255B-0D21-4A0A-A0E2-7759D929B4D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{FABC255B-0D21-4A0A-A0E2-7759D929B4D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{FABC255B-0D21-4A0A-A0E2-7759D929B4D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{FABC255B-0D21-4A0A-A0E2-7759D929B4D3}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{4DEA94AF-D592-4187-8850-A569C93256C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{4DEA94AF-D592-4187-8850-A569C93256C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{4DEA94AF-D592-4187-8850-A569C93256C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{4DEA94AF-D592-4187-8850-A569C93256C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{4DEA94AF-D592-4187-8850-A569C93256C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{4DEA94AF-D592-4187-8850-A569C93256C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
@@ -150,6 +146,10 @@ Global
|
|||||||
{6BD85BA8-B3C4-4D79-8858-F6D7676FF2CC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{6BD85BA8-B3C4-4D79-8858-F6D7676FF2CC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{6BD85BA8-B3C4-4D79-8858-F6D7676FF2CC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{6BD85BA8-B3C4-4D79-8858-F6D7676FF2CC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{6BD85BA8-B3C4-4D79-8858-F6D7676FF2CC}.Release|Any CPU.Build.0 = Release|Any CPU
|
{6BD85BA8-B3C4-4D79-8858-F6D7676FF2CC}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{613C74E8-720C-4205-8BA7-85B23D2E7881}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{613C74E8-720C-4205-8BA7-85B23D2E7881}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{613C74E8-720C-4205-8BA7-85B23D2E7881}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{613C74E8-720C-4205-8BA7-85B23D2E7881}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
@@ -160,7 +160,6 @@ Global
|
|||||||
{9FF9D5FA-1D0C-4743-87E3-CC8C08694CAC} = {3C316ABB-08D5-4450-9A4E-91059DB54254}
|
{9FF9D5FA-1D0C-4743-87E3-CC8C08694CAC} = {3C316ABB-08D5-4450-9A4E-91059DB54254}
|
||||||
{D43E63EA-2210-471E-BFED-D1D33D196554} = {3C316ABB-08D5-4450-9A4E-91059DB54254}
|
{D43E63EA-2210-471E-BFED-D1D33D196554} = {3C316ABB-08D5-4450-9A4E-91059DB54254}
|
||||||
{7A49A922-127C-4786-84B7-53E64D816336} = {3C316ABB-08D5-4450-9A4E-91059DB54254}
|
{7A49A922-127C-4786-84B7-53E64D816336} = {3C316ABB-08D5-4450-9A4E-91059DB54254}
|
||||||
{FABC255B-0D21-4A0A-A0E2-7759D929B4D3} = {3C316ABB-08D5-4450-9A4E-91059DB54254}
|
|
||||||
{4DEA94AF-D592-4187-8850-A569C93256C9} = {53B1231B-37F5-44BA-80D5-DBA979775F5C}
|
{4DEA94AF-D592-4187-8850-A569C93256C9} = {53B1231B-37F5-44BA-80D5-DBA979775F5C}
|
||||||
{8DB5300A-B38A-4F6D-8FF7-A722DA47667E} = {53B1231B-37F5-44BA-80D5-DBA979775F5C}
|
{8DB5300A-B38A-4F6D-8FF7-A722DA47667E} = {53B1231B-37F5-44BA-80D5-DBA979775F5C}
|
||||||
{6050F6A9-F136-4B7B-82D2-57E689463ACA} = {53B1231B-37F5-44BA-80D5-DBA979775F5C}
|
{6050F6A9-F136-4B7B-82D2-57E689463ACA} = {53B1231B-37F5-44BA-80D5-DBA979775F5C}
|
||||||
@@ -177,6 +176,7 @@ Global
|
|||||||
{3680DAFB-10BA-4A0F-AE40-620D06DAF617} = {3F057926-562F-4EF4-BFC0-EE62372D4551}
|
{3680DAFB-10BA-4A0F-AE40-620D06DAF617} = {3F057926-562F-4EF4-BFC0-EE62372D4551}
|
||||||
{6BD85BA8-B3C4-4D79-8858-F6D7676FF2CC} = {3C316ABB-08D5-4450-9A4E-91059DB54254}
|
{6BD85BA8-B3C4-4D79-8858-F6D7676FF2CC} = {3C316ABB-08D5-4450-9A4E-91059DB54254}
|
||||||
{A0D07244-9CB2-4E30-85A5-97D520E4B9CC} = {0C0E5A56-AD29-4D0B-AB87-E865F8B933E2}
|
{A0D07244-9CB2-4E30-85A5-97D520E4B9CC} = {0C0E5A56-AD29-4D0B-AB87-E865F8B933E2}
|
||||||
|
{613C74E8-720C-4205-8BA7-85B23D2E7881} = {3C316ABB-08D5-4450-9A4E-91059DB54254}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {4A55A28E-C657-4A0B-95EA-2931AE66004E}
|
SolutionGuid = {4A55A28E-C657-4A0B-95EA-2931AE66004E}
|
||||||
|
|||||||
Reference in new issue
Block a user