Browse Source

Added tenants page.

pull/206/head
Halil İbrahim Kalkan 8 years ago
parent
commit
645ee84039
  1. 9
      Volo.Abp.sln
  2. 2
      src/AbpDesk/AbpDesk.Web.Mvc/AbpDesk.Web.Mvc.csproj
  3. 2
      src/AbpDesk/AbpDesk.Web.Mvc/AbpDeskWebMvcModule.cs
  4. 13
      src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/AbpIdentityHttpApiModule.cs
  5. 2
      src/Volo.Abp.Identity.Web/AbpIdentityWebAutoMapperProfile.cs
  6. 3
      src/Volo.Abp.Identity.Web/AbpIdentityWebModule.cs
  7. 3
      src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/users/index.less
  8. 25
      src/Volo.Abp.MultiTenancy.HttpApi/Volo.Abp.MultiTenancy.HttpApi.csproj
  9. 26
      src/Volo.Abp.MultiTenancy.HttpApi/Volo/Abp/MultiTenancy/AbpIdentityHttpApiModule.cs
  10. 25
      src/Volo.Abp.MultiTenancy.Web/AbpMultiTenancyWebAutoMapperProfile.cs
  11. 14
      src/Volo.Abp.MultiTenancy.Web/AbpMultiTenancyWebModule.cs
  12. 0
      src/Volo.Abp.MultiTenancy.Web/Localization/Resources/AbpMultiTenancy/AbpMultiTenancyResource.cs
  13. 3
      src/Volo.Abp.MultiTenancy.Web/Localization/Resources/AbpMultiTenancy/en.json
  14. 33
      src/Volo.Abp.MultiTenancy.Web/Pages/MultiTenancy/Tenants/CreateModal.cshtml
  15. 38
      src/Volo.Abp.MultiTenancy.Web/Pages/MultiTenancy/Tenants/CreateModal.cshtml.cs
  16. 35
      src/Volo.Abp.MultiTenancy.Web/Pages/MultiTenancy/Tenants/EditModal.cshtml
  17. 49
      src/Volo.Abp.MultiTenancy.Web/Pages/MultiTenancy/Tenants/EditModal.cshtml.cs
  18. 40
      src/Volo.Abp.MultiTenancy.Web/Pages/MultiTenancy/Tenants/Index.cshtml
  19. 2
      src/Volo.Abp.MultiTenancy.Web/Pages/MultiTenancy/_ViewImports.cshtml
  20. 8
      src/Volo.Abp.MultiTenancy.Web/Volo.Abp.MultiTenancy.Web.csproj
  21. 6
      src/Volo.Abp.MultiTenancy.Web/compilerconfig.json
  22. 49
      src/Volo.Abp.MultiTenancy.Web/compilerconfig.json.defaults
  23. 21
      src/Volo.Abp.MultiTenancy.Web/wwwroot/modules/multi-tenancy/views/tenants/index.css
  24. 6
      src/Volo.Abp.MultiTenancy.Web/wwwroot/modules/multi-tenancy/views/tenants/index.es5.js
  25. 1
      src/Volo.Abp.MultiTenancy.Web/wwwroot/modules/multi-tenancy/views/tenants/index.es5.min.js
  26. 84
      src/Volo.Abp.MultiTenancy.Web/wwwroot/modules/multi-tenancy/views/tenants/index.js
  27. 39
      src/Volo.Abp.MultiTenancy.Web/wwwroot/modules/multi-tenancy/views/tenants/index.less
  28. 1
      src/Volo.Abp.MultiTenancy.Web/wwwroot/modules/multi-tenancy/views/tenants/index.min.css

9
Volo.Abp.sln

@ -242,7 +242,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Abp.MultiTenancy", "Abp.Mul
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.MultiTenancy.Application.Tests", "test\Volo.Abp.MultiTenancy.Application.Tests\Volo.Abp.MultiTenancy.Application.Tests.csproj", "{B65973F1-9EE0-4914-B6F2-D88F753E1D21}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.MultiTenancy.Web", "src\Volo.Abp.MultiTenancy.Web\Volo.Abp.MultiTenancy.Web.csproj", "{0808036D-065B-4525-BF30-CBCEA062F8E9}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.MultiTenancy.Web", "src\Volo.Abp.MultiTenancy.Web\Volo.Abp.MultiTenancy.Web.csproj", "{0808036D-065B-4525-BF30-CBCEA062F8E9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.MultiTenancy.HttpApi", "src\Volo.Abp.MultiTenancy.HttpApi\Volo.Abp.MultiTenancy.HttpApi.csproj", "{06423FAC-67E2-4B7C-B29F-39578F460C4F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -634,6 +636,10 @@ Global
{0808036D-065B-4525-BF30-CBCEA062F8E9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0808036D-065B-4525-BF30-CBCEA062F8E9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0808036D-065B-4525-BF30-CBCEA062F8E9}.Release|Any CPU.Build.0 = Release|Any CPU
{06423FAC-67E2-4B7C-B29F-39578F460C4F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{06423FAC-67E2-4B7C-B29F-39578F460C4F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{06423FAC-67E2-4B7C-B29F-39578F460C4F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{06423FAC-67E2-4B7C-B29F-39578F460C4F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -752,6 +758,7 @@ Global
{3CE22CAC-4B27-4EEC-A35E-C01219ED6E99} = {447C8A77-E5F0-4538-8687-7383196D04EA}
{B65973F1-9EE0-4914-B6F2-D88F753E1D21} = {3CE22CAC-4B27-4EEC-A35E-C01219ED6E99}
{0808036D-065B-4525-BF30-CBCEA062F8E9} = {CA154803-3589-47B3-B7CB-B18F94FE1EB6}
{06423FAC-67E2-4B7C-B29F-39578F460C4F} = {CA154803-3589-47B3-B7CB-B18F94FE1EB6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BB97ECF4-9A84-433F-A80B-2A3285BDD1D5}

2
src/AbpDesk/AbpDesk.Web.Mvc/AbpDesk.Web.Mvc.csproj

@ -27,7 +27,7 @@
<ProjectReference Include="..\..\Volo.Abp.Identity.HttpApi\Volo.Abp.Identity.HttpApi.csproj" />
<ProjectReference Include="..\..\Volo.Abp.IdentityServer.Domain\Volo.Abp.IdentityServer.Domain.csproj" />
<ProjectReference Include="..\..\Volo.Abp.IdentityServer.EntityFrameworkCore\Volo.Abp.IdentityServer.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\Volo.Abp.MultiTenancy.Application\Volo.Abp.MultiTenancy.Application.csproj" />
<ProjectReference Include="..\..\Volo.Abp.MultiTenancy.HttpApi\Volo.Abp.MultiTenancy.HttpApi.csproj" />
<ProjectReference Include="..\..\Volo.Abp.MultiTenancy.Web\Volo.Abp.MultiTenancy.Web.csproj" />
<ProjectReference Include="..\AbpDesk.Application.Contracts\AbpDesk.Application.Contracts.csproj" />
<ProjectReference Include="..\..\Volo.Abp.AspNetCore.Mvc\Volo.Abp.AspNetCore.Mvc.csproj" />

2
src/AbpDesk/AbpDesk.Web.Mvc/AbpDeskWebMvcModule.cs

@ -46,7 +46,7 @@ namespace AbpDesk.Web.Mvc
typeof(AbpIdentityServerEntityFrameworkCoreModule),
typeof(AbpAspNetCoreMultiTenancyModule),
typeof(AbpMultiTenancyWebModule),
typeof(AbpMultiTenancyApplicationModule)
typeof(AbpMultiTenancyHttpApiModule)
)]
public class AbpDeskWebMvcModule : AbpModule //TODO: Rename to AbpDeskWebModule, change default namespace to AbpDesk.Web
{

13
src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/AbpIdentityHttpApiModule.cs

@ -14,11 +14,14 @@ namespace Volo.Abp.Identity
services.Configure<AbpAspNetCoreMvcOptions>(options =>
{
options.ConventionalControllers.Create(typeof(AbpIdentityApplicationModule).Assembly, opts =>
{
opts.RootPath = "identity";
opts.UrlControllerNameNormalizer = context => context.ControllerName.RemovePreFix("Identity");
});
options.ConventionalControllers.Create(
typeof(AbpIdentityApplicationModule).Assembly,
opts =>
{
opts.RootPath = "identity";
opts.UrlControllerNameNormalizer = context => context.ControllerName.RemovePreFix("Identity");
}
);
});
}
}

2
src/Volo.Abp.Identity.Web/ObjectMappings/AbpIdentityWebAutoMapperProfile.cs → src/Volo.Abp.Identity.Web/AbpIdentityWebAutoMapperProfile.cs

@ -3,7 +3,7 @@ using Volo.Abp.Identity.Web.Pages.Identity.Roles;
using CreateUserModalModel = Volo.Abp.Identity.Web.Pages.Identity.Users.CreateModalModel;
using EditUserModalModel = Volo.Abp.Identity.Web.Pages.Identity.Users.EditModalModel;
namespace Volo.Abp.Identity.Web.ObjectMappings
namespace Volo.Abp.Identity.Web
{
public class AbpIdentityWebAutoMapperProfile : Profile
{

3
src/Volo.Abp.Identity.Web/AbpIdentityWebModule.cs

@ -4,7 +4,6 @@ using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap;
using Volo.Abp.AutoMapper;
using Volo.Abp.Identity.Web.Localization.Resources.AbpIdentity;
using Volo.Abp.Identity.Web.Navigation;
using Volo.Abp.Identity.Web.ObjectMappings;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.Ui.Navigation;
@ -46,7 +45,7 @@ namespace Volo.Abp.Identity.Web
services.Configure<AbpAutoMapperOptions>(options =>
{
options.AddProfile<AbpIdentityWebAutoMapperProfile>(true);
options.AddProfile<AbpIdentityWebAutoMapperProfile>(validate: true);
});
}
}

3
src/Volo.Abp.Identity.Web/wwwroot/modules/identity/views/users/index.less

@ -1,4 +1,5 @@
.dataTable {
//TODO: This code is duplicated for other pages too. Unify them.
.dataTable {
width: 100% !important;
border-spacing: 0 !important;
}

25
src/Volo.Abp.MultiTenancy.HttpApi/Volo.Abp.MultiTenancy.HttpApi.csproj

@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>Volo.Abp.MultiTenancy.HttpApi</AssemblyName>
<PackageId>Volo.Abp.MultiTenancy.HttpApi</PackageId>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="2.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Volo.Abp.AspNetCore.Mvc\Volo.Abp.AspNetCore.Mvc.csproj" />
<ProjectReference Include="..\Volo.Abp.MultiTenancy.Application\Volo.Abp.MultiTenancy.Application.csproj" />
</ItemGroup>
</Project>

26
src/Volo.Abp.MultiTenancy.HttpApi/Volo/Abp/MultiTenancy/AbpIdentityHttpApiModule.cs

@ -0,0 +1,26 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Modularity;
namespace Volo.Abp.MultiTenancy
{
[DependsOn(typeof(AbpMultiTenancyApplicationModule), typeof(AbpAspNetCoreMvcModule))]
public class AbpMultiTenancyHttpApiModule : AbpModule
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddAssemblyOf<AbpMultiTenancyHttpApiModule>();
services.Configure<AbpAspNetCoreMvcOptions>(options =>
{
options.ConventionalControllers.Create(
typeof(AbpMultiTenancyApplicationModule).Assembly,
opts =>
{
opts.RootPath = "multi-tenancy";
}
);
});
}
}
}

25
src/Volo.Abp.MultiTenancy.Web/AbpMultiTenancyWebAutoMapperProfile.cs

@ -0,0 +1,25 @@
using AutoMapper;
using Volo.Abp.MultiTenancy.Web.Pages.MultiTenancy.Tenants;
namespace Volo.Abp.MultiTenancy.Web
{
public class AbpMultiTenancyWebAutoMapperProfile : Profile
{
public AbpMultiTenancyWebAutoMapperProfile()
{
CreateRoleMappings();
}
private void CreateRoleMappings()
{
//List
CreateMap<TenantDto, EditModalModel.TenantInfoModel>();
//CreateModal
CreateMap<CreateModalModel.TenantInfoModel, TenantCreateDto>();
//EditModal
CreateMap<EditModalModel.TenantInfoModel, TenantUpdateDto>();
}
}
}

14
src/Volo.Abp.MultiTenancy.Web/AbpMultiTenancyWebModule.cs

@ -1,4 +1,5 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AspNetCore.Mvc.Localization;
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap;
using Volo.Abp.AutoMapper;
using Volo.Abp.Localization;
@ -15,6 +16,14 @@ namespace Volo.Abp.MultiTenancy.Web
[DependsOn(typeof(AbpAutoMapperModule))]
public class AbpMultiTenancyWebModule : AbpModule
{
public override void PreConfigureServices(IServiceCollection services)
{
services.PreConfigure<AbpMvcDataAnnotationsLocalizationOptions>(options =>
{
options.AddAssemblyResource(typeof(AbpMultiTenancyResource));
});
}
public override void ConfigureServices(IServiceCollection services)
{
services.AddAssemblyOf<AbpMultiTenancyWebModule>();
@ -33,6 +42,11 @@ namespace Volo.Abp.MultiTenancy.Web
{
options.Resources.AddVirtualJson<AbpMultiTenancyResource>("en", "/Localization/Resources/AbpMultiTenancy");
});
services.Configure<AbpAutoMapperOptions>(options =>
{
options.AddProfile<AbpMultiTenancyWebAutoMapperProfile>(validate: true);
});
}
}
}

0
src/Volo.Abp.MultiTenancy.Web/Localization/Resources/AbpMultiTenancy/IdentityResource.cs → src/Volo.Abp.MultiTenancy.Web/Localization/Resources/AbpMultiTenancy/AbpMultiTenancyResource.cs

3
src/Volo.Abp.MultiTenancy.Web/Localization/Resources/AbpMultiTenancy/en.json

@ -1,6 +1,7 @@
{
"culture": "en",
"texts": {
"NewTenant": "New tenant",
"TenantName": "Tenant name"
}
}

33
src/Volo.Abp.MultiTenancy.Web/Pages/MultiTenancy/Tenants/CreateModal.cshtml

@ -0,0 +1,33 @@
@page
@using Microsoft.Extensions.Localization
@using Volo.Abp.MultiTenancy.Web.Localization.Resources.AbpMultiTenancy
@using Volo.Abp.MultiTenancy.Web.Pages.MultiTenancy.Tenants
@model CreateModalModel
@inject IStringLocalizer<AbpMultiTenancyResource> L
@{
Layout = null;
}
<form method="post" asp-page="/MultiTenancy/Tenants/CreateModal">
<abp-modal>
<abp-modal-header title="@L["NewTenant"]"></abp-modal-header>
<abp-modal-body>
<div class="form-group">
<label asp-for="TenantModel.Name"></label>
<input asp-for="TenantModel.Name" class="form-control" />
<span asp-validation-for="TenantModel.Name" class="text-danger"></span>
</div>
<div asp-validation-summary="All" class="text-danger"></div>
</abp-modal-body>
<abp-modal-footer></abp-modal-footer>
</abp-modal>
</form>

38
src/Volo.Abp.MultiTenancy.Web/Pages/MultiTenancy/Tenants/CreateModal.cshtml.cs

@ -0,0 +1,38 @@
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.MultiTenancy.Web.Pages.MultiTenancy.Tenants
{
public class CreateModalModel : AbpPageModel
{
[BindProperty]
public TenantInfoModel TenantModel { get; set; }
private readonly ITenantAppService _tenantAppService;
public CreateModalModel(ITenantAppService tenantAppService)
{
_tenantAppService = tenantAppService;
}
public async Task<IActionResult> OnPostAsync()
{
ValidateModel();
var input = ObjectMapper.Map<TenantInfoModel, TenantCreateDto>(TenantModel);
await _tenantAppService.CreateAsync(input);
return NoContent();
}
public class TenantInfoModel
{
[Required]
[StringLength(TenantConsts.MaxNameLength)]
[Display(Name = "TenantName")]
public string Name { get; set; }
}
}
}

35
src/Volo.Abp.MultiTenancy.Web/Pages/MultiTenancy/Tenants/EditModal.cshtml

@ -0,0 +1,35 @@
@page
@using Microsoft.Extensions.Localization
@using Volo.Abp.MultiTenancy.Web.Localization.Resources.AbpMultiTenancy
@using Volo.Abp.MultiTenancy.Web.Pages.MultiTenancy.Tenants
@model EditModalModel
@inject IStringLocalizer<AbpMultiTenancyResource> L
@{
Layout = null;
}
<form method="post" asp-page="/MultiTenancy/Tenants/EditModal" autocomplete="off">
<abp-modal>
<abp-modal-header title="@L["Edit"]"></abp-modal-header>
<abp-modal-body>
<input asp-for="TenantInfo.Id" />
<div class="form-group">
<label asp-for="TenantInfo.Name"></label>
<input asp-for="TenantInfo.Name" class="form-control"/>
<span asp-validation-for="TenantInfo.Name" class="text-danger"></span>
</div>
<div asp-validation-summary="All" class="text-danger"></div>
</abp-modal-body>
<abp-modal-footer></abp-modal-footer>
</abp-modal>
</form>

49
src/Volo.Abp.MultiTenancy.Web/Pages/MultiTenancy/Tenants/EditModal.cshtml.cs

@ -0,0 +1,49 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.RazorPages;
namespace Volo.Abp.MultiTenancy.Web.Pages.MultiTenancy.Tenants
{
public class EditModalModel : AbpPageModel
{
[BindProperty]
public TenantInfoModel TenantInfo { get; set; }
private readonly ITenantAppService _tenantAppService;
public EditModalModel(ITenantAppService tenantAppService)
{
_tenantAppService = tenantAppService;
}
public async Task OnGetAsync(Guid id)
{
TenantInfo = ObjectMapper.Map<TenantDto, TenantInfoModel>(
await _tenantAppService.GetAsync(id)
);
}
public async Task<IActionResult> OnPostAsync()
{
ValidateModel();
var input = ObjectMapper.Map<TenantInfoModel, TenantUpdateDto>(TenantInfo);
await _tenantAppService.UpdateAsync(TenantInfo.Id, input);
return NoContent();
}
public class TenantInfoModel
{
[HiddenInput]
public Guid Id { get; set; }
[Required]
[StringLength(TenantConsts.MaxNameLength)]
[Display(Name = "TenantName")]
public string Name { get; set; }
}
}
}

40
src/Volo.Abp.MultiTenancy.Web/Pages/MultiTenancy/Tenants/Index.cshtml

@ -1,7 +1,45 @@
@page
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.MultiTenancy.Web.Localization.Resources.AbpMultiTenancy
@using Volo.Abp.MultiTenancy.Web.Pages.MultiTenancy.Tenants
@model IndexModel
@{
}
@inject IHtmlLocalizer<AbpMultiTenancyResource> L
@section styles {
<link rel="stylesheet" type="text/css" href="~/modules/multi-tenancy/views/tenants/index.css" />
}
@section scripts {
<script type="text/javascript" src="~/abp/helpers/jquery.js"></script>
<script type="text/javascript" src="~/abp/helpers/datatables.extensions.js"></script>
<script type="text/javascript" src="~/abp/helpers/ResourceLoader.js"></script>
<script type="text/javascript" src="~/abp/helpers/ModalManager.js"></script>
<script type="text/javascript" src="~/modules/multi-tenancy/views/tenants/index.js"></script>
}
Tenants page...
<abp-card id="TenantsWrapper">
<abp-card-header>
<div class="row">
<div class="col-md-6">
<h2>@L["Tenants"]</h2>
</div>
<div class="col-md-6 text-right">
<button type="button" class="btn btn-primary" v-on:click="openCreateModal">
<i class="fa fa-plus" aria-hidden="true"></i>
@L["NewTenant"]
</button>
</div>
</div>
</abp-card-header>
<abp-card-body>
<table class="table table-striped nowrap">
<thead>
<tr>
<th>@L["Actions"]</th>
<th>@L["Name"]</th>
</tr>
</thead>
</table>
</abp-card-body>
</abp-card>

2
src/Volo.Abp.MultiTenancy.Web/Pages/MultiTenancy/_ViewImports.cshtml

@ -0,0 +1,2 @@
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap

8
src/Volo.Abp.MultiTenancy.Web/Volo.Abp.MultiTenancy.Web.csproj

@ -16,14 +16,14 @@
<EmbeddedResource Include="Localization\Resources\**\*.json" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Remove="Pages\MultiTenancy\Tenants\CreateModal.cshtml" />
<EmbeddedResource Remove="Pages\MultiTenancy\Tenants\EditModal.cshtml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Volo.Abp.AspNetCore.Mvc.UI.Bootstrap\Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.csproj" />
<ProjectReference Include="..\Volo.Abp.MultiTenancy.Application.Contracts\Volo.Abp.MultiTenancy.Application.Contracts.csproj" />
<ProjectReference Include="..\Volo.Abp.AutoMapper\Volo.Abp.AutoMapper.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="wwwroot\" />
</ItemGroup>
</Project>

6
src/Volo.Abp.MultiTenancy.Web/compilerconfig.json

@ -0,0 +1,6 @@
[
{
"outputFile": "wwwroot/modules/multi-tenancy/views/tenants/index.css",
"inputFile": "wwwroot/modules/multi-tenancy/views/tenants/index.less"
}
]

49
src/Volo.Abp.MultiTenancy.Web/compilerconfig.json.defaults

@ -0,0 +1,49 @@
{
"compilers": {
"less": {
"autoPrefix": "",
"cssComb": "none",
"ieCompat": true,
"strictMath": false,
"strictUnits": false,
"relativeUrls": true,
"rootPath": "",
"sourceMapRoot": "",
"sourceMapBasePath": "",
"sourceMap": false
},
"sass": {
"includePath": "",
"indentType": "space",
"indentWidth": 2,
"outputStyle": "nested",
"Precision": 5,
"relativeUrls": true,
"sourceMapRoot": "",
"sourceMap": false
},
"stylus": {
"sourceMap": false
},
"babel": {
"sourceMap": false
},
"coffeescript": {
"bare": false,
"runtimeMode": "node",
"sourceMap": false
}
},
"minifiers": {
"css": {
"enabled": true,
"termSemicolons": true,
"gzip": false
},
"javascript": {
"enabled": true,
"termSemicolons": true,
"gzip": false
}
}
}

21
src/Volo.Abp.MultiTenancy.Web/wwwroot/modules/multi-tenancy/views/tenants/index.css

@ -0,0 +1,21 @@
.dataTable {
width: 100% !important;
border-spacing: 0 !important;
}
.table td,
.table th {
padding: 8px 10px;
}
.dataTable tbody tr td button {
cursor: pointer;
}
.dataTable tbody tr td div.dropdown ul.dropdown-menu li {
cursor: pointer;
padding: 5px;
}
.dataTable tbody tr td div.dropdown ul.dropdown-menu li a {
display: block;
}
.dataTable tbody tr td div.dropdown ul.dropdown-menu li:hover {
background: #f4f5f8;
}

6
src/Volo.Abp.MultiTenancy.Web/wwwroot/modules/multi-tenancy/views/tenants/index.es5.js

@ -0,0 +1,6 @@
'use strict';
$(function () {
$('#IdentityUsersTable').DataTable();
});

1
src/Volo.Abp.MultiTenancy.Web/wwwroot/modules/multi-tenancy/views/tenants/index.es5.min.js

@ -0,0 +1 @@
"use strict";$(function(){$("#IdentityUsersTable").DataTable()});

84
src/Volo.Abp.MultiTenancy.Web/wwwroot/modules/multi-tenancy/views/tenants/index.js

@ -0,0 +1,84 @@
(function () {
var l = abp.localization.getResource('AbpMultiTenancy');
var _tenantAppService = volo.abp.multiTenancy.tenant;
var _editModal = new abp.ModalManager(abp.appPath + 'MultiTenancy/Tenants/EditModal');
var _createModal = new abp.ModalManager(abp.appPath + 'MultiTenancy/Tenants/CreateModal');
var app = new Vue({
el: '#TenantsWrapper',
methods: {
openCreateModal: function () {
_createModal.open();
}
}
});
$(function () {
var _$wrapper = $('#TenantsWrapper');
var _$table = _$wrapper.find('table');
var _dataTable = _$table.DataTable({
order: [[1, "asc"]],
ajax: abp.libs.datatables.createAjax(_tenantAppService.getList),
columnDefs: [
{
//TODO: Can we eleminate targets, data, orderable, autoWidth, defaultContent fields or make these values default
targets: 0,
data: null,
orderable: false,
autoWidth: false,
defaultContent: '',
rowAction: {
text: '<i class="fa fa-cog"></i> ' + l('Actions') + ' <span class="caret"></span>', //TODO: Add icon option and set text as only l('Actions')
items:
[
{
//TODO: Allow to add icon
text: l('Edit'),
visible: function () { //TODO: Allow visible to be a boolean for simple cases
return true;
},
action: function (data) {
_editModal.open({
id: data.record.id
});
}
},
{
text: l('Delete'),
visible: function () {
return true;
},
action: function (data) {
if (confirm(l('TenantDeletionConfirmationMessage', data.record.name))) {
_tenantAppService
.delete(data.record.id)
.then(function () {
_dataTable.ajax.reload();
});
}
}
}
]
}
},
{
targets: 1,
data: "name"
}
]
});
_createModal.onResult(function () {
_dataTable.ajax.reload();
});
_editModal.onResult(function () {
_dataTable.ajax.reload();
});
});
})();

39
src/Volo.Abp.MultiTenancy.Web/wwwroot/modules/multi-tenancy/views/tenants/index.less

@ -0,0 +1,39 @@
//TODO: This code is duplicated for other pages too. Unify them.
.dataTable {
width: 100% !important;
border-spacing: 0 !important;
}
.table td, .table th {
padding: 8px 10px;
}
.dataTable {
tbody {
tr {
td {
button {
cursor: pointer;
}
div.dropdown {
ul.dropdown-menu {
li {
cursor: pointer;
padding: 5px;
a {
display: block;
}
}
li:hover {
background: #f4f5f8;
}
}
}
}
}
}
}

1
src/Volo.Abp.MultiTenancy.Web/wwwroot/modules/multi-tenancy/views/tenants/index.min.css

@ -0,0 +1 @@
.dataTable{width:100% !important;border-spacing:0 !important;}.table td,.table th{padding:8px 10px;}.dataTable tbody tr td button{cursor:pointer;}.dataTable tbody tr td div.dropdown ul.dropdown-menu li{cursor:pointer;padding:5px;}.dataTable tbody tr td div.dropdown ul.dropdown-menu li a{display:block;}.dataTable tbody tr td div.dropdown ul.dropdown-menu li:hover{background:#f4f5f8;}
Loading…
Cancel
Save