Browse Source

abp version imaging added

pull/125/head
Onur Pıçakcı 4 years ago
parent
commit
c6d02d2dce
  1. 4
      modules/payment/src/Payment.Admin.Application/Payment.Admin.Application.csproj
  2. 2
      modules/payment/src/Payment.Admin.Blazor/Pages/Payment/Requests/Index.razor.cs
  3. 4
      modules/payment/src/Payment.Application/Payment.Application.csproj
  4. 58
      src/EventHub.Domain.Shared/Assemblies/AssemblyInfoHelper.cs
  5. 20
      src/EventHub.HttpApi.Host/Assemblies/VersionApplicationConfigurationContributor.cs
  6. 6
      src/EventHub.HttpApi.Host/EventHubHttpApiHostModule.cs
  7. 14
      src/EventHub.Web.Theme/Themes/EventHub/Components/Footer/Default.cshtml

4
modules/payment/src/Payment.Admin.Application/Payment.Admin.Application.csproj

@ -4,12 +4,12 @@
<Import Project="..\..\configureawait.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>Payment.Admin</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AutoMapper" Version="5.0.0" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="6.0.0" />
<PackageReference Include="Volo.Abp.Ddd.Application" Version="6.0.0" />
<ProjectReference Include="..\Payment.Admin.Application.Contracts\Payment.Admin.Application.Contracts.csproj" />
<ProjectReference Include="..\Payment.Domain\Payment.Domain.csproj" />

2
modules/payment/src/Payment.Admin.Blazor/Pages/Payment/Requests/Index.razor.cs

@ -63,7 +63,7 @@ namespace Payment.Admin.Pages.Payment.Requests
protected virtual async Task OnDataGridReadAsync(DataGridReadDataEventArgs<PaymentRequestWithDetailsDto> e)
{
CurrentSorting = e.Columns
.Where(c => c.SortDirection != SortDirection.None)
.Where(c => c.SortDirection != SortDirection.Default)
.Select(c => c.Field + (c.SortDirection == SortDirection.Descending ? " DESC" : ""))
.JoinAsString(",");

4
modules/payment/src/Payment.Application/Payment.Application.csproj

@ -4,12 +4,12 @@
<Import Project="..\..\configureawait.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>Payment</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AutoMapper" Version="5.0.0" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="6.0.0" />
<PackageReference Include="Volo.Abp.Ddd.Application" Version="6.0.0" />
<ProjectReference Include="..\Payment.Application.Contracts\Payment.Application.Contracts.csproj" />
<ProjectReference Include="..\Payment.Domain\Payment.Domain.csproj" />

58
src/EventHub.Domain.Shared/Assemblies/AssemblyInfoHelper.cs

@ -0,0 +1,58 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Threading;
using Volo.Abp;
namespace EventHub;
public static class AssemblyInfoHelper
{
private const string AssemblyInfoCacheKey = "AssemblyInfoCacheKey";
private readonly static Dictionary<string, AssemblyInfo> AssemblyInfoCache = new();
public static AssemblyInfo Get()
{
if (AssemblyInfoCache.TryGetValue(AssemblyInfoCacheKey, out var assemblyInfo))
{
return assemblyInfo;
}
var abpCorePackageVersion = GetAbpCorePackageVersion();
var applicationAssembly = Assembly.GetEntryAssembly();
var applicationVersion = applicationAssembly?.GetFileVersion();
var modificationDate = applicationAssembly?.Location == null ? DateTime.Now : File.GetLastWriteTime(applicationAssembly.Location);
assemblyInfo = new AssemblyInfo(abpCorePackageVersion, applicationVersion, modificationDate);
AssemblyInfoCache[AssemblyInfoCacheKey] = assemblyInfo;
return assemblyInfo;
}
private static string GetAbpCorePackageVersion()
{
var abpCoreAssembly = Assembly.GetAssembly(typeof(AbpApplicationBase));
return abpCoreAssembly == null
? string.Empty
: abpCoreAssembly.GetFileVersion();
}
public class AssemblyInfo
{
public string AbpCoreVersion { get; }
public string Version { get; }
public DateTime ModificationDate { get; }
public AssemblyInfo(string abpCoreVersion, string version, DateTime modificationDate)
{
AbpCoreVersion = abpCoreVersion;
Version = version;
ModificationDate = modificationDate;
}
}
}

20
src/EventHub.HttpApi.Host/Assemblies/VersionApplicationConfigurationContributor.cs

@ -0,0 +1,20 @@
using System.Threading.Tasks;
using EventHub;
using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations;
using Volo.Abp.Data;
public class VersionApplicationConfigurationContributor : IApplicationConfigurationContributor
{
public Task ContributeAsync(ApplicationConfigurationContributorContext context)
{
var assemblyInfo = AssemblyInfoHelper.Get();
context.ApplicationConfiguration.SetProperty("versions", new
{
abp = assemblyInfo.AbpCoreVersion,
application = assemblyInfo.Version,
applicationCompileDate = assemblyInfo.ModificationDate
});
return Task.CompletedTask;
}
}

6
src/EventHub.HttpApi.Host/EventHubHttpApiHostModule.cs

@ -22,6 +22,7 @@ using Microsoft.OpenApi.Models;
using StackExchange.Redis;
using Volo.Abp;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared;
using Volo.Abp.AspNetCore.Serilog;
@ -67,6 +68,11 @@ namespace EventHub
ConfigureAutoApiControllers();
ConfigureTiming();
ConfigurePremiumPlanInfo(context, configuration);
Configure<AbpApplicationConfigurationOptions>(options =>
{
options.Contributors.AddIfNotContains(new VersionApplicationConfigurationContributor());
});
}
private void ConfigureAutoApiControllers()

14
src/EventHub.Web.Theme/Themes/EventHub/Components/Footer/Default.cshtml

@ -8,6 +8,7 @@
@inject IOptions<EventHubUrlOptions> UrlOptions
@{
var currentPageUrl = Context.Request.GetDisplayUrl();
var platformVersion = EventHub.AssemblyInfoHelper.Get();
}
<footer class="mt-5">
@ -34,16 +35,16 @@
<div class="col-md">
<h5>Follow Us</h5>
<div class="footer-links">
<a href="https://www.facebook.com/openeventhub">
<a target="_blank" href="https://www.facebook.com/openeventhub">
<i class="fab fa-facebook"></i>
</a>
<a href="https://twitter.com/openeventhub">
<a target="_blank" href="https://twitter.com/openeventhub">
<i class="fab fa-twitter"></i>
</a>
<a href="https://www.instagram.com/openeventhub/">
<a target="_blank" href="https://www.instagram.com/openeventhub/">
<i class="fab fa-instagram"></i>
</a>
<a href="https://github.com/openeventhub">
<a target="_blank" href="https://github.com/abpframework/eventhub">
<i class="fab fa-github"></i>
</a>
</div>
@ -56,8 +57,11 @@
<div class="col-md-auto">
<span class="copyright">© 2021 - @DateTime.Now.Year © <a>OpenEventHub</a></span>
<div>
<span class="copyright">Open source license with <a href="https://github.com/abpframework/eventhub/blob/main/LICENSE">LGPLv3.0</a></span>
<span class="copyright">Open source license with <a href="https://github.com/abpframework/eventhub/blob/main/LICENSE" target="_blank">LGPLv3.0</a></span>
</div>
<span style="font-size: 0.7rem;">
Made with ❤️ on <a href="https://github.com/abpframework/abp" target="_blank">ABP</a> @($"v{platformVersion.AbpCoreVersion}") <br/> Updated on @($"{platformVersion.ModificationDate.ToString("MMMM dd, yyyy, HH:mm")}")
</span>
</div>
<div class="col-md text-center text-md-end">
<a href="@UrlOptions.Value.Www/terms-service">

Loading…
Cancel
Save