Mark subproject as dirty in CMKS - Infra
This commit is contained in:
108
src/EntKube.Web/Components/Pages/Tenants/TenantDetail.razor
Normal file
108
src/EntKube.Web/Components/Pages/Tenants/TenantDetail.razor
Normal file
@@ -0,0 +1,108 @@
|
||||
@page "/tenants/{Slug}"
|
||||
@using EntKube.Web.Data
|
||||
@using EntKube.Web.Services
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@rendermode InteractiveServer
|
||||
@inject TenantService TenantService
|
||||
@inject NavigationManager Navigation
|
||||
|
||||
<PageTitle>@(tenant?.Name ?? "Tenant")</PageTitle>
|
||||
|
||||
@if (tenant is null)
|
||||
{
|
||||
<div class="text-center py-5">
|
||||
<div class="spinner-border text-primary" role="status"></div>
|
||||
<p class="text-muted mt-2">Loading tenant...</p>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<nav aria-label="breadcrumb" class="mb-3">
|
||||
<ol class="breadcrumb small">
|
||||
<li class="breadcrumb-item"><a href="/tenants" class="text-decoration-none"><i class="bi bi-building me-1"></i>Tenants</a></li>
|
||||
<li class="breadcrumb-item active">@tenant.Name</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
<div class="d-flex align-items-center mb-4">
|
||||
<i class="bi bi-building fs-3 me-2 text-primary"></i>
|
||||
<div>
|
||||
<h2 class="mb-0">@tenant.Name</h2>
|
||||
<small class="text-muted"><code>@tenant.Slug</code></small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ul class="nav nav-pills mb-4 gap-1">
|
||||
<li class="nav-item">
|
||||
<button class="nav-link @(activeTab == "environments" ? "active" : "")" @onclick='() => activeTab = "environments"'>
|
||||
<i class="bi bi-layers me-1"></i>Environments
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button class="nav-link @(activeTab == "customers" ? "active" : "")" @onclick='() => activeTab = "customers"'>
|
||||
<i class="bi bi-people me-1"></i>Customers
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button class="nav-link @(activeTab == "vault" ? "active" : "")" @onclick='() => activeTab = "vault"'>
|
||||
<i class="bi bi-shield-lock me-1"></i>Vault
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button class="nav-link @(activeTab == "groups" ? "active" : "")" @onclick='() => activeTab = "groups"'>
|
||||
<i class="bi bi-diagram-3 me-1"></i>Groups
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button class="nav-link @(activeTab == "databases" ? "active" : "")" @onclick='() => activeTab = "databases"'>
|
||||
<i class="bi bi-database me-1"></i>Databases
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button class="nav-link @(activeTab == "storage" ? "active" : "")" @onclick='() => activeTab = "storage"'>
|
||||
<i class="bi bi-bucket me-1"></i>Storage
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
@switch (activeTab)
|
||||
{
|
||||
case "environments":
|
||||
<EnvironmentTab TenantId="tenant.Id" />
|
||||
break;
|
||||
case "customers":
|
||||
<CustomerTab TenantId="tenant.Id" />
|
||||
break;
|
||||
case "vault":
|
||||
<VaultTab TenantId="tenant.Id" />
|
||||
break;
|
||||
case "groups":
|
||||
<GroupTab TenantId="tenant.Id" />
|
||||
break;
|
||||
case "databases":
|
||||
<DatabaseTab TenantId="tenant.Id" />
|
||||
break;
|
||||
case "storage":
|
||||
<StorageTab TenantId="tenant.Id" />
|
||||
break;
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
@code {
|
||||
[Parameter] public string Slug { get; set; } = "";
|
||||
|
||||
private Tenant? tenant;
|
||||
private string activeTab = "environments";
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
tenant = await TenantService.GetTenantBySlugAsync(Slug);
|
||||
|
||||
if (tenant is null)
|
||||
{
|
||||
Navigation.NavigateTo("/tenants");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user