Implemented template crud, db entities, import/export, ptero and pelican import
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
@using LucideBlazor
|
||||
@using ShadcnBlazor.Inputs
|
||||
@using ShadcnBlazor.Tabels
|
||||
@using ShadcnBlazor.Buttons
|
||||
|
||||
@inherits Editor<List<string>>
|
||||
|
||||
<div class="rounded-md bg-card shadow-sm border">
|
||||
<Table>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
<TableHead>
|
||||
Online Text
|
||||
</TableHead>
|
||||
<TableHead ClassName="w-10"/>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
@foreach (var command in Value)
|
||||
{
|
||||
<TableRow
|
||||
@key="command">
|
||||
<TableCell>
|
||||
<TextInputField Value="@command"
|
||||
ValueExpression="() => command" disabled/>
|
||||
</TableCell>
|
||||
<TableCell ClassName="text-right pr-4">
|
||||
<Button @onclick="() => DeleteAsync(command)"
|
||||
Size="ButtonSize.Icon"
|
||||
Variant="ButtonVariant.Destructive">
|
||||
<Trash2Icon/>
|
||||
</Button>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
}
|
||||
<TableRow>
|
||||
<TableCell colspan="999999">
|
||||
<div class="flex justify-end gap-1">
|
||||
<TextInputField ClassName="h-8"
|
||||
@bind-Value="Input"
|
||||
placeholder="Enter text..." />
|
||||
<Button
|
||||
@onclick="AddAsync"
|
||||
Variant="ButtonVariant.Outline"
|
||||
Size="ButtonSize.Sm">
|
||||
<PlusIcon/>
|
||||
Add Online Text
|
||||
</Button>
|
||||
</div>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
</Table>
|
||||
</div>
|
||||
|
||||
@code
|
||||
{
|
||||
private string Input;
|
||||
|
||||
private async Task DeleteAsync(string command)
|
||||
{
|
||||
Value.Remove(command);
|
||||
await ValueChanged.InvokeAsync(Value);
|
||||
}
|
||||
|
||||
private async Task AddAsync()
|
||||
{
|
||||
if(string.IsNullOrEmpty(Input))
|
||||
return;
|
||||
|
||||
if(Value.Contains(Input))
|
||||
return;
|
||||
|
||||
Value.Add(Input);
|
||||
Input = "";
|
||||
await ValueChanged.InvokeAsync(Value);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user