You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
79 lines
3.5 KiB
79 lines
3.5 KiB
@using AntDesign
|
|
@using Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme
|
|
@using Microsoft.AspNetCore.Components
|
|
@using Microsoft.Extensions.Localization
|
|
@using Microsoft.Extensions.Options
|
|
@using Volo.Abp.Validation.StringValues
|
|
@inherits AbpFeatureManagementComponentBase
|
|
<Modal Title="@L["Features"]"
|
|
Visible="@_visible"
|
|
OnOk="@SaveAsync"
|
|
OnCancel="@CloseModal" Style="min-width: 700px">
|
|
|
|
@if (_visible)
|
|
{
|
|
@if (Groups == null || !Groups.Any())
|
|
{
|
|
<Empty Description="false" />
|
|
}
|
|
else
|
|
{
|
|
<Tabs TabPosition="@TabPosition.Left">
|
|
@foreach (var group in Groups)
|
|
{
|
|
<TabPane Key="@GetNormalizedGroupName(group.Name)" Tab="@group.DisplayName">
|
|
<h4>@group.DisplayName</h4>
|
|
<Divider/>
|
|
|
|
@foreach (var feature in group.Features)
|
|
{
|
|
var disabled = IsDisabled(feature.Provider.Name);
|
|
|
|
<div style="@GetFeatureStyles(feature)">
|
|
|
|
|
|
@if (feature.ValueType is FreeTextStringValueType)
|
|
{
|
|
<Text>@feature.DisplayName</Text>
|
|
<Input
|
|
TValue="string"
|
|
Disabled="@disabled"
|
|
@bind-Value="@feature.Value"
|
|
OnChange=" args => OnFeatureValueChangedAsync(args, feature)"/>
|
|
@if (feature.Description != null)
|
|
{
|
|
<span>@feature.Description</span>
|
|
}
|
|
}
|
|
|
|
@if (feature.ValueType is SelectionStringValueType type)
|
|
{
|
|
var items = type.ItemSource.Items;
|
|
<Select DataSource="@items"
|
|
@bind-Value="@SelectionStringValues[feature.Name]"
|
|
LabelName="@nameof(ISelectionStringValueItem.DisplayText)"
|
|
ValueName="@nameof(ISelectionStringValueItem.Value)"
|
|
DefaultActiveFirstItem="false">
|
|
<ItemTemplate>
|
|
<span>@CreateStringLocalizer(context.DisplayText.ResourceName).GetString(context.DisplayText.Name)</span>
|
|
</ItemTemplate>
|
|
</Select>
|
|
}
|
|
|
|
@if (feature.ValueType is ToggleStringValueType)
|
|
{
|
|
<Checkbox
|
|
Disabled="@disabled"
|
|
@bind-Checked="@ToggleValues[feature.Name]"
|
|
OnChange="b => OnSelectedValueChangedAsync(b, feature)">
|
|
@feature.DisplayName
|
|
</Checkbox>
|
|
}
|
|
</div>
|
|
}
|
|
</TabPane>
|
|
}
|
|
</Tabs>
|
|
}
|
|
}
|
|
</Modal>
|
|
|