net8, language features, bugfixes
This commit is contained in:
parent
1591618c2c
commit
ce99053a10
353 changed files with 3245 additions and 3944 deletions
|
|
@ -85,28 +85,31 @@
|
|||
{
|
||||
var sender = ChatService.Users.Keys.FirstOrDefault(p => p.Uid == message.SenderId);
|
||||
|
||||
<MudListItem Dense="true">
|
||||
<div class="d-flex my-4" style="flex-direction:row;">
|
||||
<div class="mr-4">
|
||||
<MudBadge Class="my-2" Overlap Visible="true" Color="@(sender.Online ? Color.Success : Color.Error)">
|
||||
<MudAvatar Color="Color.Primary" Style="height:50px; width:50px;">
|
||||
@sender?.Username?.ToUpper().FirstOrDefault()
|
||||
</MudAvatar>
|
||||
</MudBadge>
|
||||
@if (sender is not null)
|
||||
{
|
||||
<MudListItem Dense="true">
|
||||
<div class="d-flex my-4" style="flex-direction:row;">
|
||||
<div class="mr-4">
|
||||
<MudBadge Class="my-2" Overlap Visible="true" Color="@(sender.Online ? Color.Success : Color.Error)">
|
||||
<MudAvatar Color="Color.Primary" Style="height:50px; width:50px;">
|
||||
@sender?.Username?.ToUpper().FirstOrDefault()
|
||||
</MudAvatar>
|
||||
</MudBadge>
|
||||
</div>
|
||||
<div>
|
||||
<MudText Align="Align.Start" Typo="Typo.body1" Style="font-weight: bold;">
|
||||
@sender?.Username
|
||||
</MudText>
|
||||
<MudText Align="Align.Start" Typo="Typo.body1" Style="font-size: x-small!important;">
|
||||
@message.CreatedDate.ToString("dd MMM yyyy - hh:mm tt")
|
||||
</MudText>
|
||||
<MudText Align="Align.Start" Typo="Typo.body2" Style="padding: 15px; background-color: var(--mud-palette-background-grey); border-radius: 5px; margin-top:5px;">
|
||||
@message.Message
|
||||
</MudText>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<MudText Align="Align.Start" Typo="Typo.body1" Style="font-weight: bold;">
|
||||
@sender?.Username
|
||||
</MudText>
|
||||
<MudText Align="Align.Start" Typo="Typo.body1" Style="font-size: x-small!important;">
|
||||
@message.CreatedDate.ToString("dd MMM yyyy - hh:mm tt")
|
||||
</MudText>
|
||||
<MudText Align="Align.Start" Typo="Typo.body2" Style="padding: 15px; background-color: var(--mud-palette-background-grey); border-radius: 5px; margin-top:5px;">
|
||||
@message.Message
|
||||
</MudText>
|
||||
</div>
|
||||
</div>
|
||||
</MudListItem>
|
||||
</MudListItem>
|
||||
}
|
||||
}
|
||||
}
|
||||
</MudList>
|
||||
|
|
|
|||
|
|
@ -50,14 +50,16 @@ public partial class ChatDialog : IDisposable
|
|||
private string? _currentMessage;
|
||||
private bool _disposed;
|
||||
|
||||
private readonly List<IDisposable> _subscriptions = new();
|
||||
private readonly List<IDisposable> _subscriptions = [];
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
protected override Task OnInitializedAsync()
|
||||
{
|
||||
_subscriptions.Add(Bus.SubscribeAsync<ChatUserConnected>(UserConnected, p => p.User.Uid != SessionHandler.State.Uid));
|
||||
_subscriptions.Add(Bus.SubscribeAsync<ChatUserDisconnected>(UserDisconnected, p => p.User.Uid != SessionHandler.State.Uid));
|
||||
_subscriptions.Add(Bus.SubscribeAsync<ChatRefresh>(RefreshAsync, null));
|
||||
_subscriptions.Add(Bus.SubscribeAsync<ChatMessageReceived>(MessageReceived, p => p.Message.SenderId != SessionHandler.State.Uid));
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
|
|
@ -82,6 +84,8 @@ public partial class ChatDialog : IDisposable
|
|||
|
||||
private async Task GetSessionAsync(ChatUser user)
|
||||
{
|
||||
if (_currentUser is null) return;
|
||||
|
||||
var members = new List<ChatUser>() { _currentUser, user };
|
||||
var session = await ChatService.AddOrGetSession(members);
|
||||
|
||||
|
|
@ -93,7 +97,7 @@ public partial class ChatDialog : IDisposable
|
|||
|
||||
private async Task SendAsync()
|
||||
{
|
||||
if (_currentSession is null || string.IsNullOrWhiteSpace(_currentMessage)) return;
|
||||
if (_currentSession is null || _currentUser is null || string.IsNullOrWhiteSpace(_currentMessage)) return;
|
||||
|
||||
await _currentSession.SendMessage(_currentUser, _currentMessage, default);
|
||||
_currentMessage = string.Empty;
|
||||
|
|
@ -118,11 +122,11 @@ public partial class ChatDialog : IDisposable
|
|||
options.VisibleStateDuration = 10000;
|
||||
});
|
||||
|
||||
_ = JSRuntime.InvokeAsync<string>("PlayAudio", "chat_user_online");
|
||||
await JSRuntime.InvokeAsync<string>("PlayAudio", "chat_user_online");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError(ex.Message);
|
||||
Logger.LogError("{exception}", ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -141,17 +145,17 @@ public partial class ChatDialog : IDisposable
|
|||
options.VisibleStateDuration = 10000;
|
||||
});
|
||||
|
||||
_ = JSRuntime.InvokeAsync<string>("PlayAudio", "chat_user_online");
|
||||
await JSRuntime.InvokeAsync<string>("PlayAudio", "chat_user_online");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError(ex.Message);
|
||||
Logger.LogError("{exception}", ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private async ValueTask RefreshAsync(ChatRefresh model, CancellationToken cancellationToken)
|
||||
{
|
||||
_ = InvokeAsync(StateHasChanged);
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
private async ValueTask MessageReceived(ChatMessageReceived model, CancellationToken cancellationToken)
|
||||
|
|
@ -175,14 +179,14 @@ public partial class ChatDialog : IDisposable
|
|||
|
||||
if (_content != Content.Chat)
|
||||
{
|
||||
_ = JSRuntime.InvokeAsync<string>("PlayAudio", "chat_message");
|
||||
await JSRuntime.InvokeAsync<string>("PlayAudio", "chat_message");
|
||||
}
|
||||
|
||||
_ = InvokeAsync(StateHasChanged);
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError(ex.ToString());
|
||||
Logger.LogError("{exception}", ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,10 +28,7 @@
|
|||
</Authorized>
|
||||
</AuthorizeView>
|
||||
<MudSpacer />
|
||||
@if (_darkModeSwitch is false)
|
||||
{
|
||||
<MudIconButton OnClick="@OnDarkModeToggleAsync" Icon="@(_darkMode ? Icons.Material.Filled.Brightness5 : Icons.Material.Filled.Brightness4)" Color="Color.Inherit" />
|
||||
}
|
||||
<MudIconButton OnClick="@OnDarkModeToggleAsync" Icon="@(_darkMode ? Icons.Material.Filled.Brightness5 : Icons.Material.Filled.Brightness4)" Color="Color.Inherit" />
|
||||
<ChatProvider />
|
||||
<ProfileProvider />
|
||||
</MudAppBar>
|
||||
|
|
@ -50,17 +47,17 @@
|
|||
</MudLayout>
|
||||
|
||||
@code{
|
||||
public IReadOnlyDictionary<string, object>? RouteValues { get; set; }
|
||||
public IReadOnlyDictionary<string, object?>? RouteValues { get; set; }
|
||||
|
||||
private MudTheme _currentTheme = Themes.Default();
|
||||
private DrawerProvider? _drawer;
|
||||
private bool _darkMode;
|
||||
private bool _darkModeSwitch;
|
||||
private bool _disposed;
|
||||
|
||||
|
||||
protected override void OnParametersSet()
|
||||
{
|
||||
RouteValues = (Body?.Target as RouteView)?.RouteData.RouteValues;
|
||||
if (Body?.Target as RouteView is RouteView routeView)
|
||||
RouteValues = routeView.RouteData.RouteValues;
|
||||
|
||||
base.OnParametersSet();
|
||||
}
|
||||
|
|
@ -94,6 +91,8 @@
|
|||
using var scope = ServiceScopeFactory.CreateScope();
|
||||
var userManager = scope.ServiceProvider.GetRequiredService<UserManager<InsightUser>>();
|
||||
|
||||
if (state.User.Identity?.Name is null) return;
|
||||
|
||||
if (await userManager.FindByNameAsync(state.User.Identity.Name) is not InsightUser user) return;
|
||||
|
||||
var userPrefs = await Database.UserPreference()
|
||||
|
|
@ -124,6 +123,8 @@
|
|||
using var scope = ServiceScopeFactory.CreateScope();
|
||||
var userManager = scope.ServiceProvider.GetRequiredService<UserManager<InsightUser>>();
|
||||
|
||||
if (state.User.Identity?.Name is null) return;
|
||||
|
||||
if (await userManager.FindByNameAsync(state.User.Identity.Name) is not InsightUser user) return;
|
||||
|
||||
var date = DateTime.Now;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
@code{
|
||||
[CascadingParameter] public IReadOnlyDictionary<string, object>? RouteValues { get; set; }
|
||||
|
||||
private string _title = "Account";
|
||||
private bool _disposed;
|
||||
|
||||
public void Dispose()
|
||||
|
|
@ -21,8 +20,7 @@
|
|||
|
||||
private void Dispose(bool disposing)
|
||||
{
|
||||
if (_disposed is false) return;
|
||||
if (disposing is false) return;
|
||||
if (_disposed || disposing is false) return;
|
||||
|
||||
try
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
using static Insight.Web.Constants.Navigation.Monitoring;
|
||||
|
||||
namespace Insight.Web.Constants;
|
||||
namespace Insight.Web.Constants;
|
||||
|
||||
public static class Navigation
|
||||
{
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ public static class Themes
|
|||
FontWeight = 400,
|
||||
LineHeight = 1.43,
|
||||
LetterSpacing = "normal",
|
||||
FontFamily = new string[] { "Public Sans", "Roboto", "Arial", "sans-serif" }
|
||||
FontFamily = ["Public Sans", "Roboto", "Arial", "sans-serif"]
|
||||
},
|
||||
H1 = new H1
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ public static class NavigationManagerExtensions
|
|||
public static Dictionary<string, StringValues> GetQueryString(this NavigationManager navigationManager)
|
||||
{
|
||||
var uri = navigationManager.ToAbsoluteUri(navigationManager.Uri);
|
||||
if (uri is null) return new Dictionary<string, StringValues>();
|
||||
if (uri is null) return [];
|
||||
|
||||
return QueryHelpers.ParseQuery(uri.Query);
|
||||
}
|
||||
|
|
@ -19,9 +19,9 @@ public static class NavigationManagerExtensions
|
|||
{
|
||||
var queryString = GetQueryString(navigationManager);
|
||||
|
||||
if (queryString.ContainsKey(key))
|
||||
if (queryString.TryGetValue(key, out StringValues keyValues))
|
||||
{
|
||||
if (queryString[key] == value) return;
|
||||
if (keyValues == value) return;
|
||||
queryString[key] = value;
|
||||
}
|
||||
else
|
||||
|
|
@ -49,11 +49,10 @@ public static class NavigationManagerExtensions
|
|||
url = RemoveQueryStringByKey(url, key);
|
||||
}
|
||||
|
||||
var query = new Dictionary<string, string>();
|
||||
var query = new Dictionary<string, string?>();
|
||||
|
||||
foreach (var keys in queryString.Where(x => string.IsNullOrWhiteSpace(x.Value) is false))
|
||||
{
|
||||
query.Add(keys.Key, keys.Value.ToString());
|
||||
}
|
||||
query.Add(keys.Key, keys.Value);
|
||||
|
||||
return QueryHelpers.AddQueryString(url, query);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<Product>Insight</Product>
|
||||
<AssemblyName>web</AssemblyName>
|
||||
<AssemblyVersion>2023.12.14.0</AssemblyVersion>
|
||||
|
|
@ -10,30 +11,34 @@
|
|||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<PublishAot>false</PublishAot>
|
||||
<PublishTrimmed>false</PublishTrimmed>
|
||||
<SatelliteResourceLanguages>none</SatelliteResourceLanguages>
|
||||
<!--<ServerGarbageCollection>false</ServerGarbageCollection>
|
||||
<ConcurrentGarbageCollection>false</ConcurrentGarbageCollection>-->
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DebugType>none</DebugType>
|
||||
<DebugType>none</DebugType>
|
||||
<NoWarn>BL0007</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
<DebugType>none</DebugType>
|
||||
<DebugType>none</DebugType>
|
||||
<NoWarn>BL0007</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="7.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="8.0.0" />
|
||||
<PackageReference Include="Serilog.Extensions.Logging.File" Version="3.0.0" />
|
||||
<PackageReference Include="Blazored.LocalStorage" Version="4.4.0" />
|
||||
<PackageReference Include="Blazored.SessionStorage" Version="2.4.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="7.0.13" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="8.0.0" />
|
||||
<PackageReference Include="MudBlazor" Version="6.11.1" />
|
||||
<!--Unix Serilog stuff-->
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Core\Insight.Infrastructure.Web\Insight.Infrastructure.Web.csproj" />
|
||||
<ProjectReference Include="..\..\Core\Insight.Infrastructure\Insight.Infrastructure.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
|||
|
|
@ -8,72 +8,66 @@ using System.Collections.Concurrent;
|
|||
|
||||
namespace Insight.Web.Middleware;
|
||||
|
||||
public class IdentityMiddleware
|
||||
public class IdentityMiddleware(RequestDelegate next, ILogger<IdentityMiddleware> logger)
|
||||
{
|
||||
public static IDictionary<Guid, LoginModel> Logins { get; private set; } = new ConcurrentDictionary<Guid, LoginModel>();
|
||||
public static IDictionary<Guid, ChangePasswordModel> Passwords { get; private set; } = new ConcurrentDictionary<Guid, ChangePasswordModel>();
|
||||
|
||||
private RequestDelegate Next { get; }
|
||||
private ILogger<IdentityMiddleware> Logger { get; }
|
||||
|
||||
public IdentityMiddleware(RequestDelegate next, ILogger<IdentityMiddleware> logger)
|
||||
{
|
||||
Next = next;
|
||||
Logger = logger;
|
||||
}
|
||||
private RequestDelegate Next { get; } = next;
|
||||
private ILogger<IdentityMiddleware> Logger { get; } = logger;
|
||||
|
||||
public async Task Invoke(HttpContext context, IServiceProvider serviceProvider)
|
||||
{
|
||||
try
|
||||
{
|
||||
// skip blazor / internal requests
|
||||
if (context.Request.Path.Value.StartsWith("/_blazor")) return;
|
||||
if (context.Request.Path.Value.StartsWith("/_framework")) return;
|
||||
if (context.Request.Path.Value.StartsWith("/_content")) return;
|
||||
if (context.Request.Path.Value.StartsWith("/css")) return;
|
||||
if (context.Request.Path.Value.StartsWith("/fonts")) return;
|
||||
if (context.Request.Path.Value.StartsWith("/media")) return;
|
||||
if (context.Request.Path.Value.StartsWith("/js")) return;
|
||||
if (context.Request.Path.Value.StartsWith("/favicon")) return;
|
||||
|
||||
//Logger.LogWarning($"{context.Request.Path}");
|
||||
|
||||
// skip hub request (test)
|
||||
if (context.Request.Path.Value.StartsWith("/hub")) return;
|
||||
|
||||
|
||||
// ignore 2fa login request
|
||||
if (context.Request.Path.Value.StartsWith($"/{Navigation.Account.LoginTFA}")) return;
|
||||
|
||||
// ignore login request
|
||||
if (context.Request.Path.Value.StartsWith($"/{Navigation.Account.Login}")) return;
|
||||
|
||||
// 2fa signin request
|
||||
if (context.Request.Path.Value.StartsWith($"/{Navigation.Account.SignInTFA}"))
|
||||
if (context.Request.Path.Value is not null)
|
||||
{
|
||||
await OnSignInTFAAsync(context, serviceProvider).ConfigureAwait(false);
|
||||
return;
|
||||
}
|
||||
// skip blazor / internal requests
|
||||
if (context.Request.Path.Value.StartsWith("/_blazor")) return;
|
||||
if (context.Request.Path.Value.StartsWith("/_framework")) return;
|
||||
if (context.Request.Path.Value.StartsWith("/_content")) return;
|
||||
if (context.Request.Path.Value.StartsWith("/css")) return;
|
||||
if (context.Request.Path.Value.StartsWith("/fonts")) return;
|
||||
if (context.Request.Path.Value.StartsWith("/media")) return;
|
||||
if (context.Request.Path.Value.StartsWith("/js")) return;
|
||||
if (context.Request.Path.Value.StartsWith("/favicon")) return;
|
||||
|
||||
// signin request
|
||||
if (context.Request.Path.Value.StartsWith($"/{Navigation.Account.SignIn}"))
|
||||
{
|
||||
await OnSignInAsync(context, serviceProvider).ConfigureAwait(false);
|
||||
return;
|
||||
}
|
||||
// skip hub request (test)
|
||||
if (context.Request.Path.Value.StartsWith("/hub")) return;
|
||||
|
||||
// logout request
|
||||
if (context.Request.Path.Value.StartsWith($"/{Navigation.Account.Logout}"))
|
||||
{
|
||||
await OnLogoutAsync(context, serviceProvider).ConfigureAwait(false);
|
||||
return;
|
||||
}
|
||||
// ignore 2fa login request
|
||||
if (context.Request.Path.Value.StartsWith($"/{Navigation.Account.LoginTFA}")) return;
|
||||
|
||||
//password change request
|
||||
if (context.Request.Path.Value.StartsWith($"/{Navigation.Account.ChangePassword}"))
|
||||
{
|
||||
await OnChangePasswordAsync(context, serviceProvider).ConfigureAwait(false);
|
||||
return;
|
||||
// ignore login request
|
||||
if (context.Request.Path.Value.StartsWith($"/{Navigation.Account.Login}")) return;
|
||||
|
||||
// 2fa signin request
|
||||
if (context.Request.Path.Value.StartsWith($"/{Navigation.Account.SignInTFA}"))
|
||||
{
|
||||
await OnSignInTFAAsync(context, serviceProvider).ConfigureAwait(false);
|
||||
return;
|
||||
}
|
||||
|
||||
// signin request
|
||||
if (context.Request.Path.Value.StartsWith($"/{Navigation.Account.SignIn}"))
|
||||
{
|
||||
await OnSignInAsync(context, serviceProvider).ConfigureAwait(false);
|
||||
return;
|
||||
}
|
||||
|
||||
// logout request
|
||||
if (context.Request.Path.Value.StartsWith($"/{Navigation.Account.Logout}"))
|
||||
{
|
||||
await OnLogoutAsync(context, serviceProvider).ConfigureAwait(false);
|
||||
return;
|
||||
}
|
||||
|
||||
//password change request
|
||||
if (context.Request.Path.Value.StartsWith($"/{Navigation.Account.ChangePassword}"))
|
||||
{
|
||||
await OnChangePasswordAsync(context, serviceProvider).ConfigureAwait(false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
await OnCatchRoute(context, serviceProvider).ConfigureAwait(false);
|
||||
|
|
@ -87,7 +81,7 @@ public class IdentityMiddleware
|
|||
private async ValueTask OnSignInAsync(HttpContext context, IServiceProvider serviceProvider)
|
||||
{
|
||||
if (context.Request.Query.ContainsKey("key") is false) return;
|
||||
var key = Guid.Parse(context.Request.Query["key"]);
|
||||
if (Guid.TryParse(context.Request.Query["key"], out var key) is false) return;
|
||||
|
||||
try
|
||||
{
|
||||
|
|
@ -96,21 +90,21 @@ public class IdentityMiddleware
|
|||
var userManager = scope.ServiceProvider.GetRequiredService<UserManager<InsightUser>>();
|
||||
var signInManager = scope.ServiceProvider.GetRequiredService<SignInManager<InsightUser>>();
|
||||
|
||||
if (await userManager.FindByEmailAsync(Logins[key].Email) is not InsightUser user)
|
||||
if (await userManager.FindByEmailAsync(Logins[key].Email ?? string.Empty) is not InsightUser user)
|
||||
{
|
||||
context.Response.Redirect($"/{Navigation.Account.LoginHref(Logins[key].Redirect)}");
|
||||
context.Response.Redirect($"/{Navigation.Account.LoginHref(Logins[key].Redirect ?? string.Empty)}");
|
||||
return;
|
||||
}
|
||||
|
||||
if (await userManager.CheckPasswordAsync(user, Logins[key].Password) is false)
|
||||
if (Logins[key].Password is not string password || await userManager.CheckPasswordAsync(user, password) is false)
|
||||
{
|
||||
context.Response.Redirect($"/{Navigation.Account.LoginHref(Logins[key].Redirect)}");
|
||||
context.Response.Redirect($"/{Navigation.Account.LoginHref(Logins[key].Redirect ?? string.Empty)}");
|
||||
return;
|
||||
}
|
||||
|
||||
if (await userManager.GetTwoFactorEnabledAsync(user))
|
||||
{
|
||||
var result = await signInManager.PasswordSignInAsync(user.UserName, Logins[key].Password, Logins[key].RememberMe, lockoutOnFailure: false).ConfigureAwait(false);
|
||||
var result = await signInManager.PasswordSignInAsync(user.UserName ?? string.Empty, Logins[key].Password ?? string.Empty, Logins[key].RememberMe, lockoutOnFailure: false).ConfigureAwait(false);
|
||||
context.Response.Redirect($"/{Navigation.Account.LoginTFAHref(key)}");
|
||||
return;
|
||||
}
|
||||
|
|
@ -146,7 +140,7 @@ public class IdentityMiddleware
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError(ex.ToString());
|
||||
Logger.LogError("{exception}", ex.ToString());
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
|
@ -156,11 +150,10 @@ public class IdentityMiddleware
|
|||
|
||||
private async ValueTask OnSignInTFAAsync(HttpContext context, IServiceProvider serviceProvider)
|
||||
{
|
||||
Logger.LogInformation($"OnSignInTFAAsync ({context.Request.Path})");
|
||||
Logger.LogInformation("OnSignInTFAAsync ({context})", context.Request.Path);
|
||||
|
||||
if (context.Request.Query.ContainsKey("key") is false) return;
|
||||
|
||||
var key = Guid.Parse(context.Request.Query["key"]);
|
||||
if (Guid.TryParse(context.Request.Query["key"], out var key) is false) return;
|
||||
|
||||
try
|
||||
{
|
||||
|
|
@ -169,9 +162,13 @@ public class IdentityMiddleware
|
|||
var userManager = scope.ServiceProvider.GetRequiredService<UserManager<InsightUser>>();
|
||||
var signInManager = scope.ServiceProvider.GetRequiredService<SignInManager<InsightUser>>();
|
||||
|
||||
var user = await userManager.FindByEmailAsync(Logins[key].Email).ConfigureAwait(false);
|
||||
if (Logins[key].Email is not string email) return;
|
||||
|
||||
var authenticatorCode = Logins[key].TwoFactorToken.Replace(" ", string.Empty).Replace("-", string.Empty);
|
||||
var user = await userManager.FindByEmailAsync(email).ConfigureAwait(false);
|
||||
if (user is null) return;
|
||||
|
||||
var authenticatorCode = Logins[key].TwoFactorToken?.Replace(" ", string.Empty).Replace("-", string.Empty);
|
||||
if (authenticatorCode is null) return;
|
||||
|
||||
var valid = await userManager.VerifyTwoFactorTokenAsync(user, userManager.Options.Tokens.AuthenticatorTokenProvider, authenticatorCode).ConfigureAwait(false);
|
||||
if (valid is false)
|
||||
|
|
@ -208,12 +205,12 @@ public class IdentityMiddleware
|
|||
}
|
||||
else
|
||||
{
|
||||
context.Response.Redirect($"/{Navigation.Account.LoginHref(Logins[key].Redirect)}");
|
||||
context.Response.Redirect($"/{Navigation.Account.LoginHref(Logins[key].Redirect ?? string.Empty)}");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError(ex.ToString());
|
||||
Logger.LogError("{exception}", ex.ToString());
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
|
@ -223,7 +220,7 @@ public class IdentityMiddleware
|
|||
|
||||
private async ValueTask OnLogoutAsync(HttpContext context, IServiceProvider serviceProvider)
|
||||
{
|
||||
Logger.LogInformation($"OnLogoutAsync ({context.Request.Path})");
|
||||
Logger.LogInformation("OnLogoutAsync ({context})", context.Request.Path);
|
||||
|
||||
using var scope = serviceProvider.CreateScope();
|
||||
var signInManager = scope.ServiceProvider.GetRequiredService<SignInManager<InsightUser>>();
|
||||
|
|
@ -232,24 +229,23 @@ public class IdentityMiddleware
|
|||
context.Response.Redirect($"/");
|
||||
}
|
||||
|
||||
private async ValueTask OnDisconnectAsync(HttpContext context, IServiceProvider serviceProvider)
|
||||
{
|
||||
Logger.LogInformation($"OnDisconnectAsync ({context.Request.Path})");
|
||||
//private async ValueTask OnDisconnectAsync(HttpContext context, IServiceProvider serviceProvider)
|
||||
//{
|
||||
// Logger.LogInformation($"OnDisconnectAsync ({context.Request.Path})");
|
||||
|
||||
using var scope = serviceProvider.CreateScope();
|
||||
var signInManager = scope.ServiceProvider.GetRequiredService<SignInManager<InsightUser>>();
|
||||
await signInManager.SignOutAsync().ConfigureAwait(false);
|
||||
// using var scope = serviceProvider.CreateScope();
|
||||
// var signInManager = scope.ServiceProvider.GetRequiredService<SignInManager<InsightUser>>();
|
||||
// await signInManager.SignOutAsync().ConfigureAwait(false);
|
||||
|
||||
context.Abort();
|
||||
}
|
||||
// context.Abort();
|
||||
//}
|
||||
|
||||
private async ValueTask OnChangePasswordAsync(HttpContext context, IServiceProvider serviceProvider)
|
||||
{
|
||||
Logger.LogInformation($"OnChangePasswordAsync ({context.Request.Path})");
|
||||
Logger.LogInformation("OnChangePasswordAsync ({context})", context.Request.Path);
|
||||
|
||||
if (context.Request.Query.ContainsKey("key") is false) return;
|
||||
|
||||
var key = Guid.Parse(context.Request.Query["key"]);
|
||||
if (Guid.TryParse(context.Request.Query["key"], out var key) is false) return;
|
||||
|
||||
try
|
||||
{
|
||||
|
|
@ -257,11 +253,14 @@ public class IdentityMiddleware
|
|||
var userManager = scope.ServiceProvider.GetRequiredService<UserManager<InsightUser>>();
|
||||
|
||||
var user = await userManager.GetUserAsync(context.User).ConfigureAwait(false);
|
||||
var result = await userManager.ChangePasswordAsync(user, Passwords[key]?.OldPassword, Passwords[key]?.NewPassword).ConfigureAwait(false);
|
||||
if (user is null) return;
|
||||
|
||||
if (Passwords[key]?.OldPassword is string pwOld && Passwords[key]?.NewPassword is string pwNew)
|
||||
_ = await userManager.ChangePasswordAsync(user, pwOld, pwNew).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError(ex.ToString());
|
||||
Logger.LogError("{exception}", ex.ToString());
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
|
@ -282,10 +281,9 @@ public class IdentityMiddleware
|
|||
Logger.LogCritical("non auth - redirect");
|
||||
|
||||
var returnPath = context.Request.Path.Value ?? string.Empty;
|
||||
if (returnPath.StartsWith("/"))
|
||||
{
|
||||
returnPath = returnPath.Substring(1);
|
||||
}
|
||||
|
||||
if (returnPath.StartsWith('/'))
|
||||
returnPath = returnPath[1..];
|
||||
|
||||
context.Response.Redirect($"/{Navigation.Account.LoginHref(returnPath)}");
|
||||
|
||||
|
|
|
|||
|
|
@ -3,19 +3,16 @@ using System.Collections.Concurrent;
|
|||
|
||||
namespace Insight.Web.Models;
|
||||
|
||||
public class ChatSession
|
||||
public class ChatSession(
|
||||
IEnumerable<ChatUser> members,
|
||||
Func<ChatSession, ChatMessage,
|
||||
CancellationToken, Task> onMessageSent)
|
||||
{
|
||||
public ObjectId Id { get; } = ObjectId.GenerateNewId();
|
||||
public IEnumerable<ChatUser> Members { get; }
|
||||
public ConcurrentBag<ChatMessage> Messages { get; } = new();
|
||||
public IEnumerable<ChatUser> Members { get; } = members;
|
||||
public ConcurrentBag<ChatMessage> Messages { get; } = [];
|
||||
|
||||
private readonly Func<ChatSession, ChatMessage, CancellationToken, Task> OnMessageSent;
|
||||
|
||||
public ChatSession(IEnumerable<ChatUser> members, Func<ChatSession, ChatMessage, CancellationToken, Task> onMessageSent)
|
||||
{
|
||||
Members = members;
|
||||
OnMessageSent = onMessageSent;
|
||||
}
|
||||
private readonly Func<ChatSession, ChatMessage, CancellationToken, Task> OnMessageSent = onMessageSent;
|
||||
|
||||
public async Task SendMessage(ChatUser sender, string message, CancellationToken cancellationToken)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,19 +2,14 @@
|
|||
|
||||
namespace Insight.Web.Models;
|
||||
|
||||
public class ChatUser
|
||||
public class ChatUser(ObjectId uid)
|
||||
{
|
||||
public ObjectId Uid { get; set; }
|
||||
public ObjectId Uid { get; set; } = uid;
|
||||
public bool Online { get; set; }
|
||||
public string? Username { get; set; }
|
||||
public string? Email { get; set; }
|
||||
public byte[]? Avatar { get; set; }
|
||||
|
||||
public ChatUser(ObjectId uid)
|
||||
{
|
||||
Uid = uid;
|
||||
}
|
||||
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
if (obj == null || GetType() != obj.GetType()) return false;
|
||||
|
|
|
|||
|
|
@ -5,14 +5,9 @@ using Vaitr.Bus;
|
|||
|
||||
namespace Insight.Web.Network.Broker.Handlers;
|
||||
|
||||
public class AgentHandler : IMessageHandler<WebSession>
|
||||
public class AgentHandler(Bus bus) : IMessageHandler<WebSession>
|
||||
{
|
||||
private readonly Bus _bus;
|
||||
|
||||
public AgentHandler(Bus bus)
|
||||
{
|
||||
_bus = bus;
|
||||
}
|
||||
private readonly Bus _bus = bus;
|
||||
|
||||
public async ValueTask HandleAsync<TMessage>(WebSession sender, TMessage message, CancellationToken cancellationToken) where TMessage : IMessage
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,14 +4,12 @@ using Vaitr.Network;
|
|||
|
||||
namespace Insight.Web.Network.Broker;
|
||||
|
||||
public class WebSession : TcpSession<IMessage>
|
||||
public class WebSession(
|
||||
IEnumerable<IMessageHandler<WebSession>> handlers,
|
||||
ISerializer<IMessage> serializer,
|
||||
ILogger<WebSession> logger) : TcpSession<IMessage>(serializer, logger)
|
||||
{
|
||||
private readonly IEnumerable<IMessageHandler<WebSession>> _handlers;
|
||||
|
||||
public WebSession(IEnumerable<IMessageHandler<WebSession>> handlers, ISerializer<IMessage> serializer, ILogger<WebSession> logger) : base(serializer, logger)
|
||||
{
|
||||
_handlers = handlers;
|
||||
}
|
||||
private readonly IEnumerable<IMessageHandler<WebSession>> _handlers = handlers;
|
||||
|
||||
protected override ValueTask OnConnectedAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,22 +2,15 @@
|
|||
using Insight.Domain.Network;
|
||||
using Insight.Domain.Network.Remote.Messages;
|
||||
using Vaitr.Bus;
|
||||
using Vaitr.Network;
|
||||
|
||||
namespace Insight.Web.Network.Remote.Handlers;
|
||||
|
||||
public class RemoteHandler : IMessageHandler<RemoteSession>
|
||||
public class RemoteHandler(
|
||||
Bus bus,
|
||||
ILogger<RemoteHandler> logger) : IMessageHandler<RemoteSession>
|
||||
{
|
||||
private readonly Bus _bus;
|
||||
private readonly ISessionPool<RemoteSession, IMessage> _remotePool;
|
||||
private readonly ILogger<RemoteHandler> _logger;
|
||||
|
||||
public RemoteHandler(Bus bus, ISessionPool<RemoteSession, IMessage> remotePool, ILogger<RemoteHandler> logger)
|
||||
{
|
||||
_bus = bus;
|
||||
_remotePool = remotePool;
|
||||
_logger = logger;
|
||||
}
|
||||
private readonly Bus _bus = bus;
|
||||
private readonly ILogger<RemoteHandler> _logger = logger;
|
||||
|
||||
public async ValueTask HandleAsync<TMessage>(RemoteSession sender, TMessage message, CancellationToken cancellationToken) where TMessage : IMessage
|
||||
{
|
||||
|
|
@ -53,7 +46,7 @@ public class RemoteHandler : IMessageHandler<RemoteSession>
|
|||
|
||||
private async Task OnSessionRequest(RemoteSession session, RemoteSessionRequest sessionRequest, CancellationToken cancellationToken)
|
||||
{
|
||||
_logger.LogInformation($"Remote {session.Id} => SessionRequest");
|
||||
_logger.LogInformation("Remote {session} => SessionRequest", session.Id);
|
||||
|
||||
session.Mode = sessionRequest.Mode;
|
||||
|
||||
|
|
@ -65,7 +58,7 @@ public class RemoteHandler : IMessageHandler<RemoteSession>
|
|||
|
||||
private async Task OnCastRequestResponse(RemoteSession session, CastRequestResponse castRequestResponse, CancellationToken cancellationToken)
|
||||
{
|
||||
_logger.LogInformation($"Remote {castRequestResponse.Id} => CastRequestResponse");
|
||||
_logger.LogInformation("Remote {id} => CastRequestResponse", castRequestResponse.Id);
|
||||
|
||||
await _bus.PublishAsync(castRequestResponse, cancellationToken);
|
||||
}
|
||||
|
|
@ -81,7 +74,7 @@ public class RemoteHandler : IMessageHandler<RemoteSession>
|
|||
{
|
||||
//_logger.LogInformation($"Remote {screenData.Id} => ScreenData");
|
||||
|
||||
await _bus.PublishAsync(screenData, cancellationToken);
|
||||
await _bus.PublishAsync(screenData, cancellationToken);
|
||||
}
|
||||
|
||||
private async Task OnCursorData(RemoteSession session, CastCursor cursorChanged, CancellationToken cancellationToken)
|
||||
|
|
@ -93,14 +86,14 @@ public class RemoteHandler : IMessageHandler<RemoteSession>
|
|||
|
||||
private async Task OnClipboardData(RemoteSession session, CastClipboardReceived clipboardChanged, CancellationToken cancellationToken)
|
||||
{
|
||||
_logger.LogInformation($"Remote {session.Id} => ClipboardData");
|
||||
_logger.LogInformation("Remote {session} => ClipboardData", session.Id);
|
||||
|
||||
await _bus.PublishAsync(clipboardChanged, cancellationToken);
|
||||
}
|
||||
|
||||
private async Task OnAudioData(RemoteSession session, CastAudio audioSample, CancellationToken cancellationToken)
|
||||
{
|
||||
_logger.LogInformation($"Remote {session.Id} => AudioData");
|
||||
_logger.LogInformation("Remote {session} => AudioData", session.Id);
|
||||
|
||||
await _bus.PublishAsync(audioSample, cancellationToken);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,32 +8,22 @@ using static Insight.Web.Messages.RemoteMessages;
|
|||
|
||||
namespace Insight.Web.Network.Remote;
|
||||
|
||||
public class RemoteSession : TcpSession<IMessage>
|
||||
public class RemoteSession(
|
||||
Bus bus,
|
||||
IEnumerable<IMessageHandler<RemoteSession>> handlers,
|
||||
ISerializer<IMessage> serializer,
|
||||
ILogger<RemoteSession> logger) : TcpSession<IMessage>(serializer, logger)
|
||||
{
|
||||
public string Id { get; }
|
||||
public string Id { get; } = GenerateRandomId();
|
||||
public RemoteControlMode Mode { get; set; }
|
||||
|
||||
private readonly Bus _bus;
|
||||
private readonly IEnumerable<IMessageHandler<RemoteSession>> _handlers;
|
||||
|
||||
public RemoteSession(
|
||||
Bus bus,
|
||||
IEnumerable<IMessageHandler<RemoteSession>> handlers,
|
||||
ISerializer<IMessage> serializer,
|
||||
ILogger<RemoteSession> logger) : base(serializer, logger)
|
||||
{
|
||||
Id = GenerateRandomId();
|
||||
|
||||
_bus = bus;
|
||||
_handlers = handlers;
|
||||
}
|
||||
private readonly Bus _bus = bus;
|
||||
private readonly IEnumerable<IMessageHandler<RemoteSession>> _handlers = handlers;
|
||||
|
||||
protected override async ValueTask OnConnectedAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
_logger.LogInformation("Remote ({ep?}) connected", RemoteEndPoint);
|
||||
|
||||
//return;
|
||||
|
||||
await _bus.PublishAsync(new RemoteDisconnected(this), default);
|
||||
}
|
||||
|
||||
|
|
@ -44,9 +34,10 @@ public class RemoteSession : TcpSession<IMessage>
|
|||
await _bus.PublishAsync(new RemoteDisconnected(this), default);
|
||||
}
|
||||
|
||||
protected override async ValueTask OnSentAsync(IPacketContext<IMessage> context, CancellationToken cancellationToken)
|
||||
protected override ValueTask OnSentAsync(IPacketContext<IMessage> context, CancellationToken cancellationToken)
|
||||
{
|
||||
//await base.OnSentAsync(context, cancellationToken);
|
||||
return default;
|
||||
}
|
||||
|
||||
protected override async ValueTask OnReceivedAsync(IPacketContext<IMessage> context, CancellationToken cancellationToken)
|
||||
|
|
@ -66,9 +57,10 @@ public class RemoteSession : TcpSession<IMessage>
|
|||
}
|
||||
}
|
||||
|
||||
protected override async ValueTask OnHeartbeatAsync(CancellationToken cancellationToken)
|
||||
protected override ValueTask OnHeartbeatAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
_logger.LogInformation("Remote ({ep?}) Heartbeat", RemoteEndPoint);
|
||||
return default;
|
||||
}
|
||||
|
||||
public async Task ScreenDataAckAsync(CastScreen screenData, CancellationToken cancellationToken)
|
||||
|
|
|
|||
|
|
@ -62,15 +62,14 @@ public partial class Login
|
|||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
IdentityMiddleware.Logins[Key.Value].TwoFactorToken = code;
|
||||
NavigationManager.NavigateTo(Navigation.Account.SignInTFAHref(Key.Value), true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
if (Key is null || IdentityMiddleware.Logins[Key.Value] is not LoginModel model)
|
||||
{
|
||||
Notification.Error(Snackbar, "Invalid Security Token");
|
||||
NavigationManager.NavigateTo(Navigation.Account.LoginHref(null), false);
|
||||
NavigationManager.NavigateTo(Navigation.Account.LoginHref(string.Empty), false);
|
||||
return;
|
||||
}
|
||||
|
||||
IdentityMiddleware.Logins[Key.Value].TwoFactorToken = code;
|
||||
NavigationManager.NavigateTo(Navigation.Account.SignInTFAHref(Key.Value), true);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
@inherits ComponentBase
|
||||
|
||||
|
||||
|
||||
@if (true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
<BaseContainer Title="@_title">
|
||||
<Content>
|
||||
<div class="h-100" style="display:flex; height: 90vh; margin: auto;">
|
||||
<div style="margin:auto; height: 35vh;">
|
||||
<MudGrid>
|
||||
<MudItem xs="12" md="12" lg="12">
|
||||
<MudTextField T="string" Label="Authenticator Token" Placeholder="Token" @bind-Value="_code"
|
||||
AutoFocus Variant="Variant.Outlined" />
|
||||
</MudItem>
|
||||
<MudItem xs="12" md="12" lg="12" Class="d-flex justify-center">
|
||||
<MudButton ButtonType="ButtonType.Submit" Variant="Variant.Filled" Color="Color.Surface" Size="Size.Large" Style="width: 100%;" OnClick="()=>Submit(_code)">
|
||||
Login
|
||||
</MudButton>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
</div>
|
||||
</div>
|
||||
</Content>
|
||||
</BaseContainer>
|
||||
|
||||
@code{
|
||||
private string? _code;
|
||||
}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
using Insight.Web.Constants;
|
||||
using Insight.Web.Middleware;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using MudBlazor;
|
||||
|
||||
namespace Insight.Web.Pages.Account;
|
||||
|
||||
//[Route(Navigation.Account.LoginTFA)]
|
||||
public partial class LoginTFA
|
||||
{
|
||||
[Parameter] public Guid Key { get; set; }
|
||||
|
||||
[Inject] private NavigationManager NavigationManager { get; init; } = default!;
|
||||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
|
||||
private readonly string _title = "Login|Insight";
|
||||
|
||||
private void Submit(string? code)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(code))
|
||||
{
|
||||
Notification.Information(Snackbar, "Enter Authenticator Code");
|
||||
return;
|
||||
}
|
||||
|
||||
IdentityMiddleware.Logins[Key].TwoFactorToken = code;
|
||||
NavigationManager.NavigateTo(Navigation.Account.SignInTFAHref(Key), true);
|
||||
}
|
||||
}
|
||||
|
|
@ -16,12 +16,12 @@ public partial class Profile
|
|||
[Inject] private AuthenticationStateProvider AuthenticationStateProvider { get; init; } = default!;
|
||||
|
||||
private readonly string _title = "Profile|Insight";
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = new()
|
||||
{
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs =
|
||||
[
|
||||
new BreadcrumbItem("Home", href: Navigation.Home),
|
||||
new BreadcrumbItem("Account", href: Navigation.Account.Profile),
|
||||
new BreadcrumbItem("Profile", href: "#", true)
|
||||
};
|
||||
];
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -13,10 +13,10 @@ public partial class Index
|
|||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
|
||||
private readonly string _title = "Home|Insight";
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = new()
|
||||
{
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs =
|
||||
[
|
||||
new BreadcrumbItem("Home", href: "#", true),
|
||||
};
|
||||
];
|
||||
|
||||
private async Task LoadDataAsync()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,5 +10,4 @@ public partial class Sessions
|
|||
[Inject] private SessionPool SessionPool { get; init; } = default!;
|
||||
[Inject] private SessionHandler SessionHandler { get; init; } = default!;
|
||||
[Inject] private IHttpContextAccessor HttpContextAccessor { get; init; } = default!;
|
||||
[Inject] private ILogger<Sessions> Logger { get; init; } = default!;
|
||||
}
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
@inherits ComponentBase
|
||||
|
||||
<TableContainer T="ViewModel"
|
||||
@ref="Container"
|
||||
@bind-Search="Search"
|
||||
Title="@Title"
|
||||
Breadcrumbs="@Breadcrumbs"
|
||||
@ref="_container"
|
||||
@bind-Search="_search"
|
||||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync">
|
||||
<Header>
|
||||
<MudTh>
|
||||
|
|
@ -52,7 +52,7 @@
|
|||
</MudTd>
|
||||
<MudTd DataLabel="Status">
|
||||
@{
|
||||
var color = context?.Status?.ToLower() switch
|
||||
var color = context.Status?.ToLower() switch
|
||||
{
|
||||
"ok" => Color.Success,
|
||||
_ => Color.Error
|
||||
|
|
|
|||
|
|
@ -23,16 +23,16 @@ public partial class Hosts
|
|||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
[Inject] private NavigationManager NavigationManager { get; init; } = default!;
|
||||
|
||||
private TableContainer<ViewModel>? Container { get; set; }
|
||||
private string Title { get; set; } = Global.Name;
|
||||
private List<BreadcrumbItem> Breadcrumbs { get; } = new();
|
||||
private string? Search { get; set; }
|
||||
private TableContainer<ViewModel>? _container;
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private string? _search;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Drives", href: Navigation.Inventory.Hardware.Drives.Index));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Drives", href: Navigation.Inventory.Hardware.Drives.Index));
|
||||
|
||||
if (string.IsNullOrWhiteSpace(DriveName))
|
||||
{
|
||||
|
|
@ -40,9 +40,9 @@ public partial class Hosts
|
|||
NavigationManager.NavigateTo(Navigation.Inventory.Hardware.Drives.Index);
|
||||
}
|
||||
|
||||
Title = $"Inventory » Drives » {DriveName} » Hosts|Insight";
|
||||
Breadcrumbs.Add(new BreadcrumbItem(DriveName, href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Hosts", href: "#", true));
|
||||
_title = $"Inventory » Drives » {DriveName} » Hosts|Insight";
|
||||
_breadcrumbs.Add(new BreadcrumbItem(DriveName ?? "undefined", href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Hosts", href: "#", true));
|
||||
}
|
||||
|
||||
private async Task<TableData<ViewModel>> LoadDataAsync(TableState state)
|
||||
|
|
@ -51,9 +51,9 @@ public partial class Hosts
|
|||
{
|
||||
var filter = Builders<BsonDocument>.Filter.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Search) is false)
|
||||
if (string.IsNullOrWhiteSpace(_search) is false)
|
||||
{
|
||||
var regex = new BsonRegularExpression(new Regex(Search, RegexOptions.IgnoreCase));
|
||||
var regex = new BsonRegularExpression(new Regex(_search, RegexOptions.IgnoreCase));
|
||||
filter &= Builders<BsonDocument>.Filter.Regex("customer.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("host.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("firmware", regex) |
|
||||
|
|
@ -63,7 +63,7 @@ public partial class Hosts
|
|||
|
||||
var query = Database.HostDrive()
|
||||
.Aggregate()
|
||||
.Match(Builders<HostDriveEntity>.Filter.Regex(p => p.Name, new BsonRegularExpression(new Regex(DriveName.Escape(), RegexOptions.IgnoreCase))))
|
||||
.Match(Builders<HostDriveEntity>.Filter.Regex(p => p.Name, new BsonRegularExpression(new Regex(DriveName?.Escape() ?? string.Empty, RegexOptions.IgnoreCase))))
|
||||
.Lookup("host", "_host", "_id", "hosts")
|
||||
.Match(new BsonDocument("hosts", new BsonDocument
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
@inherits ComponentBase
|
||||
|
||||
<TableContainer T="ViewModel"
|
||||
@ref="Container"
|
||||
@bind-Search="Search"
|
||||
Title="@Title"
|
||||
Breadcrumbs="@Breadcrumbs"
|
||||
@ref="_container"
|
||||
@bind-Search="_search"
|
||||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync">
|
||||
<Header>
|
||||
<MudTh>
|
||||
|
|
|
|||
|
|
@ -18,17 +18,17 @@ public partial class Index
|
|||
[Inject] private IMongoDatabase Database { get; init; } = default!;
|
||||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
|
||||
private TableContainer<ViewModel>? Container { get; set; }
|
||||
private string Title { get; set; } = Global.Name;
|
||||
private List<BreadcrumbItem> Breadcrumbs { get; } = new();
|
||||
private string? Search { get; set; }
|
||||
private TableContainer<ViewModel>? _container;
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private string? _search;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
Title = $"Inventory » Drives|Insight";
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Drives", href: "#", true));
|
||||
_title = $"Inventory » Drives|Insight";
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Drives", href: "#", true));
|
||||
}
|
||||
|
||||
private async Task<TableData<ViewModel>> LoadDataAsync(TableState state)
|
||||
|
|
@ -37,9 +37,9 @@ public partial class Index
|
|||
{
|
||||
var filter = Builders<HostDriveEntity>.Filter.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Search) is false)
|
||||
if (string.IsNullOrWhiteSpace(_search) is false)
|
||||
{
|
||||
var regex = new BsonRegularExpression(new Regex(Search, RegexOptions.IgnoreCase));
|
||||
var regex = new BsonRegularExpression(new Regex(_search, RegexOptions.IgnoreCase));
|
||||
filter &= Builders<HostDriveEntity>.Filter.Regex(x => x.Company, regex) |
|
||||
Builders<HostDriveEntity>.Filter.Regex(x => x.Name, regex);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
@inherits ComponentBase
|
||||
|
||||
<TableContainer T="ViewModel"
|
||||
@ref="Container"
|
||||
@bind-Search="Search"
|
||||
Title="@Title"
|
||||
Breadcrumbs="@Breadcrumbs"
|
||||
@ref="_container"
|
||||
@bind-Search="_search"
|
||||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync">
|
||||
<Header>
|
||||
<MudTh>
|
||||
|
|
|
|||
|
|
@ -23,16 +23,16 @@ public partial class Hosts
|
|||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
[Inject] private NavigationManager NavigationManager { get; init; } = default!;
|
||||
|
||||
private TableContainer<ViewModel>? Container { get; set; }
|
||||
private string Title { get; set; } = Global.Name;
|
||||
private List<BreadcrumbItem> Breadcrumbs { get; } = new();
|
||||
private string? Search { get; set; }
|
||||
private TableContainer<ViewModel>? _container;
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private string? _search;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Mainboards", href: Navigation.Inventory.Hardware.Mainboards.Index));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Mainboards", href: Navigation.Inventory.Hardware.Mainboards.Index));
|
||||
|
||||
if (string.IsNullOrWhiteSpace(MainboardName))
|
||||
{
|
||||
|
|
@ -41,9 +41,9 @@ public partial class Hosts
|
|||
return;
|
||||
}
|
||||
|
||||
Title = $"Inventory » Mainboards » {MainboardName} » Hosts|Insight";
|
||||
Breadcrumbs.Add(new BreadcrumbItem(MainboardName, href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Hosts", href: "#", true));
|
||||
_title = $"Inventory » Mainboards » {MainboardName} » Hosts|Insight";
|
||||
_breadcrumbs.Add(new BreadcrumbItem(MainboardName, href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Hosts", href: "#", true));
|
||||
}
|
||||
|
||||
private async Task<TableData<ViewModel>> LoadDataAsync(TableState state)
|
||||
|
|
@ -52,9 +52,9 @@ public partial class Hosts
|
|||
{
|
||||
var filter = Builders<BsonDocument>.Filter.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Search) is false)
|
||||
if (string.IsNullOrWhiteSpace(_search) is false)
|
||||
{
|
||||
var regex = new BsonRegularExpression(new Regex(Search, RegexOptions.IgnoreCase));
|
||||
var regex = new BsonRegularExpression(new Regex(_search, RegexOptions.IgnoreCase));
|
||||
filter &= Builders<BsonDocument>.Filter.Regex("customer.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("host.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("version", regex);
|
||||
|
|
@ -62,7 +62,7 @@ public partial class Hosts
|
|||
|
||||
var query = Database.HostMainboard()
|
||||
.Aggregate()
|
||||
.Match(Builders<HostMainboardEntity>.Filter.Regex(p => p.Name, new BsonRegularExpression(new Regex(MainboardName.Escape(), RegexOptions.IgnoreCase))))
|
||||
.Match(Builders<HostMainboardEntity>.Filter.Regex(p => p.Name, new BsonRegularExpression(new Regex(MainboardName?.Escape() ?? string.Empty, RegexOptions.IgnoreCase))))
|
||||
.Lookup("host", "_host", "_id", "hosts")
|
||||
.Match(new BsonDocument("hosts", new BsonDocument
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
@inherits ComponentBase
|
||||
|
||||
<TableContainer T="ViewModel"
|
||||
@ref="Container"
|
||||
@bind-Search="Search"
|
||||
Title="@Title"
|
||||
Breadcrumbs="@Breadcrumbs"
|
||||
@ref="_container"
|
||||
@bind-Search="_search"
|
||||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync">
|
||||
<Header>
|
||||
<MudTh>
|
||||
|
|
|
|||
|
|
@ -18,17 +18,17 @@ public partial class Index
|
|||
[Inject] private IMongoDatabase Database { get; init; } = default!;
|
||||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
|
||||
private TableContainer<ViewModel>? Container { get; set; }
|
||||
private string Title { get; set; } = Global.Name;
|
||||
private List<BreadcrumbItem> Breadcrumbs { get; } = new();
|
||||
private string? Search { get; set; }
|
||||
private TableContainer<ViewModel>? _container;
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private string? _search;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
Title = $"Inventory » Mainboards|Insight";
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Mainboards", href: "#", true));
|
||||
_title = $"Inventory » Mainboards|Insight";
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Mainboards", href: "#", true));
|
||||
}
|
||||
|
||||
private async Task<TableData<ViewModel>> LoadDataAsync(TableState state)
|
||||
|
|
@ -37,9 +37,9 @@ public partial class Index
|
|||
{
|
||||
var filter = Builders<HostMainboardEntity>.Filter.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Search) is false)
|
||||
if (string.IsNullOrWhiteSpace(_search) is false)
|
||||
{
|
||||
var regex = new BsonRegularExpression(new Regex(Search, RegexOptions.IgnoreCase));
|
||||
var regex = new BsonRegularExpression(new Regex(_search, RegexOptions.IgnoreCase));
|
||||
filter &= Builders<HostMainboardEntity>.Filter.Regex(x => x.Bios, regex) |
|
||||
Builders<HostMainboardEntity>.Filter.Regex(x => x.Name, regex);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
@inherits ComponentBase
|
||||
|
||||
<TableContainer T="ViewModel"
|
||||
@ref="Container"
|
||||
@bind-Search="Search"
|
||||
Title="@Title"
|
||||
Breadcrumbs="@Breadcrumbs"
|
||||
@ref="_container"
|
||||
@bind-Search="_search"
|
||||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync">
|
||||
<Header>
|
||||
<MudTh>
|
||||
|
|
|
|||
|
|
@ -23,16 +23,16 @@ public partial class Hosts
|
|||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
[Inject] private NavigationManager NavigationManager { get; init; } = default!;
|
||||
|
||||
private TableContainer<ViewModel>? Container { get; set; }
|
||||
private string Title { get; set; } = Global.Name;
|
||||
private List<BreadcrumbItem> Breadcrumbs { get; } = new();
|
||||
private string? Search { get; set; }
|
||||
private TableContainer<ViewModel>? _container;
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private string? _search;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Memory", href: Navigation.Inventory.Hardware.Memory.Index));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Memory", href: Navigation.Inventory.Hardware.Memory.Index));
|
||||
|
||||
if (string.IsNullOrWhiteSpace(MemoryName))
|
||||
{
|
||||
|
|
@ -41,9 +41,9 @@ public partial class Hosts
|
|||
return;
|
||||
}
|
||||
|
||||
Title = $"Inventory » Memory » {MemoryName} » Hosts|Insight";
|
||||
Breadcrumbs.Add(new BreadcrumbItem(MemoryName, href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Hosts", href: "#", true));
|
||||
_title = $"Inventory » Memory » {MemoryName} » Hosts|Insight";
|
||||
_breadcrumbs.Add(new BreadcrumbItem(MemoryName, href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Hosts", href: "#", true));
|
||||
}
|
||||
|
||||
private async Task<TableData<ViewModel>> LoadDataAsync(TableState state)
|
||||
|
|
@ -52,9 +52,9 @@ public partial class Hosts
|
|||
{
|
||||
var filter = Builders<BsonDocument>.Filter.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Search) is false)
|
||||
if (string.IsNullOrWhiteSpace(_search) is false)
|
||||
{
|
||||
var regex = new BsonRegularExpression(new Regex(Search, RegexOptions.IgnoreCase));
|
||||
var regex = new BsonRegularExpression(new Regex(_search, RegexOptions.IgnoreCase));
|
||||
filter &= Builders<BsonDocument>.Filter.Regex("customer.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("host.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("location", regex) |
|
||||
|
|
@ -63,7 +63,7 @@ public partial class Hosts
|
|||
|
||||
var query = Database.HostMemory()
|
||||
.Aggregate()
|
||||
.Match(Builders<HostMemoryEntity>.Filter.Regex(p => p.Name, new BsonRegularExpression(new Regex(MemoryName.Escape(), RegexOptions.IgnoreCase))))
|
||||
.Match(Builders<HostMemoryEntity>.Filter.Regex(p => p.Name, new BsonRegularExpression(new Regex(MemoryName?.Escape() ?? string.Empty, RegexOptions.IgnoreCase))))
|
||||
.Lookup("host", "_host", "_id", "hosts")
|
||||
.Match(new BsonDocument("hosts", new BsonDocument
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
@inherits ComponentBase
|
||||
|
||||
<TableContainer T="ViewModel"
|
||||
@ref="Container"
|
||||
@bind-Search="Search"
|
||||
Title="@Title"
|
||||
Breadcrumbs="@Breadcrumbs"
|
||||
@ref="_container"
|
||||
@bind-Search="_search"
|
||||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync">
|
||||
<Header>
|
||||
<MudTh>
|
||||
|
|
|
|||
|
|
@ -18,17 +18,17 @@ public partial class Index
|
|||
[Inject] private IMongoDatabase Database { get; init; } = default!;
|
||||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
|
||||
private TableContainer<ViewModel>? Container { get; set; }
|
||||
private string Title { get; set; } = Global.Name;
|
||||
private List<BreadcrumbItem> Breadcrumbs { get; } = new();
|
||||
private string? Search { get; set; }
|
||||
private TableContainer<ViewModel>? _container;
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private string? _search;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
Title = $"Inventory » Memory|Insight";
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Memory", href: "#", true));
|
||||
_title = $"Inventory » Memory|Insight";
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Memory", href: "#", true));
|
||||
}
|
||||
|
||||
private async Task<TableData<ViewModel>> LoadDataAsync(TableState state)
|
||||
|
|
@ -37,9 +37,9 @@ public partial class Index
|
|||
{
|
||||
var filter = Builders<HostMemoryEntity>.Filter.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Search) is false)
|
||||
if (string.IsNullOrWhiteSpace(_search) is false)
|
||||
{
|
||||
var regex = new BsonRegularExpression(new Regex(Search, RegexOptions.IgnoreCase));
|
||||
var regex = new BsonRegularExpression(new Regex(_search, RegexOptions.IgnoreCase));
|
||||
filter &= Builders<HostMemoryEntity>.Filter.Regex(x => x.Company, regex) |
|
||||
Builders<HostMemoryEntity>.Filter.Regex(x => x.Name, regex);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
@inherits ComponentBase
|
||||
|
||||
<TableContainer T="ViewModel"
|
||||
@ref="Container"
|
||||
@bind-Search="Search"
|
||||
Title="@Title"
|
||||
Breadcrumbs="@Breadcrumbs"
|
||||
@ref="_container"
|
||||
@bind-Search="_search"
|
||||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync">
|
||||
<Header>
|
||||
<MudTh>
|
||||
|
|
|
|||
|
|
@ -23,16 +23,16 @@ public partial class Hosts
|
|||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
[Inject] private NavigationManager NavigationManager { get; init; } = default!;
|
||||
|
||||
private TableContainer<ViewModel>? Container { get; set; }
|
||||
private string Title { get; set; } = Global.Name;
|
||||
private List<BreadcrumbItem> Breadcrumbs { get; } = new();
|
||||
private string? Search { get; set; }
|
||||
private TableContainer<ViewModel>? _container;
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private string? _search;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Processors", href: Navigation.Inventory.Hardware.Processors.Index));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Processors", href: Navigation.Inventory.Hardware.Processors.Index));
|
||||
|
||||
if (string.IsNullOrWhiteSpace(ProcessorName))
|
||||
{
|
||||
|
|
@ -41,9 +41,9 @@ public partial class Hosts
|
|||
return;
|
||||
}
|
||||
|
||||
Title = $"Inventory » Processors » {ProcessorName} » Hosts|Insight";
|
||||
Breadcrumbs.Add(new BreadcrumbItem(ProcessorName, href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Hosts", href: "#", true));
|
||||
_title = $"Inventory » Processors » {ProcessorName} » Hosts|Insight";
|
||||
_breadcrumbs.Add(new BreadcrumbItem(ProcessorName, href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Hosts", href: "#", true));
|
||||
}
|
||||
|
||||
private async Task<TableData<ViewModel>> LoadDataAsync(TableState state)
|
||||
|
|
@ -52,9 +52,9 @@ public partial class Hosts
|
|||
{
|
||||
var filter = Builders<BsonDocument>.Filter.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Search) is false)
|
||||
if (string.IsNullOrWhiteSpace(_search) is false)
|
||||
{
|
||||
var regex = new BsonRegularExpression(new Regex(Search, RegexOptions.IgnoreCase));
|
||||
var regex = new BsonRegularExpression(new Regex(_search, RegexOptions.IgnoreCase));
|
||||
filter &= Builders<BsonDocument>.Filter.Regex("customer.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("host.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("version", regex) |
|
||||
|
|
@ -63,7 +63,7 @@ public partial class Hosts
|
|||
|
||||
var query = Database.HostProcessor()
|
||||
.Aggregate()
|
||||
.Match(Builders<HostProcessorEntity>.Filter.Regex(p => p.Name, new BsonRegularExpression(new Regex(ProcessorName.Escape(), RegexOptions.IgnoreCase))))
|
||||
.Match(Builders<HostProcessorEntity>.Filter.Regex(p => p.Name, new BsonRegularExpression(new Regex(ProcessorName?.Escape() ?? string.Empty, RegexOptions.IgnoreCase))))
|
||||
.Lookup("host", "_host", "_id", "hosts")
|
||||
.Match(new BsonDocument("hosts", new BsonDocument
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
@inherits ComponentBase
|
||||
|
||||
<TableContainer T="IndexViewModel"
|
||||
@ref="Container"
|
||||
@bind-Search="Search"
|
||||
Title="@Title"
|
||||
Breadcrumbs="@Breadcrumbs"
|
||||
@ref="_container"
|
||||
@bind-Search="_search"
|
||||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync">
|
||||
<Header>
|
||||
<MudTh>
|
||||
|
|
|
|||
|
|
@ -18,17 +18,17 @@ namespace Insight.Web.Pages.Inventory.Hardware.Processors
|
|||
[Inject] private IMongoDatabase Database { get; init; } = default!;
|
||||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
|
||||
private TableContainer<IndexViewModel>? Container { get; set; }
|
||||
private string Title { get; set; } = Global.Name;
|
||||
private List<BreadcrumbItem> Breadcrumbs { get; } = new();
|
||||
private string? Search { get; set; }
|
||||
private TableContainer<IndexViewModel>? _container;
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private string? _search;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
Title = $"Inventory » Processors|Insight";
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Processors", href: "#", true));
|
||||
_title = $"Inventory » Processors|Insight";
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Processors", href: "#", true));
|
||||
}
|
||||
|
||||
private async Task<TableData<IndexViewModel>> LoadDataAsync(TableState state)
|
||||
|
|
@ -37,9 +37,9 @@ namespace Insight.Web.Pages.Inventory.Hardware.Processors
|
|||
{
|
||||
var filter = Builders<HostProcessorEntity>.Filter.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Search) is false)
|
||||
if (string.IsNullOrWhiteSpace(_search) is false)
|
||||
{
|
||||
var regex = new BsonRegularExpression(new Regex(Search, RegexOptions.IgnoreCase));
|
||||
var regex = new BsonRegularExpression(new Regex(_search, RegexOptions.IgnoreCase));
|
||||
filter &= Builders<HostProcessorEntity>.Filter.Regex(x => x.Company, regex) |
|
||||
Builders<HostProcessorEntity>.Filter.Regex(x => x.Name, regex);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
@inherits ComponentBase
|
||||
|
||||
<TableContainer T="ViewModel"
|
||||
@ref="Container"
|
||||
@bind-Search="Search"
|
||||
Title="@Title"
|
||||
Breadcrumbs="@Breadcrumbs"
|
||||
@ref="_container"
|
||||
@bind-Search="_search"
|
||||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync">
|
||||
<Header>
|
||||
<MudTh>
|
||||
|
|
|
|||
|
|
@ -23,16 +23,16 @@ namespace Insight.Web.Pages.Inventory.Hardware.Videocards
|
|||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
[Inject] private NavigationManager NavigationManager { get; init; } = default!;
|
||||
|
||||
private TableContainer<ViewModel>? Container { get; set; }
|
||||
private string Title { get; set; } = Global.Name;
|
||||
private List<BreadcrumbItem> Breadcrumbs { get; } = new();
|
||||
private string? Search { get; set; }
|
||||
private TableContainer<ViewModel>? _container;
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private string? _search;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Videocards", href: Navigation.Inventory.Hardware.Videocards.Index));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Videocards", href: Navigation.Inventory.Hardware.Videocards.Index));
|
||||
|
||||
if (string.IsNullOrWhiteSpace(VideocardName))
|
||||
{
|
||||
|
|
@ -41,9 +41,9 @@ namespace Insight.Web.Pages.Inventory.Hardware.Videocards
|
|||
return;
|
||||
}
|
||||
|
||||
Title = $"Inventory » Videocards » {VideocardName} » Hosts|Insight";
|
||||
Breadcrumbs.Add(new BreadcrumbItem(VideocardName, href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Hosts", href: "#", true));
|
||||
_title = $"Inventory » Videocards » {VideocardName} » Hosts|Insight";
|
||||
_breadcrumbs.Add(new BreadcrumbItem(VideocardName, href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Hosts", href: "#", true));
|
||||
}
|
||||
|
||||
private async Task<TableData<ViewModel>> LoadDataAsync(TableState state)
|
||||
|
|
@ -52,9 +52,9 @@ namespace Insight.Web.Pages.Inventory.Hardware.Videocards
|
|||
{
|
||||
var filter = Builders<BsonDocument>.Filter.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Search) is false)
|
||||
if (string.IsNullOrWhiteSpace(_search) is false)
|
||||
{
|
||||
var regex = new BsonRegularExpression(new Regex(Search, RegexOptions.IgnoreCase));
|
||||
var regex = new BsonRegularExpression(new Regex(_search, RegexOptions.IgnoreCase));
|
||||
filter &= Builders<BsonDocument>.Filter.Regex("customer.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("host.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("driver", regex) |
|
||||
|
|
@ -63,7 +63,7 @@ namespace Insight.Web.Pages.Inventory.Hardware.Videocards
|
|||
|
||||
var query = Database.HostVideocard()
|
||||
.Aggregate()
|
||||
.Match(Builders<HostVideocardEntity>.Filter.Regex(p => p.Name, new BsonRegularExpression(new Regex(VideocardName.Escape(), RegexOptions.IgnoreCase))))
|
||||
.Match(Builders<HostVideocardEntity>.Filter.Regex(p => p.Name, new BsonRegularExpression(new Regex(VideocardName?.Escape() ?? string.Empty, RegexOptions.IgnoreCase))))
|
||||
.Lookup("host", "_host", "_id", "hosts")
|
||||
.Match(new BsonDocument("hosts", new BsonDocument
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
@inherits ComponentBase
|
||||
|
||||
<TableContainer T="ViewModel"
|
||||
@ref="Container"
|
||||
@bind-Search="Search"
|
||||
Title="@Title"
|
||||
Breadcrumbs="@Breadcrumbs"
|
||||
@ref="_container"
|
||||
@bind-Search="_search"
|
||||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync">
|
||||
<Header>
|
||||
<MudTh>
|
||||
|
|
|
|||
|
|
@ -18,17 +18,17 @@ namespace Insight.Web.Pages.Inventory.Hardware.Videocards
|
|||
[Inject] private IMongoDatabase Database { get; init; } = default!;
|
||||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
|
||||
private TableContainer<ViewModel>? Container { get; set; }
|
||||
private string Title { get; set; } = Global.Name;
|
||||
private List<BreadcrumbItem> Breadcrumbs { get; } = new();
|
||||
private string? Search { get; set; }
|
||||
private TableContainer<ViewModel>? _container;
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private string? _search;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
Title = $"Inventory » Videocards|Insight";
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Videocards", href: "#", true));
|
||||
_title = $"Inventory » Videocards|Insight";
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Videocards", href: "#", true));
|
||||
}
|
||||
|
||||
private async Task<TableData<ViewModel>> LoadDataAsync(TableState state)
|
||||
|
|
@ -37,9 +37,9 @@ namespace Insight.Web.Pages.Inventory.Hardware.Videocards
|
|||
{
|
||||
var filter = Builders<HostVideocardEntity>.Filter.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Search) is false)
|
||||
if (string.IsNullOrWhiteSpace(_search) is false)
|
||||
{
|
||||
var regex = new BsonRegularExpression(new Regex(Search, RegexOptions.IgnoreCase));
|
||||
var regex = new BsonRegularExpression(new Regex(_search, RegexOptions.IgnoreCase));
|
||||
filter &= Builders<HostVideocardEntity>.Filter.Regex(x => x.Company, regex) |
|
||||
Builders<HostVideocardEntity>.Filter.Regex(x => x.Name, regex);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
@inherits ComponentBase
|
||||
|
||||
<TableContainer T="ViewModel"
|
||||
@ref="Container"
|
||||
@bind-Search="Search"
|
||||
Title="@Title"
|
||||
Breadcrumbs="@Breadcrumbs"
|
||||
@ref="_container"
|
||||
@bind-Search="_search"
|
||||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync">
|
||||
<Header>
|
||||
<MudTh>
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
</MudLink>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="Interface">
|
||||
<MudLink Href="@Navigation.Management.Hosts.Network.Interfaces.DetailsHref(@context?.Hosts?.Id, @context?.Interface?.Id.ToString())" Typo="Typo.inherit" Underline="Underline.None">
|
||||
<MudLink Href="@Navigation.Management.Hosts.Network.Interfaces.DetailsHref(@context?.Hosts?.Id, @context?.Interface?.Id)" Typo="Typo.inherit" Underline="Underline.None">
|
||||
@context?.Interface?.Name
|
||||
</MudLink>
|
||||
</MudTd>
|
||||
|
|
|
|||
|
|
@ -23,18 +23,18 @@ public partial class Hosts
|
|||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
[Inject] private NavigationManager NavigationManager { get; init; } = default!;
|
||||
|
||||
private TableContainer<ViewModel>? Container { get; set; }
|
||||
private string Title { get; set; } = Global.Name;
|
||||
private List<BreadcrumbItem> Breadcrumbs { get; } = new();
|
||||
private string? Search { get; set; }
|
||||
private TableContainer<ViewModel>? _container;
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private string? _search;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
Address = Address?.UriEscape(true);
|
||||
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Addresses", href: Navigation.Inventory.Network.Addresses.Index));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Addresses", href: Navigation.Inventory.Network.Addresses.Index));
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Address))
|
||||
{
|
||||
|
|
@ -43,9 +43,9 @@ public partial class Hosts
|
|||
return;
|
||||
}
|
||||
|
||||
Title = $"Inventory » Address » {Address} » Hosts|Insight";
|
||||
Breadcrumbs.Add(new BreadcrumbItem(Address, href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Hosts", href: "#", true));
|
||||
_title = $"Inventory » Address » {Address} » Hosts|Insight";
|
||||
_breadcrumbs.Add(new BreadcrumbItem(Address, href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Hosts", href: "#", true));
|
||||
}
|
||||
|
||||
private async Task<TableData<ViewModel>> LoadDataAsync(TableState state)
|
||||
|
|
@ -54,9 +54,9 @@ public partial class Hosts
|
|||
{
|
||||
var filter = Builders<BsonDocument>.Filter.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Search) is false)
|
||||
if (string.IsNullOrWhiteSpace(_search) is false)
|
||||
{
|
||||
var regex = new BsonRegularExpression(new Regex(Search, RegexOptions.IgnoreCase));
|
||||
var regex = new BsonRegularExpression(new Regex(_search, RegexOptions.IgnoreCase));
|
||||
filter &= Builders<BsonDocument>.Filter.Regex("customer.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("host.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("interface", regex) |
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
@using Insight.Web.Extensions
|
||||
|
||||
<TableContainer T="ViewModel"
|
||||
@ref="Container"
|
||||
@bind-Search="Search"
|
||||
Title="@Title"
|
||||
Breadcrumbs="@Breadcrumbs"
|
||||
@ref="_container"
|
||||
@bind-Search="_search"
|
||||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync">
|
||||
<Header>
|
||||
<MudTh>
|
||||
|
|
|
|||
|
|
@ -18,17 +18,17 @@ public partial class Index
|
|||
[Inject] private IMongoDatabase Database { get; init; } = default!;
|
||||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
|
||||
private TableContainer<ViewModel>? Container { get; set; }
|
||||
private string Title { get; set; } = Global.Name;
|
||||
private List<BreadcrumbItem> Breadcrumbs { get; } = new();
|
||||
private string? Search { get; set; }
|
||||
private TableContainer<ViewModel>? _container;
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private string? _search;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
Title = $"Inventory » Addresses|Insight";
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Addresses", href: "#", true));
|
||||
_title = $"Inventory » Addresses|Insight";
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Addresses", href: "#", true));
|
||||
}
|
||||
|
||||
private async Task<TableData<ViewModel>> LoadDataAsync(TableState state)
|
||||
|
|
@ -37,9 +37,9 @@ public partial class Index
|
|||
{
|
||||
var filter = Builders<HostInterfaceAddressEntity>.Filter.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Search) is false)
|
||||
if (string.IsNullOrWhiteSpace(_search) is false)
|
||||
{
|
||||
var regex = new BsonRegularExpression(new Regex(Search, RegexOptions.IgnoreCase));
|
||||
var regex = new BsonRegularExpression(new Regex(_search, RegexOptions.IgnoreCase));
|
||||
filter &= Builders<HostInterfaceAddressEntity>.Filter.Regex(x => x.Address, regex);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
|
||||
<TableContainer T="ViewModel"
|
||||
@ref="Container"
|
||||
@bind-Search="Search"
|
||||
Title="@Title"
|
||||
Breadcrumbs="@Breadcrumbs"
|
||||
@ref="_container"
|
||||
@bind-Search="_search"
|
||||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync">
|
||||
<Header>
|
||||
<MudTh>
|
||||
|
|
@ -36,7 +36,7 @@
|
|||
</MudLink>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="Interface">
|
||||
<MudLink Href="@Navigation.Management.Hosts.Network.Interfaces.DetailsHref(@context?.Hosts?.Id, @context?.Interface?.Id.ToString())" Typo="Typo.inherit" Underline="Underline.None">
|
||||
<MudLink Href="@Navigation.Management.Hosts.Network.Interfaces.DetailsHref(@context?.Hosts?.Id, @context?.Interface?.Id)" Typo="Typo.inherit" Underline="Underline.None">
|
||||
@context?.Interface?.Name
|
||||
</MudLink>
|
||||
</MudTd>
|
||||
|
|
|
|||
|
|
@ -23,18 +23,18 @@ namespace Insight.Web.Pages.Inventory.Network.Gateways
|
|||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
[Inject] private NavigationManager NavigationManager { get; init; } = default!;
|
||||
|
||||
private TableContainer<ViewModel>? Container { get; set; }
|
||||
private string Title { get; set; } = Global.Name;
|
||||
private List<BreadcrumbItem> Breadcrumbs { get; } = new();
|
||||
private string? Search { get; set; }
|
||||
private TableContainer<ViewModel>? _container;
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private string? _search;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
GatewayAddress = GatewayAddress?.UriEscape(true);
|
||||
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Gateways", href: Navigation.Inventory.Network.Gateways.Index));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Gateways", href: Navigation.Inventory.Network.Gateways.Index));
|
||||
|
||||
if (string.IsNullOrWhiteSpace(GatewayAddress))
|
||||
{
|
||||
|
|
@ -43,9 +43,9 @@ namespace Insight.Web.Pages.Inventory.Network.Gateways
|
|||
return;
|
||||
}
|
||||
|
||||
Title = $"Inventory » Gateway » {GatewayAddress} » Hosts|Insight";
|
||||
Breadcrumbs.Add(new BreadcrumbItem(GatewayAddress, href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Hosts", href: "#", true));
|
||||
_title = $"Inventory » Gateway » {GatewayAddress} » Hosts|Insight";
|
||||
_breadcrumbs.Add(new BreadcrumbItem(GatewayAddress, href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Hosts", href: "#", true));
|
||||
}
|
||||
|
||||
private async Task<TableData<ViewModel>> LoadDataAsync(TableState state)
|
||||
|
|
@ -54,9 +54,9 @@ namespace Insight.Web.Pages.Inventory.Network.Gateways
|
|||
{
|
||||
var filter = Builders<BsonDocument>.Filter.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Search) is false)
|
||||
if (string.IsNullOrWhiteSpace(_search) is false)
|
||||
{
|
||||
var regex = new BsonRegularExpression(new Regex(Search, RegexOptions.IgnoreCase));
|
||||
var regex = new BsonRegularExpression(new Regex(_search, RegexOptions.IgnoreCase));
|
||||
filter &= Builders<BsonDocument>.Filter.Regex("customer.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("host.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("interface", regex);
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
@using Insight.Web.Extensions
|
||||
|
||||
<TableContainer T="ViewModel"
|
||||
@ref="Container"
|
||||
@bind-Search="Search"
|
||||
Title="@Title"
|
||||
Breadcrumbs="@Breadcrumbs"
|
||||
@ref="_container"
|
||||
@bind-Search="_search"
|
||||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync">
|
||||
<Header>
|
||||
<MudTh>
|
||||
|
|
|
|||
|
|
@ -18,17 +18,17 @@ public partial class Index
|
|||
[Inject] private IMongoDatabase Database { get; init; } = default!;
|
||||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
|
||||
private TableContainer<ViewModel>? Container { get; set; }
|
||||
private string Title { get; set; } = Global.Name;
|
||||
private List<BreadcrumbItem> Breadcrumbs { get; } = new();
|
||||
private string? Search { get; set; }
|
||||
private TableContainer<ViewModel>? _container;
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private string? _search;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
Title = $"Inventory » Gateways|Insight";
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Gateways", href: "#", true));
|
||||
_title = $"Inventory » Gateways|Insight";
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Gateways", href: "#", true));
|
||||
}
|
||||
|
||||
private async Task<TableData<ViewModel>> LoadDataAsync(TableState state)
|
||||
|
|
@ -37,9 +37,9 @@ public partial class Index
|
|||
{
|
||||
var filter = Builders<HostInterfaceGatewayEntity>.Filter.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Search) is false)
|
||||
if (string.IsNullOrWhiteSpace(_search) is false)
|
||||
{
|
||||
var regex = new BsonRegularExpression(new Regex(Search, RegexOptions.IgnoreCase));
|
||||
var regex = new BsonRegularExpression(new Regex(_search, RegexOptions.IgnoreCase));
|
||||
filter &= Builders<HostInterfaceGatewayEntity>.Filter.Regex(x => x.Address, regex);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
@inherits ComponentBase
|
||||
|
||||
<TableContainer T="ViewModel"
|
||||
@ref="Container"
|
||||
@bind-Search="Search"
|
||||
Title="@Title"
|
||||
Breadcrumbs="@Breadcrumbs"
|
||||
@ref="_container"
|
||||
@bind-Search="_search"
|
||||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync">
|
||||
<Header>
|
||||
<MudTh>
|
||||
|
|
|
|||
|
|
@ -18,17 +18,17 @@ public partial class Index
|
|||
[Inject] private IMongoDatabase Database { get; init; } = default!;
|
||||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
|
||||
private TableContainer<ViewModel>? Container { get; set; }
|
||||
private string Title { get; set; } = Global.Name;
|
||||
private List<BreadcrumbItem> Breadcrumbs { get; } = new();
|
||||
private string? Search { get; set; }
|
||||
private TableContainer<ViewModel>? _container;
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private string? _search;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
Title = $"Inventory » Interfaces|Insight";
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Interfaces", href: "#", true));
|
||||
_title = $"Inventory » Interfaces|Insight";
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Interfaces", href: "#", true));
|
||||
}
|
||||
|
||||
private async Task<TableData<ViewModel>> LoadDataAsync(TableState state)
|
||||
|
|
@ -37,9 +37,9 @@ public partial class Index
|
|||
{
|
||||
var search = Builders<BsonDocument>.Filter.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Search) is false)
|
||||
if (string.IsNullOrWhiteSpace(_search) is false)
|
||||
{
|
||||
var regex = new BsonRegularExpression(new Regex(Search, RegexOptions.IgnoreCase));
|
||||
var regex = new BsonRegularExpression(new Regex(_search, RegexOptions.IgnoreCase));
|
||||
search &= Builders<BsonDocument>.Filter.Regex("host.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("customer.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("name", regex) |
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
@using Insight.Web.Extensions
|
||||
|
||||
<TableContainer T="ViewModel"
|
||||
@ref="Container"
|
||||
@bind-Search="Search"
|
||||
Title="@Title"
|
||||
Breadcrumbs="@Breadcrumbs"
|
||||
@ref="_container"
|
||||
@bind-Search="_search"
|
||||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync">
|
||||
<Header>
|
||||
<MudTh>
|
||||
|
|
@ -36,7 +36,7 @@
|
|||
</MudLink>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="Interface">
|
||||
<MudLink Href="@Navigation.Management.Hosts.Network.Interfaces.DetailsHref(@context?.Hosts?.Id, @context?.Interface?.Id.ToString())" Typo="Typo.inherit" Underline="Underline.None">
|
||||
<MudLink Href="@Navigation.Management.Hosts.Network.Interfaces.DetailsHref(@context?.Hosts?.Id, @context?.Interface?.Id)" Typo="Typo.inherit" Underline="Underline.None">
|
||||
@context?.Interface?.Name
|
||||
</MudLink>
|
||||
</MudTd>
|
||||
|
|
|
|||
|
|
@ -23,18 +23,18 @@ public partial class Hosts
|
|||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
[Inject] private NavigationManager NavigationManager { get; init; } = default!;
|
||||
|
||||
private TableContainer<ViewModel>? Container { get; set; }
|
||||
private string Title { get; set; } = Global.Name;
|
||||
private List<BreadcrumbItem> Breadcrumbs { get; } = new();
|
||||
private string? Search { get; set; }
|
||||
private TableContainer<ViewModel>? _container;
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private string? _search;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
NameserverAddress = NameserverAddress?.UriEscape(true);
|
||||
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Nameservers", href: Navigation.Inventory.Network.Nameservers.Index));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Nameservers", href: Navigation.Inventory.Network.Nameservers.Index));
|
||||
|
||||
if (string.IsNullOrWhiteSpace(NameserverAddress))
|
||||
{
|
||||
|
|
@ -43,9 +43,9 @@ public partial class Hosts
|
|||
return;
|
||||
}
|
||||
|
||||
Title = $"Inventory » Nameserver » {NameserverAddress} » Hosts|Insight";
|
||||
Breadcrumbs.Add(new BreadcrumbItem(NameserverAddress, href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Hosts", href: "#", true));
|
||||
_title = $"Inventory » Nameserver » {NameserverAddress} » Hosts|Insight";
|
||||
_breadcrumbs.Add(new BreadcrumbItem(NameserverAddress, href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Hosts", href: "#", true));
|
||||
}
|
||||
|
||||
private async Task<TableData<ViewModel>> LoadDataAsync(TableState state)
|
||||
|
|
@ -54,9 +54,9 @@ public partial class Hosts
|
|||
{
|
||||
var filter = Builders<BsonDocument>.Filter.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Search) is false)
|
||||
if (string.IsNullOrWhiteSpace(_search) is false)
|
||||
{
|
||||
var regex = new BsonRegularExpression(new Regex(Search, RegexOptions.IgnoreCase));
|
||||
var regex = new BsonRegularExpression(new Regex(_search, RegexOptions.IgnoreCase));
|
||||
filter &= Builders<BsonDocument>.Filter.Regex("customer.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("host.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("interface", regex);
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
@using Insight.Web.Extensions
|
||||
|
||||
<TableContainer T="ViewModel"
|
||||
@ref="Container"
|
||||
@bind-Search="Search"
|
||||
Title="@Title"
|
||||
Breadcrumbs="@Breadcrumbs"
|
||||
@ref="_container"
|
||||
@bind-Search="_search"
|
||||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync">
|
||||
<Header>
|
||||
<MudTh>
|
||||
|
|
|
|||
|
|
@ -18,17 +18,17 @@ public partial class Index
|
|||
[Inject] private IMongoDatabase Database { get; init; } = default!;
|
||||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
|
||||
private TableContainer<ViewModel>? Container { get; set; }
|
||||
private string Title { get; set; } = Global.Name;
|
||||
private List<BreadcrumbItem> Breadcrumbs { get; } = new();
|
||||
private string? Search { get; set; }
|
||||
private TableContainer<ViewModel>? _container;
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private string? _search;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
Title = $"Inventory » Nameservers|Insight";
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Nameservers", href: "#", true));
|
||||
_title = $"Inventory » Nameservers|Insight";
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Nameservers", href: "#", true));
|
||||
}
|
||||
|
||||
private async Task<TableData<ViewModel>> LoadDataAsync(TableState state)
|
||||
|
|
@ -37,9 +37,9 @@ public partial class Index
|
|||
{
|
||||
var filter = Builders<HostInterfaceNameserverEntity>.Filter.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Search) is false)
|
||||
if (string.IsNullOrWhiteSpace(_search) is false)
|
||||
{
|
||||
var regex = new BsonRegularExpression(new Regex(Search, RegexOptions.IgnoreCase));
|
||||
var regex = new BsonRegularExpression(new Regex(_search, RegexOptions.IgnoreCase));
|
||||
filter &= Builders<HostInterfaceNameserverEntity>.Filter.Regex(x => x.Address, regex);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
@inherits ComponentBase
|
||||
|
||||
<TableContainer T="ViewModel"
|
||||
@ref="Container"
|
||||
@bind-Search="Search"
|
||||
Title="@Title"
|
||||
Breadcrumbs="@Breadcrumbs"
|
||||
@ref="_container"
|
||||
@bind-Search="_search"
|
||||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync">
|
||||
<Header>
|
||||
<MudTh>
|
||||
|
|
@ -50,7 +50,7 @@
|
|||
</MudLink>
|
||||
</MudTd>
|
||||
<MudTd DataLabel="Interface">
|
||||
<MudLink Href="@Navigation.Management.Hosts.Network.Interfaces.DetailsHref(@context?.Hosts?.Id, @context?.Interface?.Id.ToString())" Typo="Typo.inherit" Underline="Underline.None">
|
||||
<MudLink Href="@Navigation.Management.Hosts.Network.Interfaces.DetailsHref(@context?.Hosts?.Id, @context?.Interface?.Id)" Typo="Typo.inherit" Underline="Underline.None">
|
||||
@context?.Interface?.Name
|
||||
</MudLink>
|
||||
</MudTd>
|
||||
|
|
|
|||
|
|
@ -23,18 +23,18 @@ public partial class Hosts
|
|||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
[Inject] private NavigationManager NavigationManager { get; init; } = default!;
|
||||
|
||||
private TableContainer<ViewModel>? Container { get; set; }
|
||||
private string Title { get; set; } = Global.Name;
|
||||
private List<BreadcrumbItem> Breadcrumbs { get; } = new();
|
||||
private string? Search { get; set; }
|
||||
private TableContainer<ViewModel>? _container;
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private string? _search;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
RouteAddress = RouteAddress?.UriEscape(true);
|
||||
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Routes", href: Navigation.Inventory.Network.Routes.Index));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Routes", href: Navigation.Inventory.Network.Routes.Index));
|
||||
|
||||
if (string.IsNullOrWhiteSpace(RouteAddress))
|
||||
{
|
||||
|
|
@ -43,9 +43,9 @@ public partial class Hosts
|
|||
return;
|
||||
}
|
||||
|
||||
Title = $"Inventory » Route » {RouteAddress} » Hosts|Insight";
|
||||
Breadcrumbs.Add(new BreadcrumbItem(RouteAddress, href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Hosts", href: "#", true));
|
||||
_title = $"Inventory » Route » {RouteAddress} » Hosts|Insight";
|
||||
_breadcrumbs.Add(new BreadcrumbItem(RouteAddress, href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Hosts", href: "#", true));
|
||||
}
|
||||
|
||||
private async Task<TableData<ViewModel>> LoadDataAsync(TableState state)
|
||||
|
|
@ -54,9 +54,9 @@ public partial class Hosts
|
|||
{
|
||||
var filter = Builders<BsonDocument>.Filter.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Search) is false)
|
||||
if (string.IsNullOrWhiteSpace(_search) is false)
|
||||
{
|
||||
var regex = new BsonRegularExpression(new Regex(Search, RegexOptions.IgnoreCase));
|
||||
var regex = new BsonRegularExpression(new Regex(_search, RegexOptions.IgnoreCase));
|
||||
filter &= Builders<BsonDocument>.Filter.Regex("customer.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("host.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("interface", regex);
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
@using Insight.Web.Extensions
|
||||
|
||||
<TableContainer T="ViewModel"
|
||||
@ref="Container"
|
||||
@bind-Search="Search"
|
||||
Title="@Title"
|
||||
Breadcrumbs="@Breadcrumbs"
|
||||
@ref="_container"
|
||||
@bind-Search="_search"
|
||||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync">
|
||||
<Header>
|
||||
<MudTh>
|
||||
|
|
|
|||
|
|
@ -18,17 +18,17 @@ public partial class Index
|
|||
[Inject] private IMongoDatabase Database { get; init; } = default!;
|
||||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
|
||||
private TableContainer<ViewModel>? Container { get; set; }
|
||||
private string Title { get; set; } = Global.Name;
|
||||
private List<BreadcrumbItem> Breadcrumbs { get; } = new();
|
||||
private string? Search { get; set; }
|
||||
private TableContainer<ViewModel>? _container;
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private string? _search;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
Title = $"Inventory » Routes|Insight";
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Routes", href: "#", true));
|
||||
_title = $"Inventory » Routes|Insight";
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Routes", href: "#", true));
|
||||
}
|
||||
|
||||
private async Task<TableData<ViewModel>> LoadDataAsync(TableState state)
|
||||
|
|
@ -37,9 +37,9 @@ public partial class Index
|
|||
{
|
||||
var filter = Builders<HostInterfaceRouteEntity>.Filter.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Search) is false)
|
||||
if (string.IsNullOrWhiteSpace(_search) is false)
|
||||
{
|
||||
var regex = new BsonRegularExpression(new Regex(Search, RegexOptions.IgnoreCase));
|
||||
var regex = new BsonRegularExpression(new Regex(_search, RegexOptions.IgnoreCase));
|
||||
filter &= Builders<HostInterfaceRouteEntity>.Filter.Regex(x => x.Destination, regex);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
@inherits ComponentBase
|
||||
|
||||
<TableContainer T="ViewModel"
|
||||
@ref="Container"
|
||||
@bind-Search="Search"
|
||||
Title="@Title"
|
||||
Breadcrumbs="@Breadcrumbs"
|
||||
@ref="_container"
|
||||
@bind-Search="_search"
|
||||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync">
|
||||
<Header>
|
||||
<MudTh>
|
||||
|
|
|
|||
|
|
@ -23,18 +23,18 @@ public partial class Hosts
|
|||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
[Inject] private NavigationManager NavigationManager { get; init; } = default!;
|
||||
|
||||
private TableContainer<ViewModel>? Container { get; set; }
|
||||
private string Title { get; set; } = Global.Name;
|
||||
private List<BreadcrumbItem> Breadcrumbs { get; } = new();
|
||||
private string? Search { get; set; }
|
||||
private TableContainer<ViewModel>? _container;
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private string? _search;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
GroupName = GroupName?.UriEscape(true);
|
||||
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Groups", href: Navigation.Inventory.Systems.Groups.Index));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Groups", href: Navigation.Inventory.Systems.Groups.Index));
|
||||
|
||||
if (string.IsNullOrWhiteSpace(GroupName))
|
||||
{
|
||||
|
|
@ -43,9 +43,9 @@ public partial class Hosts
|
|||
return;
|
||||
}
|
||||
|
||||
Title = $"Inventory » Group » {GroupName} » Hosts|Insight";
|
||||
Breadcrumbs.Add(new BreadcrumbItem(GroupName, href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Hosts", href: "#", true));
|
||||
_title = $"Inventory » Group » {GroupName} » Hosts|Insight";
|
||||
_breadcrumbs.Add(new BreadcrumbItem(GroupName, href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Hosts", href: "#", true));
|
||||
}
|
||||
|
||||
private async Task<TableData<ViewModel>> LoadDataAsync(TableState state)
|
||||
|
|
@ -54,9 +54,9 @@ public partial class Hosts
|
|||
{
|
||||
var filter = Builders<BsonDocument>.Filter.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Search) is false)
|
||||
if (string.IsNullOrWhiteSpace(_search) is false)
|
||||
{
|
||||
var regex = new BsonRegularExpression(new Regex(Search, RegexOptions.IgnoreCase));
|
||||
var regex = new BsonRegularExpression(new Regex(_search, RegexOptions.IgnoreCase));
|
||||
filter &= Builders<BsonDocument>.Filter.Regex("customer.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("host.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("domain", regex) |
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
@using Insight.Web.Extensions
|
||||
|
||||
<TableContainer T="ViewModel"
|
||||
@ref="Container"
|
||||
@bind-Search="Search"
|
||||
Title="@Title"
|
||||
Breadcrumbs="@Breadcrumbs"
|
||||
@ref="_container"
|
||||
@bind-Search="_search"
|
||||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync">
|
||||
<Header>
|
||||
<MudTh>
|
||||
|
|
|
|||
|
|
@ -18,17 +18,17 @@ public partial class Index
|
|||
[Inject] private IMongoDatabase Database { get; init; } = default!;
|
||||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
|
||||
private TableContainer<ViewModel>? Container { get; set; }
|
||||
private string Title { get; set; } = Global.Name;
|
||||
private List<BreadcrumbItem> Breadcrumbs { get; } = new();
|
||||
private string? Search { get; set; }
|
||||
private TableContainer<ViewModel>? _container;
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private string? _search;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
Title = $"Inventory » Groups|Insight";
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Groups", href: "#", true));
|
||||
_title = $"Inventory » Groups|Insight";
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Groups", href: "#", true));
|
||||
}
|
||||
|
||||
private async Task<TableData<ViewModel>> LoadDataAsync(TableState state)
|
||||
|
|
@ -37,9 +37,9 @@ public partial class Index
|
|||
{
|
||||
var filter = Builders<HostSysGroupEntity>.Filter.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Search) is false)
|
||||
if (string.IsNullOrWhiteSpace(_search) is false)
|
||||
{
|
||||
var regex = new BsonRegularExpression(new Regex(Search, RegexOptions.IgnoreCase));
|
||||
var regex = new BsonRegularExpression(new Regex(_search, RegexOptions.IgnoreCase));
|
||||
filter &= Builders<HostSysGroupEntity>.Filter.Regex(x => x.Name, regex);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
@inherits ComponentBase
|
||||
|
||||
<TableContainer T="ViewModel"
|
||||
@ref="Container"
|
||||
@bind-Search="Search"
|
||||
Title="@Title"
|
||||
Breadcrumbs="@Breadcrumbs"
|
||||
@ref="_container"
|
||||
@bind-Search="_search"
|
||||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync">
|
||||
<Header>
|
||||
<MudTh>
|
||||
|
|
|
|||
|
|
@ -22,18 +22,18 @@ public partial class Guests
|
|||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
[Inject] private NavigationManager NavigationManager { get; init; } = default!;
|
||||
|
||||
private TableContainer<ViewModel>? Container { get; set; }
|
||||
private string Title { get; set; } = Global.Name;
|
||||
private List<BreadcrumbItem> Breadcrumbs { get; } = new();
|
||||
private string? Search { get; set; }
|
||||
private TableContainer<ViewModel>? _container;
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private string? _search;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
OsName = OsName.UriEscape(true);
|
||||
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("OS", href: Navigation.Inventory.Systems.Os.Index));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("OS", href: Navigation.Inventory.Systems.Os.Index));
|
||||
|
||||
if (string.IsNullOrWhiteSpace(OsName))
|
||||
{
|
||||
|
|
@ -42,9 +42,9 @@ public partial class Guests
|
|||
return;
|
||||
}
|
||||
|
||||
Title = $"Inventory » OS » {OsName} » Guests|Insight";
|
||||
Breadcrumbs.Add(new BreadcrumbItem(OsName, href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Guests", href: "#", true));
|
||||
_title = $"Inventory » OS » {OsName} » Guests|Insight";
|
||||
_breadcrumbs.Add(new BreadcrumbItem(OsName, href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Guests", href: "#", true));
|
||||
}
|
||||
|
||||
private async Task<TableData<ViewModel>> LoadDataAsync(TableState state)
|
||||
|
|
@ -53,9 +53,9 @@ public partial class Guests
|
|||
{
|
||||
var filter = Builders<BsonDocument>.Filter.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Search) is false)
|
||||
if (string.IsNullOrWhiteSpace(_search) is false)
|
||||
{
|
||||
var regex = new BsonRegularExpression(new Regex(Search, RegexOptions.IgnoreCase));
|
||||
var regex = new BsonRegularExpression(new Regex(_search, RegexOptions.IgnoreCase));
|
||||
filter &= Builders<BsonDocument>.Filter.Regex("customer.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("host.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("name", regex);
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
@inherits ComponentBase
|
||||
|
||||
<TableContainer T="ViewModel"
|
||||
@ref="Container"
|
||||
@bind-Search="Search"
|
||||
Title="@Title"
|
||||
@ref="_container"
|
||||
@bind-Search="_search"
|
||||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync">
|
||||
<Header>
|
||||
|
|
|
|||
|
|
@ -23,11 +23,10 @@ public partial class Hosts
|
|||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
[Inject] private NavigationManager NavigationManager { get; init; } = default!;
|
||||
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = new();
|
||||
|
||||
private string Title { get; set; } = Global.Name;
|
||||
private TableContainer<ViewModel>? Container { get; set; }
|
||||
private string? Search { get; set; }
|
||||
private TableContainer<ViewModel>? _container;
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private string? _search;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
|
|
@ -44,7 +43,7 @@ public partial class Hosts
|
|||
return;
|
||||
}
|
||||
|
||||
Title = $"Inventory » OS » {OsName} » Hosts|Insight";
|
||||
_title = $"Inventory » OS » {OsName} » Hosts|Insight";
|
||||
|
||||
_breadcrumbs.Add(new BreadcrumbItem(OsName, href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Hosts", href: "#", true));
|
||||
|
|
@ -56,9 +55,9 @@ public partial class Hosts
|
|||
{
|
||||
var filter = Builders<BsonDocument>.Filter.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Search) is false)
|
||||
if (string.IsNullOrWhiteSpace(_search) is false)
|
||||
{
|
||||
var regex = new BsonRegularExpression(new Regex(Search, RegexOptions.IgnoreCase));
|
||||
var regex = new BsonRegularExpression(new Regex(_search, RegexOptions.IgnoreCase));
|
||||
filter &= Builders<BsonDocument>.Filter.Regex("customer.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("host.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("version", regex);
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
@inherits ComponentBase
|
||||
|
||||
<TableContainer T="ViewModel"
|
||||
@ref="Container"
|
||||
@bind-Search="Search"
|
||||
Title="@Title"
|
||||
Breadcrumbs="@Breadcrumbs"
|
||||
@ref="_container"
|
||||
@bind-Search="_search"
|
||||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync">
|
||||
<Header>
|
||||
<MudTh>
|
||||
|
|
|
|||
|
|
@ -18,17 +18,17 @@ public partial class Index
|
|||
[Inject] private IMongoDatabase Database { get; init; } = default!;
|
||||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
|
||||
private TableContainer<ViewModel>? Container { get; set; }
|
||||
private string Title { get; set; } = Global.Name;
|
||||
private List<BreadcrumbItem> Breadcrumbs { get; } = new();
|
||||
private string? Search { get; set; }
|
||||
private TableContainer<ViewModel>? _container;
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private string? _search;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
Title = $"Inventory » OS|Insight";
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("OS", href: "#", true));
|
||||
_title = $"Inventory » OS|Insight";
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("OS", href: "#", true));
|
||||
}
|
||||
|
||||
private async Task<TableData<ViewModel>> LoadDataAsync(TableState state)
|
||||
|
|
@ -37,9 +37,9 @@ public partial class Index
|
|||
{
|
||||
var filter = Builders<BsonDocument>.Filter.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Search) is false)
|
||||
if (string.IsNullOrWhiteSpace(_search) is false)
|
||||
{
|
||||
var regex = new BsonRegularExpression(new Regex(Search, RegexOptions.IgnoreCase));
|
||||
var regex = new BsonRegularExpression(new Regex(_search, RegexOptions.IgnoreCase));
|
||||
filter &= Builders<BsonDocument>.Filter.Regex("name", regex);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
@inherits ComponentBase
|
||||
|
||||
<TableContainer T="ViewModel"
|
||||
@ref="Container"
|
||||
@bind-Search="Search"
|
||||
Title="@Title"
|
||||
Breadcrumbs="@Breadcrumbs"
|
||||
@ref="_container"
|
||||
@bind-Search="_search"
|
||||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync">
|
||||
<Header>
|
||||
<MudTh>
|
||||
|
|
|
|||
|
|
@ -18,17 +18,17 @@ public partial class Index
|
|||
[Inject] private IMongoDatabase Database { get; init; } = default!;
|
||||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
|
||||
private TableContainer<ViewModel>? Container { get; set; }
|
||||
private string Title { get; set; } = Global.Name;
|
||||
private List<BreadcrumbItem> Breadcrumbs { get; } = new();
|
||||
private string? Search { get; set; }
|
||||
private TableContainer<ViewModel>? _container;
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private string? _search;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
Title = $"Inventory » Printers|Insight";
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Printers", href: "#", true));
|
||||
_title = $"Inventory » Printers|Insight";
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Printers", href: "#", true));
|
||||
}
|
||||
|
||||
private async Task<TableData<ViewModel>> LoadDataAsync(TableState state)
|
||||
|
|
@ -37,9 +37,9 @@ public partial class Index
|
|||
{
|
||||
var search = Builders<BsonDocument>.Filter.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Search) is false)
|
||||
if (string.IsNullOrWhiteSpace(_search) is false)
|
||||
{
|
||||
var regex = new BsonRegularExpression(new Regex(Search, RegexOptions.IgnoreCase));
|
||||
var regex = new BsonRegularExpression(new Regex(_search, RegexOptions.IgnoreCase));
|
||||
search &= Builders<BsonDocument>.Filter.Regex("host.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("customer.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("name", regex) |
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
@inherits ComponentBase
|
||||
|
||||
<TableContainer T="ViewModel"
|
||||
@ref="Container"
|
||||
@bind-Search="Search"
|
||||
Title="@Title"
|
||||
Breadcrumbs="@Breadcrumbs"
|
||||
@ref="_container"
|
||||
@bind-Search="_search"
|
||||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync">
|
||||
<Header>
|
||||
<MudTh>
|
||||
|
|
|
|||
|
|
@ -23,18 +23,18 @@ public partial class Hosts
|
|||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
[Inject] private NavigationManager NavigationManager { get; init; } = default!;
|
||||
|
||||
private TableContainer<ViewModel>? Container { get; set; }
|
||||
private string Title { get; set; } = Global.Name;
|
||||
private List<BreadcrumbItem> Breadcrumbs { get; } = new();
|
||||
private string? Search { get; set; }
|
||||
private TableContainer<ViewModel>? _container;
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private string? _search;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
ServiceName = ServiceName?.UriEscape(true);
|
||||
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Services", href: Navigation.Inventory.Systems.Services.Index));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Services", href: Navigation.Inventory.Systems.Services.Index));
|
||||
|
||||
if (string.IsNullOrWhiteSpace(ServiceName))
|
||||
{
|
||||
|
|
@ -43,9 +43,9 @@ public partial class Hosts
|
|||
return;
|
||||
}
|
||||
|
||||
Title = $"Inventory » Service » {ServiceName} » Hosts|Insight";
|
||||
Breadcrumbs.Add(new BreadcrumbItem(ServiceName, href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Hosts", href: "#", true));
|
||||
_title = $"Inventory » Service » {ServiceName} » Hosts|Insight";
|
||||
_breadcrumbs.Add(new BreadcrumbItem(ServiceName, href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Hosts", href: "#", true));
|
||||
}
|
||||
|
||||
private async Task<TableData<ViewModel>> LoadDataAsync(TableState state)
|
||||
|
|
@ -54,9 +54,9 @@ public partial class Hosts
|
|||
{
|
||||
var filter = Builders<BsonDocument>.Filter.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Search) is false)
|
||||
if (string.IsNullOrWhiteSpace(_search) is false)
|
||||
{
|
||||
var regex = new BsonRegularExpression(new Regex(Search, RegexOptions.IgnoreCase));
|
||||
var regex = new BsonRegularExpression(new Regex(_search, RegexOptions.IgnoreCase));
|
||||
filter &= Builders<BsonDocument>.Filter.Regex("customer.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("host.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("processid", regex) |
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
@using Insight.Web.Extensions
|
||||
|
||||
<TableContainer T="ViewModel"
|
||||
@ref="Container"
|
||||
@bind-Search="Search"
|
||||
Title="@Title"
|
||||
Breadcrumbs="@Breadcrumbs"
|
||||
@ref="_container"
|
||||
@bind-Search="_search"
|
||||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync">
|
||||
<Header>
|
||||
<MudTh>
|
||||
|
|
|
|||
|
|
@ -18,17 +18,17 @@ public partial class Index
|
|||
[Inject] private IMongoDatabase Database { get; init; } = default!;
|
||||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
|
||||
private TableContainer<ViewModel>? Container { get; set; }
|
||||
private string Title { get; set; } = Global.Name;
|
||||
private List<BreadcrumbItem> Breadcrumbs { get; } = new();
|
||||
private string? Search { get; set; }
|
||||
private TableContainer<ViewModel>? _container;
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private string? _search;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
Title = $"Inventory » Services|Insight";
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Services", href: "#", true));
|
||||
_title = $"Inventory » Services|Insight";
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Services", href: "#", true));
|
||||
}
|
||||
|
||||
private async Task<TableData<ViewModel>> LoadDataAsync(TableState state)
|
||||
|
|
@ -37,9 +37,9 @@ public partial class Index
|
|||
{
|
||||
var filter = Builders<HostServiceEntity>.Filter.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Search) is false)
|
||||
if (string.IsNullOrWhiteSpace(_search) is false)
|
||||
{
|
||||
var regex = new BsonRegularExpression(new Regex(Search, RegexOptions.IgnoreCase));
|
||||
var regex = new BsonRegularExpression(new Regex(_search, RegexOptions.IgnoreCase));
|
||||
filter &= Builders<HostServiceEntity>.Filter.Regex(x => x.Company, regex) |
|
||||
Builders<HostServiceEntity>.Filter.Regex(x => x.Name, regex) |
|
||||
Builders<HostServiceEntity>.Filter.Regex(x => x.DisplayName, regex);
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
@inherits ComponentBase
|
||||
|
||||
<TableContainer T="ViewModel"
|
||||
@ref="Container"
|
||||
@bind-Search="Search"
|
||||
Title="@Title"
|
||||
Breadcrumbs="@Breadcrumbs"
|
||||
@ref="_container"
|
||||
@bind-Search="_search"
|
||||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync">
|
||||
<Header>
|
||||
<MudTh>
|
||||
|
|
|
|||
|
|
@ -18,17 +18,17 @@ public partial class Index
|
|||
[Inject] private IMongoDatabase Database { get; init; } = default!;
|
||||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
|
||||
private TableContainer<ViewModel>? Container { get; set; }
|
||||
private string Title { get; set; } = Global.Name;
|
||||
private List<BreadcrumbItem> Breadcrumbs { get; } = new();
|
||||
private string? Search { get; set; }
|
||||
private TableContainer<ViewModel>? _container;
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private string? _search;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
Title = $"Inventory » Sessions|Insight";
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Sessions", href: "#", true));
|
||||
_title = $"Inventory » Sessions|Insight";
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Sessions", href: "#", true));
|
||||
}
|
||||
|
||||
private async Task<TableData<ViewModel>> LoadDataAsync(TableState state)
|
||||
|
|
@ -37,9 +37,9 @@ public partial class Index
|
|||
{
|
||||
var search = Builders<BsonDocument>.Filter.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Search) is false)
|
||||
if (string.IsNullOrWhiteSpace(_search) is false)
|
||||
{
|
||||
var regex = new BsonRegularExpression(new Regex(Search, RegexOptions.IgnoreCase));
|
||||
var regex = new BsonRegularExpression(new Regex(_search, RegexOptions.IgnoreCase));
|
||||
search &= Builders<BsonDocument>.Filter.Regex("host.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("customer.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("user", regex) |
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
@inherits ComponentBase
|
||||
|
||||
<TableContainer T="ViewModel"
|
||||
@ref="Container"
|
||||
@bind-Search="Search"
|
||||
Title="@Title"
|
||||
Breadcrumbs="@Breadcrumbs"
|
||||
@ref="_container"
|
||||
@bind-Search="_search"
|
||||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync">
|
||||
<Header>
|
||||
<MudTh>
|
||||
|
|
|
|||
|
|
@ -23,18 +23,18 @@ public partial class Hosts
|
|||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
[Inject] private NavigationManager NavigationManager { get; init; } = default!;
|
||||
|
||||
private TableContainer<ViewModel>? Container { get; set; }
|
||||
private string Title { get; set; } = Global.Name;
|
||||
private List<BreadcrumbItem> Breadcrumbs { get; } = new();
|
||||
private string? Search { get; set; }
|
||||
private TableContainer<ViewModel>? _container;
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private string? _search;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
SoftwareName = SoftwareName?.UriEscape(true);
|
||||
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Software", href: Navigation.Inventory.Systems.Software.Index));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Software", href: Navigation.Inventory.Systems.Software.Index));
|
||||
|
||||
if (string.IsNullOrWhiteSpace(SoftwareName))
|
||||
{
|
||||
|
|
@ -43,9 +43,9 @@ public partial class Hosts
|
|||
return;
|
||||
}
|
||||
|
||||
Title = $"Inventory » Software » {SoftwareName} » Hosts|Insight";
|
||||
Breadcrumbs.Add(new BreadcrumbItem(SoftwareName, href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Hosts", href: "#", true));
|
||||
_title = $"Inventory » Software » {SoftwareName} » Hosts|Insight";
|
||||
_breadcrumbs.Add(new BreadcrumbItem(SoftwareName, href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Hosts", href: "#", true));
|
||||
}
|
||||
|
||||
private async Task<TableData<ViewModel>> LoadDataAsync(TableState state)
|
||||
|
|
@ -54,9 +54,9 @@ public partial class Hosts
|
|||
{
|
||||
var filter = Builders<BsonDocument>.Filter.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Search) is false)
|
||||
if (string.IsNullOrWhiteSpace(_search) is false)
|
||||
{
|
||||
var regex = new BsonRegularExpression(new Regex(Search, RegexOptions.IgnoreCase));
|
||||
var regex = new BsonRegularExpression(new Regex(_search, RegexOptions.IgnoreCase));
|
||||
filter &= Builders<BsonDocument>.Filter.Regex("customer.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("host.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("architecture", regex) |
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
@using Insight.Web.Extensions
|
||||
|
||||
<TableContainer T="ViewModel"
|
||||
@ref="Container"
|
||||
@bind-Search="Search"
|
||||
Title="@Title"
|
||||
Breadcrumbs="@Breadcrumbs"
|
||||
@ref="_container"
|
||||
@bind-Search="_search"
|
||||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync">
|
||||
<Header>
|
||||
<MudTh>
|
||||
|
|
|
|||
|
|
@ -18,17 +18,17 @@ public partial class Index
|
|||
[Inject] private IMongoDatabase Database { get; init; } = default!;
|
||||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
|
||||
private TableContainer<ViewModel>? Container { get; set; }
|
||||
private string Title { get; set; } = Global.Name;
|
||||
private List<BreadcrumbItem> Breadcrumbs { get; } = new();
|
||||
private string? Search { get; set; }
|
||||
private TableContainer<ViewModel>? _container;
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private string? _search;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
Title = $"Inventory » Software|Insight";
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Software", href: "#", true));
|
||||
_title = $"Inventory » Software|Insight";
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Software", href: "#", true));
|
||||
}
|
||||
|
||||
private async Task<TableData<ViewModel>> LoadDataAsync(TableState state)
|
||||
|
|
@ -37,9 +37,9 @@ public partial class Index
|
|||
{
|
||||
var filter = Builders<HostApplicationEntity>.Filter.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Search) is false)
|
||||
if (string.IsNullOrWhiteSpace(_search) is false)
|
||||
{
|
||||
var regex = new BsonRegularExpression(new Regex(Search, RegexOptions.IgnoreCase));
|
||||
var regex = new BsonRegularExpression(new Regex(_search, RegexOptions.IgnoreCase));
|
||||
filter &= Builders<HostApplicationEntity>.Filter.Regex(x => x.Company, regex) |
|
||||
Builders<HostApplicationEntity>.Filter.Regex(x => x.Name, regex);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
@inherits ComponentBase
|
||||
|
||||
<TableContainer T="ViewModel"
|
||||
@ref="Container"
|
||||
@bind-Search="Search"
|
||||
Title="@Title"
|
||||
Breadcrumbs="@Breadcrumbs"
|
||||
@ref="_container"
|
||||
@bind-Search="_search"
|
||||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync">
|
||||
<Header>
|
||||
<MudTh>
|
||||
|
|
@ -87,11 +87,14 @@
|
|||
}
|
||||
</MudTd>
|
||||
<MudTd DataLabel="States">
|
||||
@string.Concat(@context?.States)
|
||||
@if (context.States is not null)
|
||||
{
|
||||
@string.Concat(@context.States)
|
||||
}
|
||||
</MudTd>
|
||||
<MudTd DataLabel="Health">
|
||||
@{
|
||||
var color = Enum.Parse<HealthState>(context?.Health, true) switch
|
||||
var color = Enum.Parse<HealthState>(context.Health ?? string.Empty, true) switch
|
||||
{
|
||||
HealthState.Healthy => Color.Success,
|
||||
HealthState.Warning => Color.Warning,
|
||||
|
|
|
|||
|
|
@ -18,17 +18,17 @@ public partial class Index
|
|||
[Inject] private IMongoDatabase Database { get; init; } = default!;
|
||||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
|
||||
private TableContainer<ViewModel>? Container { get; set; }
|
||||
private string Title { get; set; } = Global.Name;
|
||||
private List<BreadcrumbItem> Breadcrumbs { get; } = new();
|
||||
private string? Search { get; set; }
|
||||
private TableContainer<ViewModel>? _container;
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private string? _search;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
Title = $"Inventory » Storage Pools|Insight";
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Storage Pools", href: "#", true));
|
||||
_title = $"Inventory » Storage Pools|Insight";
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Storage Pools", href: "#", true));
|
||||
}
|
||||
|
||||
private async Task<TableData<ViewModel>> LoadDataAsync(TableState state)
|
||||
|
|
@ -37,9 +37,9 @@ public partial class Index
|
|||
{
|
||||
var search = Builders<BsonDocument>.Filter.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Search) is false)
|
||||
if (string.IsNullOrWhiteSpace(_search) is false)
|
||||
{
|
||||
var regex = new BsonRegularExpression(new Regex(Search, RegexOptions.IgnoreCase));
|
||||
var regex = new BsonRegularExpression(new Regex(_search, RegexOptions.IgnoreCase));
|
||||
search &= Builders<BsonDocument>.Filter.Regex("host.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("customer.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("name", regex) |
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
@inherits ComponentBase
|
||||
|
||||
<TableContainer T="ViewModel"
|
||||
@ref="Container"
|
||||
@bind-Search="Search"
|
||||
Title="@Title"
|
||||
Breadcrumbs="@Breadcrumbs"
|
||||
@ref="_container"
|
||||
@bind-Search="_search"
|
||||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync">
|
||||
<Header>
|
||||
<MudTh>
|
||||
|
|
|
|||
|
|
@ -23,18 +23,18 @@ public partial class Hosts
|
|||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
[Inject] private NavigationManager NavigationManager { get; init; } = default!;
|
||||
|
||||
private TableContainer<ViewModel>? Container { get; set; }
|
||||
private string Title { get; set; } = Global.Name;
|
||||
private List<BreadcrumbItem> Breadcrumbs { get; } = new();
|
||||
private string? Search { get; set; }
|
||||
private TableContainer<ViewModel>? _container;
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private string? _search;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
UpdateName = UpdateName.UriEscape(true);
|
||||
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Update", href: Navigation.Inventory.Systems.Updates.Index));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Update", href: Navigation.Inventory.Systems.Updates.Index));
|
||||
|
||||
if (string.IsNullOrWhiteSpace(UpdateName))
|
||||
{
|
||||
|
|
@ -43,9 +43,9 @@ public partial class Hosts
|
|||
return;
|
||||
}
|
||||
|
||||
Title = $"Inventory » Update » {UpdateName} » Hosts|Insight";
|
||||
Breadcrumbs.Add(new BreadcrumbItem(UpdateName, href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Hosts", href: "#", true));
|
||||
_title = $"Inventory » Update » {UpdateName} » Hosts|Insight";
|
||||
_breadcrumbs.Add(new BreadcrumbItem(UpdateName, href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Hosts", href: "#", true));
|
||||
}
|
||||
|
||||
private async Task<TableData<ViewModel>> LoadDataAsync(TableState state)
|
||||
|
|
@ -54,9 +54,9 @@ public partial class Hosts
|
|||
{
|
||||
var filter = Builders<BsonDocument>.Filter.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Search) is false)
|
||||
if (string.IsNullOrWhiteSpace(_search) is false)
|
||||
{
|
||||
var regex = new BsonRegularExpression(new Regex(Search, RegexOptions.IgnoreCase));
|
||||
var regex = new BsonRegularExpression(new Regex(_search, RegexOptions.IgnoreCase));
|
||||
filter &= Builders<BsonDocument>.Filter.Regex("customer.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("host.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("pending", regex) |
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
@using Insight.Web.Extensions
|
||||
|
||||
<TableContainer T="ViewModel"
|
||||
@ref="Container"
|
||||
@bind-Search="Search"
|
||||
Title="@Title"
|
||||
Breadcrumbs="@Breadcrumbs"
|
||||
@ref="_container"
|
||||
@bind-Search="_search"
|
||||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync">
|
||||
<Header>
|
||||
<MudTh>
|
||||
|
|
|
|||
|
|
@ -18,17 +18,17 @@ public partial class Index
|
|||
[Inject] private IMongoDatabase Database { get; init; } = default!;
|
||||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
|
||||
private TableContainer<ViewModel>? Container { get; set; }
|
||||
private string Title { get; set; } = Global.Name;
|
||||
private List<BreadcrumbItem> Breadcrumbs { get; } = new();
|
||||
private string? Search { get; set; }
|
||||
private TableContainer<ViewModel>? _container;
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private string? _search;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
Title = $"Inventory » Updates|Insight";
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Updates", href: "#", true));
|
||||
_title = $"Inventory » Updates|Insight";
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Updates", href: "#", true));
|
||||
}
|
||||
|
||||
private async Task<TableData<ViewModel>> LoadDataAsync(TableState state)
|
||||
|
|
@ -37,9 +37,9 @@ public partial class Index
|
|||
{
|
||||
var filter = Builders<HostUpdateEntity>.Filter.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Search) is false)
|
||||
if (string.IsNullOrWhiteSpace(_search) is false)
|
||||
{
|
||||
var regex = new BsonRegularExpression(new Regex(Search, RegexOptions.IgnoreCase));
|
||||
var regex = new BsonRegularExpression(new Regex(_search, RegexOptions.IgnoreCase));
|
||||
filter &= Builders<HostUpdateEntity>.Filter.Regex(x => x.Name, regex) |
|
||||
Builders<HostUpdateEntity>.Filter.Regex(x => x.Date, regex);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
@inherits ComponentBase
|
||||
|
||||
<TableContainer T="ViewModel"
|
||||
@ref="Container"
|
||||
@bind-Search="Search"
|
||||
Title="@Title"
|
||||
Breadcrumbs="@Breadcrumbs"
|
||||
@ref="_container"
|
||||
@bind-Search="_search"
|
||||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync">
|
||||
<Header>
|
||||
<MudTh>
|
||||
|
|
|
|||
|
|
@ -23,18 +23,18 @@ public partial class Hosts
|
|||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
[Inject] private NavigationManager NavigationManager { get; init; } = default!;
|
||||
|
||||
private TableContainer<ViewModel>? Container { get; set; }
|
||||
private string Title { get; set; } = Global.Name;
|
||||
private List<BreadcrumbItem> Breadcrumbs { get; } = new();
|
||||
private string? Search { get; set; }
|
||||
private TableContainer<ViewModel>? _container;
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private string? _search;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
UserName = UserName?.UriEscape(true);
|
||||
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Users", href: Navigation.Inventory.Systems.Users.Index));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Users", href: Navigation.Inventory.Systems.Users.Index));
|
||||
|
||||
if (string.IsNullOrWhiteSpace(UserName))
|
||||
{
|
||||
|
|
@ -43,9 +43,9 @@ public partial class Hosts
|
|||
return;
|
||||
}
|
||||
|
||||
Title = $"Inventory » Users » {UserName} » Hosts|Insight";
|
||||
Breadcrumbs.Add(new BreadcrumbItem(UserName, href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Hosts", href: "#", true));
|
||||
_title = $"Inventory » Users » {UserName} » Hosts|Insight";
|
||||
_breadcrumbs.Add(new BreadcrumbItem(UserName, href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Hosts", href: "#", true));
|
||||
}
|
||||
|
||||
private async Task<TableData<ViewModel>> LoadDataAsync(TableState state)
|
||||
|
|
@ -54,9 +54,9 @@ public partial class Hosts
|
|||
{
|
||||
var filter = Builders<BsonDocument>.Filter.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Search) is false)
|
||||
if (string.IsNullOrWhiteSpace(_search) is false)
|
||||
{
|
||||
var regex = new BsonRegularExpression(new Regex(Search, RegexOptions.IgnoreCase));
|
||||
var regex = new BsonRegularExpression(new Regex(_search, RegexOptions.IgnoreCase));
|
||||
filter &= Builders<BsonDocument>.Filter.Regex("customer.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("host.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("domain", regex) |
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
@inherits ComponentBase
|
||||
|
||||
<TableContainer T="ViewModel"
|
||||
@ref="Container"
|
||||
@bind-Search="Search"
|
||||
Title="@Title"
|
||||
Breadcrumbs="@Breadcrumbs"
|
||||
@ref="_container"
|
||||
@bind-Search="_search"
|
||||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync">
|
||||
<Header>
|
||||
<MudTh>
|
||||
|
|
|
|||
|
|
@ -18,17 +18,17 @@ public partial class Index
|
|||
[Inject] private IMongoDatabase Database { get; init; } = default!;
|
||||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
|
||||
private TableContainer<ViewModel>? Container { get; set; }
|
||||
private string Title { get; set; } = Global.Name;
|
||||
private List<BreadcrumbItem> Breadcrumbs { get; } = new();
|
||||
private string? Search { get; set; }
|
||||
private TableContainer<ViewModel>? _container;
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private string? _search;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
Title = $"Inventory » Users|Insight";
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Users", href: "#", true));
|
||||
_title = $"Inventory » Users|Insight";
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Users", href: "#", true));
|
||||
}
|
||||
|
||||
private async Task<TableData<ViewModel>> LoadDataAsync(TableState state)
|
||||
|
|
@ -37,9 +37,9 @@ public partial class Index
|
|||
{
|
||||
var filter = Builders<HostSysUserEntity>.Filter.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Search) is false)
|
||||
if (string.IsNullOrWhiteSpace(_search) is false)
|
||||
{
|
||||
var regex = new BsonRegularExpression(new Regex(Search, RegexOptions.IgnoreCase));
|
||||
var regex = new BsonRegularExpression(new Regex(_search, RegexOptions.IgnoreCase));
|
||||
filter &= Builders<HostSysUserEntity>.Filter.Regex(x => x.Name, regex);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
@inherits ComponentBase
|
||||
|
||||
<TableContainer T="ViewModel"
|
||||
@ref="Container"
|
||||
@bind-Search="Search"
|
||||
Title="@Title"
|
||||
Breadcrumbs="@Breadcrumbs"
|
||||
@ref="_container"
|
||||
@bind-Search="_search"
|
||||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync">
|
||||
<Header>
|
||||
<MudTh>
|
||||
|
|
@ -82,14 +82,14 @@
|
|||
</MudTd>
|
||||
<MudTd DataLabel="Enabled">
|
||||
@{
|
||||
var color = Enum.Parse<EnabledEnum>(context?.Enabled, true) switch
|
||||
var color = Enum.Parse<EnabledEnum>(context.Enabled ?? string.Empty, true) switch
|
||||
{
|
||||
EnabledEnum.Aktiviert => Color.Success,
|
||||
EnabledEnum.Deaktiviert => Color.Error,
|
||||
_ => Color.Inherit
|
||||
};
|
||||
|
||||
var text = Enum.Parse<EnabledEnum>(context?.Enabled, true) switch
|
||||
var text = Enum.Parse<EnabledEnum>(context.Enabled ?? string.Empty, true) switch
|
||||
{
|
||||
EnabledEnum.Aktiviert => "Running",
|
||||
EnabledEnum.Deaktiviert => "Stopped",
|
||||
|
|
@ -103,7 +103,7 @@
|
|||
</MudTd>
|
||||
<MudTd DataLabel="Health">
|
||||
@{
|
||||
var color = Enum.Parse<HealthStatusEnum>(context?.Health, true) switch
|
||||
var color = Enum.Parse<HealthStatusEnum>(context.Health ?? string.Empty, true) switch
|
||||
{
|
||||
HealthStatusEnum.OK => Color.Success,
|
||||
HealthStatusEnum.Hauptfehler => Color.Warning,
|
||||
|
|
|
|||
|
|
@ -18,17 +18,17 @@ public partial class Index
|
|||
[Inject] private IMongoDatabase Database { get; init; } = default!;
|
||||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
|
||||
private TableContainer<ViewModel>? Container { get; set; }
|
||||
private string Title { get; set; } = Global.Name;
|
||||
private List<BreadcrumbItem> Breadcrumbs { get; } = new();
|
||||
private string? Search { get; set; }
|
||||
private TableContainer<ViewModel>? _container;
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private string? _search;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
Title = $"Inventory » Virtual Maschines|Insight";
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Virtual Maschines", href: "#", true));
|
||||
_title = $"Inventory » Virtual Maschines|Insight";
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Virtual Maschines", href: "#", true));
|
||||
}
|
||||
|
||||
private async Task<TableData<ViewModel>> LoadDataAsync(TableState state)
|
||||
|
|
@ -37,9 +37,9 @@ public partial class Index
|
|||
{
|
||||
var search = Builders<BsonDocument>.Filter.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Search) is false)
|
||||
if (string.IsNullOrWhiteSpace(_search) is false)
|
||||
{
|
||||
var regex = new BsonRegularExpression(new Regex(Search, RegexOptions.IgnoreCase));
|
||||
var regex = new BsonRegularExpression(new Regex(_search, RegexOptions.IgnoreCase));
|
||||
search &= Builders<BsonDocument>.Filter.Regex("host.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("customer.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("name", regex) |
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
@inherits ComponentBase
|
||||
|
||||
<TableContainer T="ViewModel"
|
||||
@ref="Container"
|
||||
@bind-Search="Search"
|
||||
Title="@Title"
|
||||
Breadcrumbs="@Breadcrumbs"
|
||||
@ref="_container"
|
||||
@bind-Search="_search"
|
||||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync">
|
||||
<Header>
|
||||
<MudTh>
|
||||
|
|
|
|||
|
|
@ -18,17 +18,17 @@ public partial class Index
|
|||
[Inject] private IMongoDatabase Database { get; init; } = default!;
|
||||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
|
||||
private TableContainer<ViewModel>? Container { get; set; }
|
||||
private string Title { get; set; } = Global.Name;
|
||||
private List<BreadcrumbItem> Breadcrumbs { get; } = new();
|
||||
private string? Search { get; set; }
|
||||
private TableContainer<ViewModel>? _container;
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private string? _search;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
Title = $"Inventory » Volumes|Insight";
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
Breadcrumbs.Add(new BreadcrumbItem("Volumes", href: "#", true));
|
||||
_title = $"Inventory » Volumes|Insight";
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Home", href: Navigation.Home));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Inventory", href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem("Volumes", href: "#", true));
|
||||
}
|
||||
|
||||
private async Task<TableData<ViewModel>> LoadDataAsync(TableState state)
|
||||
|
|
@ -37,9 +37,9 @@ public partial class Index
|
|||
{
|
||||
var search = Builders<BsonDocument>.Filter.Empty;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(Search) is false)
|
||||
if (string.IsNullOrWhiteSpace(_search) is false)
|
||||
{
|
||||
var regex = new BsonRegularExpression(new Regex(Search, RegexOptions.IgnoreCase));
|
||||
var regex = new BsonRegularExpression(new Regex(_search, RegexOptions.IgnoreCase));
|
||||
search &= Builders<BsonDocument>.Filter.Regex("host.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("customer.name", regex) |
|
||||
Builders<BsonDocument>.Filter.Regex("name", regex) |
|
||||
|
|
|
|||
|
|
@ -41,6 +41,8 @@ public partial class AccountCreateDialog
|
|||
return;
|
||||
}
|
||||
|
||||
if (_model.Email is null || _model.Password is null) return;
|
||||
|
||||
var result = await IdentityService.CreateUserAsync(_model.Email, _model.Password);
|
||||
|
||||
if (result.Succeeded is false)
|
||||
|
|
|
|||
|
|
@ -46,9 +46,9 @@ public partial class AccountEditDialog
|
|||
.Eq(p => p.Id, _model.Id), Builders<InsightUser>
|
||||
.Update
|
||||
.Set(p => p.Email, _model.Email)
|
||||
.Set(p => p.NormalizedEmail, _model.Email.ToUpperInvariant())
|
||||
.Set(p => p.NormalizedEmail, _model.Email?.ToUpperInvariant())
|
||||
.Set(p => p.UserName, _model.Email)
|
||||
.Set(p => p.NormalizedUserName, _model.Email.ToUpperInvariant()),
|
||||
.Set(p => p.NormalizedUserName, _model.Email?.ToUpperInvariant()),
|
||||
cancellationToken: default);
|
||||
|
||||
Notification.Success(Snackbar);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ public partial class Details
|
|||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
|
||||
private string _title = Global.Name;
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = new();
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = [];
|
||||
private readonly DetailsModel _model = new();
|
||||
|
||||
private async Task LoadDataAsync()
|
||||
|
|
@ -54,7 +54,7 @@ public partial class Details
|
|||
_model.Roles = user.Roles;
|
||||
|
||||
_title = $"Accounts » {user.UserName}|Insight";
|
||||
_breadcrumbs.Add(new BreadcrumbItem(user.UserName, href: "#", true));
|
||||
_breadcrumbs.Add(new BreadcrumbItem(user.UserName ?? "undefined", href: "#", true));
|
||||
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
Title="@_title"
|
||||
Breadcrumbs="@_breadcrumbs"
|
||||
Data="LoadDataAsync"
|
||||
OnAdd="()=>_createDialog?.ToggleAsync()">
|
||||
OnAdd="()=>_createDialog!.ToggleAsync()">
|
||||
<Header>
|
||||
<MudTh>
|
||||
<MudTableSortLabel SortLabel="Email" T="InsightUser">
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using Insight.Infrastructure.Entities;
|
||||
using Insight.Infrastructure;
|
||||
using Insight.Infrastructure.Entities;
|
||||
using Insight.Infrastructure.Services;
|
||||
using Insight.Web.Components.Containers;
|
||||
using Insight.Web.Constants;
|
||||
|
|
@ -15,18 +16,18 @@ namespace Insight.Web.Pages.Management.Accounts;
|
|||
public partial class Index
|
||||
{
|
||||
[Inject] private IdentityService IdentityService { get; init; } = default!;
|
||||
[Inject] private AccountService AccountService { get; init; } = default!;
|
||||
[Inject] private IServiceScopeFactory ScopeFactory { get; init; } = default!;
|
||||
[Inject] private ISnackbar Snackbar { get; init; } = default!;
|
||||
|
||||
private TableContainer<InsightUser>? _container;
|
||||
private string? _search;
|
||||
|
||||
private readonly string _title = "Accounts|Insight";
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs = new()
|
||||
{
|
||||
private readonly List<BreadcrumbItem> _breadcrumbs =
|
||||
[
|
||||
new BreadcrumbItem(nameof(Navigation.Home), href: Navigation.Home),
|
||||
new BreadcrumbItem(nameof(Navigation.Management.Accounts), href: Navigation.Management.Accounts.Index, disabled: true)
|
||||
};
|
||||
];
|
||||
|
||||
private async Task<TableData<InsightUser>> LoadDataAsync(TableState state)
|
||||
{
|
||||
|
|
@ -61,7 +62,10 @@ public partial class Index
|
|||
_ => Builders<InsightUser>.Sort.Ascending(p => p.Email)
|
||||
};
|
||||
|
||||
var result = await AccountService.GetAsync(filter, sort, state.Page * state.PageSize, state.PageSize).ConfigureAwait(false);
|
||||
using var scope = ScopeFactory.CreateScope();
|
||||
var collection = scope.ServiceProvider.GetRequiredService<IMongoDatabase>().User();
|
||||
|
||||
var result = await collection.GetPagedAsync(filter, sort, state.Page * state.PageSize, state.PageSize).ConfigureAwait(false);
|
||||
|
||||
return new TableData<InsightUser>()
|
||||
{
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue