Compare commits

...

3 commits

Author SHA1 Message Date
Marcel Baumgartner 83f453da3f Switched to new loader 2024-05-26 22:43:16 +02:00
Marcel Baumgartner 61492bc669 Testing display name property 2024-05-23 08:18:10 +02:00
Masu Baumgartner 6264a15b1d Testing and developing new mooncore features with moonlight as a test env 2024-05-22 16:57:37 +02:00
5 changed files with 286 additions and 10 deletions

View file

@ -0,0 +1,160 @@
@page "/test"
<div class="card card-body mb-5 p-3">
<div class="row">
<div class="col-6 col-md-3">
<div class="input-group">
<span class="input-group-text">
<i class="bx bx-sm bx-search-alt"></i>
</span>
<input placeholder="Search" class="form-control"/>
</div>
</div>
<div class="col-6 col-md-9">
<div class="text-end">
<div class="btn-group dropstart">
<!--!-->
<button class="btn btn-icon btn-secondary rounded" type="button" id="defaultDropdown" data-bs-toggle="dropdown" data-bs-auto-close="true" aria-expanded="false">
<i class="bx bx-sm bx-filter-alt"></i>
</button>
<div class="dropdown-menu py-1 px-2 fs-5 me-2 bg-secondary" style="min-width: 15rem">
<div class="my-2 text-center">
<!--!-->
<div class="mt-auto">
<input id="Id" type="number" class="form-control ">
</div>
</div>
<div class="my-2 text-center">
<!--!-->
<div class="mt-auto">
<div class="w-100">
<input id="Email" type="text" class="form-control " placeholder="Email" autocomplete="off" spellcheck="false">
</div>
</div>
</div>
<div class="my-2 text-center">
<!--!-->
<div class="mt-auto">
<div class="w-100">
<input id="Username" type="text" class="form-control " placeholder="Username" autocomplete="off" spellcheck="false">
</div>
</div>
</div>
<div class="my-2 text-center">
<!--!-->
<button class="btn btn btn-primary" type="button">
Apply<!--!-->
</button>
</div>
</div>
</div>
<button type="button" class="btn btn-primary ms-3">
<span>Create User</span>
</button>
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-body pt-3 px-5 pb-4">
<div class="table-responsive mb-3">
<table class="table table-row-bordered table-row-gray-200 align-middle gs-0 gy-3 fs-6 table-rounded">
<!--!--><!--!--><!--!-->
<!--!--><!--!-->
<!--!--><!--!-->
<!--!--><!--!-->
<!--!--><!--!-->
<thead class="fw-bold text-muted">
<tr>
<th class="w-10px align-middle">
<div class="form-check">
<input class="form-check-input" type="checkbox" value="0">
</div>
</th>
<th class="fw-bold">Id</th>
<th class="fw-bold">Email</th>
<th class="fw-bold">Username</th>
<th class="fw-bold">Created at</th>
<th></th>
</tr>
</thead><!--!-->
<tbody>
@for (var i = 1; i <= 10; i++)
{
<tr>
<td class="w-10px align-middle">
<div class="form-check my-1">
<input class="form-check-input" type="checkbox" value="0">
</div>
</td>
<td class="">@(i)</td>
<td class="">admin@masuowo.xyz@(i)</td>
<td class="">masuowo@(i)</td>
<td class="">04/19/2024 12:48:35</td>
<td class="py-1 my-0">
<div class="text-end text-nowrap me-3 fw-semibold">
<a href="#"><i class="bx bx-edit"></i> Edit</a>
</div>
</td>
</tr>
}
</tbody>
</table>
</div>
<div class="d-flex justify-content-between align-items-center mx-2">
<div class="d-none d-lg-block">
<span class="text-gray-600 fs-5">Showing 13 of 100 results</span>
</div>
<div>
<div class="input-group input-group-sm">
<span class="input-group-text">Per page</span>
<select class="form-select">
<option selected="selected">10</option>
<option>25</option>
<option>50</option>
<option>100</option>
</select>
</div>
</div>
<div>
<ul class="pagination">
<li class="page-item previous disabled"><a href="#" class="page-link"><i class="previous"></i></a></li>
<li class="page-item "><a href="#" class="page-link">1</a></li>
<li class="page-item active"><a href="#" class="page-link">2</a></li>
<li class="page-item "><a href="#" class="page-link">3</a></li>
<li class="page-item next"><a href="#" class="page-link"><i class="next"></i></a></li>
</ul>
</div>
</div>
</div>
</div>
@*
<div class="my-5"></div>
<div class="input-group mb-5">
<input type="text" class="form-control">
</div>
<div class="input-group has-validation mb-5">
<input type="text" class="form-control is-invalid">
<div class="invalid-feedback">
Please choose a username.
</div>
</div>*@
<WButton Text="Do something" CssClasses="btn-primary" OnClick="Do"></WButton>
@code
{
private async Task Do()
{
await Task.Delay(5000);
}
}

View file

@ -0,0 +1,110 @@
@page "/testy"
<div class="card card-body mb-8">
<div class="d-flex justify-content-between align-items-center">
<a href="#" class="text-body fs-4">
<i class="bx bx-md bx-chevron-left align-middle"></i>
<span class="align-middle">Back</span>
</a>
<button class="btn btn-primary">Create</button>
</div>
</div>
<div class="card mb-6">
<div class="card-body">
<div class="row g-8">
<div class="col-12 col-md-6">
<label class="form-label">Default input</label>
<input type="text" class="form-control" placeholder="name@example.com"/>
<div class="form-text fs-6 text-gray-600">
dasdfuoiusefiousidfhzuigfzduzfgiudzfogzidufzgduifzguisdzugzduifhgjkdsgkdfh
</div>
</div>
<div class="col-12 col-md-3">
<label class="form-label">Default input</label>
<input type="number" class="form-control" value="10324"/>
<div class="form-text fs-6 text-gray-600">
dasdfuoiusefiousidfhzuigfzduzfgiudzfogzidufzgduifzguisdzugzduifhgjkdsgkdfh
</div>
</div>
<div class="col-12 col-md-12">
<label class="form-label">Default input</label>
<textarea class="form-control"></textarea>
<div class="form-text fs-6 text-gray-600">
dasdfuoiusefiousidfhzuigfzduzfgiudzfogzidufzgduifzguisdzugzduifhgjkdsgkdfh
</div>
</div>
<div class="col-12 col-md-3">
<label class="form-label">Default input</label>
<div class="btn-group w-100">
<label class="btn btn-outline btn-color-muted btn-active-primary">
<input class="btn-check" type="radio" name="method" value="1" />
<i class="bx bx-sm bx-lock-open-alt"></i>
HTTP
</label>
<label class="btn btn-outline btn-color-muted btn-active-primary">
<input class="btn-check" type="radio" name="method" value="1" />
<i class="bx bx-sm bx-lock-alt"></i>
HTTPS
</label>
</div>
<div class="form-text fs-6 text-gray-600">
dasdfuoiusefiousidfhzuigfzduzfgiudzfogzidufzgduifzguisdzugzduifhgjkdsgkdfh
</div>
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header">
<div class="card-title">
<i class="bx bx-md bx-server text-primary me-3 align-middle"></i>
<span class="h3 align-middle">Some Section</span>
</div>
</div>
<div class="card-body">
<div class="row g-8">
<div class="col-12 col-md-6">
<label class="form-label">Default input</label>
<input type="text" class="form-control" placeholder="name@example.com"/>
<div class="form-text fs-6 text-gray-600">
dasdfuoiusefiousidfhzuigfzduzfgiudzfogzidufzgduifzguisdzugzduifhgjkdsgkdfh
</div>
</div>
<div class="col-12 col-md-3">
<label class="form-label">Default input</label>
<input type="number" class="form-control" value="10324"/>
<div class="form-text fs-6 text-gray-600">
dasdfuoiusefiousidfhzuigfzduzfgiudzfogzidufzgduifzguisdzugzduifhgjkdsgkdfh
</div>
</div>
<div class="col-12 col-md-3">
<label class="form-label">Default input</label>
<div class="btn-group w-100">
<label class="btn btn-outline btn-color-muted btn-active-primary">
<input class="btn-check" type="radio" name="method" value="1"/>
<i class="bx bx-sm bx-lock-open-alt"></i>
HTTP
</label>
<label class="btn btn-outline btn-color-muted btn-active-primary">
<input class="btn-check" type="radio" name="method" value="1"/>
<i class="bx bx-sm bx-lock-alt"></i>
HTTPS
</label>
</div>
<div class="form-text fs-6 text-gray-600">
dasdfuoiusefiousidfhzuigfzduzfgiudzfogzidufzgduifzguisdzugzduifhgjkdsgkdfh
</div>
</div>
</div>
</div>
</div>

View file

@ -21,27 +21,29 @@ public class CreateServerForm
[Range(1, int.MaxValue, ErrorMessage = "Enter a valid cpu value")]
[Description("The cores the server will be able to use. 100 = 1 Core")]
[Section("Resources")]
[Section("Resources", Icon = "bxs-chip")]
public int Cpu { get; set; }
[Range(1, int.MaxValue, ErrorMessage = "Enter a valid memory value")]
[Description("The amount of memory this server will be able to use")]
[ByteSize(MinimumUnit = 1, Converter = 1, DefaultUnit = 2)]
[Section("Resources")]
[Section("Resources", Icon = "bxs-chip")]
public int Memory { get; set; }
[Range(1, int.MaxValue, ErrorMessage = "Enter a valid disk value")]
[Description("The amount of disk space this server will be able to use")]
[ByteSize(MinimumUnit = 1, Converter = 1, DefaultUnit = 2)]
[Section("Resources")]
[Section("Resources", Icon = "bxs-chip")]
public int Disk { get; set; }
[Description("Whether to use a virtual disk for storing server files. Dont use this if you want to overallocate as the virtual disks will fill out the space you allocate")]
[Section("Deployment")]
[Section("Deployment", Icon = "bx-cube")]
[RadioButtonBool("Virtual Disk", "Simple Volume", TrueIcon = "bxs-hdd", FalseIcon = "bxs-data")]
[DisplayName("Storage")]
public bool UseVirtualDisk { get; set; }
[Required(ErrorMessage = "You need to specify a server node")]
[Selector(SelectorProp = "Name", DisplayProp = "Name", UseDropdown = true)]
[Section("Deployment")]
[Section("Deployment", Icon = "bx-cube")]
public ServerNode Node { get; set; }
}

View file

@ -19,7 +19,7 @@
TCreateForm="CreateServerForm"
TUpdateForm="CreateServerForm"
Title=""
Load="Load"
Loader="Load"
CustomAdd="CustomAdd"
ValidateUpdate="ValidateUpdate"
CustomDelete="CustomDelete">
@ -51,14 +51,13 @@
@code
{
private Server[] Load(Repository<Server> repository)
private IEnumerable<Server> Load(Repository<Server> repository)
{
return repository
.Get()
.Include(x => x.Owner)
.Include(x => x.Image)
.Include(x => x.Node)
.ToArray();
.Include(x => x.Node);
}
private async Task CustomAdd(Server form) => await ServerService.Create(form);

View file

@ -92,10 +92,15 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="MoonCore" Version="1.3.3" />
<PackageReference Include="MoonCoreUI" Version="1.1.7" />
<PackageReference Include="Otp.NET" Version="1.3.0" />
<PackageReference Include="QRCoder" Version="1.4.3" />
<PackageReference Include="XtermBlazor" Version="1.10.2" />
<PackageReference Include="Z.Blazor.Diagrams" Version="3.0.2" />
</ItemGroup>
<ItemGroup>
<Reference Include="MoonCoreUI">
<HintPath>..\..\..\Masu-Baumgartner\MoonCore\MoonCore\MoonCoreUI\bin\Debug\net7.0\MoonCoreUI.dll</HintPath>
</Reference>
</ItemGroup>
</Project>