Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:SeriaWei/ZKEACMS into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Wayne-KTCSZ committed Sep 19, 2023
2 parents 7e50a7a + d79f899 commit 83ba377
Show file tree
Hide file tree
Showing 20 changed files with 592 additions and 457 deletions.
2 changes: 1 addition & 1 deletion src/EasyFrameWork/Cache/CacheManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void Remove(string key)
_memoryCache.Remove(CreateCacheKey(key));
}

private static string CreateCacheKey(string key)
protected virtual string CreateCacheKey(string key)
{
return $"{typeof(Category).FullName}_{key}";
}
Expand Down
8 changes: 4 additions & 4 deletions src/EasyFrameWork/EasyFrameWork.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
<PackageReference Include="DocumentFormat.OpenXml" Version="2.20.0" />
<PackageReference Include="FastExpressionCompiler" Version="3.3.4" />
<PackageReference Include="IdGen" Version="3.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="7.0.9" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="7.0.10" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.10" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="7.0.0" />
<PackageReference Include="System.Reflection.Extensions" Version="4.3.0" />
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.7.0" />
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" />
<PackageReference Include="YamlDotNet" Version="13.1.1" />
<PackageReference Include="YamlDotNet" Version="13.3.1" />
</ItemGroup>
</Project>
15 changes: 2 additions & 13 deletions src/EasyFrameWork/Modules/MutiLanguage/LanguageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,9 @@ private static void SaveLocalizeTextToFile(string localeFile, Dictionary<string,
return _cacheManager.GetOrCreate("AllLanguageEntry", factory =>
{
factory.AddExpirationToken(_signals.When(LanguageChanged));
factory.AddExpirationToken(_webHostEnvironment.ContentRootFileProvider.Watch("Locale/*.yml"));
ExpireCacheOnFileChanged();
ConcurrentDictionary<string, ConcurrentDictionary<string, LanguageEntity>> result = new ConcurrentDictionary<string, ConcurrentDictionary<string, LanguageEntity>>(StringComparer.OrdinalIgnoreCase);
var result = new ConcurrentDictionary<string, ConcurrentDictionary<string, LanguageEntity>>(StringComparer.OrdinalIgnoreCase);
foreach (var item in GetAllFromLocaleFile())
{
if (!result.TryGetValue(item.LanKey, out ConcurrentDictionary<string, LanguageEntity> cultureDic))
Expand All @@ -105,16 +104,6 @@ private static void SaveLocalizeTextToFile(string localeFile, Dictionary<string,
});
}

private void ExpireCacheOnFileChanged()
{
if (!_webHostEnvironment.IsDevelopment()) return;

_webHostEnvironment.ContentRootFileProvider.Watch("Locale/*.yml").RegisterChangeCallback(signals =>
{
(signals as ISignals).Trigger(LanguageChanged);
}, _signals);
}

private ServiceResult<LanguageEntity> Save(LanguageEntity item)
{
var result = new ServiceResult<LanguageEntity>();
Expand Down
2 changes: 1 addition & 1 deletion src/ZKEACMS.WebHost/ZKEACMS.WebHost.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<RazorCompileOnPublish>true</RazorCompileOnPublish>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="7.0.9" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="7.0.10" />
<ProjectReference Include="..\EasyFrameWork\EasyFrameWork.csproj" />
<ProjectReference Include="..\ZKEACMS\ZKEACMS.csproj" />
</ItemGroup>
Expand Down
8 changes: 7 additions & 1 deletion src/ZKEACMS.WebHost/wwwroot/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ a.badge:hover {

#media-list .thumbnail.status-2 .caption:after {
display: block;
content: "文件不完整";
content: "Error";
color: #fff;
position: absolute;
left: 0;
Expand All @@ -611,6 +611,12 @@ a.badge:hover {

#media-list .thumbnail .caption .edit {
text-align: center;
height: 20px;
padding: 0;
line-height: 20px;
border: 1px solid #ddd;
outline: none;
border-radius: 3px;
}

#media-list .thumbnail .close {
Expand Down
2 changes: 1 addition & 1 deletion src/ZKEACMS.WebHost/wwwroot/css/admin.min.css

Large diffs are not rendered by default.

0 comments on commit 83ba377

Please sign in to comment.