Fix display of system scripts table
This commit is contained in:
parent
20731f355a
commit
f242f66813
4 changed files with 39 additions and 34 deletions
|
|
@ -10,7 +10,7 @@ namespace LANCommander.Server.UI.Components
|
|||
public class BoundDataColumn<TItem, TProp> : AntDesign.Column<TProp>
|
||||
{
|
||||
[Parameter]
|
||||
public Expression<Func<TItem, TProp>> Property { get; set; } = default!;
|
||||
public Expression<Func<TItem, TProp>>? Property { get; set; } = default!;
|
||||
|
||||
[Parameter]
|
||||
public string Include { get; set; } = default!;
|
||||
|
|
@ -21,7 +21,7 @@ namespace LANCommander.Server.UI.Components
|
|||
[CascadingParameter]
|
||||
public Dictionary<int, bool> ColumnVisibility { get; set; } = default!;
|
||||
|
||||
[CascadingParameter]
|
||||
[CascadingParameter(Name = "Includes")]
|
||||
public List<string> Includes { get; set; } = default!;
|
||||
|
||||
protected override void OnInitialized()
|
||||
|
|
|
|||
|
|
@ -16,31 +16,34 @@
|
|||
@inject NavigationManager NavigationManager
|
||||
@inject DrawerService DrawerService
|
||||
|
||||
<CascadingValue Value="this">
|
||||
<Flex Justify="FlexJustify.SpaceBetween" Class="table-toolbar">
|
||||
<Flex Gap="FlexGap.Small" Justify="FlexJustify.Start">
|
||||
@if (Searchable)
|
||||
{
|
||||
<Search Placeholder="Search" OnChange="SearchChanged" @bind-Value="Search" Style="width: auto;" />
|
||||
}
|
||||
<CascadingValue Name="DataTable" Value="@this">
|
||||
@if (Searchable || ColumnPicker || LeftToolbar != null || RightToolbar != null)
|
||||
{
|
||||
<Flex Justify="FlexJustify.SpaceBetween" Class="table-toolbar">
|
||||
<Flex Gap="FlexGap.Small" Justify="FlexJustify.Start">
|
||||
@if (Searchable)
|
||||
{
|
||||
<Search Placeholder="Search" OnChange="SearchChanged" @bind-Value="Search" Style="width: auto;"/>
|
||||
}
|
||||
|
||||
@if (ColumnPicker)
|
||||
{
|
||||
<Button Icon="@IconType.Outline.Control" Type="@ButtonType.Text" OnClick="OpenDrawer"/>
|
||||
}
|
||||
@if (ColumnPicker)
|
||||
{
|
||||
<Button Icon="@IconType.Outline.Control" Type="@ButtonType.Text" OnClick="OpenDrawer"/>
|
||||
}
|
||||
|
||||
@LeftToolbar
|
||||
</Flex>
|
||||
|
||||
@if (RightToolbar != null)
|
||||
{
|
||||
<Flex Gap="FlexGap.Small" Style="flex-grow: 1" Justify="FlexJustify.End">
|
||||
@RightToolbar
|
||||
@LeftToolbar
|
||||
</Flex>
|
||||
}
|
||||
</Flex>
|
||||
|
||||
<CascadingValue Value="Includes" IsFixed>
|
||||
@if (RightToolbar != null)
|
||||
{
|
||||
<Flex Gap="FlexGap.Small" Style="flex-grow: 1" Justify="FlexJustify.End">
|
||||
@RightToolbar
|
||||
</Flex>
|
||||
}
|
||||
</Flex>
|
||||
}
|
||||
|
||||
<CascadingValue Name="Includes" Value="Includes" IsFixed>
|
||||
<CascadingValue Value="ColumnVisibility" IsFixed>
|
||||
<div id="@Id" class="ant-table-visibility-container">
|
||||
@RenderBase()
|
||||
|
|
@ -60,8 +63,8 @@
|
|||
</style>
|
||||
|
||||
@code {
|
||||
[Parameter] public RenderFragment LeftToolbar { get; set; }
|
||||
[Parameter] public RenderFragment RightToolbar { get; set; }
|
||||
[Parameter] public RenderFragment? LeftToolbar { get; set; }
|
||||
[Parameter] public RenderFragment? RightToolbar { get; set; }
|
||||
[Parameter] public RenderFragment<TItem> Columns { get; set; }
|
||||
[Parameter] public RenderFragment Actions { get; set; }
|
||||
[Parameter] public bool Searchable { get; set; }
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
@inherits FeedbackComponent<IEnumerable<DataTableColumn>, IEnumerable<DataTableColumn>>
|
||||
@namespace LANCommander.Server.UI.Components
|
||||
|
||||
<Flex Vertical Justify="FlexJustify.SpaceBetween" Style="height: 100%;">
|
||||
<Flex Direction="FlexDirection.Vertical" Justify="FlexJustify.SpaceBetween" Style="height: 100%;">
|
||||
<Space Direction="SpaceDirection.Vertical">
|
||||
@foreach (var column in Options)
|
||||
{
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
}
|
||||
</Space>
|
||||
|
||||
<Button Type="ButtonType.Primary" Block OnClick="Apply">Apply</Button>
|
||||
<Button Type="@ButtonType.Primary" Block OnClick="Apply">Apply</Button>
|
||||
</Flex>
|
||||
|
||||
@code {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,11 @@
|
|||
@inject SettingsProvider<Settings> SettingsProvider
|
||||
@attribute [Authorize(Roles = RoleService.AdministratorRoleName)]
|
||||
|
||||
<PageHeader Title="Scripts" />
|
||||
<PageHeader Title="Scripts">
|
||||
<PageHeaderExtra>
|
||||
<Button OnClick="Save" Type="@ButtonType.Primary">Save</Button>
|
||||
</PageHeaderExtra>
|
||||
</PageHeader>
|
||||
|
||||
<PageContent>
|
||||
<Form Model="Settings.Value" Layout="@FormLayout.Vertical">
|
||||
|
|
@ -16,17 +20,15 @@
|
|||
<Switch @bind-Checked="context.Server.Scripts.EnableAutomaticRepackaging" />
|
||||
</FormItem>
|
||||
<FormItem Label="Repackage Every">
|
||||
<Flex Direction="FlexDirection.Horizontal">
|
||||
<AntDesign.InputNumber @bind-Value="context.Server.Scripts.RepackageEvery" Min="1" DefaultValue="25" />
|
||||
<Flex Direction="FlexDirection.Horizontal" Gap="FlexGap.Small" Align="FlexAlign.Center">
|
||||
<AntDesign.InputNumber @bind-Value="context.Server.Scripts.RepackageEvery" Min="1" DefaultValue="24" />
|
||||
<Text>Hours</Text>
|
||||
</Flex>
|
||||
</FormItem>
|
||||
|
||||
<FormItem>
|
||||
<Button OnClick="Save" Type="@ButtonType.Primary">Save</Button>
|
||||
</FormItem>
|
||||
</Form>
|
||||
|
||||
<Divider Text="System Scripts" />
|
||||
|
||||
<ScriptEditor AllowedTypes="new[] { ScriptType.UserLogin, ScriptType.UserRegistration }"/>
|
||||
</PageContent>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue