tenant management web layout extended

pull/4861/head
Ahmet Çotur 5 years ago
parent b646388195
commit cf17af4199

@ -5,6 +5,8 @@ using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap;
using Volo.Abp.AutoMapper;
using Volo.Abp.FeatureManagement;
using Volo.Abp.Modularity;
using Volo.Abp.ObjectExtending;
using Volo.Abp.ObjectExtending.Modularity;
using Volo.Abp.TenantManagement.Localization;
using Volo.Abp.TenantManagement.Web.Navigation;
using Volo.Abp.UI.Navigation;
@ -57,5 +59,16 @@ namespace Volo.Abp.TenantManagement.Web
options.Conventions.AuthorizePage("/TenantManagement/Tenants/ConnectionStrings", TenantManagementPermissions.Tenants.ManageConnectionStrings);
});
}
public override void PostConfigureServices(ServiceConfigurationContext context)
{
ModuleExtensionConfigurationHelper
.ApplyEntityConfigurationToUi(
TenantManagementModuleExtensionConsts.ModuleName,
TenantManagementModuleExtensionConsts.EntityNames.Tenant,
createFormTypes: new[] { typeof(Volo.Abp.TenantManagement.Web.Pages.TenantManagement.Tenants.CreateModalModel.TenantInfoModel) },
editFormTypes: new[] { typeof(Volo.Abp.TenantManagement.Web.Pages.TenantManagement.Tenants.EditModalModel.TenantInfoModel) }
);
}
}
}

@ -1,10 +1,13 @@
@page
@using Microsoft.Extensions.Localization
@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal
@using Volo.Abp.Localization
@using Volo.Abp.ObjectExtending
@using Volo.Abp.TenantManagement.Localization
@using Volo.Abp.TenantManagement.Web.Pages.TenantManagement.Tenants
@model CreateModalModel
@inject IStringLocalizer<AbpTenantManagementResource> L
@inject IStringLocalizerFactory StringLocalizerFactory
@{
Layout = null;
}
@ -17,6 +20,23 @@
<abp-input asp-for="Tenant.AdminEmailAddress" />
<abp-input asp-for="Tenant.AdminPassword" />
@foreach (var propertyInfo in ObjectExtensionManager.Instance.GetProperties<CreateModalModel.TenantInfoModel>())
{
if (propertyInfo.Type.IsEnum)
{
<abp-select asp-for="Tenant.ExtraProperties[propertyInfo.Name]"
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)"></abp-select>
}
else
{
<abp-input type="@propertyInfo.GetInputType()"
asp-for="Tenant.ExtraProperties[propertyInfo.Name]"
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)"
asp-format="@propertyInfo.GetInputFormatOrNull()"
value="@propertyInfo.GetInputValueOrNull(Model.Tenant.ExtraProperties[propertyInfo.Name])" />
}
}
</abp-modal-body>
<abp-modal-footer buttons="@(AbpModalButtons.Cancel|AbpModalButtons.Save)"></abp-modal-footer>
</abp-modal>

@ -1,6 +1,7 @@
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.ObjectExtending;
using Volo.Abp.Validation;
namespace Volo.Abp.TenantManagement.Web.Pages.TenantManagement.Tenants
@ -32,7 +33,7 @@ namespace Volo.Abp.TenantManagement.Web.Pages.TenantManagement.Tenants
return NoContent();
}
public class TenantInfoModel
public class TenantInfoModel: ExtensibleObject
{
[Required]
[DynamicStringLength(typeof(TenantConsts), nameof(TenantConsts.MaxNameLength))]

@ -1,10 +1,14 @@
@page
@using Microsoft.AspNetCore.Mvc.Localization
@using Microsoft.Extensions.Localization
@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal
@using Volo.Abp.Localization
@using Volo.Abp.ObjectExtending
@using Volo.Abp.TenantManagement.Localization
@using Volo.Abp.TenantManagement.Web.Pages.TenantManagement.Tenants
@model EditModalModel
@inject IHtmlLocalizer<AbpTenantManagementResource> L
@inject IStringLocalizerFactory StringLocalizerFactory
@{
Layout = null;
}
@ -14,6 +18,12 @@
<abp-modal-body>
<input asp-for="Tenant.Id" />
<abp-input asp-for="Tenant.Name" label="@L["TenantName"].Value" />
@foreach (var propertyInfo in ObjectExtensionManager.Instance.GetProperties<EditModalModel.TenantInfoModel>())
{
<abp-input type="@propertyInfo.GetInputType()"
asp-for="Tenant.ExtraProperties[propertyInfo.Name]"
label="@propertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)" />
}
</abp-modal-body>
<abp-modal-footer buttons="@(AbpModalButtons.Cancel|AbpModalButtons.Save)"></abp-modal-footer>
</abp-modal>

@ -2,6 +2,7 @@ using System;
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.ObjectExtending;
using Volo.Abp.Validation;
namespace Volo.Abp.TenantManagement.Web.Pages.TenantManagement.Tenants
@ -37,7 +38,7 @@ namespace Volo.Abp.TenantManagement.Web.Pages.TenantManagement.Tenants
return NoContent();
}
public class TenantInfoModel
public class TenantInfoModel : ExtensibleObject
{
[HiddenInput]
public Guid Id { get; set; }

@ -37,13 +37,6 @@
</abp-row>
</abp-card-header>
<abp-card-body>
<abp-table striped-rows="true" class="nowrap">
<thead>
<tr>
<th>@L["Actions"]</th>
<th>@L["TenantName"]</th>
</tr>
</thead>
</abp-table>
<abp-table striped-rows="true" class="nowrap"></abp-table>
</abp-card-body>
</abp-card>

@ -17,19 +17,12 @@
modalClass: 'TenantConnectionStringManagement',
});
$(function () {
var _$wrapper = $('#TenantsWrapper');
var _dataTable = _$wrapper.find('table').DataTable(
abp.libs.datatables.normalizeConfiguration({
order: [[1, 'asc']],
processing: true,
paging: true,
scrollX: true,
serverSide: true,
ajax: abp.libs.datatables.createAjax(_tenantAppService.getList),
columnDefs: [
abp.ui.extensions.tableColumns.get("tenant").addContributor(
function (columnList) {
columnList.addManyTail(
[
{
title: l("Actions"),
rowAction: {
items: [
{
@ -89,9 +82,27 @@
},
},
{
title: l("TenantName"),
data: 'name',
},
],
}
]
);
},
0 //adds as the first contributor
);
$(function () {
var _$wrapper = $('#TenantsWrapper');
var _dataTable = _$wrapper.find('table').DataTable(
abp.libs.datatables.normalizeConfiguration({
order: [[1, 'asc']],
processing: true,
paging: true,
scrollX: true,
serverSide: true,
ajax: abp.libs.datatables.createAjax(_tenantAppService.getList),
columnDefs: abp.ui.extensions.tableColumns.get("tenant").columns.toArray(),
})
);

Loading…
Cancel
Save