mirror of https://github.com/abpframework/abp
parent
6151e282eb
commit
b0a1a0d9c9
@ -0,0 +1,85 @@
|
||||
@using Microsoft.Extensions.Localization
|
||||
@using Volo.Abp.FeatureManagement.Localization
|
||||
@using Volo.Abp.Validation.StringValues
|
||||
@inject IStringLocalizer<AbpFeatureManagementResource> L
|
||||
|
||||
<Modal @ref="_modal">
|
||||
<ModalBackdrop />
|
||||
<ModalContent Size="ModalSize.Large" IsCentered="true">
|
||||
<ModalHeader>
|
||||
<ModalTitle>@L["Features"]</ModalTitle>
|
||||
<CloseButton Clicked="CloseModal" />
|
||||
</ModalHeader>
|
||||
<ModalBody MaxHeight="50">
|
||||
@if (_groups == null)
|
||||
{
|
||||
<span>@L["NoFeatureFoundMessage"]</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<Tabs TabPosition="TabPosition.Left" Pills="true" SelectedTab="@GetNormalizedGroupName(_groups.First().Name)">
|
||||
<Items>
|
||||
@foreach (var group in _groups)
|
||||
{
|
||||
<Tab Name="@GetNormalizedGroupName(group.Name)">
|
||||
<span>@group.DisplayName</span>
|
||||
</Tab>
|
||||
}
|
||||
</Items>
|
||||
<Content>
|
||||
@foreach (var group in _groups)
|
||||
{
|
||||
<TabPanel Name="@GetNormalizedGroupName(group.Name)">
|
||||
<h4>@group.DisplayName</h4>
|
||||
|
||||
@foreach (var feature in group.Features)
|
||||
{
|
||||
var disabled = IsDisabled(feature.Provider.Name);
|
||||
|
||||
if (feature.ValueType is FreeTextStringValueType)
|
||||
{
|
||||
<Field>
|
||||
<FieldLabel>@feature.DisplayName</FieldLabel>
|
||||
<TextEdit Disabled="@disabled" @bind-text="@feature.Value" />
|
||||
@if (feature.Description != null)
|
||||
{
|
||||
<span>@feature.Description</span>
|
||||
}
|
||||
</Field>
|
||||
}
|
||||
|
||||
if (feature.ValueType is SelectionStringValueType)
|
||||
{
|
||||
var items = ((SelectionStringValueType) feature.ValueType).ItemSource.Items;
|
||||
|
||||
<Field>
|
||||
<FieldLabel>@feature.DisplayName</FieldLabel>
|
||||
<Select TValue="string" SelectedValue="feature.Value">
|
||||
@foreach (var item in items)
|
||||
{
|
||||
<SelectItem Value="@item.Value">@item.DisplayText</SelectItem>
|
||||
}
|
||||
</Select>
|
||||
</Field>
|
||||
}
|
||||
|
||||
if (feature.ValueType is ToggleStringValueType)
|
||||
{
|
||||
<Field>
|
||||
<Check TValue="bool" @bind-checked="@ToggleValues[feature.Name]">@feature.DisplayName</Check>
|
||||
</Field>
|
||||
}
|
||||
}
|
||||
|
||||
</TabPanel>
|
||||
}
|
||||
</Content>
|
||||
</Tabs>
|
||||
}
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
<Button Color="Color.Secondary" Clicked="CloseModal">@L["Cancel"]</Button>
|
||||
<Button Color="Color.Primary" Clicked="SaveAsync">@L["Save"]</Button>
|
||||
</ModalFooter>
|
||||
</ModalContent>
|
||||
</Modal>
|
@ -0,0 +1,29 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
||||
|
||||
<Import Project="..\..\..\..\configureawait.props" />
|
||||
<Import Project="..\..\..\..\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.1</TargetFramework>
|
||||
<RazorLangVersion>3.0</RazorLangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.Components.WebAssembly.Theming\Volo.Abp.AspNetCore.Components.WebAssembly.Theming.csproj" />
|
||||
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AutoMapper\Volo.Abp.AutoMapper.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Volo.Abp.FeatureManagement.HttpApi.Client\Volo.Abp.FeatureManagement.HttpApi.Client.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Update="_Imports.razor">
|
||||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
||||
</Content>
|
||||
<Content Update="Components\FeatureManagementModal.razor">
|
||||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
Loading…
Reference in new issue