mirror of https://github.com/abpframework/abp.git
csharpabpc-sharpframeworkblazoraspnet-coredotnet-coreaspnetcorearchitecturesaasdomain-driven-designangularmulti-tenancy
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.
137 lines
8.3 KiB
137 lines
8.3 KiB
@page
|
|
@using Microsoft.AspNetCore.Mvc.Localization
|
|
@using Microsoft.Extensions.Localization
|
|
@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal
|
|
@using Volo.Abp.FeatureManagement.Localization
|
|
@using Volo.Abp.Validation.StringValues
|
|
@using Volo.Abp.FeatureManagement.Web.Pages.FeatureManagement
|
|
@model FeatureManagementModal
|
|
@inject IHtmlLocalizer<AbpFeatureManagementResource> L
|
|
@inject IStringLocalizerFactory StringLocalizerFactory
|
|
@{
|
|
Layout = null;
|
|
|
|
IHtmlLocalizer CreateHtmlLocalizer(string resourceName)
|
|
{
|
|
var localizer = StringLocalizerFactory.CreateByResourceNameOrNull(resourceName) ??
|
|
StringLocalizerFactory.CreateDefaultOrNull();
|
|
return new HtmlLocalizer(localizer);
|
|
}
|
|
}
|
|
|
|
<abp-script src="/Pages/FeatureManagement/feature-management-modal.js" />
|
|
|
|
<form method="post" asp-page="/FeatureManagement/FeatureManagementModal" data-script-class="abp.modals.FeatureManagement">
|
|
<abp-modal id="featureManagmentModal" size="Large">
|
|
<abp-modal-header title="@(L["Features"].Value)"></abp-modal-header>
|
|
@if (Model.FeatureListResultDto != null && Model.FeatureListResultDto.Groups.Any())
|
|
{
|
|
var featureGroups = Model.FeatureListResultDto.Groups;
|
|
|
|
<abp-modal-body>
|
|
<input asp-for="@Model.ProviderKey"/>
|
|
<input asp-for="@Model.ProviderName"/>
|
|
<abp-tabs name="FeaturesTabs" tab-style="PillVertical" vertical-header-size="_4" class="custom-scroll-container">
|
|
@for (var i = 0; i < featureGroups.Count; i++)
|
|
{
|
|
var featureGroup = featureGroups[i];
|
|
<abp-tab title="@featureGroup.DisplayName" name="v-pills-tab-@featureGroup.GetNormalizedGroupName()">
|
|
<h4>@featureGroup.DisplayName</h4>
|
|
<hr class="mt-2 mb-3"/>
|
|
<div class="custom-scroll-content">
|
|
<div class="pl-1 pt-1">
|
|
@for (var j = 0; j < featureGroup.Features.Count; j++)
|
|
{
|
|
var feature = featureGroup.Features[j];
|
|
<div class="mt-2">
|
|
|
|
<input type="text" abp-id-name="@Model.FeatureGroups[i].Features[j].Type" value="@feature.ValueType?.Name" hidden/>
|
|
|
|
@if (feature.ValueType is ToggleStringValueType)
|
|
{
|
|
<abp-input asp-for="@feature.Value"
|
|
type="checkbox"
|
|
class="d-inline"
|
|
abp-id-name="@Model.FeatureGroups[i].Features[j].BoolValue"
|
|
label="@feature.DisplayName"
|
|
group-data-feature-name="@feature.Name"
|
|
group-data-parent-name="@(feature.ParentName ?? "")"
|
|
group-style="margin-inline-start: @(feature.Depth * 20)px"/>
|
|
|
|
@if (feature.Description != null)
|
|
{
|
|
<div class="form-text" style="margin-inline-start: @(feature.Depth * 20)px">@feature.Description</div>
|
|
}
|
|
|
|
}
|
|
|
|
@if (feature.ValueType is FreeTextStringValueType)
|
|
{
|
|
var type = "text";
|
|
if(feature.ValueType.Validator is NumericValueValidator)
|
|
{
|
|
type = "number";
|
|
}
|
|
|
|
<abp-input asp-for="@feature.Value"
|
|
label="@feature.DisplayName"
|
|
abp-id-name="@Model.FeatureGroups[i].Features[j].Value"
|
|
type="@type"
|
|
group-data-feature-name="@feature.Name"
|
|
group-data-parent-name="@(feature.ParentName ?? "")"
|
|
group-style="margin-inline-start: @(feature.Depth * 25)px"/>
|
|
@if (feature.Description != null)
|
|
{
|
|
<div class="form-text" style="margin-inline-start: @(feature.Depth * 25)px">@feature.Description</div>
|
|
}
|
|
}
|
|
|
|
@if (feature.ValueType is SelectionStringValueType selectType)
|
|
{
|
|
<div data-feature-name="@feature.Name" data-parent-name="@(feature.ParentName ?? "")" style="margin-inline-start: @(feature.Depth * 25)px" class="mb-3">
|
|
<label class="form-label" for="@feature.Name">@feature.DisplayName</label>
|
|
|
|
<select id="@feature.Name" name="FeatureGroups[@i].Features[@j].Value" class="form-select">
|
|
@foreach (var item in selectType.ItemSource.Items)
|
|
{
|
|
if (item.Value == feature.Value)
|
|
{
|
|
<option value="@item.Value" selected="selected"> @CreateHtmlLocalizer(item.DisplayText.ResourceName).GetString(item.DisplayText.Name) </option>
|
|
}
|
|
else
|
|
{
|
|
<option value="@item.Value"> @CreateHtmlLocalizer(item.DisplayText.ResourceName).GetString(item.DisplayText.Name) </option>
|
|
}
|
|
}
|
|
</select>
|
|
@if (feature.Description != null)
|
|
{
|
|
<div class="form-text" style="margin-inline-start: @(feature.Depth * 25)px">@feature.Description</div>
|
|
}
|
|
</div>
|
|
}
|
|
|
|
<input value="@feature.Name" abp-id-name="@Model.FeatureGroups[i].Features[j].Name" hidden/>
|
|
</div>
|
|
}
|
|
</div>
|
|
</div>
|
|
</abp-tab>
|
|
}
|
|
|
|
</abp-tabs>
|
|
</abp-modal-body>
|
|
<abp-modal-footer>
|
|
<abp-button data-bs-dismiss="modal" button-type="Link">@L["Cancel"]</abp-button>
|
|
<abp-button button-type="Outline_Primary" id="ResetToDefaults"><i class="fa fa-refresh"></i> @L["ResetToDefault"]</abp-button>
|
|
<abp-button button-type="Primary" type="submit"><i class="fa fa-check"></i> @L["Save"]</abp-button>
|
|
</abp-modal-footer>
|
|
}
|
|
else
|
|
{
|
|
<abp-modal-body class="my-2">
|
|
@L["NoFeatureFoundMessage"]
|
|
</abp-modal-body>
|
|
}
|
|
</abp-modal>
|
|
</form>
|
|
|