Merge pull request #45 from Moonlight-Panel/DomainOverview

Domain overview
This commit is contained in:
Daniel Balk 2023-04-06 02:03:20 +02:00 committed by GitHub
commit 8b1a3df2b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 56 additions and 7 deletions

View file

@ -60,7 +60,7 @@
<input class="form-control" type="number" placeholder="@(SmartTranslateService.Translate("Priority"))" @bind="NewRecord.Priority"/>
</div>
</div>
<div class="d-flex">
<div class="d-flex me-2">
<div class="mt-3 ms-auto">
<WButton Text="@(SmartTranslateService.Translate("Add"))"
WorkingText="@(SmartTranslateService.Translate("Adding"))"
@ -79,7 +79,7 @@
<div class="separator"></div>
<div class="accordion-item">
<h2 class="accordion-header" id="heading@(record.Id)">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapse@(record.Id)" aria-expanded="false" aria-controls="collapse@(record.Id)">
<button class="accordion-button ps-6 collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapse@(record.Id)" aria-expanded="false" aria-controls="collapse@(record.Id)">
<div class="row w-100">
<div class="ms-5 col">
@(record.Type.ToString().ToUpper())
@ -103,7 +103,7 @@
</button>
</h2>
<div id="collapse@(record.Id)" class="accordion-collapse collapse" aria-labelledby="heading@(record.Id)" data-bs-parent="#accordionDomain">
<div class="accordion-body">
<div class="accordion-body ms-3 me-3">
<div class="w-100 d-flex flex-row justify-content-between align-items-center">
<div class="p-2">
<input class="form-control" type="text" value="@(record.Type.ToString().ToUpper())" disabled=""/>
@ -129,8 +129,8 @@
</div>
</div>
<div class="separator mx-5"></div>
<div class="accordion-body">
<div class="d-flex">
<div class="accordion-body me-0 ms-5">
<div class="d-flex me-2">
<div class="me-auto">
<WButton Text="@(SmartTranslateService.Translate("Delete"))"
WorkingText="@(SmartTranslateService.Translate("Deleting"))"
@ -138,9 +138,9 @@
OnClick="() => Delete(record)">
</WButton>
</div>
<div>
<div class="me-3 ms-3">
<button class="btn btn-light" data-bs-toggle="collapse" data-bs-target="#collapse@(record.Id)">
<TL>Cancle</TL>
<TL>Cancel</TL>
</button>
<WButton Text="@(SmartTranslateService.Translate("Save"))"
WorkingText="@(SmartTranslateService.Translate("Saving"))"

View file

@ -1,2 +1,51 @@
@page "/domains"
@using Moonlight.App.Repositories.Domains
@using Moonlight.App.Database.Entities
@using Microsoft.EntityFrameworkCore
@using BlazorTable
@using Moonlight.App.Services
@using domain = Moonlight.App.Database.Entities.Domain
@inject DomainRepository DomainRepository
@inject DomainService DomainService
@inject SmartTranslateService SmartTranslateService
<LazyLoader Load="Load">
@foreach (var domain in domains)
{
<div class="row px-5 mb-5">
<div class="card card-body">
<div class="row">
<div class="col">
<div class="d-flex align-items-center">
<div class="symbol symbol-50px me-3">
<i class="bx bx-md bx-purchase-tag"></i>
</div>
<div class="d-flex justify-content-start flex-column">
<a href="/domain/@domain.Id" class="text-gray-800 text-hover-primary mb-1 fs-5">@domain.Name.@domain.SharedDomain.Name</a>
</div>
</div>
</div>
</div>
</div>
</div>
}
</LazyLoader>
@code {
[CascadingParameter]
public User? User { get; set; }
private domain[] domains { get; set; }
public async Task Load(LazyLoader loader)
{
domains = DomainRepository
.Get()
.Include(x => x.SharedDomain)
.Include(x => x.Owner)
.Where(x => x.Owner == User)
.ToArray();
}
}