mirror of https://github.com/abpframework/abp.git
committed by
GitHub
6 changed files with 42 additions and 11 deletions
@ -1,8 +1,12 @@ |
|||
namespace Volo.CmsKit.Public.GlobalResources; |
|||
using System; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
public class GlobalResourceDto |
|||
namespace Volo.CmsKit.Public.GlobalResources; |
|||
|
|||
[Serializable] |
|||
public class GlobalResourceDto : AuditedEntityDto |
|||
{ |
|||
public string Name { get; set; } |
|||
|
|||
|
|||
public string Value { get; set; } |
|||
} |
|||
@ -1 +1,3 @@ |
|||
<link rel="stylesheet" href="/cms-kit/global-resources/style"/> |
|||
@model Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.GlobalResources.Style.GlobalStyleModel |
|||
|
|||
<link rel="stylesheet" href="@("/cms-kit/global-resources/style?v=" + Model.LastModificationTimeTimestamp)"/> |
|||
@ -0,0 +1,6 @@ |
|||
namespace Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.GlobalResources.Style; |
|||
|
|||
public class GlobalStyleModel |
|||
{ |
|||
public long LastModificationTimeTimestamp { get; set; } |
|||
} |
|||
@ -1,13 +1,33 @@ |
|||
using System.Threading.Tasks; |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp.AspNetCore.Mvc; |
|||
using Volo.CmsKit.Public.GlobalResources; |
|||
|
|||
namespace Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.GlobalResources.Style; |
|||
|
|||
public class GlobalStyleViewComponent : AbpViewComponent |
|||
{ |
|||
protected IGlobalResourcePublicAppService GlobalResourcePublicAppService { get; } |
|||
|
|||
public GlobalStyleViewComponent(IGlobalResourcePublicAppService globalResourcePublicAppService) |
|||
{ |
|||
GlobalResourcePublicAppService = globalResourcePublicAppService; |
|||
} |
|||
|
|||
[BindProperty(SupportsGet = true)] |
|||
public DateTime? LastModificationTime { get; set; } |
|||
|
|||
public async Task<IViewComponentResult> InvokeAsync() |
|||
{ |
|||
return View("~/Pages/CmsKit/Shared/Components/GlobalResources/Style/Default.cshtml"); |
|||
var lastModificationTime = (await GlobalResourcePublicAppService.GetGlobalStyleAsync())?.LastModificationTime; |
|||
var lastModificationTimeTimestamp = (long)(lastModificationTime.HasValue ? lastModificationTime.Value.Subtract(DateTime.UnixEpoch).TotalSeconds : 0); |
|||
|
|||
return View("~/Pages/CmsKit/Shared/Components/GlobalResources/Style/Default.cshtml", |
|||
new GlobalStyleModel() |
|||
{ |
|||
LastModificationTimeTimestamp = lastModificationTimeTimestamp |
|||
}); |
|||
} |
|||
|
|||
} |
|||
Loading…
Reference in new issue